@hestia-earth/ui-components 0.31.12 → 0.31.14

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.
@@ -30,7 +30,7 @@ import { DeltaDisplayType, delta, customDeltaFuncs } from '@hestia-earth/utils/d
30
30
  import { trigger, state, transition, style, animate } from '@angular/animations';
31
31
  import { signalStore, withState, withComputed, withMethods, patchState, withHooks } from '@ngrx/signals';
32
32
  import { rxMethod } from '@ngrx/signals/rxjs-interop';
33
- import { RouterLinkActive, RouterLink } from '@angular/router';
33
+ import { RouterLinkActive, RouterLink, ActivatedRoute } from '@angular/router';
34
34
  import * as i1$1 from 'angular-svg-icon';
35
35
  import { SvgIconComponent, AngularSvgIconModule } from 'angular-svg-icon';
36
36
  import { BreakpointObserver } from '@angular/cdk/layout';
@@ -5798,7 +5798,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
5798
5798
 
5799
5799
  class NodeLinkComponent {
5800
5800
  constructor() {
5801
+ this.route = inject(ActivatedRoute);
5801
5802
  this.faExternalLinkAlt = faExternalLinkAlt;
5803
+ this.dataVersion = toSignal(this.route.queryParams.pipe(map(({ dataVersion }) => dataVersion)));
5802
5804
  this.node = input.required();
5803
5805
  this.showExternalLink = input(false);
5804
5806
  this.linkClass = input();
@@ -5808,9 +5810,15 @@ class NodeLinkComponent {
5808
5810
  this.dataState = computed(() =>
5809
5811
  // aggregated ImpactAsessment only have a recalculated version
5810
5812
  this.aggregated() && this.type() === NodeType.ImpactAssessment ? DataState.recalculated : DataState.original);
5811
- this.url = computed(() => `${[baseUrl(), this.node()?.['@type']?.toLowerCase(), this.id()]
5813
+ this.urlParams = computed(() => [
5814
+ this.dataState() !== DataState.original ? `dataState=${this.dataState()}` : '',
5815
+ this.dataVersion() ? `dataVersion=${this.dataVersion()}` : ''
5816
+ ]
5817
+ .filter(Boolean)
5818
+ .join('&'));
5819
+ this.url = computed(() => [[baseUrl(), this.node()?.['@type']?.toLowerCase(), this.id()].filter(Boolean).join('/'), this.urlParams()]
5812
5820
  .filter(Boolean)
5813
- .join('/')}${this.dataState() !== DataState.original ? `?dataState=${this.dataState()}` : ''}`);
5821
+ .join('?'));
5814
5822
  this.showLink = computed(() => linkTypeEnabled(this.node()?.['@type']));
5815
5823
  this.target = computed(() => (this.showExternalLink() || isExternal() ? '_blank' : '_self'));
5816
5824
  }