@c8y/ngx-components 1023.14.204 → 1023.14.206

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.
@@ -514,6 +514,7 @@ class WorkspaceConfigComponent {
514
514
  this.configurations = this.configurations.map(c => c.id === configuration.id ? configuration : c);
515
515
  if (this.currentConfiguration.id === configuration.id) {
516
516
  this.currentConfiguration = configuration;
517
+ this.updateQueryParams();
517
518
  }
518
519
  this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration?.id || '');
519
520
  }
@@ -551,11 +552,6 @@ class WorkspaceConfigComponent {
551
552
  const config = { ...this.updatedConfig };
552
553
  this.currentConfiguration.config = config;
553
554
  this.configurations = this.configurations.map(currentConfig => currentConfig.id === this.currentConfiguration.id ? this.currentConfiguration : currentConfig);
554
- const queryParams = {
555
- id: this.currentConfiguration.id,
556
- label: this.currentConfiguration.label,
557
- config: this.workspaceConfigurationService.encodeConfig(config)
558
- };
559
555
  this.workspaceConfigurationService.saveConfigurations(this.configurations, this.currentConfiguration.id);
560
556
  const control = this.configurationsFormGroup.controls['configurations'];
561
557
  const index = this.configurations.findIndex(c => c.id === this.currentConfiguration.id);
@@ -566,8 +562,16 @@ class WorkspaceConfigComponent {
566
562
  id: this.currentConfiguration.id
567
563
  });
568
564
  }
565
+ this.updateQueryParams();
566
+ }
567
+ /** Reflects the current configuration in the URL so it stays shareable after every change. */
568
+ updateQueryParams() {
569
569
  this.router.navigate([], {
570
- queryParams,
570
+ queryParams: {
571
+ id: this.currentConfiguration.id,
572
+ label: this.currentConfiguration.label,
573
+ config: this.workspaceConfigurationService.encodeConfig(this.currentConfiguration.config)
574
+ },
571
575
  queryParamsHandling: 'merge'
572
576
  });
573
577
  }