15768: unit tests pass again Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox...
authorLisa Knox <lisaknox83@gmail.com>
Tue, 10 Oct 2023 21:01:06 +0000 (17:01 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Tue, 10 Oct 2023 21:01:06 +0000 (17:01 -0400)
src/store/collections/collection-move-actions.ts
src/store/data-explorer/data-explorer-action.ts
src/store/processes/process-move-actions.ts
src/store/processes/processes-actions.ts
src/store/project-panel/project-panel-action.ts
src/store/project-panel/project-panel-middleware-service.ts
src/store/projects/project-lock-actions.ts
src/store/projects/project-move-actions.ts
src/store/trash/trash-actions.ts
src/store/workbench/workbench-actions.ts
src/websocket/websocket.ts

index 929f1612f7b8c3baa6ded53a46091e811cdc2a38..16d31405565a809e5c9abefa2194c5f9069b0920 100644 (file)
@@ -4,31 +4,31 @@
 
 import { Dispatch } from "redux";
 import { dialogActions } from "store/dialog/dialog-actions";
-import { startSubmit, stopSubmit, initialize, FormErrors } from 'redux-form';
-import { ServiceRepository } from 'services/services';
-import { RootState } from 'store/store';
+import { startSubmit, stopSubmit, initialize, FormErrors } from "redux-form";
+import { ServiceRepository } from "services/services";
+import { RootState } from "store/store";
 import { getCommonResourceServiceError, CommonResourceServiceError } from "services/common-service/common-resource-service";
-import {snackbarActions, SnackbarKind} from 'store/snackbar/snackbar-actions';
-import { projectPanelActions } from 'store/project-panel/project-panel-action';
-import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog';
-import { resetPickerProjectTree } from 'store/project-tree-picker/project-tree-picker-actions';
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
+// import { projectPanelActions } from 'store/project-panel/project-panel-action';
+import { MoveToFormDialogData } from "store/move-to-dialog/move-to-dialog";
+import { resetPickerProjectTree } from "store/project-tree-picker/project-tree-picker-actions";
 import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
-import { initProjectsTreePicker } from 'store/tree-picker/tree-picker-actions';
+import { initProjectsTreePicker } from "store/tree-picker/tree-picker-actions";
 import { getResource } from "store/resources/resources";
 import { CollectionResource } from "models/collection";
 
-export const COLLECTION_MOVE_FORM_NAME = 'collectionMoveFormName';
+export const COLLECTION_MOVE_FORM_NAME = "collectionMoveFormName";
 
-export const openMoveCollectionDialog = (resource: { name: string, uuid: string }) =>
-    (dispatch: Dispatch) => {
-        dispatch<any>(resetPickerProjectTree());
-        dispatch<any>(initProjectsTreePicker(COLLECTION_MOVE_FORM_NAME));
-        dispatch(initialize(COLLECTION_MOVE_FORM_NAME, resource));
-        dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_MOVE_FORM_NAME, data: {} }));
-    };
+export const openMoveCollectionDialog = (resource: { name: string; uuid: string }) => (dispatch: Dispatch) => {
+    dispatch<any>(resetPickerProjectTree());
+    dispatch<any>(initProjectsTreePicker(COLLECTION_MOVE_FORM_NAME));
+    dispatch(initialize(COLLECTION_MOVE_FORM_NAME, resource));
+    dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_MOVE_FORM_NAME, data: {} }));
+};
 
-export const moveCollection = (resource: MoveToFormDialogData) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+export const moveCollection =
+    (resource: MoveToFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         dispatch(startSubmit(COLLECTION_MOVE_FORM_NAME));
         let cachedCollection = getResource<CollectionResource>(resource.uuid)(getState().resources);
         try {
@@ -40,14 +40,18 @@ export const moveCollection = (resource: MoveToFormDialogData) =>
             dispatch(projectPanelActions.REQUEST_ITEMS());
             dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_MOVE_FORM_NAME));
