[arvados-workbench2] updated: 2.4.0-147-g1b7a371a
git repository hosting
git at public.arvados.org
Tue Jul 12 14:01:48 UTC 2022
Summary of changes:
src/components/breadcrumbs/breadcrumbs.tsx | 7 +-
src/components/icon/icon.tsx | 18 +-
src/index.tsx | 10 +-
src/store/context-menu/context-menu-actions.ts | 8 +-
src/store/projects/project-lock-actions.ts | 4 +-
.../context-menu/action-sets/project-action-set.ts | 257 ++++++++++++---------
.../action-sets/project-admin-action-set.ts | 68 ++++--
.../context-menu/actions/lock-action.tsx | 6 +-
src/views-components/context-menu/context-menu.tsx | 1 +
src/views-components/data-explorer/renderers.tsx | 4 +-
10 files changed, 228 insertions(+), 155 deletions(-)
via 1b7a371a20a0ce0f4811e1b58222f1d837b62337 (commit)
from 5a2f4597393f94b9fa7984f4445d4b599c139f27 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 1b7a371a20a0ce0f4811e1b58222f1d837b62337
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Tue Jul 12 16:00:50 2022 +0200
18692: Replaced icons, fixed context menu confusion
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index c081c314..2cb81205 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -7,7 +7,7 @@ import { Button, Grid, StyleRulesCallback, WithStyles, Typography, Tooltip } fro
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
import { withStyles } from '@material-ui/core';
import { IllegalNamingWarning } from '../warning/warning';
-import { IconType, LockIcon } from 'components/icon/icon';
+import { IconType, FreezeIcon } from 'components/icon/icon';
import grey from '@material-ui/core/colors/grey';
export interface Breadcrumb {
@@ -30,7 +30,8 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
},
icon: {
fontSize: 20,
- color: grey["600"]
+ color: grey["600"],
+ marginRight: '10px'
},
});
@@ -65,7 +66,7 @@ export const Breadcrumbs = withStyles(styles)(
onContextMenu={event => onContextMenu(event, item)}>
<Icon className={classes.icon} />
{
- item.isFrozen ? <LockIcon className={classes.icon} /> : null
+ item.isFrozen ? <FreezeIcon className={classes.icon} /> : null
}
<Typography
noWrap
diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx
index 178c4cbe..74c2f54c 100644
--- a/src/components/icon/icon.tsx
+++ b/src/components/icon/icon.tsx
@@ -73,8 +73,6 @@ import ExitToApp from '@material-ui/icons/ExitToApp';
import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
import RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';
import NotInterested from '@material-ui/icons/NotInterested';
-import Lock from '@material-ui/icons/Lock'
-import LockOpen from '@material-ui/icons/LockOpen'
// Import FontAwesome icons
import { library } from '@fortawesome/fontawesome-svg-core';
@@ -86,6 +84,20 @@ library.add(
faEllipsisH,
);
+export const FreezeIcon = (props: any) =>
+ <span {...props}>
+ <span className='fas fa-snowflake' />
+ </span>
+
+export const UnfreezeIcon = (props: any) =>
+ <div {...props}>
+ <div className="fa-layers fa-1x fa-fw">
+ <span className="fas fa-slash"
+ data-fa-mask="fas fa-snowflake" data-fa-transform="down-1.5" />
+ <span className="fas fa-slash" />
+ </div>
+ </div>;
+
export const PendingIcon = (props: any) =>
<span {...props}>
<span className='fas fa-ellipsis-h' />
@@ -155,8 +167,6 @@ export const PaginationLeftArrowIcon: IconType = (props) => <ChevronLeft {...pro
export const PaginationRightArrowIcon: IconType = (props) => <ChevronRight {...props} />;
export const ProcessIcon: IconType = (props) => <BubbleChart {...props} />;
export const ProjectIcon: IconType = (props) => <Folder {...props} />;
-export const LockIcon: IconType = (props) => <Lock {...props} />;
-export const UnlockIcon: IconType = (props) => <LockOpen {...props} />;
export const FilterGroupIcon: IconType = (props) => <Pageview {...props} />;
export const ProjectsIcon: IconType = (props) => <Inbox {...props} />;
export const ProvenanceGraphIcon: IconType = (props) => <DeviceHub {...props} />;
diff --git a/src/index.tsx b/src/index.tsx
index 066b520c..f0f75210 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -60,7 +60,7 @@ import { groupActionSet } from 'views-components/context-menu/action-sets/group-
import { groupMemberActionSet } from 'views-components/context-menu/action-sets/group-member-action-set';
import { linkActionSet } from 'views-components/context-menu/action-sets/link-action-set';
import { loadFileViewersConfig } from 'store/file-viewers/file-viewers-actions';
-import { filterGroupAdminActionSet, projectAdminActionSet } from 'views-components/context-menu/action-sets/project-admin-action-set';
+import { filterGroupAdminActionSet, frozenAdminActionSet, projectAdminActionSet } from 'views-components/context-menu/action-sets/project-admin-action-set';
import { permissionEditActionSet } from 'views-components/context-menu/action-sets/permission-edit-action-set';
import { workflowActionSet } from 'views-components/context-menu/action-sets/workflow-action-set';
import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
@@ -101,12 +101,8 @@ addMenuActionSet(ContextMenuKind.GROUP_MEMBER, groupMemberActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION_ADMIN, collectionAdminActionSet);
addMenuActionSet(ContextMenuKind.PROCESS_ADMIN, processResourceAdminActionSet);
addMenuActionSet(ContextMenuKind.PROJECT_ADMIN, projectAdminActionSet);
-addMenuActionSet(ContextMenuKind.FROZEN_PROJECT, [
- [
- ...frozenActionSet.reduce((prev, next) => prev.concat(next), []),
- ...readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []),
- ]
-]);
+addMenuActionSet(ContextMenuKind.FROZEN_PROJECT, frozenActionSet);
+addMenuActionSet(ContextMenuKind.FROZEN_PROJECT_ADMIN, frozenAdminActionSet);
addMenuActionSet(ContextMenuKind.FILTER_GROUP_ADMIN, filterGroupAdminActionSet);
addMenuActionSet(ContextMenuKind.PERMISSION_EDIT, permissionEditActionSet);
addMenuActionSet(ContextMenuKind.WORKFLOW, workflowActionSet);
diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index 3fb4d25d..d098823d 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -232,8 +232,8 @@ export const resourceUuidToContextMenuKind = (uuid: string, readonly = false) =>
switch (kind) {
case ResourceKind.PROJECT:
- if (resource && !!(resource as any).frozenByUuid) {
- return ContextMenuKind.FROZEN_PROJECT;
+ if (isFrozen) {
+ return isAdminUser ? ContextMenuKind.FROZEN_PROJECT_ADMIN : ContextMenuKind.FROZEN_PROJECT;
}
return (isAdminUser && !readonly)
@@ -254,13 +254,13 @@ export const resourceUuidToContextMenuKind = (uuid: string, readonly = false) =>
? ContextMenuKind.OLD_VERSION_COLLECTION
: (isTrashed && isEditable)
? ContextMenuKind.TRASHED_COLLECTION
- : (isAdminUser && !readonly)
+ : (isAdminUser && isEditable)
? ContextMenuKind.COLLECTION_ADMIN
: isEditable
? ContextMenuKind.COLLECTION
: ContextMenuKind.READONLY_COLLECTION;
case ResourceKind.PROCESS:
- return (isAdminUser && !readonly)
+ return (isAdminUser && isEditable)
? ContextMenuKind.PROCESS_ADMIN
: readonly
? ContextMenuKind.READONLY_PROCESS_RESOURCE
diff --git a/src/store/projects/project-lock-actions.ts b/src/store/projects/project-lock-actions.ts
index f135522b..f01a6225 100644
--- a/src/store/projects/project-lock-actions.ts
+++ b/src/store/projects/project-lock-actions.ts
@@ -7,7 +7,7 @@ import { ServiceRepository } from "services/services";
import { projectPanelActions } from "store/project-panel/project-panel-action";
import { RootState } from "store/store";
-export const lockProject = (uuid: string) =>
+export const freezeProject = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const userUUID = getState().auth.user!.uuid;
@@ -19,7 +19,7 @@ export const lockProject = (uuid: string) =>
return updatedProject;
};
-export const unlockProject = (uuid: string) =>
+export const unfreezeProject = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
const updatedProject = await services.projectService.update(uuid, {
diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts
index 77abb128..e68eda96 100644
--- a/src/views-components/context-menu/action-sets/project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-action-set.ts
@@ -19,116 +19,155 @@ import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
import { copyToClipboardAction, openInNewTabAction } from "store/open-in-new-tab/open-in-new-tab.actions";
import { openWebDavS3InfoDialog } from "store/collections/collection-info-actions";
import { ToggleLockAction } from "../actions/lock-action";
-import { lockProject, unlockProject } from "store/projects/project-lock-actions";
+import { freezeProject, unfreezeProject } from "store/projects/project-lock-actions";
-export const readOnlyProjectActionSet: ContextMenuActionSet = [[
- {
- component: ToggleFavoriteAction,
- name: 'ToggleFavoriteAction',
- execute: (dispatch, resource) => {
- dispatch<any>(toggleFavorite(resource)).then(() => {
- dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
- });
- }
- },
- {
- icon: OpenIcon,
- name: "Open in new tab",
- execute: (dispatch, resource) => {
- dispatch<any>(openInNewTabAction(resource));
- }
- },
- {
- icon: Link,
- name: "Copy to clipboard",
- execute: (dispatch, resource) => {
- dispatch<any>(copyToClipboardAction(resource));
- }
- },
- {
- icon: DetailsIcon,
- name: "View details",
- execute: dispatch => {
- dispatch<any>(toggleDetailsPanel());
- }
- },
- {
- icon: AdvancedIcon,
- name: "Advanced",
- execute: (dispatch, resource) => {
- dispatch<any>(openAdvancedTabDialog(resource.uuid));
- }
- },
- {
- icon: FolderSharedIcon,
- name: "Open with 3rd party client",
- execute: (dispatch, resource) => {
- dispatch<any>(openWebDavS3InfoDialog(resource.uuid));
+export const toggleFavoriteAction = {
+ component: ToggleFavoriteAction,
+ name: 'ToggleFavoriteAction',
+ execute: (dispatch, resource) => {
+ dispatch(toggleFavorite(resource)).then(() => {
+ dispatch(favoritePanelActions.REQUEST_ITEMS());
+ });
+ }
+};
+
+export const openInNewTabMenuAction = {
+ icon: OpenIcon,
+ name: "Open in new tab",
+ execute: (dispatch, resource) => {
+ dispatch(openInNewTabAction(resource));
+ }
+};
+
+export const copyToClipboardMenuAction = {
+ icon: Link,
+ name: "Copy to clipboard",
+ execute: (dispatch, resource) => {
+ dispatch(copyToClipboardAction(resource));
+ }
+};
+
+export const viewDetailsAction = {
+ icon: DetailsIcon,
+ name: "View details",
+ execute: dispatch => {
+ dispatch(toggleDetailsPanel());
+ }
+}
+
+export const advancedAction = {
+ icon: AdvancedIcon,
+ name: "Advanced",
+ execute: (dispatch, resource) => {
+ dispatch(openAdvancedTabDialog(resource.uuid));
+ }
+}
+
+export const openWith3rdPartyClientAction = {
+ icon: FolderSharedIcon,
+ name: "Open with 3rd party client",
+ execute: (dispatch, resource) => {
+ dispatch(openWebDavS3InfoDialog(resource.uuid));
+ }
+}
+
+export const editProjectAction = {
+ icon: RenameIcon,
+ name: "Edit project",
+ execute: (dispatch, resource) => {
+ dispatch(openProjectUpdateDialog(resource));
+ }
+}
+
+export const shareAction = {
+ icon: ShareIcon,
+ name: "Share",
+ execute: (dispatch, { uuid }) => {
+ dispatch(openSharingDialog(uuid));
+ }
+}
+
+export const moveToAction = {
+ icon: MoveToIcon,
+ name: "Move to",
+ execute: (dispatch, resource) => {
+ dispatch(openMoveProjectDialog(resource));
+ }
+}
+
+export const toggleTrashAction = {
+ component: ToggleTrashAction,
+ name: 'ToggleTrashAction',
+ execute: (dispatch, resource) => {
+ dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
+ }
+}
+
+export const freezeProjectAction = {
+ component: ToggleLockAction,
+ name: 'ToggleLockAction',
+ execute: (dispatch, resource) => {
+ if (resource.isFrozen) {
+ dispatch(unfreezeProject(resource.uuid));
+ } else {
+ dispatch(freezeProject(resource.uuid));
}
- },
+
+ }
+}
+
+export const newProjectAction: any = {
+ icon: NewProjectIcon,
+ name: "New project",
+ execute: (dispatch, resource): void => {
+ dispatch(openProjectCreateDialog(resource.uuid));
+ }
+}
+
+export const readOnlyProjectActionSet: ContextMenuActionSet = [[
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
]];
-export const filterGroupActionSet: ContextMenuActionSet = [
- [
- ...readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []),
- {
- icon: RenameIcon,
- name: "Edit project",
- execute: (dispatch, resource) => {
- dispatch<any>(openProjectUpdateDialog(resource));
- }
- },
- {
- icon: ShareIcon,
- name: "Share",
- execute: (dispatch, { uuid }) => {
- dispatch<any>(openSharingDialog(uuid));
- }
- },
- {
- icon: MoveToIcon,
- name: "Move to",
- execute: (dispatch, resource) => {
- dispatch<any>(openMoveProjectDialog(resource));
- }
- },
- {
- component: ToggleTrashAction,
- name: 'ToggleTrashAction',
- execute: (dispatch, resource) => {
- dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
- }
- },
- ]
-];
-
-export const frozenActionSet: ContextMenuActionSet = [
- [
- {
- component: ToggleLockAction,
- name: 'ToggleLockAction',
- execute: (dispatch, resource) => {
- if (resource.isFrozen) {
- dispatch<any>(unlockProject(resource.uuid));
- } else {
- dispatch<any>(lockProject(resource.uuid));
- }
-
- }
- }
- ]
-];
-
-export const projectActionSet: ContextMenuActionSet = [
- [
- ...filterGroupActionSet.reduce((prev, next) => prev.concat(next), []),
- {
- icon: NewProjectIcon,
- name: "New project",
- execute: (dispatch, resource) => {
- dispatch<any>(openProjectCreateDialog(resource.uuid));
- }
- },
- ...frozenActionSet.reduce((prev, next) => prev.concat(next), []),
- ]
-];
+export const filterGroupActionSet: ContextMenuActionSet = [[
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ editProjectAction,
+ shareAction,
+ moveToAction,
+ toggleTrashAction,
+]];
+
+export const frozenActionSet: ContextMenuActionSet = [[
+ shareAction,
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ freezeProjectAction
+]];
+
+export const projectActionSet: ContextMenuActionSet = [[
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ editProjectAction,
+ shareAction,
+ moveToAction,
+ toggleTrashAction,
+ newProjectAction,
+ freezeProjectAction,
+]];
diff --git a/src/views-components/context-menu/action-sets/project-admin-action-set.ts b/src/views-components/context-menu/action-sets/project-admin-action-set.ts
index ebf827aa..3faf675d 100644
--- a/src/views-components/context-menu/action-sets/project-admin-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-admin-action-set.ts
@@ -7,30 +7,56 @@ import { TogglePublicFavoriteAction } from "views-components/context-menu/action
import { togglePublicFavorite } from "store/public-favorites/public-favorites-actions";
import { publicFavoritePanelActions } from "store/public-favorites-panel/public-favorites-action";
-import { projectActionSet, filterGroupActionSet } from "views-components/context-menu/action-sets/project-action-set";
+import { shareAction, toggleFavoriteAction, openInNewTabMenuAction, copyToClipboardMenuAction, viewDetailsAction, advancedAction, openWith3rdPartyClientAction, freezeProjectAction, editProjectAction, moveToAction, toggleTrashAction, newProjectAction } from "views-components/context-menu/action-sets/project-action-set";
+
+export const togglePublicFavoriteAction = {
+ component: TogglePublicFavoriteAction,
+ name: 'TogglePublicFavoriteAction',
+ execute: (dispatch, resource) => {
+ dispatch(togglePublicFavorite(resource)).then(() => {
+ dispatch(publicFavoritePanelActions.REQUEST_ITEMS());
+ });
+}}
export const projectAdminActionSet: ContextMenuActionSet = [[
- ...projectActionSet.reduce((prev, next) => prev.concat(next), []),
- {
- component: TogglePublicFavoriteAction,
- name: 'TogglePublicFavoriteAction',
- execute: (dispatch, resource) => {
- dispatch<any>(togglePublicFavorite(resource)).then(() => {
- dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
- });
- }
- }
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ editProjectAction,
+ shareAction,
+ moveToAction,
+ toggleTrashAction,
+ newProjectAction,
+ freezeProjectAction,
+ togglePublicFavoriteAction
]];
export const filterGroupAdminActionSet: ContextMenuActionSet = [[
- ...filterGroupActionSet.reduce((prev, next) => prev.concat(next), []),
- {
- component: TogglePublicFavoriteAction,
- name: 'TogglePublicFavoriteAction',
- execute: (dispatch, resource) => {
- dispatch<any>(togglePublicFavorite(resource)).then(() => {
- dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
- });
- }
- }
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ editProjectAction,
+ shareAction,
+ moveToAction,
+ toggleTrashAction,
+ togglePublicFavoriteAction
+]];
+
+
+export const frozenAdminActionSet: ContextMenuActionSet = [[
+ shareAction,
+ togglePublicFavoriteAction,
+ toggleFavoriteAction,
+ openInNewTabMenuAction,
+ copyToClipboardMenuAction,
+ viewDetailsAction,
+ advancedAction,
+ openWith3rdPartyClientAction,
+ freezeProjectAction
]];
diff --git a/src/views-components/context-menu/actions/lock-action.tsx b/src/views-components/context-menu/actions/lock-action.tsx
index 785de583..8d141e96 100644
--- a/src/views-components/context-menu/actions/lock-action.tsx
+++ b/src/views-components/context-menu/actions/lock-action.tsx
@@ -4,7 +4,7 @@
import React from "react";
import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
-import { LockIcon, UnlockIcon } from "components/icon/icon";
+import { FreezeIcon, UnfreezeIcon } from "components/icon/icon";
import { connect } from "react-redux";
import { RootState } from "store/store";
import { ProjectResource } from "models/project";
@@ -25,8 +25,8 @@ export const ToggleLockAction = withRouter(connect(mapStateToProps)((props: { st
onClick={props.onClick} >
<ListItemIcon>
{props.isLocked
- ? <UnlockIcon />
- : <LockIcon />}
+ ? <UnfreezeIcon />
+ : <FreezeIcon />}
</ListItemIcon>
<ListItemText style={{ textDecoration: 'none' }}>
{props.isLocked
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index b66a9a84..f89a1780 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -80,6 +80,7 @@ export enum ContextMenuKind {
FILTER_GROUP = "FilterGroup",
READONLY_PROJECT = 'ReadOnlyProject',
FROZEN_PROJECT = 'FrozenProject',
+ FROZEN_PROJECT_ADMIN = 'FrozenProjectAdmin',
PROJECT_ADMIN = "ProjectAdmin",
FILTER_GROUP_ADMIN = "FilterGroupAdmin",
RESOURCE = "Resource",
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index c955ebec..e0916066 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -15,7 +15,7 @@ import {
import { FavoriteStar, PublicFavoriteStar } from '../favorite-star/favorite-star';
import { Resource, ResourceKind, TrashableResource } from 'models/resource';
import {
- LockIcon,
+ FreezeIcon,
ProjectIcon,
FilterGroupIcon,
CollectionIcon,
@@ -100,7 +100,7 @@ const FrozenProject = (props: {item: ProjectResource}) => {
if (props.item.frozenByUuid) {
return <Tooltip onOpen={getFullName} enterDelay={500} title={<span>Project was frozen by {fullUsername}</span>}>
- <LockIcon style={{ fontSize: "inherit" }}/>
+ <FreezeIcon style={{ fontSize: "inherit" }}/>
</Tooltip>;
} else {
return null;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list