[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

@ -75,16 +75,22 @@
};
}
},
watch: {
index(newIndex) {
if (!this.context) {
return;
}
this.context.index = newIndex;
}
},
mounted() {
let context = {
this.context = {
layoutItem: this.item,
index: this.index
};
this.removeSelectable = this.openmct.selection.selectable(
this.$el,
context,
this.initSelect
);
this.$el, this.context, this.initSelect);
},
destroyed() {
if (this.removeSelectable) {