-            return {...cachedCollection, ...collection};
+            return { ...cachedCollection, ...collection };
         } catch (e) {
             const error = getCommonResourceServiceError(e);
             if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
-                dispatch(stopSubmit(COLLECTION_MOVE_FORM_NAME, { ownerUuid: 'A collection with the same name already exists in the target project.' } as FormErrors));
+                dispatch(
+                    stopSubmit(COLLECTION_MOVE_FORM_NAME, {
+                        ownerUuid: "A collection with the same name already exists in the target project.",
+                    } as FormErrors)
+                );
             } else {
                 dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_MOVE_FORM_NAME }));
-                dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not move the collection.', hideDuration: 2000, kind: SnackbarKind.ERROR }));
+                dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not move the collection.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
             }
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_MOVE_FORM_NAME));
             return;
index 387decf7ed1e26edf0d7ddcc74b7f387438fab89..483ec14c58f26610e00ec17a8e577330d607711e 100644 (file)
@@ -2,9 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { unionize, ofType, UnionOf } from 'common/unionize';
-import { DataColumns, DataTableFetchMode } from 'components/data-table/data-table';
-import { DataTableFilters } from 'components/data-table-filters/data-table-filters-tree';
+import { unionize, ofType, UnionOf } from "common/unionize";
+import { DataColumns, DataTableFetchMode } from "components/data-table/data-table";
+import { DataTableFilters } from "components/data-table-filters/data-table-filters-tree";
 
 export enum DataTableRequestState {
     IDLE,
@@ -40,8 +40,10 @@ export const bindDataExplorerActions = (id: string) => ({
     SET_FETCH_MODE: (payload: { fetchMode: DataTableFetchMode }) => dataExplorerActions.SET_FETCH_MODE({ ...payload, id }),
     SET_COLUMNS: (payload: { columns: DataColumns<any, any> }) => dataExplorerActions.SET_COLUMNS({ ...payload, id }),
     SET_FILTERS: (payload: { columnName: string; filters: DataTableFilters }) => dataExplorerActions.SET_FILTERS({ ...payload, id }),
-    SET_ITEMS: (payload: { items: any[]; page: number; rowsPerPage: number; itemsAvailable: number }) => dataExplorerActions.SET_ITEMS({ ...payload, id }),
-    APPEND_ITEMS: (payload: { items: any[]; page: number; rowsPerPage: number; itemsAvailable: number }) => dataExplorerActions.APPEND_ITEMS({ ...payload, id }),
+    SET_ITEMS: (payload: { items: any[]; page: number; rowsPerPage: number; itemsAvailable: number }) =>
+        dataExplorerActions.SET_ITEMS({ ...payload, id }),
+    APPEND_ITEMS: (payload: { items: any[]; page: number; rowsPerPage: number; itemsAvailable: number }) =>
+        dataExplorerActions.APPEND_ITEMS({ ...payload, id }),
     SET_PAGE: (payload: { page: number }) => dataExplorerActions.SET_PAGE({ ...payload, id }),
     SET_ROWS_PER_PAGE: (payload: { rowsPerPage: number }) => dataExplorerActions.SET_ROWS_PER_PAGE({ ...payload, id }),
     TOGGLE_COLUMN: (payload: { columnName: string }) => dataExplorerActions.TOGGLE_COLUMN({ ...payload, id }),
@@ -50,3 +52,6 @@ export const bindDataExplorerActions = (id: string) => ({
     RESET_EXPLORER_SEARCH_VALUE: () => dataExplorerActions.RESET_EXPLORER_SEARCH_VALUE({ id }),
     SET_REQUEST_STATE: (payload: { requestState: DataTableRequestState }) => dataExplorerActions.SET_REQUEST_STATE({ ...payload, id }),
 });
+
+const PROJECT_PANEL_ID = "projectPanel";
+export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID);
index 78703e197ff7aeda35ae117624cdb39d23adca1a..6f9e157f884dc039b7458514ca81bef4339f6ba1 100644 (file)
@@ -4,21 +4,22 @@
 
 import { Dispatch } from "redux";
 import { dialogActions } from "store/dialog/dialog-actions";
-import { startSubmit, stopSubmit, initialize, FormErrors } from 'redux-form';
-import { ServiceRepository } from 'services/services';
-import { RootState } from 'store/store';
+import { startSubmit, stopSubmit, initialize, FormErrors } from "redux-form";
+import { ServiceRepository } from "services/services";
+import { RootState } from "store/store";
 import { getCommonResourceServiceError, CommonResourceServiceError } from "services/common-service/common-resource-service";
-import {snackbarActions, SnackbarKind} from 'store/snackbar/snackbar-actions';
-import { MoveToFormDialogData } from 'store/move-to-dialog/move-to-dialog';
-import { resetPickerProjectTree } from 'store/project-tree-picker/project-tree-picker-actions';
-import { projectPanelActions } from 'store/project-panel/project-panel-action';
-import { getProcess } from 'store/processes/process';
-import { initProjectsTreePicker } from 'store/tree-picker/tree-picker-actions';
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
+import { MoveToFormDialogData } from "store/move-to-dialog/move-to-dialog";
+import { resetPickerProjectTree } from "store/project-tree-picker/project-tree-picker-actions";
+// import { projectPanelActions } from 'store/project-panel/project-panel-action';
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
+import { getProcess } from "store/processes/process";
+import { initProjectsTreePicker } from "store/tree-picker/tree-picker-actions";
 
-export const PROCESS_MOVE_FORM_NAME = 'processMoveFormName';
+export const PROCESS_MOVE_FORM_NAME = "processMoveFormName";
 
-export const openMoveProcessDialog = (resource: { name: string, uuid: string }) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+export const openMoveProcessDialog =
+    (resource: { name: string; uuid: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         const process = getProcess(resource.uuid)(getState().resources);
         if (process) {
             dispatch<any>(resetPickerProjectTree());
@@ -26,27 +27,28 @@ export const openMoveProcessDialog = (resource: { name: string, uuid: string })
             dispatch(initialize(PROCESS_MOVE_FORM_NAME, resource));
             dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_MOVE_FORM_NAME, data: {} }));
         } else {
-            dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process not found', hideDuration: 2000, kind: SnackbarKind.ERROR }));
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Process not found", hideDuration: 2000, kind: SnackbarKind.ERROR }));
         }
     };
 
