Fix loss of tree node state when switching views
This commit fixes an issue where the check state of categories was lost when toggling between card and tree views. This is solved by immediately emitting node state changes for all nodes. This ensures consistent view transitions without any loss of node state information. Furthermore, this commit includes added unit tests for the modified code sections.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { TreeNode } from '@/presentation/components/Scripts/View/Tree/TreeView/Node/TreeNode';
|
||||
import { QueryableNodes } from '@/presentation/components/Scripts/View/Tree/TreeView/TreeRoot/NodeCollection/Query/QueryableNodes';
|
||||
import { TreeNodeStub } from './TreeNodeStub';
|
||||
|
||||
export class QueryableNodesStub implements QueryableNodes {
|
||||
public rootNodes: readonly TreeNode[];
|
||||
public rootNodes: readonly TreeNode[] = [
|
||||
new TreeNodeStub().withId(`[${QueryableNodesStub.name}] root-node-stub`),
|
||||
];
|
||||
|
||||
public flattenedNodes: readonly TreeNode[];
|
||||
public flattenedNodes: readonly TreeNode[] = [
|
||||
new TreeNodeStub().withId(`[${QueryableNodesStub.name}] flattened-node-stub-1`),
|
||||
new TreeNodeStub().withId(`[${QueryableNodesStub.name}] flattened-node-stub-2`),
|
||||
];
|
||||
|
||||
public getNodeById(): TreeNode {
|
||||
throw new Error('Method not implemented.');
|
||||
|
||||
Reference in New Issue
Block a user