import { Dispatch } from 'redux';
import { RootState } from "~/store/store";
-import { getUserUuid } from "~/common/getuser";
+import { getUserUuid } from "~/common/getuser";
import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
import { favoritePanelActions, loadFavoritePanel } from '~/store/favorite-panel/favorite-panel-action';
import { collectionContentAddressPanelColumns } from '~/views/collection-content-address-panel/collection-content-address-panel';
import { subprocessPanelActions } from '~/store/subprocess-panel/subprocess-panel-actions';
import { subprocessPanelColumns } from '~/views/subprocess-panel/subprocess-panel-root';
+import { loadAllProcessesPanel, allProcessesPanelActions } from '../all-processes-panel/all-processes-panel-action';
+import { allProcessesPanelColumns } from '~/views/all-processes-panel/all-processes-panel';
+import { collectionPanelFilesAction } from '../collection-panel/collection-panel-files/collection-panel-files-actions';
+import { createTree } from '~/models/tree';
export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
if (user) {
dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
+ dispatch(allProcessesPanelActions.SET_COLUMNS({ columns: allProcessesPanelColumns }));
dispatch(publicFavoritePanelActions.SET_COLUMNS({ columns: publicFavoritePanelColumns }));
dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
});
+export const loadAllProcesses = () =>
+ handleFirstTimeLoad(
+ (dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.ALL_PROCESSES));
+ dispatch<any>(loadAllProcessesPanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.ALL_PROCESSES));
+ }
+ );
+
export const loadProject = (uuid: string) =>
handleFirstTimeLoad(
async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
kind: SnackbarKind.SUCCESS
}));
await dispatch<any>(loadSidePanelTreeProjects(newProject.ownerUuid));
- dispatch<any>(reloadProjectMatchingUuid([newProject.ownerUuid]));
+ dispatch<any>(navigateTo(newProject.uuid));
}
};
async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
const userUuid = getUserUuid(getState());
if (userUuid) {
+ // Clear collection files panel
+ dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files: createTree() }));
const match = await loadGroupContentsResource({ uuid, userUuid, services });
match({
OWNED: async collection => {
dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource));
dispatch(updateResources([collection]));
- await dispatch(activateSidePanelTreeItem(collection.ownerUuid));
+ dispatch(activateSidePanelTreeItem(collection.ownerUuid));
dispatch(setSidePanelBreadcrumbs(collection.ownerUuid));
dispatch(loadCollectionPanel(collection.uuid));
},
dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
dispatch(loadCollectionPanel(collection.uuid));
},
-
});
}
});
kind: SnackbarKind.SUCCESS
}));
dispatch<any>(updateResources([collection]));
- dispatch<any>(reloadProjectMatchingUuid([collection.ownerUuid]));
+ dispatch<any>(navigateTo(collection.uuid));
}
};