-export const moveProcess = (resource: MoveToFormDialogData) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        dispatch(startSubmit(PROCESS_MOVE_FORM_NAME));
-        try {
-            const process = await services.containerRequestService.get(resource.uuid);
-            await services.containerRequestService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
-            dispatch(projectPanelActions.REQUEST_ITEMS());
+export const moveProcess = (resource: MoveToFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    dispatch(startSubmit(PROCESS_MOVE_FORM_NAME));
+    try {
+        const process = await services.containerRequestService.get(resource.uuid);
+        await services.containerRequestService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
+        dispatch(projectPanelActions.REQUEST_ITEMS());
+        dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_MOVE_FORM_NAME }));
+        return process;
+    } catch (e) {
+        const error = getCommonResourceServiceError(e);
+        if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
+            dispatch(
+                stopSubmit(PROCESS_MOVE_FORM_NAME, { ownerUuid: "A process with the same name already exists in the target project." } as FormErrors)
+            );
+        } else {
             dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_MOVE_FORM_NAME }));
-            return process;
-        } catch (e) {
-            const error = getCommonResourceServiceError(e);
-            if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
-                dispatch(stopSubmit(PROCESS_MOVE_FORM_NAME, { ownerUuid: 'A process with the same name already exists in the target project.' } as FormErrors));
-            } else {
-                dispatch(dialogActions.CLOSE_DIALOG({ id: PROCESS_MOVE_FORM_NAME }));
-                dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not move the process.', hideDuration: 2000, kind: SnackbarKind.ERROR }));
-            }
-            return;
+            dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not move the process.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
         }
