1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

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

View File

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

View File

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

View File

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