Skip to content

Commit

Permalink
fix: linked property label (#DEV-4379) (#1904)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmastnt authored Nov 26, 2024
1 parent 37f3565 commit 6533df3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
7 changes: 5 additions & 2 deletions apps/dsp-app/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@
},
"resource": {
"properties": "Eigenschaften",
"comment": "Kommentar"
"comment": "Kommentar",
"propertyLabels": {
"linkedProperty": "Verlinkte Ressource"
}
},
"searchPanel": {
"howToSearch": "Wie suchen?",
Expand Down Expand Up @@ -214,4 +217,4 @@
"myAccount": "Mein Konto"
}
}
}
}
7 changes: 5 additions & 2 deletions apps/dsp-app/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@
},
"resource": {
"properties": "Properties",
"comment": "Comment"
"comment": "Comment",
"propertyLabels": {
"linkedProperty": "Linked resource"
}
},
"searchPanel": {
"howToSearch": "How to search",
Expand Down Expand Up @@ -241,4 +244,4 @@
"myAccount": "My Account"
}
}
}
}
7 changes: 5 additions & 2 deletions apps/dsp-app/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@
},
"resource": {
"properties": "Properties",
"comment": "Comment"
"comment": "Comment",
"propertyLabels": {
"linkedProperty": "Ressource liée"
}
},
"searchPanel": {
"howToSearch": "How to search",
Expand Down Expand Up @@ -241,4 +244,4 @@
"myAccount": "My Account"
}
}
}
}
7 changes: 5 additions & 2 deletions apps/dsp-app/src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@
},
"resource": {
"properties": "Properties",
"comment": "Comment"
"comment": "Comment",
"propertyLabels": {
"linkedProperty": "Risorse collegate"
}
},
"searchPanel": {
"howToSearch": "How to search",
Expand Down Expand Up @@ -241,4 +244,4 @@
"myAccount": "My Account"
}
}
}
}
7 changes: 5 additions & 2 deletions apps/dsp-app/src/assets/i18n/rm.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@
},
"resource": {
"properties": "Properties",
"comment": "Comment"
"comment": "Comment",
"propertyLabels": {
"linkedProperty": "Linked resource"
}
},
"searchPanel": {
"howToSearch": "How to search",
Expand Down Expand Up @@ -241,4 +244,4 @@
"myAccount": "My Account"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } fro
import { ActivatedRoute } from '@angular/router';
import { PropertyInfoValues } from '@dasch-swiss/vre/shared/app-common';
import { RouteConstants } from '@dasch-swiss/vre/shared/app-config';
import { TranslateService } from '@ngx-translate/core';
import { Subject, of } from 'rxjs';
import { takeUntil, takeWhile } from 'rxjs/operators';

@Component({
selector: 'app-property-row',
template: ` <div [class.border-bottom]="borderBottom" #rowElement style="display: flex; padding: 8px 0;">
<h3 class="label mat-subtitle-2" [matTooltip]="tooltip ?? ''" matTooltipPosition="above">{{ label }}</h3>
<h3 class="label mat-subtitle-2" [matTooltip]="tooltip ?? ''" matTooltipPosition="above">{{ propLabel }}</h3>
<div style="flex: 1">
<ng-content></ng-content>
</div>
Expand Down Expand Up @@ -48,7 +49,22 @@ export class PropertyRowComponent implements AfterViewInit, OnDestroy {
return this.prop && this.prop.values.length > 0 ? this.prop.values[0]?.id.split('/').pop() : undefined;
}

constructor(private route: ActivatedRoute) {}
get isLinkValueProperty(): boolean {
return (
(this.prop?.propDef as any)?.isLinkValueProperty === true &&
(this.prop?.values[0] as any)?.linkedResource !== undefined
);
}

get propLabel(): string {
const label = this._translateService.instant('resource.propertyLabels.linkedProperty');
return this.isLinkValueProperty ? label : this.label;
}

constructor(
private route: ActivatedRoute,
private _translateService: TranslateService
) {}

ngAfterViewInit() {
this.highlightArkValue();
Expand Down

0 comments on commit 6533df3

Please sign in to comment.