[ARVADOS-WORKBENCH2] created: 2.1.0-51-g29791840
Git user
git at public.arvados.org
Mon Nov 9 15:32:55 UTC 2020
at 2979184025afad76550e6684bb1c201a6eeb0e56 (commit)
commit 2979184025afad76550e6684bb1c201a6eeb0e56
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Mon Nov 9 16:31:48 2020 +0100
17096: Added check if collection data is present
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>1~
diff --git a/src/store/breadcrumbs/breadcrumbs-actions.ts b/src/store/breadcrumbs/breadcrumbs-actions.ts
index 90af2c2f..8803cfba 100644
--- a/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/src/store/breadcrumbs/breadcrumbs-actions.ts
@@ -43,14 +43,14 @@ const getSidePanelTreeBreadcrumbs = (uuid: string) => (treePicker: TreePicker):
export const setSidePanelBreadcrumbs = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const { treePicker } = getState();
+ const { treePicker, collectionPanel: { item } } = getState();
const breadcrumbs = getSidePanelTreeBreadcrumbs(uuid)(treePicker);
const path = getState().router.location!.pathname;
const currentUuid = path.split('/')[2];
const uuidKind = extractUuidKind(currentUuid);
if (uuidKind === ResourceKind.COLLECTION) {
- const collectionItem = await services.collectionService.get(currentUuid);
+ const collectionItem = item ? item : await services.collectionService.get(currentUuid);
dispatch(setBreadcrumbs(breadcrumbs, collectionItem));
} else if (uuidKind === ResourceKind.PROCESS) {
const processItem = await services.containerRequestService.get(currentUuid);
@@ -72,6 +72,7 @@ export const setCategoryBreadcrumbs = (uuid: string, category: SidePanelTreeCate
const initialBreadcrumbs: ResourceBreadcrumb[] = [
{ label: category, uuid: category }
];
+ const { collectionPanel: { item } } = getState();
const path = getState().router.location!.pathname;
const currentUuid = path.split('/')[2];
const uuidKind = extractUuidKind(currentUuid);
@@ -81,7 +82,7 @@ export const setCategoryBreadcrumbs = (uuid: string, category: SidePanelTreeCate
: breadcrumbs,
initialBreadcrumbs);
if (uuidKind === ResourceKind.COLLECTION) {
- const collectionItem = await services.collectionService.get(currentUuid);
+ const collectionItem = item ? item : await services.collectionService.get(currentUuid);
dispatch(setBreadcrumbs(breadcrumbs, collectionItem));
} else if (uuidKind === ResourceKind.PROCESS) {
const processItem = await services.containerRequestService.get(currentUuid);
diff --git a/src/store/collection-panel/collection-panel-action.ts b/src/store/collection-panel/collection-panel-action.ts
index 13943665..15d5ef72 100644
--- a/src/store/collection-panel/collection-panel-action.ts
+++ b/src/store/collection-panel/collection-panel-action.ts
@@ -29,8 +29,9 @@ export const COLLECTION_TAG_FORM_NAME = 'collectionTagForm';
export const loadCollectionPanel = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const { collectionPanel: { item } } = getState();
dispatch(collectionPanelActions.LOAD_COLLECTION({ uuid }));
- const collection = await services.collectionService.get(uuid);
+ const collection = item ? item : await services.collectionService.get(uuid);
dispatch(loadDetailsPanel(collection.uuid));
dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection }));
dispatch(resourcesActions.SET_RESOURCES([collection]));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list