From cfa88a0915d5a49a6eb870505c346db2dbd58648 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Tue, 24 Oct 2023 15:45:12 -0400 Subject: [PATCH] 19302: side panel updates favorites Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- src/store/favorites/favorites-actions.ts | 2 ++ src/store/side-panel-tree/side-panel-tree-actions.ts | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/favorites/favorites-actions.ts b/src/store/favorites/favorites-actions.ts index bd4d878e..8697e686 100644 --- a/src/store/favorites/favorites-actions.ts +++ b/src/store/favorites/favorites-actions.ts @@ -10,6 +10,7 @@ import { checkFavorite } from "./favorites-reducer"; import { snackbarActions, SnackbarKind } from "../snackbar/snackbar-actions"; import { ServiceRepository } from "services/services"; import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions"; +import { loadFavorites} from "store/side-panel-tree/side-panel-tree-actions"; export const favoritesActions = unionize({ TOGGLE_FAVORITE: ofType<{ resourceUuid: string }>(), @@ -51,6 +52,7 @@ export const toggleFavorite = (resource: { uuid: string; name: string }) => kind: SnackbarKind.SUCCESS })); dispatch(progressIndicatorActions.STOP_WORKING("toggleFavorite")); + dispatch(loadFavorites()) }) .catch((e: any) => { dispatch(progressIndicatorActions.STOP_WORKING("toggleFavorite")); diff --git a/src/store/side-panel-tree/side-panel-tree-actions.ts b/src/store/side-panel-tree/side-panel-tree-actions.ts index 8fac7dc2..1105285f 100644 --- a/src/store/side-panel-tree/side-panel-tree-actions.ts +++ b/src/store/side-panel-tree/side-panel-tree-actions.ts @@ -98,7 +98,7 @@ export const loadSidePanelTreeProjects = (projectUuid: string) => if (projectUuid === SidePanelTreeCategory.PUBLIC_FAVORITES) { await dispatch(loadPublicFavorites); } else if (projectUuid === SidePanelTreeCategory.FAVORITES) { - await dispatch(loadFavorites); + await dispatch(loadFavorites()); } else if (node || projectUuid !== '') { await dispatch(loadProject(projectUuid)); } @@ -124,7 +124,7 @@ const loadProject = (projectUuid: string) => dispatch(resourcesActions.SET_RESOURCES(items)); }; -const loadFavorites = async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { +export const loadFavorites =()=> async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { dispatch(treePickerActions.LOAD_TREE_PICKER_NODE({ id: SidePanelTreeCategory.FAVORITES, pickerId: SIDE_PANEL_TREE })); const params = { @@ -170,7 +170,6 @@ const loadPublicFavorites = async (dispatch: Dispatch, getState: () => RootState }; const { items } = await services.linkService.list(params); - console.log(items) dispatch(treePickerActions.LOAD_TREE_PICKER_NODE_SUCCESS({ id: SidePanelTreeCategory.PUBLIC_FAVORITES, @@ -184,7 +183,6 @@ const loadPublicFavorites = async (dispatch: Dispatch, getState: () => RootState export const activateSidePanelTreeItem = (id: string) => async (dispatch: Dispatch, getState: () => RootState) => { const node = getSidePanelTreeNode(id)(getState().treePicker); - console.log(id) if (node && !node.active) { dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({ id, pickerId: SIDE_PANEL_TREE })); } -- 2.30.2