From: Michal Klobukowski Date: Wed, 14 Nov 2018 14:26:55 +0000 (+0100) Subject: Extract constants from shared and favorites projects ids X-Git-Tag: 1.3.0~23^2^2^2~2^2~10 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/807660c78edbb1672af8b60348961896e48487b6 Extract constants from shared and favorites projects ids Feature #14470 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts index a3816354..657d65b7 100644 --- a/src/store/tree-picker/tree-picker-actions.ts +++ b/src/store/tree-picker/tree-picker-actions.ts @@ -137,7 +137,7 @@ export const loadCollection = (id: string, pickerId: string) => if (node && 'kind' in node.value && node.value.kind === ResourceKind.COLLECTION) { const filesTree = await services.collectionService.files(node.value.portableDataHash); - + dispatch( treePickerActions.APPEND_TREE_PICKER_NODE_SUBTREE({ id, @@ -175,13 +175,13 @@ export const loadUserProject = (pickerId: string, includeCollections = false, in } }; - +export const SHARED_PROJECT_ID = 'Shared with me'; export const initSharedProject = (pickerId: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { dispatch(receiveTreePickerData({ id: '', pickerId, - data: [{ uuid: 'Shared with me', name: 'Shared with me' }], + data: [{ uuid: SHARED_PROJECT_ID, name: SHARED_PROJECT_ID }], extractNodeData: value => ({ id: value.uuid, status: TreeNodeStatus.INITIAL, @@ -190,12 +190,13 @@ export const initSharedProject = (pickerId: string) => })); }; +export const FAVORITES_PROJECT_ID = 'Favorites'; export const initFavoritesProject = (pickerId: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { dispatch(receiveTreePickerData({ id: '', pickerId, - data: [{ uuid: 'Favorites', name: 'Favorites' }], + data: [{ uuid: FAVORITES_PROJECT_ID, name: FAVORITES_PROJECT_ID }], extractNodeData: value => ({ id: value.uuid, status: TreeNodeStatus.INITIAL,