[arvados] created: 2.7.0-5669-gdc16046dbf
git repository hosting
git at public.arvados.org
Thu Dec 21 20:09:37 UTC 2023
at dc16046dbfdca4a9c0d94971730d220b27e80620 (commit)
commit dc16046dbfdca4a9c0d94971730d220b27e80620
Merge: c656b0b18c 2efa65c6c4
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Thu Dec 21 15:09:12 2023 -0500
21200: copied branch from arvados-workbench2 Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --cc services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts
index 018a64ce9b,0000000000..2ba2201bac
mode 100644,000000..100644
--- a/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/services/workbench2/src/store/breadcrumbs/breadcrumbs-actions.ts
@@@ -1,328 -1,0 +1,329 @@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Dispatch } from 'redux';
+import { RootState } from 'store/store';
+import { getUserUuid } from "common/getuser";
+import { getResource } from 'store/resources/resources';
+import { propertiesActions } from '../properties/properties-actions';
+import { getProcess } from 'store/processes/process';
+import { ServiceRepository } from 'services/services';
+import { SidePanelTreeCategory, activateSidePanelTreeItem } from 'store/side-panel-tree/side-panel-tree-actions';
+import { updateResources } from '../resources/resources-actions';
+import { ResourceKind } from 'models/resource';
+import { GroupResource } from 'models/group';
+import { extractUuidKind } from 'models/resource';
+import { UserResource } from 'models/user';
+import { FilterBuilder } from 'services/api/filter-builder';
+import { ProcessResource } from 'models/process';
+import { OrderBuilder } from 'services/api/order-builder';
+import { Breadcrumb } from 'components/breadcrumbs/breadcrumbs';
+import { ContainerRequestResource, containerRequestFieldsNoMounts } from 'models/container-request';
+import { AdminMenuIcon, CollectionIcon, IconType, ProcessIcon, ProjectIcon, ResourceIcon, WorkflowIcon } from 'components/icon/icon';
+import { CollectionResource } from 'models/collection';
+import { getSidePanelIcon } from 'views-components/side-panel-tree/side-panel-tree';
+import { WorkflowResource } from 'models/workflow';
+import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
+
+export const BREADCRUMBS = 'breadcrumbs';
+
+export const setBreadcrumbs = (breadcrumbs: any, currentItem?: CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource) => {
+ if (currentItem) {
- breadcrumbs.push(resourceToBreadcrumb(currentItem));
++ const currentCrumb = resourceToBreadcrumb(currentItem)
++ if (currentCrumb.label.length) breadcrumbs.push(currentCrumb);
+ }
+ return propertiesActions.SET_PROPERTY({ key: BREADCRUMBS, value: breadcrumbs });
+};
+
+const resourceToBreadcrumbIcon = (resource: CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource): IconType | undefined => {
+ switch (resource.kind) {
+ case ResourceKind.PROJECT:
+ return ProjectIcon;
+ case ResourceKind.PROCESS:
+ return ProcessIcon;
+ case ResourceKind.COLLECTION:
+ return CollectionIcon;
+ case ResourceKind.WORKFLOW:
+ return WorkflowIcon;
+ default:
+ return undefined;
+ }
+}
+
- const resourceToBreadcrumb = (resource: CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource): Breadcrumb => ({
- label: resource.name,
++const resourceToBreadcrumb = (resource: (CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource) & {fullName?: string} ): Breadcrumb => ({
++ label: resource.name || resource.fullName || '',
+ uuid: resource.uuid,
+ icon: resourceToBreadcrumbIcon(resource),
+})
+
+export const setSidePanelBreadcrumbs = (uuid: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid + "-breadcrumbs"));
+ const ancestors = await services.ancestorsService.ancestors(uuid, '');
+ dispatch(updateResources(ancestors));
+
+ let breadcrumbs: Breadcrumb[] = [];
+ const { collectionPanel: { item } } = getState();
+
+ const path = getState().router.location!.pathname;
+ const currentUuid = path.split('/')[2];
+ const uuidKind = extractUuidKind(currentUuid);
+ const rootUuid = getUserUuid(getState());
+
+ if (ancestors.find(ancestor => ancestor.uuid === rootUuid)) {
+ // Handle home project uuid root
+ breadcrumbs.push({
+ label: SidePanelTreeCategory.PROJECTS,
+ uuid: SidePanelTreeCategory.PROJECTS,
+ icon: getSidePanelIcon(SidePanelTreeCategory.PROJECTS)
+ });
+ } else if (Object.values(SidePanelTreeCategory).includes(uuid as SidePanelTreeCategory)) {
+ // Handle SidePanelTreeCategory root
+ breadcrumbs.push({
+ label: uuid,
+ uuid: uuid,
+ icon: getSidePanelIcon(uuid)
+ });
+ }
+
+ breadcrumbs = ancestors.reduce((breadcrumbs, ancestor) =>
+ ancestor.kind === ResourceKind.GROUP
+ ? [...breadcrumbs, resourceToBreadcrumb(ancestor)]
+ : breadcrumbs,
+ breadcrumbs);
+
+ if (uuidKind === ResourceKind.COLLECTION) {
+ const collectionItem = item ? item : await services.collectionService.get(currentUuid);
+ const parentProcessItem = await getCollectionParent(collectionItem)(services);
+ if (parentProcessItem) {
+ const mainProcessItem = await getProcessParent(parentProcessItem)(services);
+ mainProcessItem && breadcrumbs.push(resourceToBreadcrumb(mainProcessItem));
+ breadcrumbs.push(resourceToBreadcrumb(parentProcessItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs, collectionItem));
+ } else if (uuidKind === ResourceKind.PROCESS) {
+ const processItem = await services.containerRequestService.get(currentUuid);
+ const parentProcessItem = await getProcessParent(processItem)(services);
+ if (parentProcessItem) {
+ breadcrumbs.push(resourceToBreadcrumb(parentProcessItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs, processItem));
+ } else if (uuidKind === ResourceKind.WORKFLOW) {
+ const workflowItem = await services.workflowService.get(currentUuid);
+ dispatch(setBreadcrumbs(breadcrumbs, workflowItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs));
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(uuid + "-breadcrumbs"));
+ }
+ };
+
+export const setSharedWithMeBreadcrumbs = (uuid: string) =>
+ setCategoryBreadcrumbs(uuid, SidePanelTreeCategory.SHARED_WITH_ME);
+
+export const setTrashBreadcrumbs = (uuid: string) =>
+ setCategoryBreadcrumbs(uuid, SidePanelTreeCategory.TRASH);
+
+export const setCategoryBreadcrumbs = (uuid: string, category: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid + "-breadcrumbs"));
+ const ancestors = await services.ancestorsService.ancestors(uuid, '');
+ dispatch(updateResources(ancestors));
+ const initialBreadcrumbs: Breadcrumb[] = [
+ {
+ label: category,
+ uuid: category,
+ icon: getSidePanelIcon(category)
+ }
+ ];
+ const { collectionPanel: { item } } = getState();
+ const path = getState().router.location!.pathname;
+ const currentUuid = path.split('/')[2];
+ const uuidKind = extractUuidKind(currentUuid);
+ let breadcrumbs = ancestors.reduce((breadcrumbs, ancestor) =>
+ ancestor.kind === ResourceKind.GROUP
+ ? [...breadcrumbs, resourceToBreadcrumb(ancestor)]
+ : breadcrumbs,
+ initialBreadcrumbs);
+ if (uuidKind === ResourceKind.COLLECTION) {
+ const collectionItem = item ? item : await services.collectionService.get(currentUuid);
+ const parentProcessItem = await getCollectionParent(collectionItem)(services);
+ if (parentProcessItem) {
+ const mainProcessItem = await getProcessParent(parentProcessItem)(services);
+ mainProcessItem && breadcrumbs.push(resourceToBreadcrumb(mainProcessItem));
+ breadcrumbs.push(resourceToBreadcrumb(parentProcessItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs, collectionItem));
+ } else if (uuidKind === ResourceKind.PROCESS) {
+ const processItem = await services.containerRequestService.get(currentUuid);
+ const parentProcessItem = await getProcessParent(processItem)(services);
+ if (parentProcessItem) {
+ breadcrumbs.push(resourceToBreadcrumb(parentProcessItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs, processItem));
+ } else if (uuidKind === ResourceKind.WORKFLOW) {
+ const workflowItem = await services.workflowService.get(currentUuid);
+ dispatch(setBreadcrumbs(breadcrumbs, workflowItem));
+ }
+ dispatch(setBreadcrumbs(breadcrumbs));
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(uuid + "-breadcrumbs"));
+ }
+ };
+
+const getProcessParent = (childProcess: ContainerRequestResource) =>
+ async (services: ServiceRepository): Promise<ContainerRequestResource | undefined> => {
+ if (childProcess.requestingContainerUuid) {
+ const parentProcesses = await services.containerRequestService.list({
+ order: new OrderBuilder<ProcessResource>().addAsc('createdAt').getOrder(),
+ filters: new FilterBuilder().addEqual('container_uuid', childProcess.requestingContainerUuid).getFilters(),
+ select: containerRequestFieldsNoMounts,
+ });
+ if (parentProcesses.items.length > 0) {
+ return parentProcesses.items[0];
+ } else {
+ return undefined;
+ }
+ } else {
+ return undefined;
+ }
+ }
+
+const getCollectionParent = (collection: CollectionResource) =>
+ async (services: ServiceRepository): Promise<ContainerRequestResource | undefined> => {
+ const parentOutputPromise = services.containerRequestService.list({
+ order: new OrderBuilder<ProcessResource>().addAsc('createdAt').getOrder(),
+ filters: new FilterBuilder().addEqual('output_uuid', collection.uuid).getFilters(),
+ select: containerRequestFieldsNoMounts,
+ });
+ const parentLogPromise = services.containerRequestService.list({
+ order: new OrderBuilder<ProcessResource>().addAsc('createdAt').getOrder(),
+ filters: new FilterBuilder().addEqual('log_uuid', collection.uuid).getFilters(),
+ select: containerRequestFieldsNoMounts,
+ });
+ const [parentOutput, parentLog] = await Promise.all([parentOutputPromise, parentLogPromise]);
+ return parentOutput.items.length > 0 ?
+ parentOutput.items[0] :
+ parentLog.items.length > 0 ?
+ parentLog.items[0] :
+ undefined;
+ }
+
+
+export const setProjectBreadcrumbs = (uuid: string) =>
+ async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const ancestors = await services.ancestorsService.ancestors(uuid, '');
+ const rootUuid = getUserUuid(getState());
+ if (uuid === rootUuid || ancestors.find(ancestor => ancestor.uuid === rootUuid)) {
+ dispatch(setSidePanelBreadcrumbs(uuid));
+ } else {
+ dispatch(setSharedWithMeBreadcrumbs(uuid));
+ dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME));
+ }
+ };
+
+export const setProcessBreadcrumbs = (processUuid: string) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ const { resources } = getState();
+ const process = getProcess(processUuid)(resources);
+ if (process) {
+ dispatch<any>(setProjectBreadcrumbs(process.containerRequest.ownerUuid));
+ }
+ };
+
+export const setGroupsBreadcrumbs = () =>
+ setBreadcrumbs([{
+ label: SidePanelTreeCategory.GROUPS,
+ uuid: SidePanelTreeCategory.GROUPS,
+ icon: getSidePanelIcon(SidePanelTreeCategory.GROUPS)
+ }]);
+
+export const setGroupDetailsBreadcrumbs = (groupUuid: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+
+ const group = getResource<GroupResource>(groupUuid)(getState().resources);
+
+ const breadcrumbs: Breadcrumb[] = [
+ {
+ label: SidePanelTreeCategory.GROUPS,
+ uuid: SidePanelTreeCategory.GROUPS,
+ icon: getSidePanelIcon(SidePanelTreeCategory.GROUPS)
+ },
+ { label: group ? group.name : (await services.groupsService.get(groupUuid)).name, uuid: groupUuid },
+ ];
+
+ dispatch(setBreadcrumbs(breadcrumbs));
+
+ };
+
+export const USERS_PANEL_LABEL = 'Users';
+
+export const setUsersBreadcrumbs = () =>
+ setBreadcrumbs([{ label: USERS_PANEL_LABEL, uuid: USERS_PANEL_LABEL }]);
+
+export const setUserProfileBreadcrumbs = (userUuid: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ const user = getResource<UserResource>(userUuid)(getState().resources)
+ || await services.userService.get(userUuid, false);
+ const breadcrumbs: Breadcrumb[] = [
+ { label: USERS_PANEL_LABEL, uuid: USERS_PANEL_LABEL },
- { label: user ? user.username : userUuid, uuid: userUuid },
++ { label: user ? `${user.firstName} ${user.lastName}` : userUuid, uuid: userUuid },
+ ];
+ dispatch(setBreadcrumbs(breadcrumbs));
+ } catch (e) {
+ const breadcrumbs: Breadcrumb[] = [
+ { label: USERS_PANEL_LABEL, uuid: USERS_PANEL_LABEL },
+ { label: userUuid, uuid: userUuid },
+ ];
+ dispatch(setBreadcrumbs(breadcrumbs));
+ }
+ };
+
+export const MY_ACCOUNT_PANEL_LABEL = 'My Account';
+
+export const setMyAccountBreadcrumbs = () =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(setBreadcrumbs([
+ { label: MY_ACCOUNT_PANEL_LABEL, uuid: MY_ACCOUNT_PANEL_LABEL },
+ ]));
+ };
+
+export const INSTANCE_TYPES_PANEL_LABEL = 'Instance Types';
+
+export const setInstanceTypesBreadcrumbs = () =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(setBreadcrumbs([
+ { label: INSTANCE_TYPES_PANEL_LABEL, uuid: INSTANCE_TYPES_PANEL_LABEL, icon: ResourceIcon },
+ ]));
+ };
+
+export const VIRTUAL_MACHINES_USER_PANEL_LABEL = 'Virtual Machines';
+
+export const setVirtualMachinesBreadcrumbs = () =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(setBreadcrumbs([
+ { label: VIRTUAL_MACHINES_USER_PANEL_LABEL, uuid: VIRTUAL_MACHINES_USER_PANEL_LABEL },
+ ]));
+ };
+
+export const VIRTUAL_MACHINES_ADMIN_PANEL_LABEL = 'Virtual Machines Admin';
+
+export const setVirtualMachinesAdminBreadcrumbs = () =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(setBreadcrumbs([
+ { label: VIRTUAL_MACHINES_ADMIN_PANEL_LABEL, uuid: VIRTUAL_MACHINES_ADMIN_PANEL_LABEL, icon: AdminMenuIcon },
+ ]));
+ };
+
+export const REPOSITORIES_PANEL_LABEL = 'Repositories';
+
+export const setRepositoriesBreadcrumbs = () =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(setBreadcrumbs([
+ { label: REPOSITORIES_PANEL_LABEL, uuid: REPOSITORIES_PANEL_LABEL, icon: AdminMenuIcon },
+ ]));
+ };
diff --cc services/workbench2/src/store/workbench/workbench-actions.ts
index c6e7ff66d3,0000000000..f5245b0e53
mode 100644,000000..100644
--- a/services/workbench2/src/store/workbench/workbench-actions.ts
+++ b/services/workbench2/src/store/workbench/workbench-actions.ts
@@@ -1,876 -1,0 +1,877 @@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Dispatch } from "redux";
+import { RootState } from "store/store";
+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, setIsProjectPanelTrashed } from "store/project-panel/project-panel-action";
+import { projectPanelActions } from "store/project-panel/project-panel-action-bind";
+import {
+ activateSidePanelTreeItem,
+ initSidePanelTree,
+ loadSidePanelTreeProjects,
+ SidePanelTreeCategory,
+} from "store/side-panel-tree/side-panel-tree-actions";
+import { updateResources } from "store/resources/resources-actions";
+import { projectPanelColumns } from "views/project-panel/project-panel";
+import { favoritePanelColumns } from "views/favorite-panel/favorite-panel";
+import { matchRootRoute } from "routes/routes";
+import {
+ setGroupDetailsBreadcrumbs,
+ setGroupsBreadcrumbs,
+ setProcessBreadcrumbs,
+ setSharedWithMeBreadcrumbs,
+ setSidePanelBreadcrumbs,
+ setTrashBreadcrumbs,
+ setUsersBreadcrumbs,
+ setMyAccountBreadcrumbs,
+ setUserProfileBreadcrumbs,
+ setInstanceTypesBreadcrumbs,
+ setVirtualMachinesBreadcrumbs,
+ setVirtualMachinesAdminBreadcrumbs,
+ setRepositoriesBreadcrumbs,
+} from "store/breadcrumbs/breadcrumbs-actions";
+import { navigateTo, navigateToRootProject } from "store/navigation/navigation-action";
+import { MoveToFormDialogData } from "store/move-to-dialog/move-to-dialog";
+import { ServiceRepository } from "services/services";
+import { getResource } from "store/resources/resources";
+import * as projectCreateActions from "store/projects/project-create-actions";
+import * as projectMoveActions from "store/projects/project-move-actions";
+import * as projectUpdateActions from "store/projects/project-update-actions";
+import * as collectionCreateActions from "store/collections/collection-create-actions";
+import * as collectionCopyActions from "store/collections/collection-copy-actions";
+import * as collectionMoveActions from "store/collections/collection-move-actions";
+import * as processesActions from "store/processes/processes-actions";
+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 { 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";
+import { FilterBuilder } from "services/api/filter-builder";
+import { GroupContentsResource } from "services/groups-service/groups-service";
+import { MatchCases, ofType, unionize, UnionOf } from "common/unionize";
+import { loadRunProcessPanel } from "store/run-process-panel/run-process-panel-actions";
+import { collectionPanelActions, loadCollectionPanel } from "store/collection-panel/collection-panel-action";
+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 { loadAllProcessesPanel, allProcessesPanelActions } from "../all-processes-panel/all-processes-panel-action";
+import { allProcessesPanelColumns } from "views/all-processes-panel/all-processes-panel";
++import { TerminalIcon } from "components/icon/icon";
+import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
+import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar";
+import { multiselectActions } from "store/multiselect/multiselect-actions";
+
+export const WORKBENCH_LOADING_SCREEN = "workbenchLoadingScreen";
+
+export const isWorkbenchLoading = (state: RootState) => {
+ const progress = getProgressIndicator(WORKBENCH_LOADING_SCREEN)(state.progressIndicator);
+ return progress ? progress.working : false;
+};
+
+export const handleFirstTimeLoad = (action: any) => async (dispatch: Dispatch<any>, getState: () => RootState) => {
+ try {
+ await dispatch(action);
+ } catch (e) {
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Error " + e,
+ hideDuration: 8000,
+ kind: SnackbarKind.WARNING,
+ })
+ } finally {
+ if (isWorkbenchLoading(getState())) {
+ dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
+ }
+ }
+};
+
+export const loadWorkbench = () => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(progressIndicatorActions.START_WORKING(WORKBENCH_LOADING_SCREEN));
+ const { auth, router } = getState();
+ const { user } = auth;
+ if (user) {
+ dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
+ dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
+ dispatch(
+ allProcessesPanelActions.SET_COLUMNS({
+ columns: allProcessesPanelColumns,
+ })
+ );
+ dispatch(
+ publicFavoritePanelActions.SET_COLUMNS({
+ columns: publicFavoritePanelColumns,
+ })
+ );
+ dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
+ dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: sharedWithMePanelColumns }));
+ dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns }));
+ dispatch(
+ searchResultsPanelActions.SET_FETCH_MODE({
+ fetchMode: DataTableFetchMode.INFINITE,
+ })
+ );
+ dispatch(
+ searchResultsPanelActions.SET_COLUMNS({
+ columns: searchResultsPanelColumns,
+ })
+ );
+ dispatch(userBindedActions.SET_COLUMNS({ columns: userPanelColumns }));
+ dispatch(
+ groupPanelActions.GroupsPanelActions.SET_COLUMNS({
+ columns: groupsPanelColumns,
+ })
+ );
+ dispatch(
+ groupDetailsPanelActions.GroupMembersPanelActions.SET_COLUMNS({
+ columns: groupDetailsMembersPanelColumns,
+ })
+ );
+ dispatch(
+ groupDetailsPanelActions.GroupPermissionsPanelActions.SET_COLUMNS({
+ columns: groupDetailsPermissionsPanelColumns,
+ })
+ );
+ dispatch(
+ userProfilePanelActions.UserProfileGroupsActions.SET_COLUMNS({
+ columns: userProfileGroupsColumns,
+ })
+ );
+ dispatch(linkPanelActions.SET_COLUMNS({ columns: linkPanelColumns }));
+ dispatch(
+ apiClientAuthorizationsActions.SET_COLUMNS({
+ columns: apiClientAuthorizationPanelColumns,
+ })
+ );
+ dispatch(
+ collectionsContentAddressActions.SET_COLUMNS({
+ columns: collectionContentAddressPanelColumns,
+ })
+ );
+ dispatch(subprocessPanelActions.SET_COLUMNS({ columns: subprocessPanelColumns }));
+
+ if (services.linkAccountService.getAccountToLink()) {
+ dispatch(linkAccountPanelActions.HAS_SESSION_DATA());
+ }
+
+ dispatch<any>(initSidePanelTree());
+ if (router.location) {
+ const match = matchRootRoute(router.location.pathname);
+ if (match) {
+ dispatch<any>(navigateToRootProject);
+ }
+ }
+ } else {
+ dispatch(userIsNotAuthenticated);
+ }
+};
+
+export const loadFavorites = () =>
+ handleFirstTimeLoad((dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.FAVORITES));
+ dispatch<any>(loadFavoritePanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.FAVORITES));
+ });
+
+export const loadCollectionContentAddress = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadCollectionsContentAddressPanel());
+});
+
+export const loadTrash = () =>
+ handleFirstTimeLoad((dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
+ dispatch<any>(loadTrashPanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
+ });
+
+export const loadAllProcesses = () =>
+ handleFirstTimeLoad((dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.ALL_PROCESSES));
+ dispatch<any>(loadAllProcessesPanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.ALL_PROCESSES));
+ });
+
+export const loadProject = (uuid: string) =>
+ handleFirstTimeLoad(async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const userUuid = getUserUuid(getState());
+ dispatch(setIsProjectPanelTrashed(false));
+ if (!userUuid) {
+ return;
+ }
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid));
+ if (extractUuidKind(uuid) === ResourceKind.USER && userUuid !== uuid) {
+ // Load another users home projects
+ dispatch(finishLoadingProject(uuid));
+ } else if (userUuid !== uuid) {
+ await dispatch(finishLoadingProject(uuid));
+ const match = await loadGroupContentsResource({
+ uuid,
+ userUuid,
+ services,
+ });
+ match({
+ OWNED: async () => {
+ await dispatch(activateSidePanelTreeItem(uuid));
+ dispatch<any>(setSidePanelBreadcrumbs(uuid));
+ },
+ SHARED: async () => {
+ await dispatch(activateSidePanelTreeItem(uuid));
+ dispatch<any>(setSharedWithMeBreadcrumbs(uuid));
+ },
+ TRASHED: async () => {
+ await dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
+ dispatch<any>(setTrashBreadcrumbs(uuid));
+ dispatch(setIsProjectPanelTrashed(true));
+ },
+ });
+ } else {
+ await dispatch(finishLoadingProject(userUuid));
+ await dispatch(activateSidePanelTreeItem(userUuid));
+ dispatch<any>(setSidePanelBreadcrumbs(userUuid));
+ }
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(uuid));
+ }
+ });
+
+export const createProject = (data: projectCreateActions.ProjectCreateFormDialogData) => async (dispatch: Dispatch) => {
+ const newProject = await dispatch<any>(projectCreateActions.createProject(data));
+ if (newProject) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Project has been successfully created.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ await dispatch<any>(loadSidePanelTreeProjects(newProject.ownerUuid));
+ dispatch<any>(navigateTo(newProject.uuid));
+ }
+};
+
+export const moveProject =
+ (data: MoveToFormDialogData, isSecondaryMove = false) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const checkedList = getState().multiselect.checkedList;
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
+
+ //if no items in checkedlist default to normal context menu behavior
+ if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
+
+ const sourceUuid = getResource(data.uuid)(getState().resources)?.ownerUuid;
+ const destinationUuid = data.ownerUuid;
+
+ const projectsToMove: MoveableResource[] = uuidsToMove
+ .map(uuid => getResource(uuid)(getState().resources) as MoveableResource)
+ .filter(resource => resource.kind === ResourceKind.PROJECT);
+
+ for (const project of projectsToMove) {
+ await moveSingleProject(project);
+ }
+
+ //omly propagate if this call is the original
+ if (!isSecondaryMove) {
+ const kindsToMove: Set<string> = selectedToKindSet(checkedList);
+ kindsToMove.delete(ResourceKind.PROJECT);
+
+ kindsToMove.forEach(kind => {
+ secondaryMove[kind](data, true)(dispatch, getState, services);
+ });
+ }
+
+ async function moveSingleProject(project: MoveableResource) {
+ try {
+ const oldProject: MoveToFormDialogData = { name: project.name, uuid: project.uuid, ownerUuid: data.ownerUuid };
+ const oldOwnerUuid = oldProject ? oldProject.ownerUuid : "";
+ const movedProject = await dispatch<any>(projectMoveActions.moveProject(oldProject));
+ if (movedProject) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Project has been moved",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ await dispatch<any>(reloadProjectMatchingUuid([oldOwnerUuid, movedProject.ownerUuid, movedProject.uuid]));
+ }
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+ }
+ if (sourceUuid) await dispatch<any>(loadSidePanelTreeProjects(sourceUuid));
+ await dispatch<any>(loadSidePanelTreeProjects(destinationUuid));
+ };
+
+export const updateProject = (data: projectUpdateActions.ProjectUpdateFormDialogData) => async (dispatch: Dispatch) => {
+ const updatedProject = await dispatch<any>(projectUpdateActions.updateProject(data));
+ if (updatedProject) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Project has been successfully updated.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ await dispatch<any>(loadSidePanelTreeProjects(updatedProject.ownerUuid));
+ dispatch<any>(reloadProjectMatchingUuid([updatedProject.ownerUuid, updatedProject.uuid]));
+ }
+};
+
+export const updateGroup = (data: projectUpdateActions.ProjectUpdateFormDialogData) => async (dispatch: Dispatch) => {
+ const updatedGroup = await dispatch<any>(groupPanelActions.updateGroup(data));
+ if (updatedGroup) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Group has been successfully updated.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ await dispatch<any>(loadSidePanelTreeProjects(updatedGroup.ownerUuid));
+ dispatch<any>(reloadProjectMatchingUuid([updatedGroup.ownerUuid, updatedGroup.uuid]));
+ }
+};
+
+export const loadCollection = (uuid: string) =>
+ handleFirstTimeLoad(async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const userUuid = getUserUuid(getState());
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid));
+ if (userUuid) {
+ const match = await loadGroupContentsResource({
+ uuid,
+ userUuid,
+ services,
+ });
+ let collection: CollectionResource | undefined;
+ let breadcrumbfunc:
+ | ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>)
+ | undefined;
+ let sidepanel: string | undefined;
+ match({
+ OWNED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = collection.ownerUuid;
+ breadcrumbfunc = setSidePanelBreadcrumbs;
+ },
+ SHARED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = collection.ownerUuid;
+ breadcrumbfunc = setSharedWithMeBreadcrumbs;
+ },
+ TRASHED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = SidePanelTreeCategory.TRASH;
+ breadcrumbfunc = () => setTrashBreadcrumbs("");
+ },
+ });
+ if (collection && breadcrumbfunc && sidepanel) {
+ dispatch(updateResources([collection]));
+ await dispatch<any>(finishLoadingProject(collection.ownerUuid));
+ dispatch(collectionPanelActions.SET_COLLECTION(collection));
+ await dispatch(activateSidePanelTreeItem(sidepanel));
+ dispatch(breadcrumbfunc(collection.ownerUuid));
+ dispatch(loadCollectionPanel(collection.uuid));
+ }
+ }
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(uuid));
+ }
+ });
+
+export const createCollection = (data: collectionCreateActions.CollectionCreateFormDialogData) => async (dispatch: Dispatch) => {
+ const collection = await dispatch<any>(collectionCreateActions.createCollection(data));
+ if (collection) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Collection has been successfully created.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ dispatch<any>(updateResources([collection]));
+ dispatch<any>(navigateTo(collection.uuid));
+ }
+};
+
+export const copyCollection = (data: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const checkedList = getState().multiselect.checkedList;
+ const uuidsToCopy: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
+
+ //if no items in checkedlist && no items passed in, default to normal context menu behavior
+ if (!uuidsToCopy.length) uuidsToCopy.push(data.uuid);
+
+ const collectionsToCopy: CollectionCopyResource[] = uuidsToCopy
+ .map(uuid => getResource(uuid)(getState().resources) as CollectionCopyResource)
+ .filter(resource => resource.kind === ResourceKind.COLLECTION);
+
+ for (const collection of collectionsToCopy) {
+ await copySingleCollection({ ...collection, ownerUuid: data.ownerUuid } as CollectionCopyResource);
+ }
+
+ async function copySingleCollection(copyToProject: CollectionCopyResource) {
+ const newName = data.fromContextMenu || collectionsToCopy.length === 1 ? data.name : `Copy of: ${copyToProject.name}`;
+ try {
+ const collection = await dispatch<any>(
+ collectionCopyActions.copyCollection({
+ ...copyToProject,
+ name: newName,
+ fromContextMenu: collectionsToCopy.length === 1 ? true : data.fromContextMenu,
+ })
+ );
+ if (copyToProject && collection) {
+ await dispatch<any>(reloadProjectMatchingUuid([copyToProject.uuid]));
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Collection has been copied.",
+ hideDuration: 3000,
+ kind: SnackbarKind.SUCCESS,
+ link: collection.ownerUuid,
+ })
+ );
+ dispatch<any>(multiselectActions.deselectOne(copyToProject.uuid));
+ }
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+ }
+ dispatch(projectPanelActions.REQUEST_ITEMS());
+};
+
+export const moveCollection =
+ (data: MoveToFormDialogData, isSecondaryMove = false) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const checkedList = getState().multiselect.checkedList;
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
+
+ //if no items in checkedlist && no items passed in, default to normal context menu behavior
+ if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
+
+ const collectionsToMove: MoveableResource[] = uuidsToMove
+ .map(uuid => getResource(uuid)(getState().resources) as MoveableResource)
+ .filter(resource => resource.kind === ResourceKind.COLLECTION);
+
+ for (const collection of collectionsToMove) {
+ await moveSingleCollection(collection);
+ }
+
+ //omly propagate if this call is the original
+ if (!isSecondaryMove) {
+ const kindsToMove: Set<string> = selectedToKindSet(checkedList);
+ kindsToMove.delete(ResourceKind.COLLECTION);
+
+ kindsToMove.forEach(kind => {
+ secondaryMove[kind](data, true)(dispatch, getState, services);
+ });
+ }
+
+ async function moveSingleCollection(collection: MoveableResource) {
+ try {
+ const oldCollection: MoveToFormDialogData = { name: collection.name, uuid: collection.uuid, ownerUuid: data.ownerUuid };
+ const movedCollection = await dispatch<any>(collectionMoveActions.moveCollection(oldCollection));
+ dispatch<any>(updateResources([movedCollection]));
+ dispatch<any>(reloadProjectMatchingUuid([movedCollection.ownerUuid]));
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Collection has been moved.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+ }
+ };
+
+export const loadProcess = (uuid: string) =>
+ handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState) => {
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid));
+ dispatch<any>(loadProcessPanel(uuid));
+ const process = await dispatch<any>(processesActions.loadProcess(uuid));
+ if (process) {
+ await dispatch<any>(finishLoadingProject(process.containerRequest.ownerUuid));
+ await dispatch<any>(activateSidePanelTreeItem(process.containerRequest.ownerUuid));
+ dispatch<any>(setProcessBreadcrumbs(uuid));
+ dispatch<any>(loadDetailsPanel(uuid));
+ }
+ } finally {
+ dispatch(progressIndicatorActions.STOP_WORKING(uuid));
+ }
+ });
+
+export const loadRegisteredWorkflow = (uuid: string) =>
+ handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const userUuid = getUserUuid(getState());
+ if (userUuid) {
+ const match = await loadGroupContentsResource({
+ uuid,
+ userUuid,
+ services,
+ });
+ let workflow: WorkflowResource | undefined;
+ let breadcrumbfunc:
+ | ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>)
+ | undefined;
+ match({
+ OWNED: async theworkflow => {
+ workflow = theworkflow as WorkflowResource;
+ breadcrumbfunc = setSidePanelBreadcrumbs;
+ },
+ SHARED: async theworkflow => {
+ workflow = theworkflow as WorkflowResource;
+ breadcrumbfunc = setSharedWithMeBreadcrumbs;
+ },
+ TRASHED: () => { },
+ });
+ if (workflow && breadcrumbfunc) {
+ dispatch(updateResources([workflow]));
+ await dispatch<any>(finishLoadingProject(workflow.ownerUuid));
+ await dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
+ dispatch<any>(breadcrumbfunc(workflow.ownerUuid));
+ }
+ }
+ });
+
+export const updateProcess = (data: processUpdateActions.ProcessUpdateFormDialogData) => async (dispatch: Dispatch) => {
+ try {
+ const process = await dispatch<any>(processUpdateActions.updateProcess(data));
+ if (process) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Process has been successfully updated.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ dispatch<any>(updateResources([process]));
+ dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
+ }
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+};
+
+export const moveProcess =
+ (data: MoveToFormDialogData, isSecondaryMove = false) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const checkedList = getState().multiselect.checkedList;
+ const uuidsToMove: string[] = data.fromContextMenu ? [data.uuid] : selectedToArray(checkedList);
+
+ //if no items in checkedlist && no items passed in, default to normal context menu behavior
+ if (!isSecondaryMove && !uuidsToMove.length) uuidsToMove.push(data.uuid);
+
+ const processesToMove: MoveableResource[] = uuidsToMove
+ .map(uuid => getResource(uuid)(getState().resources) as MoveableResource)
+ .filter(resource => resource.kind === ResourceKind.PROCESS);
+
+ for (const process of processesToMove) {
+ await moveSingleProcess(process);
+ }
+
+ //omly propagate if this call is the original
+ if (!isSecondaryMove) {
+ const kindsToMove: Set<string> = selectedToKindSet(checkedList);
+ kindsToMove.delete(ResourceKind.PROCESS);
+
+ kindsToMove.forEach(kind => {
+ secondaryMove[kind](data, true)(dispatch, getState, services);
+ });
+ }
+
+ async function moveSingleProcess(process: MoveableResource) {
+ try {
+ const oldProcess: MoveToFormDialogData = { name: process.name, uuid: process.uuid, ownerUuid: data.ownerUuid };
+ const movedProcess = await dispatch<any>(processMoveActions.moveProcess(oldProcess));
+ dispatch<any>(updateResources([movedProcess]));
+ dispatch<any>(reloadProjectMatchingUuid([movedProcess.ownerUuid]));
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Process has been moved.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+ }
+ };
+
+export const copyProcess = (data: CopyFormDialogData) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ const process = await dispatch<any>(processCopyActions.copyProcess(data));
+ dispatch<any>(updateResources([process]));
+ dispatch<any>(reloadProjectMatchingUuid([process.ownerUuid]));
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: "Process has been copied.",
+ hideDuration: 2000,
+ kind: SnackbarKind.SUCCESS,
+ })
+ );
+ dispatch<any>(navigateTo(process.uuid));
+ } catch (e) {
+ dispatch(
+ snackbarActions.OPEN_SNACKBAR({
+ message: e.message,
+ hideDuration: 2000,
+ kind: SnackbarKind.ERROR,
+ })
+ );
+ }
+};
+
+export const resourceIsNotLoaded = (uuid: string) =>
+ snackbarActions.OPEN_SNACKBAR({
+ message: `Resource identified by ${uuid} is not loaded.`,
+ kind: SnackbarKind.ERROR,
+ });
+
+export const userIsNotAuthenticated = snackbarActions.OPEN_SNACKBAR({
+ message: "User is not authenticated",
+ kind: SnackbarKind.ERROR,
+});
+
+export const couldNotLoadUser = snackbarActions.OPEN_SNACKBAR({
+ message: "Could not load user",
+ kind: SnackbarKind.ERROR,
+});
+
+export const reloadProjectMatchingUuid =
+ (matchingUuids: string[]) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ const currentProjectPanelUuid = getProjectPanelCurrentUuid(getState());
+ if (currentProjectPanelUuid && matchingUuids.some(uuid => uuid === currentProjectPanelUuid)) {
+ dispatch<any>(loadProject(currentProjectPanelUuid));
+ }
+ };
+
+export const loadSharedWithMe = handleFirstTimeLoad(async (dispatch: Dispatch) => {
+ dispatch<any>(loadSharedWithMePanel());
+ await dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME));
+ await dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.SHARED_WITH_ME));
+});
+
+export const loadRunProcess = handleFirstTimeLoad(async (dispatch: Dispatch) => {
+ await dispatch<any>(loadRunProcessPanel());
+});
+
+export const loadPublicFavorites = () =>
+ handleFirstTimeLoad((dispatch: Dispatch) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.PUBLIC_FAVORITES));
+ dispatch<any>(loadPublicFavoritePanel());
+ dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.PUBLIC_FAVORITES));
+ });
+
+export const loadSearchResults = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadSearchResultsPanel());
+});
+
+export const loadLinks = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadLinkPanel());
+});
+
+export const loadVirtualMachines = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadVirtualMachinesPanel());
+ dispatch(setVirtualMachinesBreadcrumbs());
+});
+
+export const loadVirtualMachinesAdmin = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadVirtualMachinesPanel());
+ dispatch(setVirtualMachinesAdminBreadcrumbs());
+});
+
+export const loadRepositories = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadRepositoriesPanel());
+ dispatch(setRepositoriesBreadcrumbs());
+});
+
+export const loadSshKeys = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadSshKeysPanel());
+});
+
+export const loadInstanceTypes = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.INSTANCE_TYPES));
+ dispatch(setInstanceTypesBreadcrumbs());
+});
+
+export const loadSiteManager = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadSiteManagerPanel());
+});
+
+export const loadUserProfile = (userUuid?: string) =>
+ handleFirstTimeLoad((dispatch: Dispatch<any>) => {
+ if (userUuid) {
+ dispatch(setUserProfileBreadcrumbs(userUuid));
+ dispatch(userProfilePanelActions.loadUserProfilePanel(userUuid));
+ } else {
+ dispatch(setMyAccountBreadcrumbs());
+ dispatch(userProfilePanelActions.loadUserProfilePanel());
+ }
+ });
+
+export const loadLinkAccount = handleFirstTimeLoad((dispatch: Dispatch<any>) => {
+ dispatch(loadLinkAccountPanel());
+});
+
+export const loadKeepServices = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadKeepServicesPanel());
+});
+
+export const loadUsers = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadUsersPanel());
+ dispatch(setUsersBreadcrumbs());
+});
+
+export const loadApiClientAuthorizations = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
+ await dispatch(loadApiClientAuthorizationsPanel());
+});
+
+export const loadGroupsPanel = handleFirstTimeLoad((dispatch: Dispatch<any>) => {
+ dispatch(setGroupsBreadcrumbs());
+ dispatch(groupPanelActions.loadGroupsPanel());
+});
+
+export const loadGroupDetailsPanel = (groupUuid: string) =>
+ handleFirstTimeLoad((dispatch: Dispatch<any>) => {
+ dispatch(setGroupDetailsBreadcrumbs(groupUuid));
+ dispatch(groupDetailsPanelActions.loadGroupDetailsPanel(groupUuid));
+ });
+
+const finishLoadingProject = (project: GroupContentsResource | string) => async (dispatch: Dispatch<any>) => {
+ const uuid = typeof project === "string" ? project : project.uuid;
+ dispatch(loadDetailsPanel(uuid));
+ if (typeof project !== "string") {
+ dispatch(updateResources([project]));
+ }
+};
+
+const loadGroupContentsResource = async (params: { uuid: string; userUuid: string; services: ServiceRepository }) => {
+ const filters = new FilterBuilder().addEqual("uuid", params.uuid).getFilters();
+ const { items } = await params.services.groupsService.contents(params.userUuid, {
+ filters,
+ recursive: true,
+ includeTrash: true,
+ });
+ const resource = items.shift();
+ let handler: GroupContentsHandler;
+ if (resource) {
+ handler =
+ (resource.kind === ResourceKind.COLLECTION || resource.kind === ResourceKind.PROJECT) && resource.isTrashed
+ ? groupContentsHandlers.TRASHED(resource)
+ : groupContentsHandlers.OWNED(resource);
+ } else {
+ const kind = extractUuidKind(params.uuid);
+ let resource: GroupContentsResource;
+ if (kind === ResourceKind.COLLECTION) {
+ resource = await params.services.collectionService.get(params.uuid);
+ } else if (kind === ResourceKind.PROJECT) {
+ resource = await params.services.projectService.get(params.uuid);
+ } else if (kind === ResourceKind.WORKFLOW) {
+ resource = await params.services.workflowService.get(params.uuid);
+ } else if (kind === ResourceKind.CONTAINER_REQUEST) {
+ resource = await params.services.containerRequestService.get(params.uuid);
+ } else {
+ throw new Error("loadGroupContentsResource unsupported kind " + kind);
+ }
+ handler = groupContentsHandlers.SHARED(resource);
+ }
+ return (cases: MatchCases<typeof groupContentsHandlersRecord, GroupContentsHandler, void>) => groupContentsHandlers.match(handler, cases);
+};
+
+const groupContentsHandlersRecord = {
+ TRASHED: ofType<GroupContentsResource>(),
+ SHARED: ofType<GroupContentsResource>(),
+ OWNED: ofType<GroupContentsResource>(),
+};
+
+const groupContentsHandlers = unionize(groupContentsHandlersRecord);
+
+type GroupContentsHandler = UnionOf<typeof groupContentsHandlers>;
+
+type CollectionCopyResource = Resource & { name: string; fromContextMenu: boolean };
+
+type MoveableResource = Resource & { name: string };
+
+type MoveFunc = (
+ data: MoveToFormDialogData,
+ isSecondaryMove?: boolean
+) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>;
+
+const secondaryMove: Record<string, MoveFunc> = {
+ [ResourceKind.PROJECT]: moveProject,
+ [ResourceKind.PROCESS]: moveProcess,
+ [ResourceKind.COLLECTION]: moveCollection,
+};
diff --cc services/workbench2/src/views-components/main-app-bar/account-menu.tsx
index 02dd54f1c4,0000000000..3ff3aaedeb
mode 100644,000000..100644
--- a/services/workbench2/src/views-components/main-app-bar/account-menu.tsx
+++ b/services/workbench2/src/views-components/main-app-bar/account-menu.tsx
@@@ -1,91 -1,0 +1,96 @@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import React from "react";
+import { MenuItem, Divider } from "@material-ui/core";
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { User, getUserDisplayName } from "models/user";
+import { DropdownMenu } from "components/dropdown-menu/dropdown-menu";
+import { UserPanelIcon } from "components/icon/icon";
+import { DispatchProp, connect } from 'react-redux';
+import { authActions, getNewExtraToken } from 'store/auth/auth-action';
+import { RootState } from "store/store";
+import { openTokenDialog } from 'store/token-dialog/token-dialog-actions';
+import { openRepositoriesPanel } from "store/repositories/repositories-actions";
+import {
+ navigateToSiteManager,
+ navigateToSshKeysUser,
+ navigateToMyAccount,
+ navigateToLinkAccount,
+} from 'store/navigation/navigation-action';
+import { openUserVirtualMachines } from "store/virtual-machines/virtual-machines-actions";
+import { pluginConfig } from 'plugins';
+import { ElementListReducer } from 'common/plugintypes';
++import { treePickerActions } from "store/tree-picker/tree-picker-actions";
++import { SIDE_PANEL_TREE, SidePanelTreeCategory } from "store/side-panel-tree/side-panel-tree-actions";
+
+interface AccountMenuProps {
+ user?: User;
+ currentRoute: string;
+ workbenchURL: string;
+ apiToken?: string;
+ localCluster: string;
+}
+
+const mapStateToProps = (state: RootState): AccountMenuProps => ({
+ user: state.auth.user,
+ currentRoute: state.router.location ? state.router.location.pathname : '',
+ workbenchURL: state.auth.config.workbenchUrl,
+ apiToken: state.auth.apiToken,
+ localCluster: state.auth.localCluster
+});
+
+type CssRules = 'link';
+
+const styles: StyleRulesCallback<CssRules> = () => ({
+ link: {
+ textDecoration: 'none',
+ color: 'inherit'
+ }
+});
+
+export const AccountMenuComponent =
+ ({ user, dispatch, currentRoute, workbenchURL, apiToken, localCluster, classes }: AccountMenuProps & DispatchProp<any> & WithStyles<CssRules>) => {
+ let accountMenuItems = <>
- <MenuItem onClick={() => dispatch(openUserVirtualMachines())}>Virtual Machines</MenuItem>
++ <MenuItem onClick={() => {
++ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({id: SidePanelTreeCategory.SHELL_ACCESS, pickerId: SIDE_PANEL_TREE} ))
++ dispatch(openUserVirtualMachines())
++ }}>Shell Access</MenuItem>
+ <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
+ <MenuItem onClick={() => {
+ dispatch<any>(getNewExtraToken(true));
+ dispatch(openTokenDialog);
+ }}>Get API token</MenuItem>
+ <MenuItem onClick={() => dispatch(navigateToSshKeysUser)}>Ssh Keys</MenuItem>
+ <MenuItem onClick={() => dispatch(navigateToSiteManager)}>Site Manager</MenuItem>
+ <MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>
+ <MenuItem onClick={() => dispatch(navigateToLinkAccount)}>Link account</MenuItem>
+ </>;
+
+ const reduceItemsFn: (a: React.ReactElement[],
+ b: ElementListReducer) => React.ReactElement[] = (a, b) => b(a);
+
+ accountMenuItems = React.createElement(React.Fragment, null,
+ pluginConfig.accountMenuList.reduce(reduceItemsFn, React.Children.toArray(accountMenuItems.props.children)));
+
+ return user
+ ? <DropdownMenu
+ icon={<UserPanelIcon />}
+ id="account-menu"
+ title="Account Management"
+ key={currentRoute}>
+ <MenuItem disabled>
+ {getUserDisplayName(user)} {user.uuid.substring(0, 5) !== localCluster && `(${user.uuid.substring(0, 5)})`}
+ </MenuItem>
+ {user.isActive && accountMenuItems}
+ <Divider />
+ <MenuItem data-cy="logout-menuitem"
+ onClick={() => dispatch(authActions.LOGOUT({ deleteLinkData: true, preservePath: false }))}>
+ Logout
+ </MenuItem>
+ </DropdownMenu>
+ : null;
+ };
+
+export const AccountMenu = withStyles(styles)(connect(mapStateToProps)(AccountMenuComponent));
diff --cc services/workbench2/src/views-components/side-panel/side-panel-collapsed.tsx
index 9948ace35d,0000000000..a40c64b3b7
mode 100644,000000..100644
--- a/services/workbench2/src/views-components/side-panel/side-panel-collapsed.tsx
+++ b/services/workbench2/src/views-components/side-panel/side-panel-collapsed.tsx
@@@ -1,165 -1,0 +1,166 @@@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import React, { ReactElement } from 'react'
+import { connect } from 'react-redux'
+import { ProjectsIcon, ProcessIcon, FavoriteIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon, ResourceIcon } from 'components/icon/icon'
+import { TerminalIcon } from 'components/icon/icon'
+import { IconButton, List, ListItem, Tooltip } from '@material-ui/core'
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'
+import { ArvadosTheme } from 'common/custom-theme'
+import { navigateTo, navigateToInstanceTypes } from 'store/navigation/navigation-action'
+import { RootState } from 'store/store'
+import { Dispatch } from 'redux'
+import {
+ navigateToSharedWithMe,
+ navigateToPublicFavorites,
+ navigateToFavorites,
+ navigateToGroups,
+ navigateToAllProcesses,
+ navigateToTrash,
+} from 'store/navigation/navigation-action'
+import { navigateToUserVirtualMachines } from 'store/navigation/navigation-action'
+import { RouterAction } from 'react-router-redux'
+import { User } from 'models/user'
++import { SidePanelTreeCategory } from 'store/side-panel-tree/side-panel-tree-actions'
+
+type CssRules = 'button' | 'unselected' | 'selected'
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ button: {
+ width: '40px',
+ height: '40px',
+ paddingLeft: '-2rem',
+ marginLeft: '-0.6rem',
+ marginBottom: '-1rem'
+ },
+ unselected: {
+ color: theme.customs.colors.grey600,
+ },
+ selected: {
+ color: theme.palette.primary.main,
+ },
+})
+
+enum SidePanelCollapsedCategory {
+ PROJECTS = 'Home Projects',
+ FAVORITES = 'My Favorites',
+ PUBLIC_FAVORITES = 'Public Favorites',
+ SHARED_WITH_ME = 'Shared with me',
+ ALL_PROCESSES = 'All Processes',
+ INSTANCE_TYPES = 'Instance Types',
+ SHELL_ACCESS = 'Shell Access',
+ GROUPS = 'Groups',
+ TRASH = 'Trash',
+}
+
+type TCollapsedCategory = {
+ name: SidePanelCollapsedCategory
+ icon: ReactElement
+ navTarget: RouterAction | ''
+}
+
+const sidePanelCollapsedCategories: TCollapsedCategory[] = [
+ {
+ name: SidePanelCollapsedCategory.PROJECTS,
+ icon: <ProjectsIcon />,
+ navTarget: '',
+ },
+ {
+ name: SidePanelCollapsedCategory.FAVORITES,
+ icon: <FavoriteIcon />,
+ navTarget: navigateToFavorites,
+ },
+ {
+ name: SidePanelCollapsedCategory.PUBLIC_FAVORITES,
+ icon: <PublicFavoriteIcon />,
+ navTarget: navigateToPublicFavorites,
+ },
+ {
+ name: SidePanelCollapsedCategory.SHARED_WITH_ME,
+ icon: <ShareMeIcon />,
+ navTarget: navigateToSharedWithMe,
+ },
+ {
+ name: SidePanelCollapsedCategory.ALL_PROCESSES,
+ icon: <ProcessIcon />,
+ navTarget: navigateToAllProcesses,
+ },
+ {
+ name: SidePanelCollapsedCategory.INSTANCE_TYPES,
+ icon: <ResourceIcon />,
+ navTarget: navigateToInstanceTypes,
+ },
+ {
+ name: SidePanelCollapsedCategory.SHELL_ACCESS,
+ icon: <TerminalIcon />,
+ navTarget: navigateToUserVirtualMachines,
+ },
+ {
+ name: SidePanelCollapsedCategory.GROUPS,
+ icon: <GroupsIcon style={{marginLeft: '2px', scale: '85%'}}/>,
+ navTarget: navigateToGroups,
+ },
+ {
+ name: SidePanelCollapsedCategory.TRASH,
+ icon: <TrashIcon />,
+ navTarget: navigateToTrash,
+ },
+]
+
+type SidePanelCollapsedProps = {
+ user: User;
+ selectedPath: string;
+ navToHome: (uuid: string) => void;
+ navTo: (navTarget: RouterAction | '') => void;
+};
+
+const mapStateToProps = ({auth, properties }: RootState) => {
+ return {
+ user: auth.user,
+ selectedPath: properties.breadcrumbs
- ? properties.breadcrumbs[0].label !== 'Virtual Machines'
++ ? properties.breadcrumbs[0].label !== SidePanelTreeCategory.SHELL_ACCESS
+ ? properties.breadcrumbs[0].label
+ : SidePanelCollapsedCategory.SHELL_ACCESS
+ : SidePanelCollapsedCategory.PROJECTS,
+ }
+}
+
+const mapDispatchToProps = (dispatch: Dispatch) => {
+ return {
+ navToHome: (navTarget) => dispatch<any>(navigateTo(navTarget)),
+ navTo: (navTarget) => dispatch<any>(navTarget),
+ }
+}
+
+export const SidePanelCollapsed = withStyles(styles)(
+ connect(mapStateToProps, mapDispatchToProps)(({ classes, user, selectedPath, navToHome, navTo }: WithStyles & SidePanelCollapsedProps) => {
+
+ const handleClick = (cat: TCollapsedCategory) => {
+ if (cat.name === SidePanelCollapsedCategory.PROJECTS) navToHome(user.uuid)
+ else navTo(cat.navTarget)
+ }
+
+ const { button, unselected, selected } = classes
+ return (
+ <List data-cy='side-panel-collapsed'>
+ {sidePanelCollapsedCategories.map((cat) => (
+ <ListItem
+ key={cat.name}
+ data-cy={`collapsed-${cat.name.toLowerCase().replace(/\s+/g, '-')}`}
+ onClick={() => handleClick(cat)}
+ >
+ <Tooltip
+ className={selectedPath === cat.name ? selected : unselected}
+ title={cat.name}
+ disableFocusListener
+ >
+ <IconButton className={button}>{cat.icon}</IconButton>
+ </Tooltip>
+ </ListItem>
+ ))}
+ </List>
+ );
+ })
+)
commit 2efa65c6c45d20d3f0a1ad1a82511ba82f917cd3
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Wed Dec 20 11:38:36 2023 -0500
21200: modified virtual machine int test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/cypress/integration/virtual-machine-admin.spec.js b/cypress/integration/virtual-machine-admin.spec.js
index 92011b208e..f0f5f6b9b3 100644
--- a/cypress/integration/virtual-machine-admin.spec.js
+++ b/cypress/integration/virtual-machine-admin.spec.js
@@ -31,7 +31,7 @@ describe("Virtual machine login manage tests", function () {
// Navigate to VM admin
cy.get('header button[title="Admin Panel"]').click();
- cy.get("#admin-menu").contains("Virtual Machines").click();
+ cy.get("#admin-menu").contains("Shell Access").click();
// Add login permission to admin
cy.get("[data-cy=vm-admin-table]")
@@ -114,7 +114,7 @@ describe("Virtual machine login manage tests", function () {
// Check admin's vm page for login
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-table]")
.contains(vmHost)
@@ -129,7 +129,7 @@ describe("Virtual machine login manage tests", function () {
// Check activeUser's vm page for login
cy.loginAs(activeUser);
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-table]")
.contains(vmHost)
@@ -144,7 +144,7 @@ describe("Virtual machine login manage tests", function () {
// Edit login permissions
cy.loginAs(adminUser);
cy.get('header button[title="Admin Panel"]').click();
- cy.get("#admin-menu").contains("Virtual Machines").click();
+ cy.get("#admin-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-admin-table]").contains("admin"); // Wait for page to finish
@@ -193,7 +193,7 @@ describe("Virtual machine login manage tests", function () {
// Verify new login permissions
// Check admin's vm page for login
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-table]")
.contains(vmHost)
@@ -209,7 +209,7 @@ describe("Virtual machine login manage tests", function () {
// Check activeUser's vm page for login
cy.loginAs(activeUser);
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-table]")
.contains(vmHost)
@@ -224,7 +224,7 @@ describe("Virtual machine login manage tests", function () {
// Remove login permissions
cy.loginAs(adminUser);
cy.get('header button[title="Admin Panel"]').click();
- cy.get("#admin-menu").contains("Virtual Machines").click();
+ cy.get("#admin-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-admin-table]").contains("user"); // Wait for page to finish
@@ -258,14 +258,14 @@ describe("Virtual machine login manage tests", function () {
// Check admin's vm page for login
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-panel]").should("not.contain", vmHost);
// Check activeUser's vm page for login
cy.loginAs(activeUser);
cy.get('header button[title="Account Management"]').click();
- cy.get("#account-menu").contains("Virtual Machines").click();
+ cy.get("#account-menu").contains("Shell Access").click();
cy.get("[data-cy=vm-user-panel]").should("not.contain", vmHost);
});
commit f098defc059dbd372e03ec9cdbef13ed034c55cd
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Wed Dec 20 10:16:24 2023 -0500
21200: modified unit test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/components/breadcrumbs/breadcrumbs.test.tsx b/src/components/breadcrumbs/breadcrumbs.test.tsx
index f17ce3936d..dfc52860f2 100644
--- a/src/components/breadcrumbs/breadcrumbs.test.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.test.tsx
@@ -77,7 +77,7 @@ describe("<Breadcrumbs />", () => {
</MuiThemeProvider>
</Provider>);
breadcrumbs.find(Button).at(1).simulate('click');
- expect(onClick).toBeCalledWith(items[1]);
+ expect(onClick).toHaveBeenCalledWith(expect.any(Function), items[1]);
});
});
commit 2361e41b4fe1174ecc81447a58a3aec02d2fc67f
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Dec 19 15:02:32 2023 -0500
21128: fixed faulty breadcrumb naming Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/store/breadcrumbs/breadcrumbs-actions.ts b/src/store/breadcrumbs/breadcrumbs-actions.ts
index cd4b1a627a..8ff4a0458b 100644
--- a/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/src/store/breadcrumbs/breadcrumbs-actions.ts
@@ -30,7 +30,8 @@ export const BREADCRUMBS = 'breadcrumbs';
export const setBreadcrumbs = (breadcrumbs: any, currentItem?: CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource) => {
if (currentItem) {
- breadcrumbs.push(resourceToBreadcrumb(currentItem));
+ const currentCrumb = resourceToBreadcrumb(currentItem)
+ if (currentCrumb.label.length) breadcrumbs.push(currentCrumb);
}
return propertiesActions.SET_PROPERTY({ key: BREADCRUMBS, value: breadcrumbs });
};
commit 485fbd2f20a94147d5a2cb533defa8c42c0abca8
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Dec 19 14:18:35 2023 -0500
21128: fixed breadcrumb nav to group Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index baf84d1da2..effcd543e8 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -9,10 +9,11 @@ import { withStyles } from '@material-ui/core';
import { IllegalNamingWarning } from '../warning/warning';
import { IconType, FreezeIcon } from 'components/icon/icon';
import grey from '@material-ui/core/colors/grey';
-import { ResourcesState } from 'store/resources/resources';
+import { getResource, ResourcesState } from 'store/resources/resources';
import classNames from 'classnames';
import { ArvadosTheme } from 'common/custom-theme';
-
+import { GroupClass } from "models/group";
+import { navigateTo, navigateToGroupDetails } from 'store/navigation/navigation-action';
export interface Breadcrumb {
label: string;
icon?: IconType;
@@ -59,7 +60,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
export interface BreadcrumbsProps {
items: Breadcrumb[];
resources: ResourcesState;
- onClick: (breadcrumb: Breadcrumb) => void;
+ onClick: (navFunc: (uuid: string) => void, breadcrumb: Breadcrumb) => void;
onContextMenu: (event: React.MouseEvent<HTMLElement>, breadcrumb: Breadcrumb) => void;
}
@@ -71,6 +72,9 @@ export const Breadcrumbs = withStyles(styles)(
const isLastItem = index === items.length - 1;
const isFirstItem = index === 0;
const Icon = item.icon || (() => (null));
+ const resource = getResource(item.uuid)(resources) as any;
+ const navFunc = resource && 'groupClass' in resource && resource.groupClass === GroupClass.ROLE ? navigateToGroupDetails : navigateTo;
+
return (
<React.Fragment key={index}>
{isFirstItem ? null : <IllegalNamingWarning name={item.label} />}
@@ -90,7 +94,7 @@ export const Breadcrumbs = withStyles(styles)(
label: classes.buttonLabel
}}
color="inherit"
- onClick={() => onClick(item)}
+ onClick={() => onClick(navFunc, item)}
onContextMenu={event => onContextMenu(event, item)}>
<Icon className={classes.icon} />
<Typography
diff --git a/src/views-components/breadcrumbs/breadcrumbs.ts b/src/views-components/breadcrumbs/breadcrumbs.ts
index 0334097d2e..7e78aace1b 100644
--- a/src/views-components/breadcrumbs/breadcrumbs.ts
+++ b/src/views-components/breadcrumbs/breadcrumbs.ts
@@ -6,7 +6,6 @@ import { connect } from "react-redux";
import { Breadcrumb, Breadcrumbs as BreadcrumbsComponent, BreadcrumbsProps } from 'components/breadcrumbs/breadcrumbs';
import { RootState } from 'store/store';
import { Dispatch } from 'redux';
-import { navigateTo } from 'store/navigation/navigation-action';
import { getProperty } from '../../store/properties/properties';
import { BREADCRUMBS } from '../../store/breadcrumbs/breadcrumbs-actions';
import { openSidePanelContextMenu } from 'store/context-menu/context-menu-actions';
@@ -20,8 +19,8 @@ const mapStateToProps = () => ({ properties, resources }: RootState): Breadcrumb
});
const mapDispatchToProps = (dispatch: Dispatch): BreadcrumbsActionProps => ({
- onClick: ({ uuid }: Breadcrumb) => {
- dispatch<any>(navigateTo(uuid));
+ onClick: (navFunc, { uuid }: Breadcrumb) => {
+ dispatch<any>(navFunc(uuid));
},
onContextMenu: (event, breadcrumb: Breadcrumb) => {
dispatch<any>(openSidePanelContextMenu(event, breadcrumb.uuid));
commit 4382b235020c3ac011170489fba4ce563b208dd0
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Dec 19 13:37:17 2023 -0500
21128: stopped new breadcrumb when navigating to home Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 16c5b37906..0e0db4b8f0 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -513,8 +513,7 @@ const getResourceDisplayName = (resource: Resource): string => {
}
};
-const renderResourceLink = (dispatch: Dispatch, item: Resource, breadcrumbs: any[] = []) => {
- console.log(item)
+const renderResourceLink = (dispatch: Dispatch, item: Resource, userUuid: string = '', breadcrumbs: any[] = []) => {
var displayName = getResourceDisplayName(item);
return (
@@ -525,7 +524,9 @@ const renderResourceLink = (dispatch: Dispatch, item: Resource, breadcrumbs: any
onClick={() => {
item.kind === ResourceKind.GROUP && (item as GroupResource).groupClass === "role"
? dispatch<any>(navigateToGroupDetails(item.uuid))
- : dispatch<any>(navigateTo(item.uuid)); setBreadcrumbs(breadcrumbs, item as any);
+ : dispatch<any>(navigateTo(item.uuid));
+ //don't add breadcrumb when navigating to 'Home Projects'
+ if (item.uuid !== userUuid) setBreadcrumbs(breadcrumbs, item as any);
}}
>
{resourceLabel(item.kind, item && item.kind === ResourceKind.GROUP ? (item as GroupResource).groupClass || "" : "")}:{" "}
@@ -537,12 +538,14 @@ const renderResourceLink = (dispatch: Dispatch, item: Resource, breadcrumbs: any
export const ResourceLinkTail = connect((state: RootState, props: { uuid: string }) => {
const resource = getResource<LinkResource>(props.uuid)(state.resources);
const tailResource = getResource<Resource>(resource?.tailUuid || "")(state.resources);
+ const userUuid = state.auth.user?.uuid
return {
item: tailResource || { uuid: resource?.tailUuid || "", kind: resource?.tailKind || ResourceKind.NONE },
- breadcrumbs: state.properties.breadcrumbs || []
+ breadcrumbs: state.properties.breadcrumbs || [],
+ userUuid
};
-})((props: { item: Resource, breadcrumbs: any[] } & DispatchProp<any>) => renderResourceLink(props.dispatch, props.item, props.breadcrumbs));
+})((props: { item: Resource, userUuid: string, breadcrumbs: any[] } & DispatchProp<any>) => renderResourceLink(props.dispatch, props.item, props.userUuid, props.breadcrumbs));
export const ResourceLinkHead = connect((state: RootState, props: { uuid: string }) => {
const resource = getResource<LinkResource>(props.uuid)(state.resources);
commit 46aa19c9021558faed73dac266d9d96b1cff9ac1
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Tue Dec 19 13:20:30 2023 -0500
21128: breadcrmubs now shows user name when viewing user page Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/store/breadcrumbs/breadcrumbs-actions.ts b/src/store/breadcrumbs/breadcrumbs-actions.ts
index 5f82af3eb5..cd4b1a627a 100644
--- a/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/src/store/breadcrumbs/breadcrumbs-actions.ts
@@ -50,8 +50,8 @@ const resourceToBreadcrumbIcon = (resource: CollectionResource | ContainerReques
}
}
-const resourceToBreadcrumb = (resource: CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource): Breadcrumb => ({
- label: resource.name,
+const resourceToBreadcrumb = (resource: (CollectionResource | ContainerRequestResource | GroupResource | WorkflowResource) & {fullName?: string} ): Breadcrumb => ({
+ label: resource.name || resource.fullName || '',
uuid: resource.uuid,
icon: resourceToBreadcrumbIcon(resource),
})
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 2cbf038abb..16c5b37906 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -53,6 +53,7 @@ import { VirtualMachinesResource } from "models/virtual-machines";
import { CopyToClipboardSnackbar } from "components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar";
import { ProjectResource } from "models/project";
import { ProcessResource } from "models/process";
+import { setBreadcrumbs } from "store/breadcrumbs/breadcrumbs-actions";
const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
const navFunc = "groupClass" in item && item.groupClass === GroupClass.ROLE ? navigateToGroupDetails : navigateTo;
@@ -512,7 +513,8 @@ const getResourceDisplayName = (resource: Resource): string => {
}
};
-const renderResourceLink = (dispatch: Dispatch, item: Resource) => {
+const renderResourceLink = (dispatch: Dispatch, item: Resource, breadcrumbs: any[] = []) => {
+ console.log(item)
var displayName = getResourceDisplayName(item);
return (
@@ -523,7 +525,7 @@ const renderResourceLink = (dispatch: Dispatch, item: Resource) => {
onClick={() => {
item.kind === ResourceKind.GROUP && (item as GroupResource).groupClass === "role"
? dispatch<any>(navigateToGroupDetails(item.uuid))
- : dispatch<any>(navigateTo(item.uuid));
+ : dispatch<any>(navigateTo(item.uuid)); setBreadcrumbs(breadcrumbs, item as any);
}}
>
{resourceLabel(item.kind, item && item.kind === ResourceKind.GROUP ? (item as GroupResource).groupClass || "" : "")}:{" "}
@@ -538,8 +540,9 @@ export const ResourceLinkTail = connect((state: RootState, props: { uuid: string
return {
item: tailResource || { uuid: resource?.tailUuid || "", kind: resource?.tailKind || ResourceKind.NONE },
+ breadcrumbs: state.properties.breadcrumbs || []
};
-})((props: { item: Resource } & DispatchProp<any>) => renderResourceLink(props.dispatch, props.item));
+})((props: { item: Resource, breadcrumbs: any[] } & DispatchProp<any>) => renderResourceLink(props.dispatch, props.item, props.breadcrumbs));
export const ResourceLinkHead = connect((state: RootState, props: { uuid: string }) => {
const resource = getResource<LinkResource>(props.uuid)(state.resources);
commit 255734af1fb681dc7dda5de0cd5047e7159256ba
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Wed Dec 13 11:46:58 2023 -0500
21200: changed user name breadcrumb to first & last instead of username Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/store/breadcrumbs/breadcrumbs-actions.ts b/src/store/breadcrumbs/breadcrumbs-actions.ts
index 9aebeb904c..5f82af3eb5 100644
--- a/src/store/breadcrumbs/breadcrumbs-actions.ts
+++ b/src/store/breadcrumbs/breadcrumbs-actions.ts
@@ -270,7 +270,7 @@ export const setUserProfileBreadcrumbs = (userUuid: string) =>
|| await services.userService.get(userUuid, false);
const breadcrumbs: Breadcrumb[] = [
{ label: USERS_PANEL_LABEL, uuid: USERS_PANEL_LABEL },
- { label: user ? user.username : userUuid, uuid: userUuid },
+ { label: user ? `${user.firstName} ${user.lastName}` : userUuid, uuid: userUuid },
];
dispatch(setBreadcrumbs(breadcrumbs));
} catch (e) {
commit 1229eaa4ed3692fa198b4b4ceb6da529f46f7ba9
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Wed Dec 13 11:31:24 2023 -0500
21200: added sidepanel highlight for shell access select from account & admin menus Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/views-components/main-app-bar/account-menu.tsx b/src/views-components/main-app-bar/account-menu.tsx
index 68afef2226..37c2c7a50f 100644
--- a/src/views-components/main-app-bar/account-menu.tsx
+++ b/src/views-components/main-app-bar/account-menu.tsx
@@ -22,6 +22,8 @@ import {
import { openUserVirtualMachines } from "store/virtual-machines/virtual-machines-actions";
import { pluginConfig } from 'plugins';
import { ElementListReducer } from 'common/plugintypes';
+import { treePickerActions } from "store/tree-picker/tree-picker-actions";
+import { SIDE_PANEL_TREE, SidePanelTreeCategory } from "store/side-panel-tree/side-panel-tree-actions";
interface AccountMenuProps {
user?: User;
@@ -51,7 +53,10 @@ const styles: StyleRulesCallback<CssRules> = () => ({
export const AccountMenuComponent =
({ user, dispatch, currentRoute, workbenchURL, apiToken, localCluster, classes }: AccountMenuProps & DispatchProp<any> & WithStyles<CssRules>) => {
let accountMenuItems = <>
- <MenuItem onClick={() => dispatch(openUserVirtualMachines())}>Shell Access</MenuItem>
+ <MenuItem onClick={() => {
+ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({id: SidePanelTreeCategory.SHELL_ACCESS, pickerId: SIDE_PANEL_TREE} ))
+ dispatch(openUserVirtualMachines())
+ }}>Shell Access</MenuItem>
<MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
<MenuItem onClick={() => {
dispatch<any>(getNewExtraToken(true));
diff --git a/src/views-components/main-app-bar/admin-menu.tsx b/src/views-components/main-app-bar/admin-menu.tsx
index ea93fdbb57..ffe03b9201 100644
--- a/src/views-components/main-app-bar/admin-menu.tsx
+++ b/src/views-components/main-app-bar/admin-menu.tsx
@@ -13,7 +13,8 @@ import { openRepositoriesPanel } from "store/repositories/repositories-actions";
import * as NavigationAction from 'store/navigation/navigation-action';
import { openAdminVirtualMachines } from "store/virtual-machines/virtual-machines-actions";
import { openUserPanel } from "store/users/users-actions";
-
+import { treePickerActions } from "store/tree-picker/tree-picker-actions";
+import { SIDE_PANEL_TREE, SidePanelTreeCategory } from "store/side-panel-tree/side-panel-tree-actions";
interface AdminMenuProps {
user?: User;
currentRoute: string;
@@ -33,7 +34,10 @@ export const AdminMenu = connect(mapStateToProps)(
title="Admin Panel"
key={currentRoute}>
<MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
- <MenuItem onClick={() => dispatch(openAdminVirtualMachines())}>Shell Access</MenuItem>
+ <MenuItem onClick={() => {
+ dispatch(treePickerActions.ACTIVATE_TREE_PICKER_NODE({id: SidePanelTreeCategory.SHELL_ACCESS, pickerId: SIDE_PANEL_TREE} ))
+ dispatch(openAdminVirtualMachines())
+ }}>Shell Access</MenuItem>
<MenuItem onClick={() => dispatch(NavigationAction.navigateToSshKeysAdmin)}>Ssh Keys</MenuItem>
<MenuItem onClick={() => dispatch(NavigationAction.navigateToApiClientAuthorizations)}>Api Tokens</MenuItem>
<MenuItem onClick={() => dispatch(openUserPanel())}>Users</MenuItem>
diff --git a/src/views-components/side-panel/side-panel-collapsed.tsx b/src/views-components/side-panel/side-panel-collapsed.tsx
index 800aec2ca1..d884fc386e 100644
--- a/src/views-components/side-panel/side-panel-collapsed.tsx
+++ b/src/views-components/side-panel/side-panel-collapsed.tsx
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import React, { ReactElement, useEffect } from 'react'
+import React, { ReactElement } from 'react'
import { connect } from 'react-redux'
import { ProjectsIcon, ProcessIcon, FavoriteIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon } from 'components/icon/icon'
import { TerminalIcon } from 'components/icon/icon'
@@ -23,6 +23,7 @@ import {
import { navigateToUserVirtualMachines } from 'store/navigation/navigation-action'
import { RouterAction } from 'react-router-redux'
import { User } from 'models/user'
+import { SidePanelTreeCategory } from 'store/side-panel-tree/side-panel-tree-actions'
type CssRules = 'button' | 'unselected' | 'selected'
@@ -113,7 +114,7 @@ const mapStateToProps = ({auth, properties }: RootState) => {
return {
user: auth.user,
selectedPath: properties.breadcrumbs
- ? properties.breadcrumbs[0].label !== 'Shell Access'
+ ? properties.breadcrumbs[0].label !== SidePanelTreeCategory.SHELL_ACCESS
? properties.breadcrumbs[0].label
: SidePanelCollapsedCategory.SHELL_ACCESS
: SidePanelCollapsedCategory.PROJECTS,
commit 8f78a47abe35f8fe96ef952a617c85613a1acc88
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Wed Dec 13 09:34:29 2023 -0500
21200: changed virtual machines to shell access evrywhere Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
diff --git a/src/store/workbench/workbench-actions.ts b/src/store/workbench/workbench-actions.ts
index e89a95e039..62530352cf 100644
--- a/src/store/workbench/workbench-actions.ts
+++ b/src/store/workbench/workbench-actions.ts
@@ -95,7 +95,7 @@ import { subprocessPanelActions } from "store/subprocess-panel/subprocess-panel-
import { subprocessPanelColumns } from "views/subprocess-panel/subprocess-panel-root";
import { loadAllProcessesPanel, allProcessesPanelActions } from "../all-processes-panel/all-processes-panel-action";
import { allProcessesPanelColumns } from "views/all-processes-panel/all-processes-panel";
-import { AdminMenuIcon } from "components/icon/icon";
+import { TerminalIcon } from "components/icon/icon";
import { userProfileGroupsColumns } from "views/user-profile-panel/user-profile-panel-root";
import { selectedToArray, selectedToKindSet } from "components/multiselect-toolbar/MultiselectToolbar";
import { multiselectActions } from "store/multiselect/multiselect-actions";
@@ -742,12 +742,12 @@ export const loadLinks = handleFirstTimeLoad(async (dispatch: Dispatch<any>) =>
export const loadVirtualMachines = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
await dispatch(loadVirtualMachinesPanel());
- dispatch(setBreadcrumbs([{ label: "Virtual Machines" }]));
+ dispatch(setBreadcrumbs([{ label: "Shell Access", icon: TerminalIcon }]));
});
export const loadVirtualMachinesAdmin = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
await dispatch(loadVirtualMachinesPanel());
- dispatch(setBreadcrumbs([{ label: "Virtual Machines Admin", icon: AdminMenuIcon }]));
+ dispatch(setBreadcrumbs([{ label: "Shell Access Admin", icon: TerminalIcon }]));
});
export const loadRepositories = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
diff --git a/src/views-components/main-app-bar/account-menu.tsx b/src/views-components/main-app-bar/account-menu.tsx
index c2cc0e2a47..68afef2226 100644
--- a/src/views-components/main-app-bar/account-menu.tsx
+++ b/src/views-components/main-app-bar/account-menu.tsx
@@ -51,7 +51,7 @@ const styles: StyleRulesCallback<CssRules> = () => ({
export const AccountMenuComponent =
({ user, dispatch, currentRoute, workbenchURL, apiToken, localCluster, classes }: AccountMenuProps & DispatchProp<any> & WithStyles<CssRules>) => {
let accountMenuItems = <>
- <MenuItem onClick={() => dispatch(openUserVirtualMachines())}>Virtual Machines</MenuItem>
+ <MenuItem onClick={() => dispatch(openUserVirtualMachines())}>Shell Access</MenuItem>
<MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
<MenuItem onClick={() => {
dispatch<any>(getNewExtraToken(true));
diff --git a/src/views-components/main-app-bar/admin-menu.tsx b/src/views-components/main-app-bar/admin-menu.tsx
index 198306b52c..ea93fdbb57 100644
--- a/src/views-components/main-app-bar/admin-menu.tsx
+++ b/src/views-components/main-app-bar/admin-menu.tsx
@@ -33,7 +33,7 @@ export const AdminMenu = connect(mapStateToProps)(
title="Admin Panel"
key={currentRoute}>
<MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
- <MenuItem onClick={() => dispatch(openAdminVirtualMachines())}>Virtual Machines</MenuItem>
+ <MenuItem onClick={() => dispatch(openAdminVirtualMachines())}>Shell Access</MenuItem>
<MenuItem onClick={() => dispatch(NavigationAction.navigateToSshKeysAdmin)}>Ssh Keys</MenuItem>
<MenuItem onClick={() => dispatch(NavigationAction.navigateToApiClientAuthorizations)}>Api Tokens</MenuItem>
<MenuItem onClick={() => dispatch(openUserPanel())}>Users</MenuItem>
diff --git a/src/views-components/side-panel/side-panel-collapsed.tsx b/src/views-components/side-panel/side-panel-collapsed.tsx
index d2f5cfec3b..800aec2ca1 100644
--- a/src/views-components/side-panel/side-panel-collapsed.tsx
+++ b/src/views-components/side-panel/side-panel-collapsed.tsx
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import React, { ReactElement } from 'react'
+import React, { ReactElement, useEffect } from 'react'
import { connect } from 'react-redux'
import { ProjectsIcon, ProcessIcon, FavoriteIcon, ShareMeIcon, TrashIcon, PublicFavoriteIcon, GroupsIcon } from 'components/icon/icon'
import { TerminalIcon } from 'components/icon/icon'
@@ -113,7 +113,7 @@ const mapStateToProps = ({auth, properties }: RootState) => {
return {
user: auth.user,
selectedPath: properties.breadcrumbs
- ? properties.breadcrumbs[0].label !== 'Virtual Machines'
+ ? properties.breadcrumbs[0].label !== 'Shell Access'
? properties.breadcrumbs[0].label
: SidePanelCollapsedCategory.SHELL_ACCESS
: SidePanelCollapsedCategory.PROJECTS,
commit bf64b82d45ef695c312b08b663311f4da7b7a4e3
Merge: 55334ee8b2 b774da617d
Author: Stephen Smith <stephen at curii.com>
Date: Mon Dec 11 12:12:51 2023 -0500
Merge branch '21204-stable-log-sort' into main. Closes #21204
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
commit 55334ee8b218344fec8552c1d0ea56d4c8e53a2d
Merge: 2c7f44ed77 2ffe3ac11c
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Mon Dec 11 11:25:32 2023 -0500
Merge branch '21280-search-panel-layout'
closes #21280
Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>
commit 2ffe3ac11c9bad93b8b226167aef687a274028fd
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Mon Dec 11 11:15:51 2023 -0500
21280: removed excess whitespace from subprocess panel Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>~
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 0733da43e2..b3a93bbb79 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -221,7 +221,7 @@ export const DataExplorer = withStyles(styles)(
wrap="nowrap"
className={classes.container}
>
- <div className={classes.titleWrapper} style={currentRoute?.includes('search-results') ? {marginBottom: '-20px'} : {}}>
+ <div className={classes.titleWrapper} style={currentRoute?.includes('search-results') || !!progressBar ? {marginBottom: '-20px'} : {}}>
{title && (
<Grid
item
@@ -303,7 +303,7 @@ export const DataExplorer = withStyles(styles)(
item
xs="auto"
className={classes.dataTable}
- style={currentRoute?.includes('search-results') ? {marginTop: '-10px'} : {}}
+ style={currentRoute?.includes('search-results') || !!progressBar ? {marginTop: '-10px'} : {}}
>
<DataTable
columns={this.props.contextMenuColumn ? [...columns, this.contextMenuColumn] : columns}
commit 3e3dec8b2504a47aa407878aea111dd49ab1a8e6
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Fri Dec 8 21:07:07 2023 -0500
21280: removed excess whitespace from search results Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>~
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 715d2e69db..0733da43e2 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -44,10 +44,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
title: {
display: "inline-block",
paddingLeft: theme.spacing.unit * 2,
- paddingTop: theme.spacing.unit * 3,
+ paddingTop: theme.spacing.unit * 2,
fontSize: "18px",
paddingRight: "10px",
- marginBottom: '-50px'
},
subProcessTitle: {
display: "inline-block",
@@ -196,6 +195,7 @@ export const DataExplorer = withStyles(styles)(
paperKey,
fetchMode,
currentItemUuid,
+ currentRoute,
title,
progressBar,
doHidePanel,
@@ -221,7 +221,7 @@ export const DataExplorer = withStyles(styles)(
wrap="nowrap"
className={classes.container}
>
- <div className={classes.titleWrapper}>
+ <div className={classes.titleWrapper} style={currentRoute?.includes('search-results') ? {marginBottom: '-20px'} : {}}>
{title && (
<Grid
item
@@ -303,6 +303,7 @@ export const DataExplorer = withStyles(styles)(
item
xs="auto"
className={classes.dataTable}
+ style={currentRoute?.includes('search-results') ? {marginTop: '-10px'} : {}}
>
<DataTable
columns={this.props.contextMenuColumn ? [...columns, this.contextMenuColumn] : columns}
commit 1cd60c69e5306f19dc26429379792151cdb274b8
Author: Lisa Knox <lisaknox83 at gmail.com>
Date: Fri Dec 8 14:48:47 2023 -0500
21280: nade separate css class for subprocess menu Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>~
diff --git a/src/components/data-explorer/data-explorer.tsx b/src/components/data-explorer/data-explorer.tsx
index 8f5661929b..715d2e69db 100644
--- a/src/components/data-explorer/data-explorer.tsx
+++ b/src/components/data-explorer/data-explorer.tsx
@@ -17,7 +17,7 @@ import { CloseIcon, IconType, MaximizeIcon, UnMaximizeIcon, MoreVerticalIcon } f
import { PaperProps } from "@material-ui/core/Paper";
import { MPVPanelProps } from "components/multi-panel-view/multi-panel-view";
-type CssRules = "titleWrapper" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | "dataTable" | "container";
+type CssRules = "titleWrapper" | "searchBox" | "headerMenu" | "toolbar" | "footer" | "root" | "moreOptionsButton" | "title" | 'subProcessTitle' | "dataTable" | "container";
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
titleWrapper: {
@@ -42,6 +42,14 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
padding: 0,
},
title: {
+ display: "inline-block",
+ paddingLeft: theme.spacing.unit * 2,
+ paddingTop: theme.spacing.unit * 3,
+ fontSize: "18px",
+ paddingRight: "10px",
+ marginBottom: '-50px'
+ },
+ subProcessTitle: {
display: "inline-block",
paddingLeft: theme.spacing.unit * 2,
paddingTop: theme.spacing.unit * 2,
@@ -218,7 +226,7 @@ export const DataExplorer = withStyles(styles)(
<Grid
item
xs
- className={classes.title}
+ className={!!progressBar ? classes.subProcessTitle : classes.title}
>
{title}
</Grid>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list