Skip to content

Commit 81336cc

Browse files
mohas22mohas22
authored andcommitted
Updated DataReference and Semantic Link to display as label and value
1 parent bbfd3f2 commit 81336cc

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

packages/angular-sdk-components/src/lib/_components/field/semantic-link/semantic-link.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
<div *ngIf="bVisible$ !== false" [ngClass]="label$.length > 0 ? 'psdk-grid-filter' : 'psdk-container-nolabels'">
1+
<div *ngIf="displayMode$">
2+
<div class="psdk-grid-filter">
3+
<div class="psdk-grid-label">{{ label$ }}</div>
4+
<a *ngIf="!isLinkTextEmpty; else noLink" class="psdk-value" href="#" (click)="openLinkClick($event)">{{ value$ || '---' }}</a>
5+
</div>
6+
</div>
7+
<div *ngIf="bVisible$ !== false && !displayMode$" [ngClass]="label$.length > 0 ? '' : 'psdk-container-nolabels'">
28
<div class="psdk-grid-label">{{ label$ }}</div>
39
<a *ngIf="!isLinkTextEmpty; else noLink" class="psdk-value" href="#" (click)="openLinkClick($event)">{{ value$ || '---' }}</a>
410
</div>

packages/angular-sdk-components/src/lib/_components/field/semantic-link/semantic-link.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
grid-template-columns: repeat(2, minmax(0, 1fr));
44
column-gap: calc(2 * 0.5rem);
55
row-gap: calc(2 * 0.5rem);
6-
align-items: start;
6+
align-items: center;
77
}
88

99
.psdk-container-nolabels {

packages/angular-sdk-components/src/lib/_components/template/single-reference-readonly/single-reference-readonly.component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export class SingleReferenceReadonlyComponent implements OnInit, OnDestroy {
5555
updateSelf() {
5656
this.configProps = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
5757
const rawViewMetadata = this.pConn$.getRawMetadata();
58-
const propsToUse = { ...this.pConn$.getInheritedProps(), ...this.configProps };
58+
const label = this.configProps.label;
59+
const showLabel = this.configProps.showLabel;
60+
const propsToUse = { label, showLabel, ...this.pConn$.getInheritedProps() };
5961
const type = (rawViewMetadata?.config as any)?.componentType;
6062
const displayMode = this.configProps.displayMode;
6163
const targetObjectType = this.configProps.targetObjectType;
@@ -66,12 +68,16 @@ export class SingleReferenceReadonlyComponent implements OnInit, OnDestroy {
6668
const dataRelationshipContext = (rawViewMetadata?.config as any)?.displayField
6769
? getDataRelationshipContextFromKey((rawViewMetadata?.config as any)?.displayField)
6870
: this.dataRelationshipContext;
71+
if (propsToUse.showLabel === false) {
72+
propsToUse.label = '';
73+
}
6974
this.label = propsToUse.label;
7075

7176
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown', 'RadioButtons'];
7277
const config: any = {
7378
...rawViewMetadata?.config,
74-
primaryField: (rawViewMetadata?.config as any)?.displayField
79+
primaryField: (rawViewMetadata?.config as any)?.displayField,
80+
label: this.label
7581
};
7682

7783
const activeViewRuleClass = (rawViewMetadata?.config as any)?.targetObjectClass;

0 commit comments

Comments
 (0)