mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-10426] Admin Console - Edit Modal (#11249)
* add `hideFolderSelection` for admin console ciphers * hide folder form field when configuration has `hideFolderSelection` set to true * add `addCipherV2` method in the admin console vault * add browser refresh logic for add/edit form * add admin console implementation of `AdminConsoleCipherFormConfigService` * only allow edit dialog in admin console * remove duplicate check * refactor comments * initial integration of combined dialog * integrate add cipher with admin console vault * account for special admin console collection permissions * add `edit` variable to AC ciphers when the user has permissions * Move comment to JSDoc * pass full cipher to view component * validate edit access when opening view form * partial-edit not applicable for admin console * refactor hideIndividualFields to be more generic and hide favorite button * pass entire cipher into edit logic to match view logic * add null check for cipher when attempting to view * remove logic for personal ownership, not needed in AC
This commit is contained in:
@@ -79,6 +79,9 @@ type BaseCipherFormConfig = {
|
||||
* List of organizations that the user can create ciphers for.
|
||||
*/
|
||||
organizations?: Organization[];
|
||||
|
||||
/** Hides the fields that are only applicable to individuals, useful in the Admin Console where folders aren't applicable */
|
||||
hideIndividualVaultFields?: true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<bit-section-header>
|
||||
<h2 bitTypography="h6">{{ "itemDetails" | i18n }}</h2>
|
||||
<button
|
||||
*ngIf="!config.hideIndividualVaultFields"
|
||||
slot="end"
|
||||
type="button"
|
||||
size="small"
|
||||
@@ -18,7 +19,11 @@
|
||||
<input bitInput formControlName="name" />
|
||||
</bit-form-field>
|
||||
<div class="tw-grid tw-grid-cols-2 tw-gap-1">
|
||||
<bit-form-field *ngIf="showOwnership" [disableMargin]="!showCollectionsControl">
|
||||
<bit-form-field
|
||||
*ngIf="showOwnership"
|
||||
[disableMargin]="!showCollectionsControl"
|
||||
[class.tw-col-span-2]="config.hideIndividualVaultFields"
|
||||
>
|
||||
<bit-label>{{ "owner" | i18n }}</bit-label>
|
||||
<bit-select formControlName="organizationId">
|
||||
<bit-option
|
||||
@@ -36,6 +41,7 @@
|
||||
<bit-form-field
|
||||
[class.tw-col-span-2]="!showOwnership"
|
||||
[disableMargin]="!showCollectionsControl"
|
||||
*ngIf="!config.hideIndividualVaultFields"
|
||||
>
|
||||
<bit-label>{{ "folder" | i18n }}</bit-label>
|
||||
<bit-select formControlName="folderId">
|
||||
|
||||
Reference in New Issue
Block a user