-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lifecycle hook wbBeforeDestroy
is not called for views of lazily loaded modules
#27
Labels
Comments
This problem might be related to angular/angular#28730 |
The workbench installs a This currently leads to the following problems:
We should consider a different approach to prevent views from closing. |
danielwiehl
added a commit
that referenced
this issue
May 2, 2024
To fix issues related to preventing views from closing, the guard is no longer implemented as an Angular "CanDeactivate" guard but runs before the Angular navigation. This commit fixes the following issues: - guard now also runs on child routes - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed. - the guard can perform an Angular navigation, e.g., display a message box with route content. closes #27, closes #344 BREAKING CHANGE: Interface and method for intercepting (or preventing) closing of a view has changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippets illustrate how a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 3, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 4, 2024
The guard now runs before the Angular navigation. Previously, it was implemented as an Angular `CanDeactivate` guard. The following issues have been fixed: - guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ``ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } }
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also runs on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. The following snippet illustrates what a migration could look like: **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also works on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 6, 2024
The following issues have been fixed: - `CanClose` guard now also works on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
danielwiehl
added a commit
that referenced
this issue
May 7, 2024
The following issues have been fixed: - `CanClose` guard now also works on child routes; - multiple views can be closed simultaneously, even if some views prevent closing; previously, Angular navigation was canceled, causing no views to be closed; - `CanClose` guard can now perform an Angular navigation, e.g., to display a dialog with routed content; closes #27, closes #344 BREAKING CHANGE: Interface and method for preventing closing of a view have changed. To migrate, implement the `CanClose` instead of the `WorkbenchViewPreDestroy` interface. **Before migration:** ```ts class YourComponent implements WorkbenchViewPreDestroy { public async onWorkbenchViewPreDestroy(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ``` **After migration:** ```ts class YourComponent implements CanClose { public async canClose(): Promise<boolean> { // return `true` to close the view, otherwise `false`. } } ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current behavior
Lifecycle hook
wbBeforeDestroy
is not called for views of lazily loaded modules.Also, the title and heading are not set if they are configured on the route.
Expected behavior
Lifecycle hook is called.
Minimal reproduction of the problem with instructions
wbBeforeDestroy
in that viewEnvironment
The text was updated successfully, but these errors were encountered: