Change default table view to be displayed only after data fetch
[arvados-workbench2.git] / src / store / project-panel / project-panel-middleware-service.ts
index 4b4ec2697989831e734f963eb8c872b144b1ebee..89db436f416030daa7e771cfa109fb2c813dca92 100644 (file)
@@ -18,6 +18,7 @@ import { ProjectResource } from "~/models/project";
 import { updateResources } from "~/store/resources/resources-actions";
 import { getProperty } from "~/store/properties/properties";
 import { snackbarActions } from '../snackbar/snackbar-actions';
+import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions.ts';
 import { DataExplorer, getDataExplorer } from '../data-explorer/data-explorer-reducer';
 import { ListResults } from '~/services/common-service/common-resource-service';
 import { loadContainers } from '../processes/processes-actions';
@@ -38,12 +39,15 @@ export class ProjectPanelMiddlewareService extends DataExplorerMiddlewareService
             api.dispatch(projectPanelDataExplorerIsNotSet());
         } else {
             try {
+                api.dispatch(progressIndicatorActions.START(this.getId()));
                 const response = await this.services.groupsService.contents(projectUuid, getParams(dataExplorer));
+                api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
                 api.dispatch<any>(updateFavorites(response.items.map(item => item.uuid)));
                 api.dispatch(updateResources(response.items));
                 await api.dispatch<any>(loadMissingProcessesInformation(response.items));
                 api.dispatch(setItems(response));
             } catch (e) {
+                api.dispatch(progressIndicatorActions.PERSIST_STOP(this.getId()));
                 api.dispatch(couldNotFetchProjectContents());
             }
         }