History: Take URL objects into consideration when storing Backoffice history (#20986)
* fix: allows URL to be passed to navigator * Also adds fix to Block workspace --------- Co-authored-by: leekelleher <leekelleher@gmail.com>
This commit is contained in:
@@ -313,11 +313,14 @@ export class UmbBlockWorkspaceContext<LayoutDataType extends UmbBlockLayoutBaseM
|
|||||||
/**
|
/**
|
||||||
* Check if the workspace is about to navigate away.
|
* Check if the workspace is about to navigate away.
|
||||||
* @protected
|
* @protected
|
||||||
* @param {string} newUrl The new url that the workspace is navigating to.
|
* @param {string | URL} newUrl The new url that the workspace is navigating to.
|
||||||
* @returns { boolean} true if the workspace is navigating away.
|
* @returns {boolean} true if the workspace is navigating away.
|
||||||
* @memberof UmbEntityWorkspaceContextBase
|
* @memberof UmbEntityWorkspaceContextBase
|
||||||
*/
|
*/
|
||||||
protected _checkWillNavigateAway(newUrl: string): boolean {
|
protected _checkWillNavigateAway(newUrl: string | URL): boolean {
|
||||||
|
if (newUrl instanceof URL) {
|
||||||
|
newUrl = newUrl.href;
|
||||||
|
}
|
||||||
return !newUrl.includes(this.routes.getActiveLocalPath());
|
return !newUrl.includes(this.routes.getActiveLocalPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -376,11 +376,14 @@ export abstract class UmbEntityDetailWorkspaceContextBase<
|
|||||||
/**
|
/**
|
||||||
* Check if the workspace is about to navigate away.
|
* Check if the workspace is about to navigate away.
|
||||||
* @protected
|
* @protected
|
||||||
* @param {string} newUrl The new url that the workspace is navigating to.
|
* @param {string | URL} newUrl The new url that the workspace is navigating to.
|
||||||
* @returns { boolean} true if the workspace is navigating away.
|
* @returns {boolean} true if the workspace is navigating away.
|
||||||
* @memberof UmbEntityWorkspaceContextBase
|
* @memberof UmbEntityWorkspaceContextBase
|
||||||
*/
|
*/
|
||||||
protected _checkWillNavigateAway(newUrl: string): boolean {
|
protected _checkWillNavigateAway(newUrl: string | URL): boolean {
|
||||||
|
if (newUrl instanceof URL) {
|
||||||
|
newUrl = newUrl.href;
|
||||||
|
}
|
||||||
return !newUrl.includes(this.routes.getActiveLocalPath());
|
return !newUrl.includes(this.routes.getActiveLocalPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user