From 6c0c1df0100c4cfd0d0029c8e7effde6caa02177 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 5 Apr 2019 09:32:58 -0700 Subject: [PATCH 1/8] Added a mutation listener to CompositionCollection (#2354) --- src/api/composition/CompositionCollection.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/api/composition/CompositionCollection.js b/src/api/composition/CompositionCollection.js index dbb0ce79c9..ebca20625a 100644 --- a/src/api/composition/CompositionCollection.js +++ b/src/api/composition/CompositionCollection.js @@ -25,7 +25,6 @@ define([ ], function ( _ ) { - /** * A CompositionCollection represents the list of domain objects contained * by another domain object. It provides methods for loading this @@ -63,7 +62,6 @@ define([ this.onProviderRemove = this.onProviderRemove.bind(this); } - /** * Listen for changes to this composition. Supports 'add', 'remove', and * 'load' events. @@ -76,7 +74,11 @@ define([ if (!this.listeners[event]) { throw new Error('Event not supported by composition: ' + event); } - + if (!this.mutationListener) { + this.mutationListener = this.publicAPI.objects.observe(this.domainObject, '*', (newDomainObject) => { + this.domainObject = newDomainObject; + }) + } if (this.provider.on && this.provider.off) { if (event === 'add') { this.provider.on( @@ -132,6 +134,10 @@ define([ this.listeners[event].splice(index, 1); if (this.listeners[event].length === 0) { + if (this.mutationListener) { + this.mutationListener(); + delete this.mutationListener; + } // Remove provider listener if this is the last callback to // be removed. if (this.provider.off && this.provider.on) { From a40a31aa4ca0d4e10ac0c840ea565c39133beaa1 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 5 Apr 2019 09:34:03 -0700 Subject: [PATCH 2/8] Remove wait spinners when error occurs in tables (#2356) --- src/plugins/telemetryTable/TelemetryTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/telemetryTable/TelemetryTable.js b/src/plugins/telemetryTable/TelemetryTable.js index 0efbb959b2..d42039e997 100644 --- a/src/plugins/telemetryTable/TelemetryTable.js +++ b/src/plugins/telemetryTable/TelemetryTable.js @@ -143,6 +143,7 @@ define([ let telemetryRows = telemetryData.map(datum => new TelemetryTableRow(datum, columnMap, keyString, limitEvaluator)); this.boundedRows.add(telemetryRows); + }).finally(() => { this.decrementOutstandingRequests(); }); } From 8b275b206be9a10dc3dfe1333bd0854083e4f464 Mon Sep 17 00:00:00 2001 From: Deep Tailor Date: Fri, 5 Apr 2019 09:34:55 -0700 Subject: [PATCH 3/8] Remove selection fix (#2348) * add a function to change selection of deleted item in remove action, and update flexlayouts * resize when item is deleted * fix for resize handles not showing after object is dropped * fix isAlias logic for folder views * remove uneccesary console log * move selection logic to flexible layouts * only update inspector views if selection has changed to a new context * force a digest in the plot options controller once the series are added * conditionally show snapshot button only if notebook is installed --- .../components/flexibleLayout.vue | 30 ++++++++++++------- .../components/resizeHandle.vue | 2 ++ src/plugins/flexibleLayout/toolbarProvider.js | 6 ++-- .../components/composition-loader.js | 3 +- .../src/inspector/PlotOptionsController.js | 7 +++-- src/ui/inspector/InspectorViews.vue | 13 ++++++++ src/ui/layout/BrowseBar.vue | 12 ++++++-- 7 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/plugins/flexibleLayout/components/flexibleLayout.vue b/src/plugins/flexibleLayout/components/flexibleLayout.vue index 974c37950a..934ff0b63c 100644 --- a/src/plugins/flexibleLayout/components/flexibleLayout.vue +++ b/src/plugins/flexibleLayout/components/flexibleLayout.vue @@ -414,6 +414,7 @@ import Container from '../utils/container'; import Frame from '../utils/frame'; import ResizeHandle from './resizeHandle.vue'; import DropHint from './dropHint.vue'; +import RemoveAction from '../../remove/RemoveAction.js'; const MIN_CONTAINER_SIZE = 5; @@ -505,7 +506,7 @@ export default { remove associated domainObjects from composition */ container.frames.forEach(f => { - this.composition.remove({identifier: f.domainObjectIdentifier}); + this.removeFromComposition(f.domainObjectIdentifier); }); this.containers.splice(containerIndex, 1); @@ -520,6 +521,7 @@ export default { } sizeToFill(this.containers); + this.setSelectionToParent(); this.persist(); }, moveFrame(toContainerIndex, toFrameIndex, frameId, fromContainerIndex) { @@ -553,20 +555,24 @@ export default { deleteFrame(frameId) { let container = this.containers .filter(c => c.frames.some(f => f.id === frameId))[0]; - let containerIndex = this.containers.indexOf(container); let frame = container .frames .filter((f => f.id === frameId))[0]; - let frameIndex = container.frames.indexOf(frame); - /* - remove associated domainObject from composition - */ - this.composition.remove({identifier: frame.domainObjectIdentifier}); - - container.frames.splice(frameIndex, 1); - sizeToFill(container.frames); - this.persist(containerIndex); + this.removeFromComposition(frame.domainObjectIdentifier) + .then(() => { + sizeToFill(container.frames) + this.setSelectionToParent(); + }); + }, + removeFromComposition(identifier) { + return this.openmct.objects.get(identifier).then((childDomainObject) => { + this.RemoveAction.removeFromComposition(this.domainObject, childDomainObject); + }); + }, + setSelectionToParent() { + let currentSelection = this.openmct.selection.selected; + this.openmct.selection.select(currentSelection.slice(1)); }, allowContainerDrop(event, index) { if (!event.dataTransfer.types.includes('containerid')) { @@ -657,6 +663,8 @@ export default { this.composition.on('remove', this.removeChildObject); this.composition.on('add', this.addFrame); + this.RemoveAction = new RemoveAction(this.openmct); + this.unobserve = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject); }, beforeDestroy() { diff --git a/src/plugins/flexibleLayout/components/resizeHandle.vue b/src/plugins/flexibleLayout/components/resizeHandle.vue index 88ac094899..d72f0a7f0a 100644 --- a/src/plugins/flexibleLayout/components/resizeHandle.vue +++ b/src/plugins/flexibleLayout/components/resizeHandle.vue @@ -79,10 +79,12 @@ export default { mounted() { document.addEventListener('dragstart', this.setDragging); document.addEventListener('dragend', this.unsetDragging); + document.addEventListener('drop', this.unsetDragging); }, destroyed() { document.removeEventListener('dragstart', this.setDragging); document.removeEventListener('dragend', this.unsetDragging); + document.removeEventListener('drop', this.unsetDragging); } } diff --git a/src/plugins/flexibleLayout/toolbarProvider.js b/src/plugins/flexibleLayout/toolbarProvider.js index 245c926421..588a2fd179 100644 --- a/src/plugins/flexibleLayout/toolbarProvider.js +++ b/src/plugins/flexibleLayout/toolbarProvider.js @@ -77,11 +77,11 @@ function ToolbarProvider(openmct) { .containers; let container = containers .filter(c => c.frames.some(f => f.id === frameId))[0]; - let frame = container + let containerIndex = containers.indexOf(container); + let frame = container && container .frames .filter((f => f.id === frameId))[0]; - let containerIndex = containers.indexOf(container); - let frameIndex = container.frames.indexOf(frame); + let frameIndex = container && container.frames.indexOf(frame); deleteFrame = { control: "button", diff --git a/src/plugins/folderView/components/composition-loader.js b/src/plugins/folderView/components/composition-loader.js index 5d8de5349f..c885673e6e 100644 --- a/src/plugins/folderView/components/composition-loader.js +++ b/src/plugins/folderView/components/composition-loader.js @@ -14,6 +14,7 @@ export default { }, mounted() { this.composition = this.openmct.composition.get(this.domainObject); + this.keystring = this.openmct.objects.makeKeyString(this.domainObject.identifier); if (!this.composition) { return; } @@ -34,7 +35,7 @@ export default { this.items.push({ model: child, type: type.definition, - isAlias: this.domainObject.identifier.key !== child.location, + isAlias: this.keystring !== child.location, objectPath: [child].concat(this.openmct.router.path), objectKeyString: this.openmct.objects.makeKeyString(child.identifier) }); diff --git a/src/plugins/plot/src/inspector/PlotOptionsController.js b/src/plugins/plot/src/inspector/PlotOptionsController.js index c54896df5c..5961dfe117 100644 --- a/src/plugins/plot/src/inspector/PlotOptionsController.js +++ b/src/plugins/plot/src/inspector/PlotOptionsController.js @@ -70,12 +70,15 @@ define([ this.listenTo(this.$scope, '$destroy', this.destroy, this); this.listenTo(config.series, 'add', this.addSeries, this); this.listenTo(config.series, 'remove', this.resetAllSeries, this); + config.series.forEach(this.addSeries, this); }; PlotOptionsController.prototype.addSeries = function (series, index) { - this.$scope.plotSeries[index] = series; - series.locateOldObject(this.$scope.domainObject); + this.$timeout(function () { + this.$scope.plotSeries[index] = series; + series.locateOldObject(this.$scope.domainObject); + }.bind(this)); }; PlotOptionsController.prototype.resetAllSeries = function (series, index) { diff --git a/src/ui/inspector/InspectorViews.vue b/src/ui/inspector/InspectorViews.vue index bd51c91c6f..5147c141ab 100644 --- a/src/ui/inspector/InspectorViews.vue +++ b/src/ui/inspector/InspectorViews.vue @@ -7,6 +7,8 @@ diff --git a/src/plugins/displayLayout/components/EditMarquee.vue b/src/plugins/displayLayout/components/EditMarquee.vue new file mode 100644 index 0000000000..a74ddb3a2d --- /dev/null +++ b/src/plugins/displayLayout/components/EditMarquee.vue @@ -0,0 +1,233 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2018, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ + + + + + + + diff --git a/src/plugins/displayLayout/components/ImageView.vue b/src/plugins/displayLayout/components/ImageView.vue index d4bba71912..cb6a039f3d 100644 --- a/src/plugins/displayLayout/components/ImageView.vue +++ b/src/plugins/displayLayout/components/ImageView.vue @@ -23,7 +23,8 @@ @@ -50,7 +39,7 @@ - diff --git a/src/plugins/displayLayout/components/SubobjectView.vue b/src/plugins/displayLayout/components/SubobjectView.vue index 6b7c9de175..1796dd44ad 100644 --- a/src/plugins/displayLayout/components/SubobjectView.vue +++ b/src/plugins/displayLayout/components/SubobjectView.vue @@ -22,7 +22,8 @@