From f0ef93dd3f3dcfcd2d90fa57ff1f29109b05aef2 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 31 Jul 2023 09:57:11 -0700 Subject: [PATCH] fix: remove `tree-item-destroyed` event (#6856) * fix: remove `tree-item-destroyed` event - Composition listeners should only be removed if the item has been deleted or its parent has been collapsed. Both are handled by `mct-tree` already, so doing this additionally when tree-items unmount is redundant. - In addition to that, any time the `visibleTreeItems` array changes, all tree-items will unmount, so this just doesn't work as intended-- it will unregister all composition listeners whenever the tree changes! * test: stabilize imagery test - Use keyboard gestures to navigate * fix: lint:fix --- .../plugins/imagery/exampleImagery.e2e.spec.js | 18 ++++++++++-------- src/ui/layout/mct-tree.vue | 1 - src/ui/layout/tree-item.vue | 1 - 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js index d64688e044..8a9756f3df 100644 --- a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js +++ b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js @@ -80,19 +80,21 @@ test.describe('Example Imagery Object', () => { // flip on independent time conductor await page.getByRole('switch', { name: 'Enable Independent Time Conductor' }).click(); await page.getByRole('button', { name: 'Independent Time Conductor Settings' }).click(); - await page.getByRole('textbox', { name: 'Start date' }).click(); await page.getByRole('textbox', { name: 'Start date' }).fill(''); await page.getByRole('textbox', { name: 'Start date' }).fill('2021-12-30'); - await page.getByRole('textbox', { name: 'Start time' }).click(); + await page.keyboard.press('Tab'); await page.getByRole('textbox', { name: 'Start time' }).fill(''); - await page.getByRole('textbox', { name: 'Start time' }).fill('01:01:00'); - await page.getByRole('textbox', { name: 'End date' }).click(); + await page.getByRole('textbox', { name: 'Start time' }).type('01:01:00'); + await page.keyboard.press('Tab'); await page.getByRole('textbox', { name: 'End date' }).fill(''); - await page.getByRole('textbox', { name: 'End date' }).fill('2021-12-30'); - await page.getByRole('textbox', { name: 'End time' }).click(); + await page.getByRole('textbox', { name: 'End date' }).type('2021-12-30'); + await page.keyboard.press('Tab'); await page.getByRole('textbox', { name: 'End time' }).fill(''); - await page.getByRole('textbox', { name: 'End time' }).fill('01:11:00'); - await page.getByRole('button', { name: 'Submit time bounds' }).click(); + await page.getByRole('textbox', { name: 'End time' }).type('01:11:00'); + await page.keyboard.press('Tab'); + await page.keyboard.press('Enter'); + // expect(await page.getByRole('button', { name: 'Submit time bounds' }).isEnabled()).toBe(true); + // await page.getByRole('button', { name: 'Submit time bounds' }).click(); // check image date await expect(page.getByText('2021-12-30 01:11:00.000Z').first()).toBeVisible(); diff --git a/src/ui/layout/mct-tree.vue b/src/ui/layout/mct-tree.vue index 4cbcd7c972..14822fb138 100644 --- a/src/ui/layout/mct-tree.vue +++ b/src/ui/layout/mct-tree.vue @@ -97,7 +97,6 @@ :loading-items="treeItemLoading" :targeted-path="targetedPath" @tree-item-mounted="scrollToCheck($event)" - @tree-item-destroyed="removeCompositionListenerFor($event)" @tree-item-action="treeItemAction(treeItem, $event)" @tree-item-selection="treeItemSelection(treeItem)" @targeted-path-animation-end="targetedPathAnimationEnd()" diff --git a/src/ui/layout/tree-item.vue b/src/ui/layout/tree-item.vue index 3ed262b55d..3be89f3c4c 100644 --- a/src/ui/layout/tree-item.vue +++ b/src/ui/layout/tree-item.vue @@ -191,7 +191,6 @@ export default { }, unmounted() { this.openmct.router.off('change:path', this.highlightIfNavigated); - this.$emit('tree-item-destroyed', this.navigationPath); }, methods: { targetedPathAnimationEnd($event) {