Removed - button on passkeys and uris when user has view only access, disabled cog button and made input fields on uris readonly when user has view only access

This commit is contained in:
gbubemismith 2024-06-12 00:54:21 -04:00
parent dbf74f05a3
commit 077edd77c1
No known key found for this signature in database
4 changed files with 11 additions and 4 deletions

View File

@ -144,6 +144,7 @@
appStopClick appStopClick
(click)="removePasskey()" (click)="removePasskey()"
appA11yTitle="{{ 'removePasskey' | i18n }}" appA11yTitle="{{ 'removePasskey' | i18n }}"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-fw bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-fw bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@ -542,6 +543,7 @@
> >
<button <button
type="button" type="button"
*ngIf="!(!cipher.edit && editMode)"
appStopClick appStopClick
(click)="removeUri(u)" (click)="removeUri(u)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
@ -558,6 +560,7 @@
[hidden]="$any(u).showUriOptionsInput === true" [hidden]="$any(u).showUriOptionsInput === true"
placeholder="{{ 'ex' | i18n }} https://google.com" placeholder="{{ 'ex' | i18n }} https://google.com"
inputmode="url" inputmode="url"
[readonly]="!cipher.edit && editMode"
appInputVerbatim appInputVerbatim
/> />
<label for="loginUriMatch{{ i }}" class="sr-only"> <label for="loginUriMatch{{ i }}" class="sr-only">
@ -607,6 +610,7 @@
appA11yTitle="{{ 'toggleOptions' | i18n }}" appA11yTitle="{{ 'toggleOptions' | i18n }}"
(click)="toggleUriOptions(u)" (click)="toggleUriOptions(u)"
[attr.aria-pressed]="$any(u).showOptions === true" [attr.aria-pressed]="$any(u).showOptions === true"
[disabled]="!cipher.edit && editMode"
> >
<i class="bwi bwi-fw bwi-lg bwi-cog" aria-hidden="true"></i> <i class="bwi bwi-fw bwi-lg bwi-cog" aria-hidden="true"></i>
</button> </button>

View File

@ -127,7 +127,7 @@
appStopClick appStopClick
(click)="removePasskey()" (click)="removePasskey()"
appA11yTitle="{{ 'removePasskey' | i18n }}" appA11yTitle="{{ 'removePasskey' | i18n }}"
[disabled]="!cipher.edit && editMode" *ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-fw bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-fw bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@ -488,7 +488,7 @@
appStopClick appStopClick
(click)="removeUri(u)" (click)="removeUri(u)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
[disabled]="!cipher.edit && editMode" *ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@ -500,6 +500,7 @@
name="Login.Uris[{{ i }}].Uri" name="Login.Uris[{{ i }}].Uri"
[(ngModel)]="u.uri" [(ngModel)]="u.uri"
placeholder="{{ 'ex' | i18n }} https://google.com" placeholder="{{ 'ex' | i18n }} https://google.com"
[readonly]="!cipher.edit && editMode"
appInputVerbatim appInputVerbatim
/> />
<label for="loginUriMatch{{ i }}" class="sr-only"> <label for="loginUriMatch{{ i }}" class="sr-only">
@ -533,6 +534,7 @@
($any(u).showOptions == null && u.match == null) ($any(u).showOptions == null && u.match == null)
) )
" "
[disabled]="!cipher.edit && editMode"
> >
<i class="bwi bwi-lg bwi-cog" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-cog" aria-hidden="true"></i>
</button> </button>

View File

@ -217,7 +217,7 @@
class="tw-items-center tw-border-none tw-bg-transparent tw-text-danger tw-ml-3" class="tw-items-center tw-border-none tw-bg-transparent tw-text-danger tw-ml-3"
appA11yTitle="{{ 'removePasskey' | i18n }}" appA11yTitle="{{ 'removePasskey' | i18n }}"
(click)="removePasskey()" (click)="removePasskey()"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-minus-circle"></i> <i class="bwi bwi-lg bwi-minus-circle"></i>
</button> </button>
@ -405,7 +405,7 @@
class="btn btn-link text-danger ml-2" class="btn btn-link text-danger ml-2"
(click)="removeUri(u)" (click)="removeUri(u)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>

View File

@ -93,6 +93,7 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit, On
async ngOnInit() { async ngOnInit() {
await super.ngOnInit(); await super.ngOnInit();
await this.load(); await this.load();
this.viewOnly = !this.cipher.edit && this.editMode;
// remove when all the title for all clients are updated to New Item // remove when all the title for all clients are updated to New Item
if (this.cloneMode || !this.editMode) { if (this.cloneMode || !this.editMode) {
this.title = this.i18nService.t("newItem"); this.title = this.i18nService.t("newItem");