Compare commits

..

8 Commits

Author SHA1 Message Date
David Tsay
d3825fc554 rescope objects 2023-08-18 14:52:46 -07:00
Jamie V
d42b2dd023 mappin 2023-08-17 11:23:42 -07:00
Jamie V
59ae7cddc5 Merge branch 'omm-release/5.1' of https://github.com/nasa/openmct into omm-release/5.1
mergin
2023-07-07 11:14:50 -07:00
Jamie V
321c7a3af5 suppressing abort errors as they are expected 2023-07-07 11:13:43 -07:00
David Tsay
609cf72bd1 chicken needs to come first 2023-07-06 14:39:26 -07:00
Jamie V
a447b0ada8 removing eval-source-map, dont debuggin 2023-06-21 16:32:57 -07:00
Jamie V
5788f4cc69 temp source maps for debugin 2023-06-21 14:11:23 -07:00
Jamie V
f94b4e53c7 adding back in abort on item close in tree 2023-06-21 13:31:12 -07:00
5 changed files with 38 additions and 21 deletions

View File

@@ -23,5 +23,5 @@ module.exports = merge(common, {
__OPENMCT_ROOT_RELATIVE__: '""'
})
],
devtool: "source-map"
devtool: "eval-source-map"
});

View File

@@ -239,9 +239,15 @@ export default class ObjectAPI {
return domainObject;
}).catch((error) => {
console.warn(`Failed to retrieve ${keystring}:`, error);
let result;
delete this.cache[keystring];
const result = this.applyGetInterceptors(identifier);
// suppress abort errors
if (error.name !== 'AbortError') {
console.warn(`Failed to retrieve ${keystring}:`, error);
result = this.applyGetInterceptors(identifier);
}
return result;
});

View File

@@ -35,34 +35,34 @@ export default class DuplicateAction {
}
invoke(objectPath) {
this.object = objectPath[0];
this.parent = objectPath[1];
const object = objectPath[0];
const parent = objectPath[1];
this.showForm(this.object, this.parent);
this.showForm(object, parent);
}
inNavigationPath() {
inNavigationPath(object) {
return this.openmct.router.path
.some(objectInPath => this.openmct.objects.areIdsEqual(objectInPath.identifier, this.object.identifier));
.some(objectInPath => this.openmct.objects.areIdsEqual(objectInPath.identifier, object.identifier));
}
async onSave(changes) {
async onSave(object, parent, changes) {
this.startTransaction();
let inNavigationPath = this.inNavigationPath();
let inNavigationPath = this.inNavigationPath(object);
if (inNavigationPath && this.openmct.editor.isEditing()) {
this.openmct.editor.save();
}
let duplicationTask = new DuplicateTask(this.openmct);
if (changes.name && (changes.name !== this.object.name)) {
if (changes.name && (changes.name !== object.name)) {
duplicationTask.changeName(changes.name);
}
const parentDomainObjectpath = changes.location || [this.parent];
const parent = parentDomainObjectpath[0];
const parentDomainObjectpath = changes.location || [parent];
const parentObject = parentDomainObjectpath[0];
await duplicationTask.duplicate(this.object, parent);
await duplicationTask.duplicate(object, parentObject);
return this.saveTransaction();
}
@@ -88,7 +88,7 @@ export default class DuplicateAction {
control: "locator",
required: true,
parent: parentDomainObject,
validate: this.validate(parentDomainObject),
validate: this.validate(domainObject, parentDomainObject),
key: 'location'
}
]
@@ -97,16 +97,19 @@ export default class DuplicateAction {
};
this.openmct.forms.showForm(formStructure)
.then(this.onSave.bind(this));
.then(changes => {
let onSave = this.onSave.bind(this);
onSave(domainObject, parentDomainObject, changes);
});
}
validate(currentParent) {
validate(domainObject, currentParent) {
return (data) => {
const parentCandidate = data.value[0];
let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier);
let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier);
let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier);
let objectKeystring = this.openmct.objects.makeKeyString(domainObject.identifier);
if (!this.openmct.objects.isPersistable(parentCandidate.identifier)) {
return false;
@@ -125,7 +128,7 @@ export default class DuplicateAction {
return false;
}
return parentCandidate && this.openmct.composition.checkPolicy(parentCandidate, this.object);
return parentCandidate && this.openmct.composition.checkPolicy(parentCandidate, domainObject);
};
}

View File

@@ -56,6 +56,10 @@ define([
});
},
showTab: function (isEditing) {
if (isEditing) {
return true;
}
const hasPersistedFilters = Boolean(domainObject?.configuration?.filters);
const hasGlobalFilters = Boolean(domainObject?.configuration?.globalFilters);

View File

@@ -322,10 +322,14 @@ export default {
},
async openTreeItem(parentItem) {
const parentPath = parentItem.navigationPath;
const abortSignal = this.startItemLoad(parentPath);
this.startItemLoad(parentPath);
// pass in abort signal when functional
const childrenItems = await this.loadAndBuildTreeItemsFor(parentItem.object.identifier, parentItem.objectPath);
const childrenItems = await this.loadAndBuildTreeItemsFor(
parentItem.object.identifier,
parentItem.objectPath,
abortSignal
);
const parentIndex = this.treeItems.indexOf(parentItem);
// if it's not loading, it was aborted