-    };
+        return;
+    }
+};
index 25cb8561b1576d5b87073c3224987849d20851f6..57dc7b171a2be9f3c62151e1f4090887a546c0c1 100644 (file)
@@ -9,7 +9,7 @@ import { updateResources } from "store/resources/resources-actions";
 import { Process } from "./process";
 import { dialogActions } from "store/dialog/dialog-actions";
 import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
-import { projectPanelActions } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import { navigateToRunProcess } from "store/navigation/navigation-action";
 import { goToStep, runProcessPanelActions } from "store/run-process-panel/run-process-panel-actions";
 import { getResource } from "store/resources/resources";
index 7ad18b67bdb2f50b5baf1e4a3818abc3d4581d37..1a7caa6f6635aefb633381da50e38f84ad111f6c 100644 (file)
@@ -2,27 +2,25 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Dispatch } from 'redux';
+import { Dispatch } from "redux";
 import { bindDataExplorerActions } from "store/data-explorer/data-explorer-action";
 import { propertiesActions } from "store/properties/properties-actions";
-import { RootState } from 'store/store';
+import { RootState } from "store/store";
 import { getProperty } from "store/properties/properties";
 import { loadProject } from "store/workbench/workbench-actions";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 
 export const PROJECT_PANEL_ID = "projectPanel";
 export const PROJECT_PANEL_CURRENT_UUID = "projectPanelCurrentUuid";
-export const IS_PROJECT_PANEL_TRASHED = 'isProjectPanelTrashed';
-export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID);
+export const IS_PROJECT_PANEL_TRASHED = "isProjectPanelTrashed";
 
-export const openProjectPanel = (projectUuid: string) =>
-    async (dispatch: Dispatch) => {
-        await dispatch<any>(loadProject(projectUuid));
-        dispatch(propertiesActions.SET_PROPERTY({ key: PROJECT_PANEL_CURRENT_UUID, value: projectUuid }));
-        dispatch(projectPanelActions.RESET_EXPLORER_SEARCH_VALUE());
-        dispatch(projectPanelActions.REQUEST_ITEMS());
-    };
+export const openProjectPanel = (projectUuid: string) => async (dispatch: Dispatch) => {
+    await dispatch<any>(loadProject(projectUuid));
+    dispatch(propertiesActions.SET_PROPERTY({ key: PROJECT_PANEL_CURRENT_UUID, value: projectUuid }));
+    dispatch(projectPanelActions.RESET_EXPLORER_SEARCH_VALUE());
+    dispatch(projectPanelActions.REQUEST_ITEMS());
+};
 
 export const getProjectPanelCurrentUuid = (state: RootState) => getProperty<string>(PROJECT_PANEL_CURRENT_UUID)(state.properties);
 
-export const setIsProjectPanelTrashed = (isTrashed: boolean) =>
-    propertiesActions.SET_PROPERTY({ key: IS_PROJECT_PANEL_TRASHED, value: isTrashed });
+export const setIsProjectPanelTrashed = (isTrashed: boolean) => propertiesActions.SET_PROPERTY({ key: IS_PROJECT_PANEL_TRASHED, value: isTrashed });
index c9aafd52300abb449f12dae82cd295ca185ee3e0..0eca18e2e53b21e5f97c824667031ca39d340f2c 100644 (file)
@@ -6,8 +6,8 @@ import {
     DataExplorerMiddlewareService,
     dataExplorerToListParams,
     getDataExplorerColumnFilters,
-    listResultsToDataExplorerItemsMeta
-} from 'store/data-explorer/data-explorer-middleware-service';
+    listResultsToDataExplorerItemsMeta,
+} from "store/data-explorer/data-explorer-middleware-service";
 import { ProjectPanelColumnNames } from "views/project-panel/project-panel";
 import { RootState } from "store/store";
 import { DataColumns } from "components/data-table/data-table";
