15610: Clears the collection's files panel before loading the UI.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 10 Jul 2020 17:51:41 +0000 (14:51 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 10 Jul 2020 17:51:41 +0000 (14:51 -0300)
This avoids flickering on the files panel.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/store/collection-panel/collection-panel-action.ts
src/store/workbench/workbench-actions.ts

index 35c3c3d39a1065bfaea03bfe5fa3faab851b7f6d..13943665dfe54457168a67b72ed8b9a77acc6efb 100644 (file)
@@ -5,8 +5,6 @@
 import { Dispatch } from "redux";
 import { loadCollectionFiles, COLLECTION_PANEL_LOAD_FILES_THRESHOLD } from "./collection-panel-files/collection-panel-files-actions";
 import { CollectionResource } from '~/models/collection';
-import { collectionPanelFilesAction } from "./collection-panel-files/collection-panel-files-actions";
-import { createTree } from "~/models/tree";
 import { RootState } from "~/store/store";
 import { ServiceRepository } from "~/services/services";
 import { TagProperty } from "~/models/tag";
@@ -32,7 +30,6 @@ export const COLLECTION_TAG_FORM_NAME = 'collectionTagForm';
 export const loadCollectionPanel = (uuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         dispatch(collectionPanelActions.LOAD_COLLECTION({ uuid }));
-        dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES({ files: createTree() }));
         const collection = await services.collectionService.get(uuid);
         dispatch(loadDetailsPanel(collection.uuid));
         dispatch(collectionPanelActions.LOAD_COLLECTION_SUCCESS({ item: collection }));
index e2ff01f7afa71c6df8e6434ce03d08a830f5c0fb..944c48cf8cc6006ee412182c952f765f05e1004d 100644 (file)
@@ -101,6 +101,8 @@ import { subprocessPanelActions } from '~/store/subprocess-panel/subprocess-pane
 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';
 
@@ -278,6 +280,8 @@ export const loadCollection = (uuid: string) =>
         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 => {