From fdc92189c8ce89aef7851d961da40775fee8b989 Mon Sep 17 00:00:00 2001 From: Daniel Wiehl Date: Tue, 12 Mar 2019 18:17:08 +0100 Subject: [PATCH] refactor: maintain view and viewpart registries in a single place and apply the grid in grid-component This reduces the complexity of managing auxiliary routes and applying viewgrid changes. The following changes were made: - `WorkbenchUrlObserver` is the only place to listen for URL grid changes - changed viewpart grid to be immutable - maintain viewparts in `WorkbenchViewPartRegistry` in the same way as `WorkbenchViewRegistry` for views - moved detach/attach logic of the viewparts to `ViewPartGridComponent` because responsible for showing the grid --- .../src/util/testing.util.ts | 14 +- .../src/lib/portal/wb-component-portal.ts | 2 +- .../view-registry-synchronizer.service.ts | 36 ---- .../lib/routing/workbench-router.service.ts | 12 +- .../lib/spec/view-part-grid.component.spec.ts | 32 ++-- .../src/lib/spec/view-part-grid.spec.ts | 17 +- .../view-part-grid-serializer.service.ts | 4 +- .../view-part-grid-url-observer.service.ts | 78 --------- .../view-part-grid.component.html | 4 +- .../view-part-grid.component.ts | 104 ++++++++++-- .../view-part-grid/view-part-grid.model.ts | 127 ++++++++++---- .../view-part-grid/view-part-grid.service.ts | 159 ------------------ .../workbench-view-part-registry.service.ts | 117 +++++++++++++ .../view-part-sash-box.component.ts | 10 +- .../view-part/workbench-view-part.service.ts | 12 +- ...e.ts => workbench-url-observer.service.ts} | 104 +++++++----- .../workbench/src/lib/workbench.module.ts | 12 +- .../workbench/src/lib/workbench.service.ts | 8 +- 18 files changed, 424 insertions(+), 428 deletions(-) delete mode 100644 projects/scion/workbench/src/lib/routing/view-registry-synchronizer.service.ts delete mode 100644 projects/scion/workbench/src/lib/view-part-grid/view-part-grid-url-observer.service.ts delete mode 100644 projects/scion/workbench/src/lib/view-part-grid/view-part-grid.service.ts create mode 100644 projects/scion/workbench/src/lib/view-part-grid/workbench-view-part-registry.service.ts rename projects/scion/workbench/src/lib/{routing/view-outlet-url-observer.service.ts => workbench-url-observer.service.ts} (52%) diff --git a/projects/e2e/workbench-application-platform/src/util/testing.util.ts b/projects/e2e/workbench-application-platform/src/util/testing.util.ts index 0fc4d355f..722785c2b 100644 --- a/projects/e2e/workbench-application-platform/src/util/testing.util.ts +++ b/projects/e2e/workbench-application-platform/src/util/testing.util.ts @@ -1,4 +1,4 @@ -import { $, browser, ElementFinder } from 'protractor'; +import { $, browser, ElementFinder, protractor } from 'protractor'; /** * Switches browser testing context to the main document. @@ -115,10 +115,18 @@ export async function expectActivityToShow(expected: { symbolicAppName: string; const ctx = `app=${expected.symbolicAppName}, activityCssClass=${expected.activityCssClass}, component=${expected.componentSelector}`; await switchToMainContext(); - await expect($(`wb-activity-part .e2e-activity-panel.${expected.activityCssClass}`).isDisplayed()).toBeTruthy(`Expected 'e2e-activity-panel' to show [${ctx}]`); - await expect($(`iframe.e2e-activity.e2e-${expected.symbolicAppName}.${expected.activityCssClass}`).isDisplayed()).toBeTruthy(`Expected