@@ -17,30 +17,24 @@ import { OrderBuilder, OrderDirection } from "services/api/order-builder";
 import { FilterBuilder, joinFilters } from "services/api/filter-builder";
 import { GroupContentsResource, GroupContentsResourcePrefix } from "services/groups-service/groups-service";
 import { updateFavorites } from "store/favorites/favorites-actions";
-import {
-    IS_PROJECT_PANEL_TRASHED,
-    projectPanelActions,
-    getProjectPanelCurrentUuid
-} from 'store/project-panel/project-panel-action';
+import { IS_PROJECT_PANEL_TRASHED, getProjectPanelCurrentUuid } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import { Dispatch, MiddlewareAPI } from "redux";
 import { ProjectResource } from "models/project";
 import { updateResources } from "store/resources/resources-actions";
 import { getProperty } from "store/properties/properties";
-import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
-import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions';
-import { DataExplorer, getDataExplorer } from 'store/data-explorer/data-explorer-reducer';
-import { ListResults } from 'services/common-service/common-service';
-import { loadContainers } from 'store/processes/processes-actions';
-import { ResourceKind } from 'models/resource';
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
+import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
+import { DataExplorer, getDataExplorer } from "store/data-explorer/data-explorer-reducer";
+import { ListResults } from "services/common-service/common-service";
+import { loadContainers } from "store/processes/processes-actions";
+import { ResourceKind } from "models/resource";
 import { getSortColumn } from "store/data-explorer/data-explorer-reducer";
-import {
-    serializeResourceTypeFilters,
-    buildProcessStatusFilters
-} from 'store/resource-type-filters/resource-type-filters';
-import { updatePublicFavorites } from 'store/public-favorites/public-favorites-actions';
-import { selectedFieldsOfGroup } from 'models/group';
-import { defaultCollectionSelectedFields } from 'models/collection';
-import { containerRequestFieldsNoMounts } from 'models/container-request';
+import { serializeResourceTypeFilters, buildProcessStatusFilters } from "store/resource-type-filters/resource-type-filters";
+import { updatePublicFavorites } from "store/public-favorites/public-favorites-actions";
+import { selectedFieldsOfGroup } from "models/group";
+import { defaultCollectionSelectedFields } from "models/collection";
+import { containerRequestFieldsNoMounts } from "models/container-request";
 
 export class ProjectPanelMiddlewareService extends DataExplorerMiddlewareService {
     constructor(private services: ServiceRepository, id: string) {
@@ -67,12 +61,14 @@ export class ProjectPanelMiddlewareService extends DataExplorerMiddlewareService
                 await api.dispatch<any>(loadMissingProcessesInformation(response.items));
                 api.dispatch(setItems(response));
             } catch (e) {
-                api.dispatch(projectPanelActions.SET_ITEMS({
-                    items: [],
-                    itemsAvailable: 0,
-                    page: 0,
-                    rowsPerPage: dataExplorer.rowsPerPage
-                }));
+                api.dispatch(
+                    projectPanelActions.SET_ITEMS({
+                        items: [],
+                        itemsAvailable: 0,
+                        page: 0,
+                        rowsPerPage: dataExplorer.rowsPerPage,
+                    })
+                );
                 api.dispatch(couldNotFetchProjectContents());
             } finally {
                 api.dispatch(progressIndicatorActions.PERSIST_STOP_WORKING(this.getId()));
@@ -81,22 +77,16 @@ export class ProjectPanelMiddlewareService extends DataExplorerMiddlewareService
     }
 }
 
