Skip to content

Commit 2e5ad85

Browse files
[DSC-2445] fix issue with loading status of administer page
1 parent c8a5356 commit 2e5ad85

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/app/app.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ export class AppComponent implements OnInit, AfterViewInit {
134134
))
135135
).subscribe(([currentUrl, event]: [string, RouterEvent]) => {
136136
if (event instanceof NavigationStart) {
137-
if (!(currentUrl.startsWith('/entities' || getEditItemPageRoute()) || currentUrl.startsWith(getWorkspaceItemModuleRoute()) || currentUrl.startsWith(getWorkflowItemModuleRoute()))) {
137+
const nextUrl = event.url;
138+
if (!this.shouldSkipLoadingStatus(currentUrl, nextUrl)) {
138139
distinctNext(this.isRouteLoading$, true);
139140
}
140141
// distinctNext(this.isRouteLoading$, true);
@@ -177,4 +178,14 @@ export class AppComponent implements OnInit, AfterViewInit {
177178
});
178179
}
179180

181+
private shouldSkipLoadingStatus(currentUrl: string, nextUrl: string): boolean {
182+
return (currentUrl.startsWith('/entities' || getEditItemPageRoute()) && !(this.isAdministrativeEditItemPageRoute(nextUrl, currentUrl)))
183+
|| currentUrl.startsWith(getWorkspaceItemModuleRoute()) || currentUrl.startsWith(getWorkflowItemModuleRoute());
184+
}
185+
186+
private isAdministrativeEditItemPageRoute(nextUrl: string, currentUrl: string): boolean {
187+
const editPageRegEx = /\/(entities\/[^\/]+|items)\/[0-9a-f-]{36}\/edit(?:\/.*)?$/;
188+
return editPageRegEx.test(nextUrl) && !editPageRegEx.test(currentUrl);
189+
}
190+
180191
}

0 commit comments

Comments
 (0)