mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
[PM-24232] - [Defect][Web] Admin Console - SSH key and Folder should not show as options from New button (#15834)
* properly call input functions * don't enable sshkey form * fix logic for disabling cipher form * prefer use of observable * use destroyRef. change to enabled status only
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<ng-container *ngIf="canCreateCipher || canCreateCollection || canCreateFolder">
|
||||
<ng-container *ngIf="canCreateCipher() || canCreateCollection() || canCreateFolder()">
|
||||
<div>
|
||||
<button
|
||||
bitButton
|
||||
@@ -18,13 +18,13 @@
|
||||
{{ item.labelKey | i18n }}
|
||||
</button>
|
||||
}
|
||||
<bit-menu-divider *ngIf="canCreateCipher"></bit-menu-divider>
|
||||
<button *ngIf="canCreateFolder" type="button" bitMenuItem (click)="folderAdded.emit()">
|
||||
<bit-menu-divider *ngIf="canCreateCipher()"></bit-menu-divider>
|
||||
<button *ngIf="canCreateFolder()" type="button" bitMenuItem (click)="folderAdded.emit()">
|
||||
<i class="bwi bwi-fw bwi-folder" aria-hidden="true"></i>
|
||||
{{ "folder" | i18n }}
|
||||
</button>
|
||||
<button
|
||||
*ngIf="canCreateCollection"
|
||||
*ngIf="canCreateCollection()"
|
||||
type="button"
|
||||
bitMenuItem
|
||||
(click)="collectionAdded.emit()"
|
||||
|
||||
@@ -18,6 +18,7 @@ export class NewCipherMenuComponent {
|
||||
canCreateCipher = input(false);
|
||||
canCreateFolder = input(false);
|
||||
canCreateCollection = input(false);
|
||||
canCreateSshKey = input(false);
|
||||
folderAdded = output();
|
||||
collectionAdded = output();
|
||||
cipherAdded = output<CipherType>();
|
||||
@@ -30,6 +31,9 @@ export class NewCipherMenuComponent {
|
||||
cipherMenuItems$ = this.restrictedItemTypesService.restricted$.pipe(
|
||||
map((restrictedTypes) => {
|
||||
return CIPHER_MENU_ITEMS.filter((item) => {
|
||||
if (!this.canCreateSshKey() && item.type === CipherType.SshKey) {
|
||||
return false;
|
||||
}
|
||||
return !restrictedTypes.some((restrictedType) => restrictedType.cipherType === item.type);
|
||||
});
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user