Skip to content

Commit

Permalink
fix: linked property label (#DEV-4379)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmastnt committed Nov 22, 2024
1 parent 75554ff commit c4f7d5a
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 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",
"properties": {
"linkedProperty": "Linked property"
}
},
"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",
"properties": {
"linkedProperty": "Linked property"
}
},
"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",
"properties": {
"linkedProperty": "Linked property"
}
},
"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",
"properties": {
"linkedProperty": "Linked property"
}
},
"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.properties.linkedProperty');
return this.isLinkValueProperty ? label : this.label;
}

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

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

0 comments on commit c4f7d5a

Please sign in to comment.