1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[EC-775] [Technical Dependency] Refactor Vault Filters to be routable (#4733)

* [EC-775] feat: add compatibility layer from #4154

* [EC-775] fix: ciphers not reloading on filter change

* [EC-775] feat: add support for cipher types

* [EC-775] feat: implement organization switching

* [EC-775] feat: remove invalid folder and collection checks

Had to remove these becuase they were causing double navigations on each click.

* [EC-775] fix: fix reverse data flow race condition

vault-filter.component was pushing up old filter models which would sometimes overwrite new filter models that came from the routed filter service.

* [EC-775] fix: No folder use-case not working

* [EC-775] feat: make navigation behave like master

* [EC-775] feat: add support for trash

* [EC-775] chore: simplify findNode

* [EC-775] feat: add support for org vault

* [EC-775] feat: add support for orgId in path

* [EC-775] feat: use proper treenode constructor

* [EC-775] chore: remove unnecessary variable

* [EC-775] docs: add docs to relevant classes

* [EC-775] chore: use existing function for searching tree

* [EC-775] fix: hide "new" button in trash view

* [EC-775] feat: add explicit handling for `AllItems`

* [EC-775] fix: prune folderId when changing organization

* [EC-775] fix: properly use `undefined` instead of `null`

* [EC-775] chore: simplify setters using ternary operator

* [EC-775] feat: add static typing to `type` filter

* [EC-775] feat: use new `All` variable for collections

* [EC-775] feat: return `RouterLink` compatible link from `createRoute`

* [EC-775] feat: add ordId path support to `createRoute`

* [EC-775] fix: interpret params differently in org vault

This is needed due to how defaults used to work when using `state-in-code`. We really want to get rid of this type of logic going forward.

* [EC-775] doc: clarify `createRoute`

* [EC-775] fix: better `type` typing

* [EC-775] feat: remove support for path navigation

It's better that we circle back to this type of navigationt when we're working on the VVR and have more knowledge about how this is supposed to work.

* [EC-775] fix: refactor bridge service to improve readability

Refactor follows feedback from PR review
This commit is contained in:
Andreas Coroiu
2023-03-06 08:34:13 +01:00
committed by GitHub
parent ae271b5c16
commit ea6666780a
14 changed files with 537 additions and 118 deletions

View File

@@ -70,14 +70,14 @@ export class ServiceUtils {
/**
* Searches a tree for a node with a matching `id`
* @param {TreeNode<ITreeNodeObject>} nodeTree - A single TreeNode branch that will be searched
* @param {TreeNode<T>} nodeTree - A single TreeNode branch that will be searched
* @param {string} id - The id of the node to be found
* @returns {TreeNode<ITreeNodeObject>} The node with a matching `id`
* @returns {TreeNode<T>} The node with a matching `id`
*/
static getTreeNodeObject(
nodeTree: TreeNode<ITreeNodeObject>,
static getTreeNodeObject<T extends ITreeNodeObject>(
nodeTree: TreeNode<T>,
id: string
): TreeNode<ITreeNodeObject> {
): TreeNode<T> {
if (nodeTree.node.id === id) {
return nodeTree;
}