mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[PM-6826] Vault filter refresh (#9365)
* add initial type filter - use `bit-select` while the chip component is being developed * get cipherTypes$ from service - integrate with user settings * initial add of folder selection * initial add of vault selection * initial add of collections filter * update `VaultPopupListFilterService` to `VaultPopupListFiltersService` * integrate hasFilterApplied$ * intermediate commit of integration to the filters component * do not return the tree when the value is null * return null when the updated option is null * update vault-popup-list to conform to the chip select structure * integration of bit-chip-select * move "no folder" option to the end of the list * show danger icon for deactivated organizations * show deactivated warning when the filtered org is disabled * update documentation * use pascal case for constants * store filter values as full objects rather than just id - This allows secondary logic to be applied when filters are selected * move filter form into service to be the source of truth * fix tests after adding "jest-preset-angular/setup-jest" * remove logic to have dynamic cipher type filters * use ProductType enum * invert conditional for less nesting * prefer `decryptedCollections$` over getAllDecrypted * update comments * use a `filterFunction$` observable rather than having to pass filters back to the service * fix children testing * remove check for no folder * reset filter form when filter component is destroyed * add takeUntilDestroyed for organization valueChanges * allow takeUntilDestroyed to use internal destroy ref - The associated unit tests needed to be configured with TestBed rather than just `new Service()` for this to work * use controls object for type safety
This commit is contained in:
@@ -108,7 +108,7 @@ export class ChipSelectComponent<T = unknown> implements ControlValueAccessor {
|
||||
*/
|
||||
private findOption(tree: ChipSelectOption<T>, value: T): ChipSelectOption<T> | null {
|
||||
let result = null;
|
||||
if (tree.value === value) {
|
||||
if (tree.value !== null && tree.value === value) {
|
||||
return tree;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ export class ChipSelectComponent<T = unknown> implements ControlValueAccessor {
|
||||
return;
|
||||
}
|
||||
|
||||
this.notifyOnChange(option?.value);
|
||||
this.notifyOnChange(option?.value ?? null);
|
||||
}
|
||||
|
||||
/** Implemented as part of NG_VALUE_ACCESSOR */
|
||||
|
||||
Reference in New Issue
Block a user