[Display Layout] Add delete button (#2251)

* Add delete button in the toolbar for removing items

* Mutate composition if there are no telemetry objects. Select the parent layout after deleting an item.

* Saving work

* Watch for index in the components and update it in the context.

* Select the parent after a composition is removed.

* Address reviewer's feedback.
- Rename mutatComposition() to removeFromComposition().
- Inline logic for filtering composition
- Use separate branches for each item type in trackItem().

* Address reviewer's requested changes
This commit is contained in:
Pegah Sarram
2018-12-20 13:15:23 -08:00
committed by Pete Richards
parent 47a07da17d
commit 464e5de947
10 changed files with 174 additions and 28 deletions

View File

@@ -160,6 +160,15 @@
domainObject: undefined
}
},
watch: {
index(newIndex) {
if (!this.context) {
return;
}
this.context.index = newIndex;
}
},
methods: {
requestHistoricalData() {
let bounds = this.openmct.time.bounds();
@@ -205,13 +214,13 @@
this.requestHistoricalData();
this.subscribeToObject();
let context = {
this.context = {
item: domainObject,
layoutItem: this.item,
index: this.index
};
this.removeSelectable = this.openmct.selection.selectable(
this.$el, context, this.initSelect);
this.$el, this.context, this.initSelect);
}
},
mounted() {