X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b595915f605850d59c39da9b2c75555cd3965a3b..c93fca2c9be41ca963a0271dd373cc1a40cba196:/src/store/trash/trash-actions.ts diff --git a/src/store/trash/trash-actions.ts b/src/store/trash/trash-actions.ts index b59276c1f2..b810b1e490 100644 --- a/src/store/trash/trash-actions.ts +++ b/src/store/trash/trash-actions.ts @@ -10,14 +10,14 @@ import { trashPanelActions } from "~/store/trash-panel/trash-panel-action"; import { activateSidePanelTreeItem, loadSidePanelTreeProjects } from "~/store/side-panel-tree/side-panel-tree-actions"; import { projectPanelActions } from "~/store/project-panel/project-panel-action"; import { ResourceKind } from "~/models/resource"; -import { navigateToTrash } from '../navigation/navigation-action'; -import { matchTrashRoute, matchCollectionRoute } from '../../routes/routes'; +import { navigateToTrash } from '~/store/navigation/navigation-action'; +import { matchCollectionRoute } from '~/routes/routes'; export const toggleProjectTrashed = (uuid: string, ownerUuid: string, isTrashed: boolean) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise => { try { if (isTrashed) { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash..." })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash...", kind: SnackbarKind.INFO })); await services.groupsService.untrash(uuid); dispatch(activateSidePanelTreeItem(uuid)); dispatch(trashPanelActions.REQUEST_ITEMS()); @@ -27,8 +27,9 @@ export const toggleProjectTrashed = (uuid: string, ownerUuid: string, isTrashed: kind: SnackbarKind.SUCCESS })); } else { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash..." })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash...", kind: SnackbarKind.INFO })); await services.groupsService.trash(uuid); + dispatch(projectPanelActions.REQUEST_ITEMS()); dispatch(loadSidePanelTreeProjects(ownerUuid)); dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Added to trash", @@ -49,7 +50,7 @@ export const toggleCollectionTrashed = (uuid: string, isTrashed: boolean) => try { if (isTrashed) { const { location } = getState().router; - dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash..." })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Restoring from trash...", kind: SnackbarKind.INFO })); await services.collectionService.untrash(uuid); if (matchCollectionRoute(location ? location.pathname : '')) { dispatch(navigateToTrash); @@ -61,7 +62,7 @@ export const toggleCollectionTrashed = (uuid: string, isTrashed: boolean) => kind: SnackbarKind.SUCCESS })); } else { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash..." })); + dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Moving to trash...", kind: SnackbarKind.INFO })); await services.collectionService.trash(uuid); dispatch(projectPanelActions.REQUEST_ITEMS()); dispatch(snackbarActions.OPEN_SNACKBAR({