1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

[PM-7896] Cipher Form - Additional Options section (#9928)

* [PM-7896] Adjust cipher form container to expose config and original cipher view for children

* [PM-7896] Add initial additional options section

* [PM-7896] Add tests

* [PM-7896] Add TODO comments for Custom Fields

* [PM-7896] Hide password reprompt checkbox when unavailable

* [PM-7896] Fix storybook
This commit is contained in:
Shane Melton
2024-07-11 15:01:24 -07:00
committed by GitHub
parent 050f8f4bdc
commit 9dda29fb9c
8 changed files with 235 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ import { CipherFormConfig } from "../abstractions/cipher-form-config.service";
import { CipherFormService } from "../abstractions/cipher-form.service";
import { CipherForm, CipherFormContainer } from "../cipher-form-container";
import { AdditionalOptionsSectionComponent } from "./additional-options/additional-options-section.component";
import { CardDetailsSectionComponent } from "./card-details-section/card-details-section.component";
import { IdentitySectionComponent } from "./identity/identity.component";
import { ItemDetailsSectionComponent } from "./item-details/item-details-section.component";
@@ -62,6 +63,7 @@ import { ItemDetailsSectionComponent } from "./item-details/item-details-section
CardDetailsSectionComponent,
IdentitySectionComponent,
NgIf,
AdditionalOptionsSectionComponent,
],
})
export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, CipherFormContainer {
@@ -91,18 +93,17 @@ export class CipherFormComponent implements AfterViewInit, OnInit, OnChanges, Ci
*/
@Output() cipherSaved = new EventEmitter<CipherView>();
/**
* The original cipher being edited or cloned. Null for add mode.
*/
originalCipherView: CipherView | null;
/**
* The form group for the cipher. Starts empty and is populated by child components via the `registerChildForm` method.
* @protected
*/
protected cipherForm = this.formBuilder.group<CipherForm>({});
/**
* The original cipher being edited or cloned. Null for add mode.
* @protected
*/
protected originalCipherView: CipherView | null;
/**
* The value of the updated cipher. Starts as a new cipher (or clone of originalCipher) and is updated
* by child components via the `patchCipher` method.