fix(#6942): Toggling FlexibleLayout toolbar options reflects immediately in the view (#6943)

* fix: restore reactivity of config settings

- move initialization steps to `created()` hook

- remove unnecessary `:key` binds

- fix comments

* refactor: clean up

* refactor: clean up

* refactor: lint:fix

* test(e2e): add regression test and cleanup suite

* refactor: consistency is key!

* test(fix): fix unit tests, further cleanup
This commit is contained in:
Jesse Mazzella
2023-08-16 10:52:23 -07:00
committed by GitHub
parent 82b1760b0e
commit 6c92e31036
5 changed files with 127 additions and 74 deletions

View File

@@ -47,17 +47,16 @@ export default class FlexibleLayoutViewProvider {
let component = null;
return {
show: function (element, isEditing) {
show(element, isEditing) {
const { vNode, destroy } = mount(
{
el: element,
components: {
FlexibleLayoutComponent
},
provide: {
openmct: openmct,
openmct,
objectPath,
layoutObject: domainObject
domainObject
},
data() {
return {
@@ -75,7 +74,7 @@ export default class FlexibleLayoutViewProvider {
component = vNode.componentInstance;
_destroy = destroy;
},
getSelectionContext: function () {
getSelectionContext() {
return {
item: domainObject,
addContainer: component.$refs.flexibleLayout.addContainer,
@@ -84,10 +83,10 @@ export default class FlexibleLayoutViewProvider {
type: 'flexible-layout'
};
},
onEditModeChange: function (isEditing) {
onEditModeChange(isEditing) {
component.isEditing = isEditing;
},
destroy: function (element) {
destroy() {
if (_destroy) {
_destroy();
component = null;