@c8y/ngx-components 1021.22.138 → 1021.22.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -207,6 +207,7 @@ class BridgeService {
207
207
  this.fixE2eIssues();
208
208
  this.$ng1RouteChangeSuccess = this.fromNg1Event(this.injector.get('$rootScope'), '$routeChangeSuccess');
209
209
  this.$ng1RouteChangeStart = this.fromNg1Event(this.injector.get('$rootScope'), '$routeChangeStart');
210
+ this.$ng1RouteUpdate = this.fromNg1Event(this.injector.get('$rootScope'), '$routeUpdate');
210
211
  this.hookLanguage();
211
212
  this.hookTab();
212
213
  this.hookNavigator();
@@ -224,21 +225,11 @@ class BridgeService {
224
225
  // fix to trigger an angularjs route change success
225
226
  // event on context route match to make legacy
226
227
  // view-providers resolve.
227
- // reloadOnUrl: true ensures that navigating between different IDs
228
- // (e.g., /device/123 -> /device/456) triggers $routeChangeSuccess
229
- // reloadOnSearch: true ensures that navigating to different subpaths with the same ID
230
- // (e.g., /group/123/dashboard -> /group/123/subassets) also triggers $routeChangeSuccess
231
- // Both are needed because AngularJS checks: "is update-only if reloadOnUrl is set
232
- // BUT reloadOnSearch is false AND pathParams are equal"
233
228
  c8yViews.when('/device/:id', {
234
- template: '',
235
- reloadOnUrl: true,
236
- reloadOnSearch: true
229
+ template: ''
237
230
  });
238
231
  c8yViews.when('/group/:id', {
239
- template: '',
240
- reloadOnUrl: true,
241
- reloadOnSearch: true
232
+ template: ''
242
233
  });
243
234
  c8yViews.contextViews.subscribe(cfg => this.addRoute(cfg));
244
235
  }
@@ -281,9 +272,7 @@ class BridgeService {
281
272
  fallbackRoutes.push({
282
273
  keys: [{ name: ViewContextLegacyParameter[context], optional: false }],
283
274
  regexp,
284
- template,
285
- reloadOnUrl: true,
286
- reloadOnSearch: true
275
+ template
287
276
  });
288
277
  }
289
278
  /**
@@ -391,8 +380,15 @@ class BridgeService {
391
380
  liveTabs = [];
392
381
  this.$liveTabs.next(liveTabs);
393
382
  });
394
- this.$ng1RouteChangeSuccess.subscribe(() => {
383
+ const syncRouters = () => {
395
384
  const path = $location.path();
385
+ // Don't sync if Angular Router is using secondary outlets
386
+ // (e.g., /device/123/(dashboard-details:general))
387
+ // Let Angular Router handle these advanced navigation scenarios
388
+ if (this.router.url.includes('(') && this.router.url.includes(':')) {
389
+ return;
390
+ }
391
+ // Only sync if paths differ and initial navigation is complete
396
392
  if (this.router.url !== path) {
397
393
  this.router.navigate(path === '/' ? '' : path.split('/'), {
398
394
  queryParams: $location.search(),
@@ -402,7 +398,18 @@ class BridgeService {
402
398
  if (this.actionService) {
403
399
  this.actionService.refresh();
404
400
  }
405
- });
401
+ };
402
+ // Listen to $routeChangeSuccess (full navigation - always sync)
403
+ this.$ng1RouteChangeSuccess.subscribe(syncRouters);
404
+ // Listen to $routeUpdate (skip if query-param-only)
405
+ this.$ng1RouteUpdate
406
+ .pipe(filter(() => {
407
+ const path = $location.path();
408
+ const angularPath = this.router.url.split('?')[0];
409
+ // Only process if path actually changed (not just query params)
410
+ return angularPath !== path;
411
+ }))
412
+ .subscribe(syncRouters);
406
413
  this.$routeChanges = merge(this.$ng1RouteChangeSuccess, this.fromNg1Event(c8yTabs, c8yTabs.EVENT_UPDATE), of(1)).pipe(debounceTime(100));
407
414
  }
408
415
  hookNavigator() {