-export const loadMissingProcessesInformation = (resources: GroupContentsResource[]) =>
-    async (dispatch: Dispatch) => {
-        const containerUuids = resources.reduce((uuids, resource) => {
-            return resource.kind === ResourceKind.CONTAINER_REQUEST &&
-                resource.containerUuid &&
-                !uuids.includes(resource.containerUuid)
-                ? [...uuids, resource.containerUuid]
-                : uuids;
-        }, [] as string[]);
-        if (containerUuids.length > 0) {
-            await dispatch<any>(loadContainers(
-                containerUuids,
-                false
-            ));
-        }
-    };
+export const loadMissingProcessesInformation = (resources: GroupContentsResource[]) => async (dispatch: Dispatch) => {
+    const containerUuids = resources.reduce((uuids, resource) => {
+        return resource.kind === ResourceKind.CONTAINER_REQUEST && resource.containerUuid && !uuids.includes(resource.containerUuid)
+            ? [...uuids, resource.containerUuid]
+            : uuids;
+    }, [] as string[]);
+    if (containerUuids.length > 0) {
+        await dispatch<any>(loadContainers(containerUuids, false));
+    }
+};
 
 export const setItems = (listResults: ListResults<GroupContentsResource>) =>
     projectPanelActions.SET_ITEMS({
@@ -109,16 +99,14 @@ export const getParams = (dataExplorer: DataExplorer, isProjectTrashed: boolean)
     order: getOrder(dataExplorer),
     filters: getFilters(dataExplorer),
     includeTrash: isProjectTrashed,
-    select: selectedFieldsOfGroup.concat(defaultCollectionSelectedFields, containerRequestFieldsNoMounts)
+    select: selectedFieldsOfGroup.concat(defaultCollectionSelectedFields, containerRequestFieldsNoMounts),
 });
 
 export const getFilters = (dataExplorer: DataExplorer) => {
     const columns = dataExplorer.columns as DataColumns<string, ProjectResource>;
     const typeFilters = serializeResourceTypeFilters(getDataExplorerColumnFilters(columns, ProjectPanelColumnNames.TYPE));
-    const statusColumnFilters = getDataExplorerColumnFilters(columns, 'Status');
-    const activeStatusFilter = Object.keys(statusColumnFilters).find(
-        filterName => statusColumnFilters[filterName].selected
-    );
+    const statusColumnFilters = getDataExplorerColumnFilters(columns, "Status");
+    const activeStatusFilter = Object.keys(statusColumnFilters).find(filterName => statusColumnFilters[filterName].selected);
 
     // TODO: Extract group contents name filter
     const nameFilters = new FilterBuilder()
@@ -128,25 +116,16 @@ export const getFilters = (dataExplorer: DataExplorer) => {
         .getFilters();
 
     // Filter by container status
-    const statusFilters = buildProcessStatusFilters(
-        new FilterBuilder(),
-        activeStatusFilter || '',
-        GroupContentsResourcePrefix.PROCESS).getFilters();
+    const statusFilters = buildProcessStatusFilters(new FilterBuilder(), activeStatusFilter || "", GroupContentsResourcePrefix.PROCESS).getFilters();
 
-    return joinFilters(
-        statusFilters,
-        typeFilters,
-        nameFilters,
-    );
+    return joinFilters(statusFilters, typeFilters, nameFilters);
 };
 
 const getOrder = (dataExplorer: DataExplorer) => {
     const sortColumn = getSortColumn<ProjectResource>(dataExplorer);
     const order = new OrderBuilder<ProjectResource>();
     if (sortColumn && sortColumn.sort) {
-        const sortDirection = sortColumn.sort.direction === SortDirection.ASC
-            ? OrderDirection.ASC
-            : OrderDirection.DESC;
+        const sortDirection = sortColumn.sort.direction === SortDirection.ASC ? OrderDirection.ASC : OrderDirection.DESC;
 
         return order
             .addOrder(sortDirection, sortColumn.sort.field, GroupContentsResourcePrefix.COLLECTION)
@@ -160,18 +139,18 @@ const getOrder = (dataExplorer: DataExplorer) => {
 
 const projectPanelCurrentUuidIsNotSet = () =>
     snackbarActions.OPEN_SNACKBAR({
-        message: 'Project panel is not opened.',
-        kind: SnackbarKind.ERROR
+        message: "Project panel is not opened.",
+        kind: SnackbarKind.ERROR,
     });
 
 const couldNotFetchProjectContents = () =>
     snackbarActions.OPEN_SNACKBAR({
-        message: 'Could not fetch project contents.',
-        kind: SnackbarKind.ERROR
+        message: "Could not fetch project contents.",
+        kind: SnackbarKind.ERROR,
     });
 
 const projectPanelDataExplorerIsNotSet = () =>
     snackbarActions.OPEN_SNACKBAR({
-        message: 'Project panel is not ready.',
-        kind: SnackbarKind.ERROR
+        message: "Project panel is not ready.",
+        kind: SnackbarKind.ERROR,
     });
index 98ebb3849535352769cc32e50fbf0ddc954c0318..4a5cbfef34423d7759b8b4c832ff53642c8048e0 100644 (file)
@@ -4,31 +4,28 @@
 
 import { Dispatch } from "redux";
 import { ServiceRepository } from "services/services";
-import { projectPanelActions } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import { loadResource } from "store/resources/resources-actions";
 import { RootState } from "store/store";
 
-export const freezeProject = (uuid: string) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
-        const userUUID = getState().auth.user!.uuid;
+export const freezeProject = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    const userUUID = getState().auth.user!.uuid;
 
-        const updatedProject = await services.projectService.update(uuid, {
-            frozenByUuid: userUUID
-        });
+    const updatedProject = await services.projectService.update(uuid, {
+        frozenByUuid: userUUID,
+    });
 
-        dispatch(projectPanelActions.REQUEST_ITEMS());
-        dispatch<any>(loadResource(uuid, false));
-        return updatedProject;
-    };
+    dispatch(projectPanelActions.REQUEST_ITEMS());
+    dispatch<any>(loadResource(uuid, false));
+    return updatedProject;
+};
 
-export const unfreezeProject = (uuid: string) =>
-    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+export const unfreezeProject = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    const updatedProject = await services.projectService.update(uuid, {
+        frozenByUuid: null,
+    });
 
-        const updatedProject = await services.projectService.update(uuid, {
-            frozenByUuid: null
-        });
-
-        dispatch(projectPanelActions.REQUEST_ITEMS());
-        dispatch<any>(loadResource(uuid, false));
-        return updatedProject;
-    };
\ No newline at end of file
+    dispatch(projectPanelActions.REQUEST_ITEMS());
+    dispatch<any>(loadResource(uuid, false));
+    return updatedProject;
+};
index 0684fc9c744515a704b9e6a5ac282794549377aa..8fb0dc60574fc99343ab3202130057810e229b8b 100644 (file)
@@ -12,7 +12,7 @@ import { getCommonResourceServiceError, CommonResourceServiceError } from "servi
 import { MoveToFormDialogData } from "store/move-to-dialog/move-to-dialog";
 import { resetPickerProjectTree } from "store/project-tree-picker/project-tree-picker-actions";
 import { initProjectsTreePicker } from "store/tree-picker/tree-picker-actions";
