[ARVADOS-WORKBENCH2] updated: 2.1.0-17-g8df7e312
Git user
git at public.arvados.org
Tue Oct 20 14:44:11 UTC 2020
Summary of changes:
.../details-attribute/details-attribute.tsx | 3 +-
src/index.tsx | 2 -
.../context-menu/context-menu-actions.test.ts | 4 +-
src/store/context-menu/context-menu-actions.ts | 20 ++++--
.../action-sets/collection-action-set.ts | 2 +-
.../action-sets/collection-admin-action-set.ts | 16 +----
.../action-sets/collection-resource-action-set.ts | 83 ----------------------
src/views-components/context-menu/context-menu.tsx | 1 -
src/views/collection-panel/collection-panel.tsx | 81 +++++++++++----------
9 files changed, 62 insertions(+), 150 deletions(-)
delete mode 100644 src/views-components/context-menu/action-sets/collection-resource-action-set.ts
via 8df7e312b38b8e01bfac8c719b0f883cf866c2c8 (commit)
via 8a5f805a21c44cd47b0b8b6d0b55e3f752f00a21 (commit)
from feeed01f85f60a8989b32ca463b7191d0ad9bb75 (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 8df7e312b38b8e01bfac8c719b0f883cf866c2c8
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Oct 20 11:39:35 2020 -0300
16719: Enhances collection panel.
* 'More options' menu renamed to 'Actions' and moved to the top.
* 'This is an old version' warning moved to the bottom.
* Condensed layout makes the main panel to take less vertical space.
* Added attributes: version, created_at, modified_at.
* Reworded some attribute labels on past versions.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/components/details-attribute/details-attribute.tsx b/src/components/details-attribute/details-attribute.tsx
index 8f470858..18d0d8b7 100644
--- a/src/components/details-attribute/details-attribute.tsx
+++ b/src/components/details-attribute/details-attribute.tsx
@@ -21,8 +21,7 @@ type CssRules = 'attribute' | 'label' | 'value' | 'lowercaseValue' | 'link' | 'c
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
attribute: {
display: 'flex',
- alignItems: 'flex-start',
- marginBottom: theme.spacing.unit
+ alignItems: 'flex-start'
},
label: {
boxSizing: 'border-box',
diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index a21d70ed..6e0b8609 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -21,7 +21,7 @@ import { deleteCollectionTag, navigateToProcess, collectionPanelActions } from '
import { getResource } from '~/store/resources/resources';
import { openContextMenu } from '~/store/context-menu/context-menu-actions';
import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
-import { formatFileSize } from "~/common/formatters";
+import { formatDate, formatFileSize } from "~/common/formatters";
import { openDetailsPanel } from '~/store/details-panel/details-panel-action';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
import { getPropertyChip } from '~/views-components/resource-properties-form/property-chip';
@@ -70,8 +70,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
textAlign: 'center'
},
warningLabel: {
- fontStyle: 'italic',
- fontWeight: 'bold'
+ fontStyle: 'italic'
},
collectionName: {
flexDirection: 'column',
@@ -132,45 +131,56 @@ export const CollectionPanel = withStyles(styles)(
? <div className={classes.root}>
<ExpansionPanel data-cy='collection-info-panel' defaultExpanded>
<ExpansionPanelSummary expandIcon={<ExpandIcon />}>
- <span>
- <IconButton onClick={this.openCollectionDetails}>
- { isOldVersion
- ? <CollectionOldVersionIcon className={classes.iconHeader} />
- : <CollectionIcon className={classes.iconHeader} /> }
- </IconButton>
- <IllegalNamingWarning name={item.name}/>
- <span>
- {item.name}
- {isWritable ||
- <Tooltip title="Read-only">
- <ReadOnlyIcon data-cy="read-only-icon" className={classes.readOnlyIcon} />
+ <Grid container justify="space-between">
+ <Grid item xs={11}><span>
+ <IconButton onClick={this.openCollectionDetails}>
+ { isOldVersion
+ ? <CollectionOldVersionIcon className={classes.iconHeader} />
+ : <CollectionIcon className={classes.iconHeader} /> }
+ </IconButton>
+ <IllegalNamingWarning name={item.name}/>
+ <span>
+ {item.name}
+ {isWritable ||
+ <Tooltip title="Read-only">
+ <ReadOnlyIcon data-cy="read-only-icon" className={classes.readOnlyIcon} />
+ </Tooltip>
+ }
+ </span>
+ </span></Grid>
+ <Grid item xs={1} style={{textAlign: "right"}}>
+ <Tooltip title="Actions" disableFocusListener>
+ <IconButton
+ data-cy='collection-panel-options-btn'
+ aria-label="Actions"
+ onClick={this.handleContextMenu}>
+ <MoreOptionsIcon />
+ </IconButton>
</Tooltip>
- }
- {isOldVersion &&
- <Typography className={classes.warningLabel} variant="caption">
- This is an old version. Copy it as a new one if you need to make changes. Go to the current version if you need to share it.
- </Typography>
- }
- </span>
- </span>
+ </Grid>
+ </Grid>
</ExpansionPanelSummary>
<ExpansionPanelDetails>
<Grid container justify="space-between">
- <Grid item xs={11}>
+ <Grid item xs={12}>
<Typography variant="caption">
{item.description}
</Typography>
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
- label='Collection UUID'
+ label={isOldVersion ? "This version's UUID" : "Collection UUID"}
linkToUuid={item.uuid} />
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
- label='Portable data hash'
+ label={isOldVersion ? "This version's PDH" : "Portable data hash"}
linkToUuid={item.portableDataHash} />
{isOldVersion &&
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
- label='Current Version UUID'
+ label='Most recent version'
linkToUuid={item.currentVersionUuid} />
}
+ <DetailsAttribute label='Last modified' value={formatDate(item.modifiedAt)} />
+ <DetailsAttribute label='Created at' value={formatDate(item.createdAt)} />
+ <DetailsAttribute classLabel={classes.label} classValue={classes.value}
+ label='Version number' value={item.version} />
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
label='Number of files' value={item.fileCount} />
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
@@ -182,16 +192,11 @@ export const CollectionPanel = withStyles(styles)(
<DetailsAttribute classLabel={classes.link} label='Link to process' />
</span>
}
- </Grid>
- <Grid item xs={1} style={{textAlign: "right"}}>
- <Tooltip title="More options" disableFocusListener>
- <IconButton
- data-cy='collection-panel-options-btn'
- aria-label="More options"
- onClick={this.handleContextMenu}>
- <MoreOptionsIcon />
- </IconButton>
- </Tooltip>
+ {isOldVersion &&
+ <Typography className={classes.warningLabel} variant="caption">
+ This is an old version. Copy it as a new one if you need to make changes. Go to the current version if you need to share it.
+ </Typography>
+ }
</Grid>
</Grid>
</ExpansionPanelDetails>
@@ -260,6 +265,8 @@ export const CollectionPanel = withStyles(styles)(
: ContextMenuKind.COLLECTION
: ContextMenuKind.READONLY_COLLECTION
};
+ // Avoid expanding/collapsing the panel
+ event.stopPropagation();
this.props.dispatch<any>(openContextMenu(event, resource));
}
commit 8a5f805a21c44cd47b0b8b6d0b55e3f752f00a21
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Tue Oct 20 10:27:21 2020 -0300
16719: Changes wording from 'Copy to project' to 'Make a copy' on collections.
Also, removed duplicated code about context menus.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/index.tsx b/src/index.tsx
index 0a51ed3c..a4353d4e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -28,7 +28,6 @@ import { collectionFilesActionSet, readOnlyCollectionFilesActionSet } from '~/vi
import { collectionFilesItemActionSet, readOnlyCollectionFilesItemActionSet } from '~/views-components/context-menu/action-sets/collection-files-item-action-set';
import { collectionFilesNotSelectedActionSet } from '~/views-components/context-menu/action-sets/collection-files-not-selected-action-set';
import { collectionActionSet, readOnlyCollectionActionSet } from '~/views-components/context-menu/action-sets/collection-action-set';
-import { collectionResourceActionSet } from '~/views-components/context-menu/action-sets/collection-resource-action-set';
import { processActionSet } from '~/views-components/context-menu/action-sets/process-action-set';
import { loadWorkbench } from '~/store/workbench/workbench-actions';
import { Routes } from '~/routes/routes';
@@ -77,7 +76,6 @@ addMenuActionSet(ContextMenuKind.COLLECTION_FILES_NOT_SELECTED, collectionFilesN
addMenuActionSet(ContextMenuKind.COLLECTION_FILES_ITEM, collectionFilesItemActionSet);
addMenuActionSet(ContextMenuKind.READONLY_COLLECTION_FILES_ITEM, readOnlyCollectionFilesItemActionSet);
addMenuActionSet(ContextMenuKind.COLLECTION, collectionActionSet);
-addMenuActionSet(ContextMenuKind.COLLECTION_RESOURCE, collectionResourceActionSet);
addMenuActionSet(ContextMenuKind.READONLY_COLLECTION, readOnlyCollectionActionSet);
addMenuActionSet(ContextMenuKind.TRASHED_COLLECTION, trashedCollectionActionSet);
addMenuActionSet(ContextMenuKind.PROCESS, processActionSet);
diff --git a/src/store/context-menu/context-menu-actions.test.ts b/src/store/context-menu/context-menu-actions.test.ts
index 4bcbf9f2..c3e78679 100644
--- a/src/store/context-menu/context-menu-actions.test.ts
+++ b/src/store/context-menu/context-menu-actions.test.ts
@@ -71,7 +71,7 @@ describe('context-menu-actions', () => {
expect(result).toEqual(ContextMenuKind.COLLECTION_ADMIN);
});
- it('should return ContextMenuKind.COLLECTION_RESOURCE', () => {
+ it('should return ContextMenuKind.COLLECTION', () => {
// given
const isAdmin = false;
const isEditable = true;
@@ -80,7 +80,7 @@ describe('context-menu-actions', () => {
const result = resourceKindToContextMenuKind(uuid, isAdmin, isEditable);
// then
- expect(result).toEqual(ContextMenuKind.COLLECTION_RESOURCE);
+ expect(result).toEqual(ContextMenuKind.COLLECTION);
});
it('should return ContextMenuKind.READONLY_COLLECTION', () => {
diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index 1f766bd3..308d5e88 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -204,15 +204,21 @@ export const resourceKindToContextMenuKind = (uuid: string, isAdmin?: boolean, i
const kind = extractUuidKind(uuid);
switch (kind) {
case ResourceKind.PROJECT:
- return !isAdmin ?
- isEditable ? ContextMenuKind.PROJECT : ContextMenuKind.READONLY_PROJECT :
- ContextMenuKind.PROJECT_ADMIN;
+ return !isAdmin
+ ? isEditable
+ ? ContextMenuKind.PROJECT
+ : ContextMenuKind.READONLY_PROJECT
+ : ContextMenuKind.PROJECT_ADMIN;
case ResourceKind.COLLECTION:
- return !isAdmin ?
- isEditable ? ContextMenuKind.COLLECTION_RESOURCE : ContextMenuKind.READONLY_COLLECTION :
- ContextMenuKind.COLLECTION_ADMIN;
+ return !isAdmin
+ ? isEditable
+ ? ContextMenuKind.COLLECTION
+ : ContextMenuKind.READONLY_COLLECTION
+ : ContextMenuKind.COLLECTION_ADMIN;
case ResourceKind.PROCESS:
- return !isAdmin ? ContextMenuKind.PROCESS_RESOURCE : ContextMenuKind.PROCESS_ADMIN;
+ return !isAdmin
+ ? ContextMenuKind.PROCESS_RESOURCE
+ : ContextMenuKind.PROCESS_ADMIN;
case ResourceKind.USER:
return ContextMenuKind.ROOT_PROJECT;
case ResourceKind.LINK:
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts
index fba2a53a..7fa6f224 100644
--- a/src/views-components/context-menu/action-sets/collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-action-set.ts
@@ -27,7 +27,7 @@ export const readOnlyCollectionActionSet: ContextMenuActionSet = [[
},
{
icon: CopyIcon,
- name: "Copy to project",
+ name: "Make a copy",
execute: (dispatch, resource) => {
dispatch<any>(openCollectionCopyDialog(resource));
}
diff --git a/src/views-components/context-menu/action-sets/collection-admin-action-set.ts b/src/views-components/context-menu/action-sets/collection-admin-action-set.ts
index db849136..10a839d8 100644
--- a/src/views-components/context-menu/action-sets/collection-admin-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-admin-action-set.ts
@@ -57,7 +57,7 @@ export const collectionAdminActionSet: ContextMenuActionSet = [[
},
{
icon: CopyIcon,
- name: "Copy to project",
+ name: "Make a copy",
execute: (dispatch, resource) => {
dispatch<any>(openCollectionCopyDialog(resource));
}
@@ -70,13 +70,6 @@ export const collectionAdminActionSet: ContextMenuActionSet = [[
dispatch<any>(toggleDetailsPanel());
}
},
- // {
- // icon: ProvenanceGraphIcon,
- // name: "Provenance graph",
- // execute: (dispatch, resource) => {
- // // add code
- // }
- // },
{
icon: AdvancedIcon,
name: "Advanced",
@@ -90,11 +83,4 @@ export const collectionAdminActionSet: ContextMenuActionSet = [[
dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
}
},
- // {
- // icon: RemoveIcon,
- // name: "Remove",
- // execute: (dispatch, resource) => {
- // // add code
- // }
- // }
]];
diff --git a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts b/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
deleted file mode 100644
index 5e367906..00000000
--- a/src/views-components/context-menu/action-sets/collection-resource-action-set.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import { ContextMenuActionSet } from "../context-menu-action-set";
-import { ToggleFavoriteAction } from "../actions/favorite-action";
-import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
-import { toggleFavorite } from "~/store/favorites/favorites-actions";
-import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, AdvancedIcon } from '~/components/icon/icon';
-import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
-import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
-import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
-import { openCollectionCopyDialog } from '~/store/collections/collection-copy-actions';
-import { toggleCollectionTrashed } from "~/store/trash/trash-actions";
-import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
-import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
-import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
-
-export const collectionResourceActionSet: ContextMenuActionSet = [[
- {
- icon: RenameIcon,
- name: "Edit collection",
- execute: (dispatch, resource) => {
- dispatch<any>(openCollectionUpdateDialog(resource));
- }
- },
- {
- icon: ShareIcon,
- name: "Share",
- execute: (dispatch, { uuid }) => {
- dispatch<any>(openSharingDialog(uuid));
- }
- },
- {
- component: ToggleFavoriteAction,
- execute: (dispatch, resource) => {
- dispatch<any>(toggleFavorite(resource)).then(() => {
- dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
- });
- }
- },
- {
- icon: MoveToIcon,
- name: "Move to",
- execute: (dispatch, resource) => {
- dispatch<any>(openMoveCollectionDialog(resource));
- }
- },
- {
- icon: CopyIcon,
- name: "Copy to project",
- execute: (dispatch, resource) => {
- dispatch<any>(openCollectionCopyDialog(resource));
- }
- },
- {
- icon: DetailsIcon,
- name: "View details",
- execute: dispatch => {
- dispatch<any>(toggleDetailsPanel());
- }
- },
- {
- icon: AdvancedIcon,
- name: "Advanced",
- execute: (dispatch, resource) => {
- dispatch<any>(openAdvancedTabDialog(resource.uuid));
- }
- },
- {
- component: ToggleTrashAction,
- execute: (dispatch, resource) => {
- dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));
- }
- },
- // {
- // icon: RemoveIcon,
- // name: "Remove",
- // execute: (dispatch, resource) => {
- // // add code
- // }
- // }
-]];
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index db5765ee..43474dd1 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -77,7 +77,6 @@ export enum ContextMenuKind {
COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
COLLECTION = 'Collection',
COLLECTION_ADMIN = 'CollectionAdmin',
- COLLECTION_RESOURCE = 'CollectionResource',
READONLY_COLLECTION = 'ReadOnlyCollection',
TRASHED_COLLECTION = 'TrashedCollection',
PROCESS = "Process",
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list