[arvados] updated: 2.7.0-5865-g98b5a13791

git repository hosting git at public.arvados.org
Thu Feb 8 20:07:11 UTC 2024


Summary of changes:
 .../project-details-card/project-details-card.tsx  | 27 ++++++++++++++--------
 .../resource-properties-form/property-chip.tsx     | 10 ++++----
 2 files changed, 24 insertions(+), 13 deletions(-)

       via  98b5a13791909924305049784850616fa96e3ab9 (commit)
      from  9efef17b6a074a82bb7e5a37eecda76ca6ff1fc6 (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 98b5a13791909924305049784850616fa96e3ab9
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Thu Feb 8 15:07:03 2024 -0500

    21224: stopped propagation in details card Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
index b636b4558d..593ce067e1 100644
--- a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
+++ b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
@@ -23,6 +23,7 @@ import { CollectionResource } from 'models/collection';
 import { ContextMenuKind } from 'views-components/context-menu/context-menu';
 import { Dispatch } from 'redux';
 import classNames from 'classnames';
+import { loadDetailsPanel } from 'store/details-panel/details-panel-action';
 
 type CssRules =
     | 'root'
@@ -125,7 +126,7 @@ const mapStateToProps = (state: RootState) => {
     const currentResource = getResource(currentItemUuid)(state.resources);
     const frozenByUser = currentResource && getResource((currentResource as ProjectResource).frozenByUuid as string)(state.resources);
     const frozenByFullName = frozenByUser && (frozenByUser as Resource & { fullName: string }).fullName;
-    const isSelected = currentItemUuid === state.detailsPanel.resourceUuid && state.detailsPanel.isOpened === true && !!state.multiselect.selectedUuid;
+    const isSelected = currentItemUuid === state.detailsPanel.resourceUuid && state.detailsPanel.isOpened === true;
 
     return {
         isAdmin: state.auth.user?.isAdmin,
@@ -136,6 +137,9 @@ const mapStateToProps = (state: RootState) => {
 };
 
 const mapDispatchToProps = (dispatch: Dispatch) => ({
+    handleCardClick: (uuid: string) => {
+        dispatch<any>(loadDetailsPanel(uuid));
+    },
     handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: any, isAdmin: boolean) => {
         event.stopPropagation();
         // When viewing the contents of a filter group, all contents should be treated as read only.
@@ -172,6 +176,7 @@ type DetailsCardProps = WithStyles<CssRules> & {
     isAdmin: boolean;
     isSelected: boolean;
     handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource, isAdmin: boolean) => void;
+    handleCardClick: (resource: any) => void;
 };
 
 type UserCardProps = WithStyles<CssRules> & {
@@ -179,6 +184,7 @@ type UserCardProps = WithStyles<CssRules> & {
     isAdmin: boolean;
     isSelected: boolean;
     handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource, isAdmin: boolean) => void;
+    handleCardClick: (resource: any) => void;
 };
 
 type ProjectCardProps = WithStyles<CssRules> & {
@@ -187,6 +193,7 @@ type ProjectCardProps = WithStyles<CssRules> & {
     isAdmin: boolean;
     isSelected: boolean;
     handleContextMenu: (event: React.MouseEvent<HTMLElement>, resource: ContextMenuResource, isAdmin: boolean) => void;
+    handleCardClick: (resource: any) => void;
 };
 
 export const ProjectDetailsCard = connect(
@@ -194,7 +201,7 @@ export const ProjectDetailsCard = connect(
     mapDispatchToProps
 )(
     withStyles(styles)((props: DetailsCardProps) => {
-        const { classes, currentResource, frozenByFullName, handleContextMenu, isAdmin, isSelected } = props;
+        const { classes, currentResource, frozenByFullName, handleContextMenu, handleCardClick, isAdmin, isSelected } = props;
         switch (currentResource.kind as string) {
             case ResourceKind.USER:
                 return (
@@ -204,6 +211,7 @@ export const ProjectDetailsCard = connect(
                         isAdmin={isAdmin}
                         isSelected={isSelected}
                         handleContextMenu={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
+                        handleCardClick={handleCardClick}
                     />
                 );
             case ResourceKind.PROJECT:
@@ -215,6 +223,7 @@ export const ProjectDetailsCard = connect(
                         isAdmin={isAdmin}
                         isSelected={isSelected}
                         handleContextMenu={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
+                        handleCardClick={handleCardClick}
                     />
                 );
             default:
@@ -223,11 +232,11 @@ export const ProjectDetailsCard = connect(
     })
 );
 
-const UserCard: React.FC<UserCardProps> = ({ classes, currentResource, handleContextMenu, isAdmin, isSelected }) => {
+const UserCard: React.FC<UserCardProps> = ({ classes, currentResource, handleContextMenu, handleCardClick, isAdmin, isSelected }) => {
     const { fullName, uuid } = currentResource as UserResource & { fullName: string };
 
     return (
-        <Card className={classNames(classes.root, isSelected ? classes.selected : '')}>
+        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)}>
             <CardHeader
                 className={classes.cardHeader}
                 title={
@@ -265,8 +274,8 @@ const UserCard: React.FC<UserCardProps> = ({ classes, currentResource, handleCon
     );
 };
 
-const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, frozenByFullName, handleContextMenu, isAdmin, isSelected }) => {
-    const { name, description } = currentResource as ProjectResource;
+const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, frozenByFullName, handleContextMenu, handleCardClick, isAdmin, isSelected }) => {
+    const { name, description, uuid } = currentResource as ProjectResource;
     const [showDescription, setShowDescription] = React.useState(false);
 
     const toggleDescription = () => {
@@ -274,7 +283,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
     };
 
     return (
-        <Card className={classNames(classes.root, isSelected ? classes.selected : '')}>
+        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)}>
             <CardHeader
                 className={classes.cardHeader}
                 title={
@@ -332,7 +341,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
                                 )}
                         </Typography>
                     </section>
-                    <section className={classes.descriptionLabel}>
+                    <section className={classes.descriptionLabel} onClick={(ev)=>ev.stopPropagation()}>
                         {description ? (
                             <Typography
                                 className={classes.showMore}
@@ -346,7 +355,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
                     </section>
                 </section>
                 <Collapse in={showDescription} timeout='auto'>
-                    <section>
+                    <section onClick={(ev)=>ev.stopPropagation()}>
                         <Typography className={classes.description}>
                             {description}
                         </Typography>
diff --git a/services/workbench2/src/views-components/resource-properties-form/property-chip.tsx b/services/workbench2/src/views-components/resource-properties-form/property-chip.tsx
index 24b5c0a96d..cfdae3fe83 100644
--- a/services/workbench2/src/views-components/resource-properties-form/property-chip.tsx
+++ b/services/workbench2/src/views-components/resource-properties-form/property-chip.tsx
@@ -43,10 +43,12 @@ export const PropertyChipComponent = connect(mapStateToProps, mapDispatchToProps
     ({ propKey, propValue, vocabulary, className, onCopy, onDelete }: PropertyChipComponentProps) => {
         const label = `${getTagKeyLabel(propKey, vocabulary)}: ${getTagValueLabel(propKey, propValue, vocabulary)}`;
         return (
-            <CopyToClipboard key={propKey} text={label} onCopy={() => onCopy("Copied to clipboard")}>
-                <Chip onDelete={onDelete} key={propKey}
-                    className={className} label={label} />
-            </CopyToClipboard>
+            <span onClick={(ev)=>ev.stopPropagation()}>
+                <CopyToClipboard key={propKey} text={label} onCopy={() => onCopy("Copied to clipboard")}>
+                    <Chip onDelete={onDelete} key={propKey}
+                        className={className} label={label} />
+                </CopyToClipboard>
+            </span>
         );
     }
 );

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list