-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix User Reference works as expected(i.e. Read only) in Details templ…
…ate (#170) Co-authored-by: Vishal <[email protected]>
- Loading branch information
1 parent
ba68081
commit d49bf07
Showing
2 changed files
with
53 additions
and
46 deletions.
There are no files selected for viewing
95 changes: 50 additions & 45 deletions
95
...lar-sdk-components/src/lib/_components/field/user-reference/user-reference.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,53 @@ | ||
<div class="psdk-user-reference"> | ||
<div *ngIf="type === 'operator'"> | ||
<component-mapper name="Operator" [props]="{ pConn$ }"></component-mapper> | ||
</div> | ||
<div [formGroup]="formGroup$" *ngIf="type === 'dropdown'"> | ||
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText"> | ||
<mat-select | ||
[value]="value$" | ||
[required]="bRequired$" | ||
[formControl]="fieldControl" | ||
[attr.data-test-id]="testId" | ||
(selectionChange)="fieldOnChange($event)" | ||
> | ||
<mat-option *ngFor="let opt of options$" [value]="opt.key"> | ||
{{ opt.value }} | ||
</mat-option> | ||
</mat-select> | ||
<mat-label>{{ label$ }}</mat-label> | ||
<mat-error *ngIf="fieldControl.invalid"> | ||
{{ getErrorMessage() }} | ||
</mat-error> | ||
</mat-form-field> | ||
</div> | ||
<div [formGroup]="formGroup$" *ngIf="type === 'searchbox'"> | ||
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText"> | ||
<mat-label>{{ label$ }}</mat-label> | ||
<input | ||
matInput | ||
[placeholder]="placeholder" | ||
[formControl]="fieldControl" | ||
[value]="value$" | ||
[required]="bRequired$" | ||
[matAutocomplete]="auto" | ||
[attr.data-test-id]="testId" | ||
(change)="fieldOnChange($event)" | ||
(blur)="fieldOnBlur($event)" | ||
/> | ||
<mat-autocomplete #auto="matAutocomplete"> | ||
<mat-option *ngFor="let opt of options$" [value]="opt.value"> | ||
<span>{{ opt.value }}</span> | ||
</mat-option> | ||
</mat-autocomplete> | ||
<mat-error *ngIf="fieldControl.invalid"> | ||
{{ getErrorMessage() }} | ||
</mat-error> | ||
</mat-form-field> | ||
<div *ngIf="displayMode$; else noDisplayMode"> | ||
<component-mapper name="FieldValueList" [props]="{ label$, value$, displayMode$ }"></component-mapper> | ||
</div> | ||
<ng-template #noDisplayMode> | ||
<div *ngIf="type === 'operator'"> | ||
<component-mapper name="Operator" [props]="{ pConn$ }"></component-mapper> | ||
</div> | ||
<div [formGroup]="formGroup$" *ngIf="type === 'dropdown'"> | ||
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText"> | ||
<mat-select | ||
[value]="value$" | ||
[required]="bRequired$" | ||
[formControl]="fieldControl" | ||
[attr.data-test-id]="testId" | ||
(selectionChange)="fieldOnChange($event)" | ||
> | ||
<mat-option *ngFor="let opt of options$" [value]="opt.key"> | ||
{{ opt.value }} | ||
</mat-option> | ||
</mat-select> | ||
<mat-label>{{ label$ }}</mat-label> | ||
<mat-error *ngIf="fieldControl.invalid"> | ||
{{ getErrorMessage() }} | ||
</mat-error> | ||
</mat-form-field> | ||
</div> | ||
<div [formGroup]="formGroup$" *ngIf="type === 'searchbox'"> | ||
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic" [hintLabel]="helperText"> | ||
<mat-label>{{ label$ }}</mat-label> | ||
<input | ||
matInput | ||
[placeholder]="placeholder" | ||
[formControl]="fieldControl" | ||
[value]="value$" | ||
[required]="bRequired$" | ||
[matAutocomplete]="auto" | ||
[attr.data-test-id]="testId" | ||
(change)="fieldOnChange($event)" | ||
(blur)="fieldOnBlur($event)" | ||
/> | ||
<mat-autocomplete #auto="matAutocomplete"> | ||
<mat-option *ngFor="let opt of options$" [value]="opt.value"> | ||
<span>{{ opt.value }}</span> | ||
</mat-option> | ||
</mat-autocomplete> | ||
<mat-error *ngIf="fieldControl.invalid"> | ||
{{ getErrorMessage() }} | ||
</mat-error> | ||
</mat-form-field> | ||
</div> | ||
</ng-template> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters