[PM-9629] Custom Fields V2 View Section Defects (#10103)

* Updates to Custom Fields V2 View
This commit is contained in:
Jason Ng 2024-07-18 18:56:02 -04:00 committed by GitHub
parent c27657eb82
commit 150b9ef29c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 16 deletions

View File

@ -4,25 +4,25 @@
</bit-section-header>
<bit-card>
<div
class="tw-mb-4 tw-border-secondary-300 tw-bg-background"
class="tw-border-secondary-300"
*ngFor="let field of fields; let last = last"
[ngClass]="{ 'tw-border-0 tw-border-b tw-border-solid tw-pb-2 tw-mb-4': !last }"
[ngClass]="{ 'tw-mb-4': !last }"
>
<ng-container *ngIf="field.type === fieldType.Text">
<label class="tw-text-xs tw-text-muted tw-select-none">
{{ field.name }}
</label>
<div class="tw-flex tw-justify-between">
<bit-form-field>
<input readonly bitInput type="text" [value]="field.value" aria-readonly="true" />
<button
bitIconButton="bwi-clone"
size="small"
bitSuffix
type="button"
[appCopyClick]="field.value"
showToast
[appA11yTitle]="'copyValue' | i18n"
></button>
</div>
</bit-form-field>
</ng-container>
<ng-container *ngIf="field.type === fieldType.Hidden">
<label class="tw-text-xs tw-text-muted tw-select-none">
@ -30,10 +30,10 @@
</label>
<bit-form-field>
<input readonly bitInput type="password" [value]="field.value" aria-readonly="true" />
<button type="button" bitIconButton bitPasswordInputToggle></button>
<button bitSuffix type="button" bitIconButton bitPasswordInputToggle></button>
<button
bitIconButton="bwi-clone"
size="small"
bitSuffix
type="button"
[appCopyClick]="field.value"
showToast
@ -42,18 +42,22 @@
</bit-form-field>
</ng-container>
<ng-container *ngIf="field.type === fieldType.Boolean">
<div class="tw-flex tw-my-2">
<input type="checkbox" [value]="field.value" readonly aria-readonly="true" />
<h5 class="tw-ml-3">
{{ field.name }}
</h5>
</div>
<bit-form-control>
<input
bitCheckbox
type="checkbox"
[checked]="field.value"
aria-readonly="true"
disabled
/>
<bit-label> {{ field.name }} </bit-label>
</bit-form-control>
</ng-container>
<ng-container *ngIf="field.type === fieldType.Linked">
<label class="tw-text-xs tw-text-muted tw-select-none">
{{ "linked" | i18n }}: {{ field.name }}
</label>
<div class="tw-flex tw-justify-between">
<bit-form-field>
<input
readonly
bitInput
@ -63,13 +67,13 @@
/>
<button
bitIconButton="bwi-clone"
size="small"
bitSuffix
type="button"
[appCopyClick]="field.name"
showToast
[appA11yTitle]="'copyValue' | i18n"
></button>
</div>
</bit-form-field>
</ng-container>
</div>
</bit-card>

View File

@ -13,6 +13,7 @@ import {
SectionComponent,
SectionHeaderComponent,
TypographyModule,
CheckboxModule,
} from "@bitwarden/components";
@Component({
@ -29,6 +30,7 @@ import {
SectionComponent,
SectionHeaderComponent,
TypographyModule,
CheckboxModule,
],
})
export class CustomFieldV2Component {