From e9d7b4ef3c2a02bb357f768cc8a87aae29395d91 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 3 Oct 2024 17:26:37 -0400 Subject: [PATCH] 22141: Refactoring to reduce circular import dependencies The DataExplorer test started failing with the error "can't access lexical declaration 'DataExplorer' before initialization". I couldn't figure out exactly what I did that caused this to suddenly start being a problem, but running the 'dpdm' tool on the codebase showed a huge number of circular imports. I moved several symbols directly or indirectly involving DataExplorer out of the 'view' modules over to the 'action' modules and fixed everything to import from the new location, and the DataExplorer test is passing again. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../column-selector/column-selector.tsx | 3 +- .../data-explorer/data-explorer.tsx | 13 +- .../data-table-filters-popover.tsx | 3 +- .../data-table-filters-tree.tsx | 9 +- ...able-filters.tsx => data-table-filters.ts} | 5 +- .../src/components/data-table/data-column.ts | 4 +- .../src/components/data-table/data-table.tsx | 6 +- .../subprocess-progress-bar.tsx | 2 +- .../all-processes-panel-middleware-service.ts | 2 +- .../store/breadcrumbs/breadcrumbs-actions.ts | 8 +- .../data-explorer/data-explorer-action.ts | 5 +- .../data-explorer-middleware-service.ts | 5 +- .../data-explorer/data-explorer-reducer.ts | 4 +- .../favorite-panel-middleware-service.ts | 2 +- .../process-panel/process-panel-actions.ts | 6 +- .../src/store/processes/processes-actions.ts | 4 +- .../processes/processes-middleware-service.ts | 2 +- .../project-panel-data-middleware-service.ts | 3 +- .../project-panel-run-middleware-service.ts | 3 +- .../public-favorites-middleware-service.ts | 2 +- .../resource-type-filters.ts | 2 +- .../run-process-panel-actions.cy.js | 7 +- .../run-process-panel-actions.ts | 34 ++- .../search-results-middleware-service.ts | 3 +- .../shared-with-me-middleware-service.ts | 5 +- .../side-panel-tree-actions.ts | 26 +++ .../trash-panel-middleware-service.ts | 3 +- .../src/store/workbench/workbench-actions.ts | 44 ++-- .../workflow-panel-actions.cy.js | 4 +- .../workflow-panel/workflow-panel-actions.ts | 4 +- .../data-explorer/data-explorer.tsx | 6 +- .../side-panel-tree/side-panel-tree.tsx | 34 +-- .../all-processes-panel.tsx | 3 +- .../api-client-authorization-panel-root.tsx | 3 +- .../collection-content-address-panel.tsx | 3 +- .../views/favorite-panel/favorite-panel.tsx | 2 +- .../group-details-panel.tsx | 2 +- .../src/views/groups-panel/groups-panel.tsx | 3 +- .../src/views/link-panel/link-panel-root.tsx | 3 +- .../project-panel/project-panel-data.tsx | 3 +- .../views/project-panel/project-panel-run.tsx | 3 +- .../public-favorites-panel.tsx | 2 +- .../run-process-advanced-form.tsx | 29 +-- .../run-process-basic-form.tsx | 8 +- .../run-process-inputs-form.tsx | 3 +- .../run-process-second-step.tsx | 10 +- .../search-results-panel-view.tsx | 3 +- .../shared-with-me-columns.tsx | 194 ++++++++++++++++++ .../shared-with-me-panel.tsx | 191 +---------------- .../subprocess-panel-root.tsx | 3 +- .../src/views/trash-panel/trash-panel.tsx | 3 +- .../src/views/user-panel/user-panel.tsx | 3 +- .../user-profile-panel-root.tsx | 2 +- .../workflow-panel/workflow-panel-view.tsx | 3 +- .../workflow-processes-panel-root.tsx | 3 +- 55 files changed, 374 insertions(+), 371 deletions(-) rename services/workbench2/src/components/data-table-filters/{data-table-filters.tsx => data-table-filters.ts} (62%) create mode 100644 services/workbench2/src/views/shared-with-me-panel/shared-with-me-columns.tsx diff --git a/services/workbench2/src/components/column-selector/column-selector.tsx b/services/workbench2/src/components/column-selector/column-selector.tsx index 93a47bf592..d6874b2888 100644 --- a/services/workbench2/src/components/column-selector/column-selector.tsx +++ b/services/workbench2/src/components/column-selector/column-selector.tsx @@ -8,10 +8,9 @@ import { IconButton, Paper, List, Checkbox, ListItemText, ListItem, Tooltip } fr import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import MenuIcon from "@mui/icons-material/Menu"; -import { DataColumn } from '../data-table/data-column'; +import { DataColumn, DataColumns } from '../data-table/data-column'; import { Popover } from "../popover/popover"; import { IconButtonProps } from '@mui/material/IconButton'; -import { DataColumns } from '../data-table/data-table'; import { ArvadosTheme } from "common/custom-theme"; interface ColumnSelectorDataProps { diff --git a/services/workbench2/src/components/data-explorer/data-explorer.tsx b/services/workbench2/src/components/data-explorer/data-explorer.tsx index 9ff53f3767..9c88a6595b 100644 --- a/services/workbench2/src/components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/components/data-explorer/data-explorer.tsx @@ -17,14 +17,15 @@ import { import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { ColumnSelector } from "components/column-selector/column-selector"; -import { DataTable, DataColumns, DataTableFetchMode } from "components/data-table/data-table"; +import { DataColumns } from "components/data-table/data-column"; +import { DataTable, DataTableFetchMode } from "components/data-table/data-table"; import { DataColumn } from "components/data-table/data-column"; import { SearchInput } from "components/search-input/search-input"; import { ArvadosTheme } from "common/custom-theme"; import { MultiselectToolbar } from "components/multiselect-toolbar/MultiselectToolbar"; import { TCheckedList } from "components/data-table/data-table"; import { createTree } from "models/tree"; -import { DataTableFilters } from "components/data-table-filters/data-table-filters-tree"; +import { DataTableFilters } from "components/data-table-filters/data-table-filters"; import { CloseIcon, IconType, MaximizeIcon, UnMaximizeIcon, MoreVerticalIcon } from "components/icon/icon"; import { PaperProps } from "@mui/material/Paper"; import { MPVPanelProps } from "components/multi-panel-view/multi-panel-view"; @@ -48,8 +49,8 @@ type CssRules = | 'container' | 'paginationLabel' | 'paginationRoot' - | "subToolbarWrapper" - | 'progressWrapper' + | "subToolbarWrapper" + | 'progressWrapper' | 'progressWrapperNoTitle'; const styles: CustomStyleRulesCallback = (theme: ArvadosTheme) => ({ @@ -420,9 +421,9 @@ export const DataExplorer = withStyles(styles)( labelDisplayedRows={renderPaginationLabel(loadingItemsAvailable)} nextIconButtonProps={getPaginiationButtonProps(itemsAvailable, loadingItemsAvailable)} component="div" - classes={{ + classes={{ root: classes.paginationRoot, - selectLabel: classes.paginationLabel, + selectLabel: classes.paginationLabel, displayedRows: classes.paginationLabel, }} /> diff --git a/services/workbench2/src/components/data-table-filters/data-table-filters-popover.tsx b/services/workbench2/src/components/data-table-filters/data-table-filters-popover.tsx index 0b72110db7..922f00b8c5 100644 --- a/services/workbench2/src/components/data-table-filters/data-table-filters-popover.tsx +++ b/services/workbench2/src/components/data-table-filters/data-table-filters-popover.tsx @@ -21,7 +21,8 @@ import withStyles from '@mui/styles/withStyles'; import classnames from 'classnames'; import { DefaultTransformOrigin } from 'components/popover/helpers'; import { createTree } from 'models/tree'; -import { DataTableFilters, DataTableFiltersTree } from './data-table-filters-tree'; +import { DataTableFilters } from './data-table-filters'; +import { DataTableFiltersTree } from './data-table-filters-tree'; import { getNodeDescendants } from 'models/tree'; import debounce from 'lodash/debounce'; diff --git a/services/workbench2/src/components/data-table-filters/data-table-filters-tree.tsx b/services/workbench2/src/components/data-table-filters/data-table-filters-tree.tsx index d52b58f5ae..b6bcf207c7 100644 --- a/services/workbench2/src/components/data-table-filters/data-table-filters-tree.tsx +++ b/services/workbench2/src/components/data-table-filters/data-table-filters-tree.tsx @@ -3,17 +3,12 @@ // SPDX-License-Identifier: AGPL-3.0 import React from "react"; -import { Tree, toggleNodeSelection, getNode, initTreeNode, getNodeChildrenIds, selectNode, deselectNodes } from 'models/tree'; +import { toggleNodeSelection, getNode, initTreeNode, getNodeChildrenIds, selectNode, deselectNodes } from 'models/tree'; import { Tree as TreeComponent, TreeItem, TreeItemStatus } from 'components/tree/tree'; import { noop, map } from "lodash/fp"; import { toggleNodeCollapse } from 'models/tree'; import { countNodes, countChildren } from 'models/tree'; - -export interface DataTableFilterItem { - name: string; -} - -export type DataTableFilters = Tree; +import { DataTableFilterItem, DataTableFilters } from './data-table-filters'; export interface DataTableFilterProps { filters: DataTableFilters; diff --git a/services/workbench2/src/components/data-table-filters/data-table-filters.tsx b/services/workbench2/src/components/data-table-filters/data-table-filters.ts similarity index 62% rename from services/workbench2/src/components/data-table-filters/data-table-filters.tsx rename to services/workbench2/src/components/data-table-filters/data-table-filters.ts index ed7b30e759..0c3025587a 100644 --- a/services/workbench2/src/components/data-table-filters/data-table-filters.tsx +++ b/services/workbench2/src/components/data-table-filters/data-table-filters.ts @@ -2,7 +2,10 @@ // // SPDX-License-Identifier: AGPL-3.0 +import { Tree } from 'models/tree'; + export interface DataTableFilterItem { name: string; - selected: boolean; } + +export type DataTableFilters = Tree; diff --git a/services/workbench2/src/components/data-table/data-column.ts b/services/workbench2/src/components/data-table/data-column.ts index 35655fb7df..edabd61b48 100644 --- a/services/workbench2/src/components/data-table/data-column.ts +++ b/services/workbench2/src/components/data-table/data-column.ts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import React from "react"; -import { DataTableFilters } from "../data-table-filters/data-table-filters-tree"; +import { DataTableFilters } from "../data-table-filters/data-table-filters"; import { createTree } from 'models/tree'; /** @@ -55,3 +55,5 @@ export const createDataColumn = (dataColumn: Partial>): D render: () => React.createElement('span'), ...dataColumn, }); + +export type DataColumns = Array>; diff --git a/services/workbench2/src/components/data-table/data-table.tsx b/services/workbench2/src/components/data-table/data-table.tsx index f0dc87b0f3..8b45d66fa1 100644 --- a/services/workbench2/src/components/data-table/data-table.tsx +++ b/services/workbench2/src/components/data-table/data-table.tsx @@ -17,9 +17,9 @@ import { import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import classnames from "classnames"; -import { DataColumn, SortDirection } from "./data-column"; +import { DataColumn, DataColumns, SortDirection } from "./data-column"; import { DataTableDefaultView } from "../data-table-default-view/data-table-default-view"; -import { DataTableFilters } from "../data-table-filters/data-table-filters-tree"; +import { DataTableFilters } from "../data-table-filters/data-table-filters"; import { DataTableMultiselectPopover } from "../data-table-multiselect-popover/data-table-multiselect-popover"; import { DataTableFiltersPopover } from "../data-table-filters/data-table-filters-popover"; import { countNodes, getTreeDirty } from "models/tree"; @@ -32,8 +32,6 @@ import { isExactlyOneSelected } from "store/multiselect/multiselect-actions"; import { PendingIcon } from "components/icon/icon"; import { CustomTheme, ArvadosTheme } from "common/custom-theme"; -export type DataColumns = Array>; - export enum DataTableFetchMode { PAGINATED, INFINITE, diff --git a/services/workbench2/src/components/subprocess-progress-bar/subprocess-progress-bar.tsx b/services/workbench2/src/components/subprocess-progress-bar/subprocess-progress-bar.tsx index 7d94f43860..36edcbc439 100644 --- a/services/workbench2/src/components/subprocess-progress-bar/subprocess-progress-bar.tsx +++ b/services/workbench2/src/components/subprocess-progress-bar/subprocess-progress-bar.tsx @@ -20,7 +20,7 @@ import { RootState } from "store/store"; import { ProcessResource } from "models/process"; import { getDataExplorerColumnFilters } from "store/data-explorer/data-explorer-middleware-service"; import { ProjectPanelRunColumnNames } from "views/project-panel/project-panel-run"; -import { DataColumns } from "components/data-table/data-table"; +import { DataColumns } from "components/data-table/data-column"; type CssRules = 'progressStacked'; diff --git a/services/workbench2/src/store/all-processes-panel/all-processes-panel-middleware-service.ts b/services/workbench2/src/store/all-processes-panel/all-processes-panel-middleware-service.ts index 97975d6461..5f0d7df734 100644 --- a/services/workbench2/src/store/all-processes-panel/all-processes-panel-middleware-service.ts +++ b/services/workbench2/src/store/all-processes-panel/all-processes-panel-middleware-service.ts @@ -9,7 +9,7 @@ import { joinFilters } from "services/api/filter-builder"; import { allProcessesPanelActions } from "./all-processes-panel-action"; import { Dispatch, MiddlewareAPI } from "redux"; import { DataExplorer } from "store/data-explorer/data-explorer-reducer"; -import { DataColumns } from "components/data-table/data-table"; +import { DataColumns } from "components/data-table/data-column"; import { serializeOnlyProcessTypeFilters } from "../resource-type-filters/resource-type-filters"; diff --git a/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts b/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts index d7bbaf7e4b..feda3dc5fe 100644 --- a/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts +++ b/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts @@ -22,7 +22,7 @@ import { Breadcrumb } from 'components/breadcrumbs/breadcrumbs'; import { ContainerRequestResource, containerRequestFieldsNoMounts } from 'models/container-request'; import { AdminMenuIcon, CollectionIcon, IconType, ProcessIcon, ProjectIcon, ResourceIcon, TerminalIcon, WorkflowIcon } from 'components/icon/icon'; import { CollectionResource } from 'models/collection'; -import { getSidePanelIcon } from 'views-components/side-panel-tree/side-panel-tree'; +import { getSidePanelIcon } from 'store/side-panel-tree/side-panel-tree-actions'; import { WorkflowResource } from 'models/workflow'; import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions"; @@ -123,8 +123,8 @@ export const setSidePanelBreadcrumbs = (uuid: string) => dispatch(setBreadcrumbs(breadcrumbs, workflowItem)); } dispatch(setBreadcrumbs(breadcrumbs)); - } catch (e) { - console.log("Error setting breadcrumbs "+e); + } catch (e) { + console.log("Error setting breadcrumbs "+e); } finally { dispatch(progressIndicatorActions.STOP_WORKING(uuid + "-breadcrumbs")); } @@ -240,7 +240,7 @@ export const setProcessBreadcrumbs = (processUuid: string) => const { resources } = getState(); const process = getProcess(processUuid)(resources); if (process) { - dispatch(setProjectBreadcrumbs(process.containerRequest.ownerUuid)); + dispatch(setProjectBreadcrumbs(process.containerRequest.ownerUuid)); } }; diff --git a/services/workbench2/src/store/data-explorer/data-explorer-action.ts b/services/workbench2/src/store/data-explorer/data-explorer-action.ts index 7cfb26474b..264a7cdded 100644 --- a/services/workbench2/src/store/data-explorer/data-explorer-action.ts +++ b/services/workbench2/src/store/data-explorer/data-explorer-action.ts @@ -3,8 +3,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 { DataColumns } from "components/data-table/data-column"; +import { DataTableFetchMode } from "components/data-table/data-table"; +import { DataTableFilters } from "components/data-table-filters/data-table-filters"; import { SnackbarKind, snackbarActions } from "store/snackbar/snackbar-actions"; export enum DataTableRequestState { diff --git a/services/workbench2/src/store/data-explorer/data-explorer-middleware-service.ts b/services/workbench2/src/store/data-explorer/data-explorer-middleware-service.ts index 07d2be7386..c4d21c87fe 100644 --- a/services/workbench2/src/store/data-explorer/data-explorer-middleware-service.ts +++ b/services/workbench2/src/store/data-explorer/data-explorer-middleware-service.ts @@ -4,13 +4,12 @@ import { Dispatch, MiddlewareAPI } from 'redux'; import { RootState } from '../store'; -import { DataColumns } from 'components/data-table/data-table'; import { DataExplorer, getSortColumn } from './data-explorer-reducer'; import { ListResults } from 'services/common-service/common-service'; import { createTree } from 'models/tree'; -import { DataTableFilters } from 'components/data-table-filters/data-table-filters-tree'; +import { DataTableFilters } from 'components/data-table-filters/data-table-filters'; import { OrderBuilder, OrderDirection } from 'services/api/order-builder'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { Resource } from 'models/resource'; export abstract class DataExplorerMiddlewareService { diff --git a/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts b/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts index 9c8b99bf2d..c3ed361e8b 100644 --- a/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts +++ b/services/workbench2/src/store/data-explorer/data-explorer-reducer.ts @@ -7,6 +7,7 @@ import { resetSortDirection, SortDirection, toggleSortDirection, + DataColumns, } from 'components/data-table/data-column'; import { DataExplorerAction, @@ -14,10 +15,9 @@ import { DataTableRequestState, } from './data-explorer-action'; import { - DataColumns, DataTableFetchMode, } from 'components/data-table/data-table'; -import { DataTableFilters } from 'components/data-table-filters/data-table-filters-tree'; +import { DataTableFilters } from 'components/data-table-filters/data-table-filters'; export interface DataExplorer { fetchMode: DataTableFetchMode; diff --git a/services/workbench2/src/store/favorite-panel/favorite-panel-middleware-service.ts b/services/workbench2/src/store/favorite-panel/favorite-panel-middleware-service.ts index 21a374f9e8..748b4313b3 100644 --- a/services/workbench2/src/store/favorite-panel/favorite-panel-middleware-service.ts +++ b/services/workbench2/src/store/favorite-panel/favorite-panel-middleware-service.ts @@ -6,7 +6,7 @@ import { DataExplorerMiddlewareService, dataExplorerToListParams, listResultsToD import { FavoritePanelColumnNames } from "views/favorite-panel/favorite-panel"; import { RootState } from "../store"; import { getUserUuid } from "common/getuser"; -import { DataColumns } from "components/data-table/data-table"; +import { DataColumns } from "components/data-table/data-column"; import { ServiceRepository } from "services/services"; import { FilterBuilder } from "services/api/filter-builder"; import { updateFavorites } from "../favorites/favorites-actions"; diff --git a/services/workbench2/src/store/process-panel/process-panel-actions.ts b/services/workbench2/src/store/process-panel/process-panel-actions.ts index 0dc1d83ff7..f5910b824b 100644 --- a/services/workbench2/src/store/process-panel/process-panel-actions.ts +++ b/services/workbench2/src/store/process-panel/process-panel-actions.ts @@ -63,9 +63,9 @@ export const loadProcess = try { const containerRequestResult = await services.groupsService.contents( '', { - filters: new FilterBuilder().addIsA('uuid', 'arvados#containerRequest'). - addEqual('uuid', containerRequestUuid). - getFilters(), + filters: new FilterBuilder().addIsA('uuid', 'arvados#containerRequest') + .addEqual('uuid', containerRequestUuid) + .getFilters(), include: ["container_uuid"] }); if (containerRequestResult.items.length === 1) { diff --git a/services/workbench2/src/store/processes/processes-actions.ts b/services/workbench2/src/store/processes/processes-actions.ts index c3d7a88e2c..b2559d6753 100644 --- a/services/workbench2/src/store/processes/processes-actions.ts +++ b/services/workbench2/src/store/processes/processes-actions.ts @@ -13,8 +13,8 @@ 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"; import { initialize } from "redux-form"; -import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from "views/run-process-panel/run-process-basic-form"; -import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM } from "views/run-process-panel/run-process-advanced-form"; +import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from "store/run-process-panel/run-process-panel-actions"; +import { RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM } from "store/run-process-panel/run-process-panel-actions"; import { MOUNT_PATH_CWL_WORKFLOW, MOUNT_PATH_CWL_INPUT } from "models/process"; import { CommandInputParameter, getWorkflow, getWorkflowInputs, getWorkflowOutputs, WorkflowInputsData } from "models/workflow"; import { ProjectResource } from "models/project"; diff --git a/services/workbench2/src/store/processes/processes-middleware-service.ts b/services/workbench2/src/store/processes/processes-middleware-service.ts index 0904a776f3..a4325cf869 100644 --- a/services/workbench2/src/store/processes/processes-middleware-service.ts +++ b/services/workbench2/src/store/processes/processes-middleware-service.ts @@ -16,7 +16,7 @@ import { ListArguments, ListResults } from 'services/common-service/common-servi import { ContentsArguments } from 'services/groups-service/groups-service'; import { ProcessResource } from 'models/process'; import { FilterBuilder } from 'services/api/filter-builder'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { ProcessStatusFilter, buildProcessStatusFilters } from '../resource-type-filters/resource-type-filters'; import { ContainerRequestResource, containerRequestFieldsNoMounts } from 'models/container-request'; import { progressIndicatorActions } from '../progress-indicator/progress-indicator-actions'; diff --git a/services/workbench2/src/store/project-panel/project-panel-data-middleware-service.ts b/services/workbench2/src/store/project-panel/project-panel-data-middleware-service.ts index 4fe6e8d13d..da6f0df238 100644 --- a/services/workbench2/src/store/project-panel/project-panel-data-middleware-service.ts +++ b/services/workbench2/src/store/project-panel/project-panel-data-middleware-service.ts @@ -10,9 +10,8 @@ import { } from "store/data-explorer/data-explorer-middleware-service"; import { ProjectPanelDataColumnNames } from "views/project-panel/project-panel-data"; import { RootState } from "store/store"; -import { DataColumns } from "components/data-table/data-table"; import { ServiceRepository } from "services/services"; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { OrderBuilder, OrderDirection } from "services/api/order-builder"; import { FilterBuilder, joinFilters } from "services/api/filter-builder"; import { ContentsArguments, GroupContentsResource, GroupContentsResourcePrefix } from "services/groups-service/groups-service"; diff --git a/services/workbench2/src/store/project-panel/project-panel-run-middleware-service.ts b/services/workbench2/src/store/project-panel/project-panel-run-middleware-service.ts index d109a4f4af..f309f0806c 100644 --- a/services/workbench2/src/store/project-panel/project-panel-run-middleware-service.ts +++ b/services/workbench2/src/store/project-panel/project-panel-run-middleware-service.ts @@ -10,9 +10,8 @@ import { } from "store/data-explorer/data-explorer-middleware-service"; import { ProjectPanelRunColumnNames } from "views/project-panel/project-panel-run"; import { RootState } from "store/store"; -import { DataColumns } from "components/data-table/data-table"; import { ServiceRepository } from "services/services"; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { OrderBuilder, OrderDirection } from "services/api/order-builder"; import { FilterBuilder, joinFilters } from "services/api/filter-builder"; import { ContentsArguments, GroupContentsResource, GroupContentsResourcePrefix } from "services/groups-service/groups-service"; diff --git a/services/workbench2/src/store/public-favorites-panel/public-favorites-middleware-service.ts b/services/workbench2/src/store/public-favorites-panel/public-favorites-middleware-service.ts index 590e924c2b..578d40f080 100644 --- a/services/workbench2/src/store/public-favorites-panel/public-favorites-middleware-service.ts +++ b/services/workbench2/src/store/public-favorites-panel/public-favorites-middleware-service.ts @@ -12,7 +12,7 @@ import { resourcesActions } from 'store/resources/resources-actions'; import { FilterBuilder } from 'services/api/filter-builder'; import { FavoritePanelColumnNames } from 'views/favorite-panel/favorite-panel'; import { publicFavoritePanelActions } from 'store/public-favorites-panel/public-favorites-action'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { serializeSimpleObjectTypeFilters } from '../resource-type-filters/resource-type-filters'; import { LinkClass, LinkResource } from 'models/link'; import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions'; diff --git a/services/workbench2/src/store/resource-type-filters/resource-type-filters.ts b/services/workbench2/src/store/resource-type-filters/resource-type-filters.ts index 9de7735f7a..1a4b4bf3cb 100644 --- a/services/workbench2/src/store/resource-type-filters/resource-type-filters.ts +++ b/services/workbench2/src/store/resource-type-filters/resource-type-filters.ts @@ -4,7 +4,7 @@ import { difference, pipe, values, includes, __ } from 'lodash/fp'; import { createTree, setNode, TreeNodeStatus, TreeNode, Tree } from 'models/tree'; -import { DataTableFilterItem, DataTableFilters } from 'components/data-table-filters/data-table-filters-tree'; +import { DataTableFilterItem, DataTableFilters } from 'components/data-table-filters/data-table-filters'; import { ResourceKind } from 'models/resource'; import { FilterBuilder } from 'services/api/filter-builder'; import { getSelectedNodes } from 'models/tree'; diff --git a/services/workbench2/src/store/run-process-panel/run-process-panel-actions.cy.js b/services/workbench2/src/store/run-process-panel/run-process-panel-actions.cy.js index cbb8f76b44..b4dd81b19d 100644 --- a/services/workbench2/src/store/run-process-panel/run-process-panel-actions.cy.js +++ b/services/workbench2/src/store/run-process-panel/run-process-panel-actions.cy.js @@ -3,10 +3,9 @@ // SPDX-License-Identifier: AGPL-3.0 import { runProcess } from "./run-process-panel-actions"; -import { RUN_PROCESS_BASIC_FORM } from "views/run-process-panel/run-process-basic-form"; -import { RUN_PROCESS_INPUTS_FORM } from "views/run-process-panel/run-process-inputs-form"; +import { RUN_PROCESS_BASIC_FORM, RUN_PROCESS_INPUTS_FORM } from "./run-process-panel-actions"; import { navigateTo } from "store/navigation/navigation-action"; - + describe("run-process-panel-actions", () => { describe("runProcess", () => { const newProcessUUID = 'newProcessUUID'; @@ -288,4 +287,4 @@ const testCreateArgs = { schedulingParameters: { max_run_time: undefined }, state: 'Committed', useExisting: false, -}; \ No newline at end of file +}; diff --git a/services/workbench2/src/store/run-process-panel/run-process-panel-actions.ts b/services/workbench2/src/store/run-process-panel/run-process-panel-actions.ts index 85c6952407..e68fdc5036 100644 --- a/services/workbench2/src/store/run-process-panel/run-process-panel-actions.ts +++ b/services/workbench2/src/store/run-process-panel/run-process-panel-actions.ts @@ -9,22 +9,44 @@ import { RootState } from 'store/store'; import { getUserUuid } from "common/getuser"; import { WorkflowResource, WorkflowRunnerResources, getWorkflow, getWorkflowInputs, parseWorkflowDefinition } from 'models/workflow'; import { getFormValues, initialize } from 'redux-form'; -import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from 'views/run-process-panel/run-process-basic-form'; -import { RUN_PROCESS_INPUTS_FORM } from 'views/run-process-panel/run-process-inputs-form'; import { WorkflowInputsData } from 'models/workflow'; import { createWorkflowMounts, createWorkflowSecretMounts } from 'models/process'; import { ContainerRequestState } from 'models/container-request'; import { navigateTo } from '../navigation/navigation-action'; -import { - RunProcessAdvancedFormData, RUN_PROCESS_ADVANCED_FORM, VCPUS_FIELD, - KEEP_CACHE_RAM_FIELD, RAM_FIELD, RUNTIME_FIELD, OUTPUT_FIELD, RUNNER_IMAGE_FIELD -} from 'views/run-process-panel/run-process-advanced-form'; import { dialogActions } from 'store/dialog/dialog-actions'; import { setBreadcrumbs } from 'store/breadcrumbs/breadcrumbs-actions'; import { getResource } from 'store/resources/resources'; import { ProjectResource } from "models/project"; import { UserResource } from "models/user"; +export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm'; +export const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm'; + +export interface RunProcessBasicFormData { + name: string; + owner?: ProjectResource | UserResource; +} + +export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm'; + +export const DESCRIPTION_FIELD = 'description'; +export const OUTPUT_FIELD = 'output'; +export const RUNTIME_FIELD = 'runtime'; +export const RAM_FIELD = 'ram'; +export const VCPUS_FIELD = 'vcpus'; +export const KEEP_CACHE_RAM_FIELD = 'keep_cache_ram'; +export const RUNNER_IMAGE_FIELD = 'acr_container_image'; + +export interface RunProcessAdvancedFormData { + [DESCRIPTION_FIELD]?: string; + [OUTPUT_FIELD]?: string; + [RUNTIME_FIELD]?: number; + [RAM_FIELD]: number; + [VCPUS_FIELD]: number; + [KEEP_CACHE_RAM_FIELD]: number; + [RUNNER_IMAGE_FIELD]: string; +} + export const runProcessPanelActions = unionize({ SET_PROCESS_PATHNAME: ofType(), SET_PROCESS_OWNER_UUID: ofType(), diff --git a/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts b/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts index f322b10bea..bc34e68699 100644 --- a/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts +++ b/services/workbench2/src/store/search-results-panel/search-results-middleware-service.ts @@ -9,7 +9,7 @@ import { RootState } from 'store/store'; import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions'; import { DataExplorer, getDataExplorer } from 'store/data-explorer/data-explorer-reducer'; import { updateResources } from 'store/resources/resources-actions'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { OrderDirection, OrderBuilder } from 'services/api/order-builder'; import { GroupContentsResource, GroupContentsResourcePrefix, ContentsArguments } from "services/groups-service/groups-service"; import { ListResults } from 'services/common-service/common-service'; @@ -22,7 +22,6 @@ import { } from 'store/search-bar/search-bar-actions'; import { getSortColumn } from "store/data-explorer/data-explorer-reducer"; import { FilterBuilder, joinFilters } from 'services/api/filter-builder'; -import { DataColumns } from 'components/data-table/data-table'; import { serializeResourceTypeFilters } from 'store//resource-type-filters/resource-type-filters'; import { SearchResultsPanelColumnNames } from 'views/search-results-panel/search-results-panel-view'; import { ResourceKind } from 'models/resource'; diff --git a/services/workbench2/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts b/services/workbench2/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts index 728ad80f74..db4b7a9177 100644 --- a/services/workbench2/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts +++ b/services/workbench2/src/store/shared-with-me-panel/shared-with-me-middleware-service.ts @@ -18,7 +18,7 @@ import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions'; import { sharedWithMePanelActions } from './shared-with-me-panel-actions'; import { ListResults } from 'services/common-service/common-service'; import { ContentsArguments, GroupContentsResource, GroupContentsResourcePrefix } from 'services/groups-service/groups-service'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { OrderBuilder, OrderDirection } from 'services/api/order-builder'; import { ProjectResource } from 'models/project'; import { getSortColumn } from "store/data-explorer/data-explorer-reducer"; @@ -26,9 +26,8 @@ import { updatePublicFavorites } from 'store/public-favorites/public-favorites-a import { FilterBuilder, joinFilters } from 'services/api/filter-builder'; import { progressIndicatorActions } from 'store/progress-indicator/progress-indicator-actions'; import { AuthState } from 'store/auth/auth-reducer'; -import { SharedWithMePanelColumnNames } from 'views/shared-with-me-panel/shared-with-me-panel'; +import { SharedWithMePanelColumnNames } from 'views/shared-with-me-panel/shared-with-me-columns'; import { buildProcessStatusFilters, serializeResourceTypeFilters } from 'store/resource-type-filters/resource-type-filters'; -import { DataColumns } from 'components/data-table/data-table'; import { couldNotFetchItemsAvailable } from 'store/data-explorer/data-explorer-action'; export class SharedWithMeMiddlewareService extends DataExplorerMiddlewareService { diff --git a/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts b/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts index 691b436c83..9a633c5c35 100644 --- a/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts +++ b/services/workbench2/src/store/side-panel-tree/side-panel-tree-actions.ts @@ -18,6 +18,7 @@ import { CategoriesListReducer } from 'common/plugintypes'; import { pluginConfig } from 'plugins'; import { LinkClass, LinkResource } from 'models/link'; import { verifyAndUpdateLinks } from 'common/link-update-name'; +import { ProcessIcon, ProjectIcon, FilterGroupIcon, FavoriteIcon, ProjectsIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon, TerminalIcon, ResourceIcon } from 'components/icon/icon'; export enum SidePanelTreeCategory { PROJECTS = 'Home Projects', @@ -331,3 +332,28 @@ export const getSidePanelTreeNodeAncestorsIds = (id: string) => (treePicker: Tre ? getNodeAncestorsIds(id)(sidePanelTree) : []; }; + +export const getSidePanelIcon = (category: string) => { + switch (category) { + case SidePanelTreeCategory.FAVORITES: + return FavoriteIcon; + case SidePanelTreeCategory.PROJECTS: + return ProjectsIcon; + case SidePanelTreeCategory.SHARED_WITH_ME: + return ShareMeIcon; + case SidePanelTreeCategory.TRASH: + return TrashIcon; + case SidePanelTreeCategory.PUBLIC_FAVORITES: + return PublicFavoriteIcon; + case SidePanelTreeCategory.ALL_PROCESSES: + return ProcessIcon; + case SidePanelTreeCategory.INSTANCE_TYPES: + return ResourceIcon; + case SidePanelTreeCategory.GROUPS: + return GroupsIcon; + case SidePanelTreeCategory.SHELL_ACCESS: + return TerminalIcon + default: + return ProjectIcon; + } +}; diff --git a/services/workbench2/src/store/trash-panel/trash-panel-middleware-service.ts b/services/workbench2/src/store/trash-panel/trash-panel-middleware-service.ts index 0fb21206f4..9a0ab59349 100644 --- a/services/workbench2/src/store/trash-panel/trash-panel-middleware-service.ts +++ b/services/workbench2/src/store/trash-panel/trash-panel-middleware-service.ts @@ -8,9 +8,8 @@ import { } from "../data-explorer/data-explorer-middleware-service"; import { RootState } from "../store"; import { getUserUuid } from "common/getuser"; -import { DataColumns } from "components/data-table/data-table"; import { ServiceRepository } from "services/services"; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { FilterBuilder } from "services/api/filter-builder"; import { trashPanelActions } from "./trash-panel-action"; import { Dispatch, MiddlewareAPI } from "redux"; diff --git a/services/workbench2/src/store/workbench/workbench-actions.ts b/services/workbench2/src/store/workbench/workbench-actions.ts index 57a71ea0b9..77efa2a903 100644 --- a/services/workbench2/src/store/workbench/workbench-actions.ts +++ b/services/workbench2/src/store/workbench/workbench-actions.ts @@ -18,9 +18,6 @@ import { SIDE_PANEL_TREE, } from "store/side-panel-tree/side-panel-tree-actions"; import { updateResources } from "store/resources/resources-actions"; -import { projectPanelDataColumns } from "views/project-panel/project-panel-data"; -import { projectPanelRunColumns } from "views/project-panel/project-panel-run"; -import { favoritePanelColumns } from "views/favorite-panel/favorite-panel"; import { matchRootRoute } from "routes/routes"; import { setGroupDetailsBreadcrumbs, @@ -50,17 +47,15 @@ import * as collectionMoveActions from "store/collections/collection-move-action import * as processMoveActions from "store/processes/process-move-actions"; import * as processUpdateActions from "store/processes/process-update-actions"; import * as processCopyActions from "store/processes/process-copy-actions"; -import { trashPanelColumns } from "views/trash-panel/trash-panel"; + import { loadTrashPanel, trashPanelActions } from "store/trash-panel/trash-panel-action"; import { loadProcess as loadProcessResources, loadProcessPanel } from "store/process-panel/process-panel-actions"; import { loadSharedWithMePanel, sharedWithMePanelActions } from "store/shared-with-me-panel/shared-with-me-panel-actions"; -import { sharedWithMePanelColumns } from "views/shared-with-me-panel/shared-with-me-panel"; import { CopyFormDialogData } from "store/copy-dialog/copy-dialog"; import { workflowPanelActions } from "store/workflow-panel/workflow-panel-actions"; import { loadSshKeysPanel } from "store/auth/auth-action-ssh"; import { loadLinkAccountPanel, linkAccountPanelActions } from "store/link-account-panel/link-account-panel-actions"; import { loadSiteManagerPanel } from "store/auth/auth-action-session"; -import { workflowPanelColumns } from "views/workflow-panel/workflow-panel-view"; import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions"; import { getProgressIndicator } from "store/progress-indicator/progress-indicator-reducer"; import { extractUuidKind, Resource, ResourceKind } from "models/resource"; @@ -72,39 +67,48 @@ import { collectionPanelActions, loadCollectionPanel } from "store/collection-pa import { CollectionResource } from "models/collection"; import { WorkflowResource } from "models/workflow"; import { loadSearchResultsPanel, searchResultsPanelActions } from "store/search-results-panel/search-results-panel-actions"; -import { searchResultsPanelColumns } from "views/search-results-panel/search-results-panel-view"; import { loadVirtualMachinesPanel } from "store/virtual-machines/virtual-machines-actions"; import { loadRepositoriesPanel } from "store/repositories/repositories-actions"; import { loadKeepServicesPanel } from "store/keep-services/keep-services-actions"; import { loadUsersPanel, userBindedActions } from "store/users/users-actions"; import * as userProfilePanelActions from "store/user-profile/user-profile-actions"; import { linkPanelActions, loadLinkPanel } from "store/link-panel/link-panel-actions"; -import { linkPanelColumns } from "views/link-panel/link-panel-root"; -import { userPanelColumns } from "views/user-panel/user-panel"; import { loadApiClientAuthorizationsPanel, apiClientAuthorizationsActions } from "store/api-client-authorizations/api-client-authorizations-actions"; -import { apiClientAuthorizationPanelColumns } from "views/api-client-authorization-panel/api-client-authorization-panel-root"; import * as groupPanelActions from "store/groups-panel/groups-panel-actions"; -import { groupsPanelColumns } from "views/groups-panel/groups-panel"; import * as groupDetailsPanelActions from "store/group-details-panel/group-details-panel-actions"; -import { groupDetailsMembersPanelColumns, groupDetailsPermissionsPanelColumns } from "views/group-details-panel/group-details-panel"; -import { DataTableFetchMode } from "components/data-table/data-table"; import { loadPublicFavoritePanel, publicFavoritePanelActions } from "store/public-favorites-panel/public-favorites-action"; -import { publicFavoritePanelColumns } from "views/public-favorites-panel/public-favorites-panel"; import { loadCollectionsContentAddressPanel, collectionsContentAddressActions, } from "store/collections-content-address-panel/collections-content-address-panel-actions"; -import { collectionContentAddressPanelColumns } from "views/collection-content-address-panel/collection-content-address-panel"; import { subprocessPanelActions } from "store/subprocess-panel/subprocess-panel-actions"; -import { subprocessPanelColumns } from "views/subprocess-panel/subprocess-panel-root"; +import { deselectOne } from "store/multiselect/multiselect-actions"; +import { treePickerActions } from "store/tree-picker/tree-picker-actions"; +import { workflowProcessesPanelActions } from "store/workflow-panel/workflow-panel-actions"; import { loadAllProcessesPanel, allProcessesPanelActions } from "../all-processes-panel/all-processes-panel-action"; + +import { DataTableFetchMode } from "components/data-table/data-table"; +import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar"; + +import { sharedWithMePanelColumns } from "views/shared-with-me-panel/shared-with-me-columns"; +import { workflowPanelColumns } from "views/workflow-panel/workflow-panel-view"; +import { searchResultsPanelColumns } from "views/search-results-panel/search-results-panel-view"; +import { linkPanelColumns } from "views/link-panel/link-panel-root"; +import { userPanelColumns } from "views/user-panel/user-panel"; +import { apiClientAuthorizationPanelColumns } from "views/api-client-authorization-panel/api-client-authorization-panel-root"; +import { groupsPanelColumns } from "views/groups-panel/groups-panel"; +import { groupDetailsMembersPanelColumns, groupDetailsPermissionsPanelColumns } from "views/group-details-panel/group-details-panel"; +import { publicFavoritePanelColumns } from "views/public-favorites-panel/public-favorites-panel"; +import { collectionContentAddressPanelColumns } from "views/collection-content-address-panel/collection-content-address-panel"; +import { subprocessPanelColumns } from "views/subprocess-panel/subprocess-panel-root"; import { allProcessesPanelColumns } from "views/all-processes-panel/all-processes-panel"; import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root"; -import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar"; -import { deselectOne } from "store/multiselect/multiselect-actions"; -import { treePickerActions } from "store/tree-picker/tree-picker-actions"; import { workflowProcessesPanelColumns } from "views/workflow-panel/workflow-processes-panel-root"; -import { workflowProcessesPanelActions } from "store/workflow-panel/workflow-panel-actions"; +import { trashPanelColumns } from "views/trash-panel/trash-panel"; +import { projectPanelDataColumns } from "views/project-panel/project-panel-data"; +import { projectPanelRunColumns } from "views/project-panel/project-panel-run"; +import { favoritePanelColumns } from "views/favorite-panel/favorite-panel"; + export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen"; diff --git a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.cy.js b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.cy.js index b7f3908e50..b063b8413b 100644 --- a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.cy.js +++ b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.cy.js @@ -12,8 +12,7 @@ import MockAdapter from "axios-mock-adapter"; import { openRunProcess } from './workflow-panel-actions'; import { runProcessPanelActions } from 'store/run-process-panel/run-process-panel-actions'; import { initialize } from 'redux-form'; -import { RUN_PROCESS_INPUTS_FORM } from 'views/run-process-panel/run-process-inputs-form'; -import { RUN_PROCESS_BASIC_FORM } from 'views/run-process-panel/run-process-basic-form'; +import { RUN_PROCESS_INPUTS_FORM, RUN_PROCESS_BASIC_FORM } from 'store/run-process-panel/run-process-panel-actions'; import { ResourceKind } from 'models/resource'; describe('workflow-panel-actions', () => { @@ -103,4 +102,3 @@ const arrayDeeplyIncludesObject = (array, object) => { return false; }); }; - diff --git a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts index e4f593c0d4..e6a67ff0dc 100644 --- a/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts +++ b/services/workbench2/src/store/workflow-panel/workflow-panel-actions.ts @@ -17,9 +17,7 @@ import { } from 'store/run-process-panel/run-process-panel-actions'; import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions'; import { initialize } from 'redux-form'; -import { RUN_PROCESS_BASIC_FORM } from 'views/run-process-panel/run-process-basic-form'; -import { RUN_PROCESS_INPUTS_FORM } from 'views/run-process-panel/run-process-inputs-form'; -import { RUN_PROCESS_ADVANCED_FORM } from 'views/run-process-panel/run-process-advanced-form'; +import { RUN_PROCESS_BASIC_FORM, RUN_PROCESS_INPUTS_FORM, RUN_PROCESS_ADVANCED_FORM } from 'store/run-process-panel/run-process-panel-actions'; import { getResource } from 'store/resources/resources'; import { ProjectResource } from 'models/project'; import { UserResource } from 'models/user'; diff --git a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx index 4ac2d08149..356e92b11b 100644 --- a/services/workbench2/src/views-components/data-explorer/data-explorer.tsx +++ b/services/workbench2/src/views-components/data-explorer/data-explorer.tsx @@ -8,9 +8,9 @@ import { DataExplorer as DataExplorerComponent } from "components/data-explorer/ import { getDataExplorer } from "store/data-explorer/data-explorer-reducer"; import { Dispatch } from "redux"; import { dataExplorerActions } from "store/data-explorer/data-explorer-action"; -import { DataColumn } from "components/data-table/data-column"; -import { DataColumns, TCheckedList } from "components/data-table/data-table"; -import { DataTableFilters } from "components/data-table-filters/data-table-filters-tree"; +import { DataColumn, DataColumns, } from "components/data-table/data-column"; +import { TCheckedList } from "components/data-table/data-table"; +import { DataTableFilters } from "components/data-table-filters/data-table-filters"; import { toggleMSToolbar, setCheckedListOnStore } from "store/multiselect/multiselect-actions"; import { setSelectedResourceUuid } from "store/selected-resource/selected-resource-actions"; import { usesDetailsCard } from "components/multiselect-toolbar/MultiselectToolbar"; diff --git a/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx b/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx index 643e9e0413..9013151003 100644 --- a/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx +++ b/services/workbench2/src/views-components/side-panel-tree/side-panel-tree.tsx @@ -9,14 +9,19 @@ import { TreePicker, TreePickerProps } from "../tree-picker/tree-picker"; import { TreeItem } from "components/tree/tree"; import { ProjectResource } from "models/project"; import { ListItemTextIcon } from "components/list-item-text-icon/list-item-text-icon"; -import { ProcessIcon, ProjectIcon, FilterGroupIcon, FavoriteIcon, ProjectsIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon, TerminalIcon, ResourceIcon } from 'components/icon/icon'; -import { activateSidePanelTreeItem, toggleSidePanelTreeItemCollapse, SIDE_PANEL_TREE, SidePanelTreeCategory } from 'store/side-panel-tree/side-panel-tree-actions'; +import { activateSidePanelTreeItem, + toggleSidePanelTreeItemCollapse, + SIDE_PANEL_TREE, + SidePanelTreeCategory, + getSidePanelIcon +} from 'store/side-panel-tree/side-panel-tree-actions'; import { openSidePanelContextMenu } from 'store/context-menu/context-menu-actions'; import { noop } from 'lodash'; import { ResourceKind } from "models/resource"; import { IllegalNamingWarning } from "components/warning/warning"; import { GroupClass } from "models/group"; import { setSelectedResourceUuid } from "store/selected-resource/selected-resource-actions"; +import { FilterGroupIcon, ProjectsIcon } from 'components/icon/icon'; export interface SidePanelTreeProps { onItemActivation: (id: string) => void; @@ -72,28 +77,3 @@ const getProjectPickerIcon = (item: TreeItem) => : (item.data && item.data.groupClass === GroupClass.FILTER) ? FilterGroupIcon : ProjectsIcon; - -export const getSidePanelIcon = (category: string) => { - switch (category) { - case SidePanelTreeCategory.FAVORITES: - return FavoriteIcon; - case SidePanelTreeCategory.PROJECTS: - return ProjectsIcon; - case SidePanelTreeCategory.SHARED_WITH_ME: - return ShareMeIcon; - case SidePanelTreeCategory.TRASH: - return TrashIcon; - case SidePanelTreeCategory.PUBLIC_FAVORITES: - return PublicFavoriteIcon; - case SidePanelTreeCategory.ALL_PROCESSES: - return ProcessIcon; - case SidePanelTreeCategory.INSTANCE_TYPES: - return ResourceIcon; - case SidePanelTreeCategory.GROUPS: - return GroupsIcon; - case SidePanelTreeCategory.SHELL_ACCESS: - return TerminalIcon - default: - return ProjectIcon; - } -}; diff --git a/services/workbench2/src/views/all-processes-panel/all-processes-panel.tsx b/services/workbench2/src/views/all-processes-panel/all-processes-panel.tsx index 3d582aab24..85cadef0bf 100644 --- a/services/workbench2/src/views/all-processes-panel/all-processes-panel.tsx +++ b/services/workbench2/src/views/all-processes-panel/all-processes-panel.tsx @@ -8,10 +8,9 @@ import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from "react-redux"; -import { DataColumns } from "components/data-table/data-table"; import { RouteComponentProps } from "react-router"; import { DataTableFilterItem } from "components/data-table-filters/data-table-filters"; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { ResourceKind } from "models/resource"; import { ArvadosTheme } from "common/custom-theme"; import { ALL_PROCESSES_PANEL_ID } from "store/all-processes-panel/all-processes-panel-action"; diff --git a/services/workbench2/src/views/api-client-authorization-panel/api-client-authorization-panel-root.tsx b/services/workbench2/src/views/api-client-authorization-panel/api-client-authorization-panel-root.tsx index c16c69eb9a..12a4712789 100644 --- a/services/workbench2/src/views/api-client-authorization-panel/api-client-authorization-panel-root.tsx +++ b/services/workbench2/src/views/api-client-authorization-panel/api-client-authorization-panel-root.tsx @@ -9,8 +9,7 @@ import withStyles from '@mui/styles/withStyles'; import { ArvadosTheme } from 'common/custom-theme'; import { ShareMeIcon } from 'components/icon/icon'; import { createTree } from 'models/tree'; -import { DataColumns } from 'components/data-table/data-table'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { API_CLIENT_AUTHORIZATION_PANEL_ID } from '../../store/api-client-authorizations/api-client-authorizations-actions'; import { DataExplorer } from 'views-components/data-explorer/data-explorer'; import { ResourcesState } from 'store/resources/resources'; diff --git a/services/workbench2/src/views/collection-content-address-panel/collection-content-address-panel.tsx b/services/workbench2/src/views/collection-content-address-panel/collection-content-address-panel.tsx index dc5609935e..866f71328e 100644 --- a/services/workbench2/src/views/collection-content-address-panel/collection-content-address-panel.tsx +++ b/services/workbench2/src/views/collection-content-address-panel/collection-content-address-panel.tsx @@ -21,8 +21,7 @@ import { ResourceKind } from 'models/resource'; import { loadDetailsPanel } from 'store/details-panel/details-panel-action'; import { connect } from 'react-redux'; import { navigateTo } from 'store/navigation/navigation-action'; -import { DataColumns } from 'components/data-table/data-table'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { createTree } from 'models/tree'; import { ResourceName, diff --git a/services/workbench2/src/views/favorite-panel/favorite-panel.tsx b/services/workbench2/src/views/favorite-panel/favorite-panel.tsx index d1fd5e1d14..5de75afb90 100644 --- a/services/workbench2/src/views/favorite-panel/favorite-panel.tsx +++ b/services/workbench2/src/views/favorite-panel/favorite-panel.tsx @@ -8,7 +8,7 @@ import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { RouteComponentProps } from 'react-router'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { ResourceKind } from 'models/resource'; diff --git a/services/workbench2/src/views/group-details-panel/group-details-panel.tsx b/services/workbench2/src/views/group-details-panel/group-details-panel.tsx index 6ae62b618e..daa78f455d 100644 --- a/services/workbench2/src/views/group-details-panel/group-details-panel.tsx +++ b/services/workbench2/src/views/group-details-panel/group-details-panel.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { ResourceLinkHeadUuid, ResourceLinkTailUsername, ResourceLinkHeadPermissionLevel, ResourceLinkTailPermissionLevel, ResourceLinkHead, ResourceLinkTail, ResourceLinkDelete, ResourceLinkTailAccountStatus, ResourceLinkTailIsVisible } from 'views-components/data-explorer/renderers'; import { createTree } from 'models/tree'; import { noop } from 'lodash/fp'; diff --git a/services/workbench2/src/views/groups-panel/groups-panel.tsx b/services/workbench2/src/views/groups-panel/groups-panel.tsx index a0c9a0d3ab..fc761fb276 100644 --- a/services/workbench2/src/views/groups-panel/groups-panel.tsx +++ b/services/workbench2/src/views/groups-panel/groups-panel.tsx @@ -9,8 +9,7 @@ import { Grid, Button } from "@mui/material"; import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; -import { DataColumns } from 'components/data-table/data-table'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { GroupMembersCount, ResourceUuid } from 'views-components/data-explorer/renderers'; import { AddIcon } from 'components/icon/icon'; import { ResourceName } from 'views-components/data-explorer/renderers'; diff --git a/services/workbench2/src/views/link-panel/link-panel-root.tsx b/services/workbench2/src/views/link-panel/link-panel-root.tsx index 4eeeb31ad8..83674cfd27 100644 --- a/services/workbench2/src/views/link-panel/link-panel-root.tsx +++ b/services/workbench2/src/views/link-panel/link-panel-root.tsx @@ -5,8 +5,7 @@ import React from 'react'; import { LINK_PANEL_ID } from 'store/link-panel/link-panel-actions'; import { DataExplorer } from 'views-components/data-explorer/data-explorer'; -import { SortDirection } from 'components/data-table/data-column'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { ResourcesState } from 'store/resources/resources'; import { ShareMeIcon } from 'components/icon/icon'; import { createTree } from 'models/tree'; diff --git a/services/workbench2/src/views/project-panel/project-panel-data.tsx b/services/workbench2/src/views/project-panel/project-panel-data.tsx index a8bde2cd9c..69e41ce020 100644 --- a/services/workbench2/src/views/project-panel/project-panel-data.tsx +++ b/services/workbench2/src/views/project-panel/project-panel-data.tsx @@ -5,10 +5,9 @@ import React from "react"; import { ProjectIcon } from "components/icon/icon"; import { PROJECT_PANEL_DATA_ID } from "store/project-panel/project-panel-action-bind"; -import { DataColumns } from 'components/data-table/data-table'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { ProjectResource } from 'models/project'; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { createTree } from "models/tree"; import { ResourceCreatedAtDate, diff --git a/services/workbench2/src/views/project-panel/project-panel-run.tsx b/services/workbench2/src/views/project-panel/project-panel-run.tsx index 4413bfd492..11b02d3776 100644 --- a/services/workbench2/src/views/project-panel/project-panel-run.tsx +++ b/services/workbench2/src/views/project-panel/project-panel-run.tsx @@ -5,10 +5,9 @@ import React from "react"; import { ProjectIcon } from "components/icon/icon"; import { PROJECT_PANEL_RUN_ID } from "store/project-panel/project-panel-action-bind"; -import { DataColumns } from 'components/data-table/data-table'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { ProjectResource } from 'models/project'; -import { SortDirection } from "components/data-table/data-column"; +import { DataColumns, SortDirection } from "components/data-table/data-column"; import { createTree } from "models/tree"; import { ContainerRunTime, diff --git a/services/workbench2/src/views/public-favorites-panel/public-favorites-panel.tsx b/services/workbench2/src/views/public-favorites-panel/public-favorites-panel.tsx index 8860b634ee..6a7561bbca 100644 --- a/services/workbench2/src/views/public-favorites-panel/public-favorites-panel.tsx +++ b/services/workbench2/src/views/public-favorites-panel/public-favorites-panel.tsx @@ -8,7 +8,7 @@ import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { RouteComponentProps } from 'react-router'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { ResourceKind } from 'models/resource'; diff --git a/services/workbench2/src/views/run-process-panel/run-process-advanced-form.tsx b/services/workbench2/src/views/run-process-panel/run-process-advanced-form.tsx index 7387546cba..0a1f066528 100644 --- a/services/workbench2/src/views/run-process-panel/run-process-advanced-form.tsx +++ b/services/workbench2/src/views/run-process-panel/run-process-advanced-form.tsx @@ -11,26 +11,15 @@ import { ExpandIcon } from 'components/icon/icon'; import * as IntInput from './inputs/int-input'; import { min } from 'validators/min'; import { optional } from 'validators/optional'; - -export const RUN_PROCESS_ADVANCED_FORM = 'runProcessAdvancedForm'; - -export const DESCRIPTION_FIELD = 'description'; -export const OUTPUT_FIELD = 'output'; -export const RUNTIME_FIELD = 'runtime'; -export const RAM_FIELD = 'ram'; -export const VCPUS_FIELD = 'vcpus'; -export const KEEP_CACHE_RAM_FIELD = 'keep_cache_ram'; -export const RUNNER_IMAGE_FIELD = 'acr_container_image'; - -export interface RunProcessAdvancedFormData { - [DESCRIPTION_FIELD]?: string; - [OUTPUT_FIELD]?: string; - [RUNTIME_FIELD]?: number; - [RAM_FIELD]: number; - [VCPUS_FIELD]: number; - [KEEP_CACHE_RAM_FIELD]: number; - [RUNNER_IMAGE_FIELD]: string; -} +import { RUN_PROCESS_ADVANCED_FORM, + OUTPUT_FIELD, + RUNTIME_FIELD, + RAM_FIELD, + VCPUS_FIELD, + KEEP_CACHE_RAM_FIELD, + RUNNER_IMAGE_FIELD, + RunProcessAdvancedFormData +} from 'store/run-process-panel/run-process-panel-actions'; export const RunProcessAdvancedForm = reduxForm({ diff --git a/services/workbench2/src/views/run-process-panel/run-process-basic-form.tsx b/services/workbench2/src/views/run-process-panel/run-process-basic-form.tsx index 32bbd8b0d9..31cd5f1181 100644 --- a/services/workbench2/src/views/run-process-panel/run-process-basic-form.tsx +++ b/services/workbench2/src/views/run-process-panel/run-process-basic-form.tsx @@ -14,13 +14,7 @@ import { ProjectResource } from 'models/project'; import { UserResource } from 'models/user'; import { WorkflowResource } from 'models/workflow'; import { ArvadosTheme, CustomStyleRulesCallback } from 'common/custom-theme'; - -export const RUN_PROCESS_BASIC_FORM = 'runProcessBasicForm'; - -export interface RunProcessBasicFormData { - name: string; - owner?: ProjectResource | UserResource; -} +import { RUN_PROCESS_BASIC_FORM, RunProcessBasicFormData } from 'store/run-process-panel/run-process-panel-actions'; interface RunProcessBasicFormProps { workflow?: WorkflowResource; diff --git a/services/workbench2/src/views/run-process-panel/run-process-inputs-form.tsx b/services/workbench2/src/views/run-process-panel/run-process-inputs-form.tsx index 4c1bf2142d..ecfb0c21e0 100644 --- a/services/workbench2/src/views/run-process-panel/run-process-inputs-form.tsx +++ b/services/workbench2/src/views/run-process-panel/run-process-inputs-form.tsx @@ -25,8 +25,7 @@ import { FileArrayInput } from './inputs/file-array-input'; import { DirectoryArrayInput } from './inputs/directory-array-input'; import { FloatArrayInput } from './inputs/float-array-input'; import { IntArrayInput } from './inputs/int-array-input'; - -export const RUN_PROCESS_INPUTS_FORM = 'runProcessInputsForm'; +import { RUN_PROCESS_INPUTS_FORM } from 'store/run-process-panel/run-process-panel-actions'; export interface RunProcessInputFormProps { inputs: CommandInputParameter[]; diff --git a/services/workbench2/src/views/run-process-panel/run-process-second-step.tsx b/services/workbench2/src/views/run-process-panel/run-process-second-step.tsx index 70c9c3e74f..05f98f6644 100644 --- a/services/workbench2/src/views/run-process-panel/run-process-second-step.tsx +++ b/services/workbench2/src/views/run-process-panel/run-process-second-step.tsx @@ -4,14 +4,18 @@ import React from 'react'; import { Grid, Button } from '@mui/material'; -import { RunProcessBasicForm, RUN_PROCESS_BASIC_FORM } from './run-process-basic-form'; +import { + RUN_PROCESS_BASIC_FORM, + RUN_PROCESS_INPUTS_FORM, + RUN_PROCESS_ADVANCED_FORM +} from 'store/run-process-panel/run-process-panel-actions'; +import { RunProcessBasicForm } from './run-process-basic-form'; +import { RunProcessAdvancedForm } from './run-process-advanced-form'; import { RunProcessInputsForm } from 'views/run-process-panel/run-process-inputs-form'; import { CommandInputParameter, WorkflowResource } from 'models/workflow'; import { connect } from 'react-redux'; import { RootState } from 'store/store'; import { isValid } from 'redux-form'; -import { RUN_PROCESS_INPUTS_FORM } from './run-process-inputs-form'; -import { RunProcessAdvancedForm, RUN_PROCESS_ADVANCED_FORM } from './run-process-advanced-form'; import { createStructuredSelector } from 'reselect'; import { selectPreset } from 'store/run-process-panel/run-process-panel-actions'; diff --git a/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx b/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx index 320a56e35c..c6ab8f6c99 100644 --- a/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx +++ b/services/workbench2/src/views/search-results-panel/search-results-panel-view.tsx @@ -3,8 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import React, { useEffect, useCallback, useState } from 'react'; -import { SortDirection } from 'components/data-table/data-column'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { extractUuidKind, ResourceKind } from 'models/resource'; import { ContainerRequestState } from 'models/container-request'; diff --git a/services/workbench2/src/views/shared-with-me-panel/shared-with-me-columns.tsx b/services/workbench2/src/views/shared-with-me-panel/shared-with-me-columns.tsx new file mode 100644 index 0000000000..1b6b6ee373 --- /dev/null +++ b/services/workbench2/src/views/shared-with-me-panel/shared-with-me-columns.tsx @@ -0,0 +1,194 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import { DataColumns } from 'components/data-table/data-column'; +import { + ResourceName, + ProcessStatus as ResourceStatus, + ResourceType, + ResourceOwnerWithNameLink, + ResourcePortableDataHash, + ResourceFileSize, + ResourceFileCount, + ResourceUUID, + ResourceContainerUuid, + ContainerRunTime, + ResourceOutputUuid, + ResourceLogUuid, + ResourceParentProcess, + ResourceModifiedByUserUuid, + ResourceVersion, + ResourceCreatedAtDate, + ResourceLastModifiedDate, + ResourceTrashDate, + ResourceDeleteDate, +} from 'views-components/data-explorer/renderers'; +import { ProjectResource } from 'models/project'; +import { createTree } from 'models/tree'; +import { SortDirection } from 'components/data-table/data-column'; +import { getInitialResourceTypeFilters, getInitialProcessStatusFilters } from 'store/resource-type-filters/resource-type-filters'; + +export enum SharedWithMePanelColumnNames { + NAME = 'Name', + STATUS = 'Status', + TYPE = 'Type', + OWNER = 'Owner', + PORTABLE_DATA_HASH = 'Portable Data Hash', + FILE_SIZE = 'File Size', + FILE_COUNT = 'File Count', + UUID = 'UUID', + CONTAINER_UUID = 'Container UUID', + RUNTIME = 'Runtime', + OUTPUT_UUID = 'Output UUID', + LOG_UUID = 'Log UUID', + PARENT_PROCESS = 'Parent Process UUID', + MODIFIED_BY_USER_UUID = 'Modified by User UUID', + VERSION = 'Version', + CREATED_AT = 'Date Created', + LAST_MODIFIED = 'Last Modified', + TRASH_AT = 'Trash at', + DELETE_AT = 'Delete at', +} + +export const sharedWithMePanelColumns: DataColumns = [ + { + name: SharedWithMePanelColumnNames.NAME, + selected: true, + configurable: true, + sort: { direction: SortDirection.NONE, field: 'name' }, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.STATUS, + selected: true, + configurable: true, + mutuallyExclusiveFilters: true, + filters: getInitialProcessStatusFilters(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.TYPE, + selected: true, + configurable: true, + filters: getInitialResourceTypeFilters(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.OWNER, + selected: true, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.PORTABLE_DATA_HASH, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.FILE_SIZE, + selected: true, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.FILE_COUNT, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.UUID, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.CONTAINER_UUID, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.RUNTIME, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.OUTPUT_UUID, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.LOG_UUID, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.PARENT_PROCESS, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.MODIFIED_BY_USER_UUID, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.VERSION, + selected: false, + configurable: true, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.CREATED_AT, + selected: false, + configurable: true, + sort: { direction: SortDirection.NONE, field: 'createdAt' }, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.LAST_MODIFIED, + selected: true, + configurable: true, + sort: { direction: SortDirection.DESC, field: 'modifiedAt' }, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.TRASH_AT, + selected: false, + configurable: true, + sort: { direction: SortDirection.NONE, field: 'trashAt' }, + filters: createTree(), + render: (uuid) => , + }, + { + name: SharedWithMePanelColumnNames.DELETE_AT, + selected: false, + configurable: true, + sort: { direction: SortDirection.NONE, field: 'deleteAt' }, + filters: createTree(), + render: (uuid) => , + }, +]; diff --git a/services/workbench2/src/views/shared-with-me-panel/shared-with-me-panel.tsx b/services/workbench2/src/views/shared-with-me-panel/shared-with-me-panel.tsx index fdaeaa806a..07ac3201a4 100644 --- a/services/workbench2/src/views/shared-with-me-panel/shared-with-me-panel.tsx +++ b/services/workbench2/src/views/shared-with-me-panel/shared-with-me-panel.tsx @@ -20,36 +20,13 @@ import { openContextMenu, resourceUuidToContextMenuKind } from 'store/context-menu/context-menu-actions'; -import { - ResourceName, - ProcessStatus as ResourceStatus, - ResourceType, - ResourceOwnerWithNameLink, - ResourcePortableDataHash, - ResourceFileSize, - ResourceFileCount, - ResourceUUID, - ResourceContainerUuid, - ContainerRunTime, - ResourceOutputUuid, - ResourceLogUuid, - ResourceParentProcess, - ResourceModifiedByUserUuid, - ResourceVersion, - ResourceCreatedAtDate, - ResourceLastModifiedDate, - ResourceTrashDate, - ResourceDeleteDate, -} from 'views-components/data-explorer/renderers'; + import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { GroupContentsResource } from 'services/groups-service/groups-service'; import { toggleOne, deselectAllOthers } from 'store/multiselect/multiselect-actions'; -import { DataColumns } from 'components/data-table/data-table'; + import { ContainerRequestState } from 'models/container-request'; -import { ProjectResource } from 'models/project'; -import { createTree } from 'models/tree'; -import { SortDirection } from 'components/data-table/data-column'; -import { getInitialResourceTypeFilters, getInitialProcessStatusFilters } from 'store/resource-type-filters/resource-type-filters'; + type CssRules = "toolbar" | "button" | "root"; @@ -66,173 +43,11 @@ const styles: CustomStyleRulesCallback = (theme: ArvadosTheme) => ({ }, }); -export enum SharedWithMePanelColumnNames { - NAME = 'Name', - STATUS = 'Status', - TYPE = 'Type', - OWNER = 'Owner', - PORTABLE_DATA_HASH = 'Portable Data Hash', - FILE_SIZE = 'File Size', - FILE_COUNT = 'File Count', - UUID = 'UUID', - CONTAINER_UUID = 'Container UUID', - RUNTIME = 'Runtime', - OUTPUT_UUID = 'Output UUID', - LOG_UUID = 'Log UUID', - PARENT_PROCESS = 'Parent Process UUID', - MODIFIED_BY_USER_UUID = 'Modified by User UUID', - VERSION = 'Version', - CREATED_AT = 'Date Created', - LAST_MODIFIED = 'Last Modified', - TRASH_AT = 'Trash at', - DELETE_AT = 'Delete at', -} export interface ProjectPanelFilter extends DataTableFilterItem { type: ResourceKind | ContainerRequestState; } -export const sharedWithMePanelColumns: DataColumns = [ - { - name: SharedWithMePanelColumnNames.NAME, - selected: true, - configurable: true, - sort: { direction: SortDirection.NONE, field: 'name' }, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.STATUS, - selected: true, - configurable: true, - mutuallyExclusiveFilters: true, - filters: getInitialProcessStatusFilters(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.TYPE, - selected: true, - configurable: true, - filters: getInitialResourceTypeFilters(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.OWNER, - selected: true, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.PORTABLE_DATA_HASH, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.FILE_SIZE, - selected: true, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.FILE_COUNT, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.UUID, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.CONTAINER_UUID, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.RUNTIME, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.OUTPUT_UUID, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.LOG_UUID, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.PARENT_PROCESS, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.MODIFIED_BY_USER_UUID, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.VERSION, - selected: false, - configurable: true, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.CREATED_AT, - selected: false, - configurable: true, - sort: { direction: SortDirection.NONE, field: 'createdAt' }, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.LAST_MODIFIED, - selected: true, - configurable: true, - sort: { direction: SortDirection.DESC, field: 'modifiedAt' }, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.TRASH_AT, - selected: false, - configurable: true, - sort: { direction: SortDirection.NONE, field: 'trashAt' }, - filters: createTree(), - render: (uuid) => , - }, - { - name: SharedWithMePanelColumnNames.DELETE_AT, - selected: false, - configurable: true, - sort: { direction: SortDirection.NONE, field: 'deleteAt' }, - filters: createTree(), - render: (uuid) => , - }, -]; interface SharedWithMePanelDataProps { diff --git a/services/workbench2/src/views/subprocess-panel/subprocess-panel-root.tsx b/services/workbench2/src/views/subprocess-panel/subprocess-panel-root.tsx index f5b7d3bacb..59cf67fcb1 100644 --- a/services/workbench2/src/views/subprocess-panel/subprocess-panel-root.tsx +++ b/services/workbench2/src/views/subprocess-panel/subprocess-panel-root.tsx @@ -4,10 +4,9 @@ import React from 'react'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; -import { DataColumns } from 'components/data-table/data-table'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { ContainerRequestState } from 'models/container-request'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { ResourceKind } from 'models/resource'; import { ResourceCreatedAtDate, ProcessStatus, ContainerRunTime } from 'views-components/data-explorer/renderers'; import { ProcessIcon } from 'components/icon/icon'; diff --git a/services/workbench2/src/views/trash-panel/trash-panel.tsx b/services/workbench2/src/views/trash-panel/trash-panel.tsx index 372ea62df5..54f9748fcd 100644 --- a/services/workbench2/src/views/trash-panel/trash-panel.tsx +++ b/services/workbench2/src/views/trash-panel/trash-panel.tsx @@ -9,10 +9,9 @@ import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; -import { DataColumns } from 'components/data-table/data-table'; import { RootState } from 'store/store'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { ResourceKind, TrashableResource } from 'models/resource'; import { ArvadosTheme } from 'common/custom-theme'; import { RestoreFromTrashIcon, TrashIcon } from 'components/icon/icon'; diff --git a/services/workbench2/src/views/user-panel/user-panel.tsx b/services/workbench2/src/views/user-panel/user-panel.tsx index 10839584cd..546961c0ba 100644 --- a/services/workbench2/src/views/user-panel/user-panel.tsx +++ b/services/workbench2/src/views/user-panel/user-panel.tsx @@ -8,9 +8,8 @@ import { WithStyles } from '@mui/styles'; import withStyles from '@mui/styles/withStyles'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; -import { DataColumns } from 'components/data-table/data-table'; import { RootState } from 'store/store'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { openUserContextMenu } from "store/context-menu/context-menu-actions"; import { getResource, ResourcesState } from "store/resources/resources"; import { diff --git a/services/workbench2/src/views/user-profile-panel/user-profile-panel-root.tsx b/services/workbench2/src/views/user-profile-panel/user-profile-panel-root.tsx index 454c44d826..23a4765aea 100644 --- a/services/workbench2/src/views/user-profile-panel/user-profile-panel-root.tsx +++ b/services/workbench2/src/views/user-profile-panel/user-profile-panel-root.tsx @@ -29,7 +29,7 @@ import { PROFILE_EMAIL_VALIDATION, PROFILE_URL_VALIDATION } from "validators/val import { USER_PROFILE_PANEL_ID } from 'store/user-profile/user-profile-actions'; import { noop } from 'lodash'; import { DetailsIcon, GroupsIcon, MoreVerticalIcon } from 'components/icon/icon'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns } from 'components/data-table/data-column'; import { ResourceLinkHeadUuid, ResourceLinkHeadPermissionLevel, ResourceLinkHead, ResourceLinkDelete, ResourceLinkTailIsVisible, UserResourceAccountStatus } from 'views-components/data-explorer/renderers'; import { createTree } from 'models/tree'; import { getResource, ResourcesState } from 'store/resources/resources'; diff --git a/services/workbench2/src/views/workflow-panel/workflow-panel-view.tsx b/services/workbench2/src/views/workflow-panel/workflow-panel-view.tsx index 792f132cd4..40e76a217b 100644 --- a/services/workbench2/src/views/workflow-panel/workflow-panel-view.tsx +++ b/services/workbench2/src/views/workflow-panel/workflow-panel-view.tsx @@ -13,8 +13,7 @@ import { ResourceShare, ResourceRunProcess } from "views-components/data-explorer/renderers"; -import { SortDirection } from 'components/data-table/data-column'; -import { DataColumns } from 'components/data-table/data-table'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { Grid, Paper } from '@mui/material'; import { WorkflowDetailsCard } from './workflow-description-card'; diff --git a/services/workbench2/src/views/workflow-panel/workflow-processes-panel-root.tsx b/services/workbench2/src/views/workflow-panel/workflow-processes-panel-root.tsx index 45cb0236e4..e3cf3decb0 100644 --- a/services/workbench2/src/views/workflow-panel/workflow-processes-panel-root.tsx +++ b/services/workbench2/src/views/workflow-panel/workflow-processes-panel-root.tsx @@ -4,10 +4,9 @@ import React from 'react'; import { DataExplorer } from "views-components/data-explorer/data-explorer"; -import { DataColumns } from 'components/data-table/data-table'; import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters'; import { ContainerRequestState } from 'models/container-request'; -import { SortDirection } from 'components/data-table/data-column'; +import { DataColumns, SortDirection } from 'components/data-table/data-column'; import { ResourceKind } from 'models/resource'; import { ResourceCreatedAtDate, ProcessStatus, ContainerRunTime } from 'views-components/data-explorer/renderers'; import { ProcessIcon } from 'components/icon/icon'; -- 2.30.2