-import { projectPanelActions } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import { loadSidePanelTreeProjects } from "../side-panel-tree/side-panel-tree-actions";
 
 export const PROJECT_MOVE_FORM_NAME = "projectMoveFormName";
@@ -35,6 +35,7 @@ export const moveProject = (resource: MoveToFormDialogData) => async (dispatch:
     try {
         const newProject = await services.projectService.update(resource.uuid, { ownerUuid: resource.ownerUuid });
         dispatch(projectPanelActions.REQUEST_ITEMS());
+
         dispatch(dialogActions.CLOSE_DIALOG({ id: PROJECT_MOVE_FORM_NAME }));
         await dispatch<any>(loadSidePanelTreeProjects(userUuid));
         return newProject;
index 3f8f8346e7b3161b6ce204183def4834872acc2d..33442f465881ca9546720b99144c3cf9d1e75fdf 100644 (file)
@@ -8,7 +8,7 @@ import { ServiceRepository } from "services/services";
 import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
 import { trashPanelActions } from "store/trash-panel/trash-panel-action";
 import { activateSidePanelTreeItem, loadSidePanelTreeProjects } from "store/side-panel-tree/side-panel-tree-actions";
-import { projectPanelActions } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import { ResourceKind } from "models/resource";
 import { navigateTo, navigateToTrash } from "store/navigation/navigation-action";
 import { matchCollectionRoute } from "routes/routes";
index c6f1d1b1e6c5a6a2141b69673c0e42b7600cdd91..cd120f42ad0710bd9a13cf1ac74dc3ab7a8531d2 100644 (file)
@@ -8,7 +8,8 @@ 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 { getProjectPanelCurrentUuid, projectPanelActions, setIsProjectPanelTrashed } from "store/project-panel/project-panel-action";
+import { getProjectPanelCurrentUuid, setIsProjectPanelTrashed } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
 import {
     activateSidePanelTreeItem,
     initSidePanelTree,
index 39940ce5ac8eda7b9e8bfc3546fc7cb19bc8f58f..0a6a05df77ff947eb7101f73543dbb88461f14ef 100644 (file)
@@ -2,21 +2,21 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { RootStore } from 'store/store';
-import { AuthService } from 'services/auth-service/auth-service';
-import { Config } from 'common/config';
-import { WebSocketService } from './websocket-service';
-import { ResourceEventMessage } from './resource-event-message';
-import { ResourceKind } from 'models/resource';
-import { loadProcess } from 'store/processes/processes-actions';
-import { getProcess, getSubprocesses } from 'store/processes/process';
-import { LogEventType } from 'models/log';
+import { RootStore } from "store/store";
+import { AuthService } from "services/auth-service/auth-service";
+import { Config } from "common/config";
+import { WebSocketService } from "./websocket-service";
+import { ResourceEventMessage } from "./resource-event-message";
+import { ResourceKind } from "models/resource";
+import { loadProcess } from "store/processes/processes-actions";
+import { getProcess, getSubprocesses } from "store/processes/process";
+import { LogEventType } from "models/log";
 import { subprocessPanelActions } from "store/subprocess-panel/subprocess-panel-actions";
-import { projectPanelActions } from "store/project-panel/project-panel-action";
-import { getProjectPanelCurrentUuid } from 'store/project-panel/project-panel-action';
-import { allProcessesPanelActions } from 'store/all-processes-panel/all-processes-panel-action';
-import { loadCollection } from 'store/workbench/workbench-actions';
-import { matchAllProcessesRoute, matchProjectRoute, matchProcessRoute } from 'routes/routes';
+import { projectPanelActions } from "store/data-explorer/data-explorer-action";
+import { getProjectPanelCurrentUuid } from "store/project-panel/project-panel-action";
+import { allProcessesPanelActions } from "store/all-processes-panel/all-processes-panel-action";
+import { loadCollection } from "store/workbench/workbench-actions";
+import { matchAllProcessesRoute, matchProjectRoute, matchProcessRoute } from "routes/routes";
 
 export const initWebSocket = (config: Config, authService: AuthService, store: RootStore) => {
     if (config.websocketUrl) {
@@ -31,7 +31,7 @@ export const initWebSocket = (config: Config, authService: AuthService, store: R
 const messageListener = (store: RootStore) => (message: ResourceEventMessage) => {
     if (message.eventType === LogEventType.CREATE || message.eventType === LogEventType.UPDATE) {
         const state = store.getState();
-        const location = state.router.location ? state.router.location.pathname : '';
+        const location = state.router.location ? state.router.location.pathname : "";
         switch (message.objectKind) {
             case ResourceKind.COLLECTION:
                 const currentCollection = state.collectionPanel.item;