+ dispatch(treePickerActions.EXPAND_TREE_PICKER_NODES({
+ ids: ancestors.map(ancestor => ancestor.uuid),
+ pickerId: SIDE_PANEL_TREE
+ }));
+ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ id, pickerId: SIDE_PANEL_TREE }));
+ };
+
+export const toggleSidePanelTreeItemCollapse = (id: string) =>
+ async (dispatch: Dispatch, getState: () => RootState) => {
+ const node = getSidePanelTreeNode(id)(getState().treePicker);
+ if (node && node.status === TreeNodeStatus.INITIAL) {
+ await dispatch<any>(loadSidePanelTreeProjects(node.id));
+ }
+ dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id, pickerId: SIDE_PANEL_TREE }));
+ };
+
+export const expandSidePanelTreeItem = (id: string) =>
+ async (dispatch: Dispatch, getState: () => RootState) => {
+ const node = getSidePanelTreeNode(id)(getState().treePicker);
+ if (node && !node.expanded) {
+ dispatch(treePickerActions.TOGGLE_TREE_PICKER_NODE_COLLAPSE({ id, pickerId: SIDE_PANEL_TREE }));