From 9ecdc799a7f75f971c5d79aa812b7d75686c413a Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Thu, 5 Oct 2023 12:11:28 -0400 Subject: [PATCH] 20891: refined group narrowing Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- .../data-explorer/renderers.tsx | 78 ++++++++++++------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index d21fead6ef..dca06084f6 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -49,7 +49,6 @@ import { setMemberIsHidden } from "store/group-details-panel/group-details-panel import { formatPermissionLevel } from "views-components/sharing-dialog/permission-select"; import { PermissionLevel } from "models/permission"; import { openPermissionEditContextMenu } from "store/context-menu/context-menu-actions"; -import { getUserUuid } from "common/getuser"; import { VirtualMachinesResource } from "models/virtual-machines"; import { CopyToClipboardSnackbar } from "components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar"; import { ProjectResource } from "models/project"; @@ -62,13 +61,15 @@ const renderName = (dispatch: Dispatch, item: GroupContentsResource) => { container alignItems="center" wrap="nowrap" - spacing={16}> + spacing={16} + > {renderIcon(item)} dispatch(navFunc(item.uuid))}> + onClick={() => dispatch(navFunc(item.uuid))} + > {item.kind === ResourceKind.PROJECT || item.kind === ResourceKind.COLLECTION ? : null} {item.name} @@ -97,7 +98,8 @@ const FrozenProject = (props: { item: ProjectResource }) => { Project was frozen by {fullUsername}}> + title={Project was frozen by {fullUsername}} + > ); @@ -136,7 +138,8 @@ const renderDate = (date?: string) => { return ( + style={{ minWidth: "100px" }} + > {formatDate(date)} ); @@ -147,12 +150,14 @@ const renderWorkflowName = (item: WorkflowResource) => ( container alignItems="center" wrap="nowrap" - spacing={16}> + spacing={16} + > {renderIcon(item)} + style={{ width: "100px" }} + > {item.name} @@ -219,7 +224,8 @@ const renderFullName = (dispatch: Dispatch, item: { uuid: string; firstName: str noWrap color="primary" style={{ cursor: "pointer" }} - onClick={() => dispatch(navigateToUserProfile(item.uuid))}> + onClick={() => dispatch(navigateToUserProfile(item.uuid))} + > {displayName} ) : ( @@ -237,7 +243,8 @@ export const UserResourceFullName = connect((state: RootState, props: { uuid: st const renderUuid = (item: { uuid: string }) => ( + noWrap + > {item.uuid} {(item.uuid && ) || "-"} @@ -246,7 +253,8 @@ const renderUuid = (item: { uuid: string }) => ( const renderUuidCopyIcon = (item: { uuid: string }) => ( + noWrap + > {(item.uuid && ) || "-"} ); @@ -275,7 +283,8 @@ const renderAccountStatus = (props: { status: UserAccountStatus }) => ( alignItems="center" wrap="nowrap" spacing={8} - data-cy="account-status"> + data-cy="account-status" + > {(() => { switch (props.status) { @@ -472,7 +481,8 @@ export const ResourceCluster = (props: { uuid: string }) => { color: clusterColors[ci][1], padding: "2px 7px", borderRadius: 3, - }}> + }} + > {clusterId} ); @@ -511,8 +521,12 @@ const renderResourceLink = (dispatch: Dispatch, item: Resource) => { color="primary" style={{ cursor: "pointer" }} onClick={() => { - item.kind === ResourceKind.GROUP ? dispatch(navigateToGroupDetails(item.uuid)) : dispatch(navigateTo(item.uuid)); - }}> + console.log(item); + item.kind === ResourceKind.GROUP && (item as GroupResource).groupClass === "role" + ? dispatch(navigateToGroupDetails(item.uuid)) + : dispatch(navigateTo(item.uuid)); + }} + > {resourceLabel(item.kind, item && item.kind === ResourceKind.GROUP ? (item as GroupResource).groupClass || "" : "")}:{" "} {displayName || item.uuid} @@ -562,7 +576,8 @@ const renderLinkDelete = (dispatch: Dispatch, item: LinkResource, canManage: boo dispatch(openRemoveGroupMemberDialog(item.uuid))}> + onClick={() => dispatch(openRemoveGroupMemberDialog(item.uuid))} + > @@ -570,7 +585,8 @@ const renderLinkDelete = (dispatch: Dispatch, item: LinkResource, canManage: boo + data-cy="resource-delete-button" + > @@ -611,7 +627,8 @@ const renderPermissionLevel = (dispatch: Dispatch, link: LinkResource, canManage {canManage ? ( dispatch(openPermissionEditContextMenu(event, link))}> + onClick={event => dispatch(openPermissionEditContextMenu(event, link))} + > ) : ( @@ -684,7 +701,8 @@ const renderWorkflowStatus = (uuidPrefix: string, ownerUuid?: string) => { const renderStatus = (status: string) => ( + style={{ width: "60px" }} + > {status} ); @@ -714,14 +732,16 @@ const renderUuidLinkWithCopyIcon = (dispatch: Dispatch, item: ProcessResource, c + wrap="nowrap" + > {selectedColumnUuid ? ( dispatch(navigateTo(selectedColumnUuid))}> + onClick={() => dispatch(navigateTo(selectedColumnUuid))} + > {selectedColumnUuid} ) : ( @@ -776,7 +796,8 @@ export const ResourceDeleteDate = connect((state: RootState, props: { uuid: stri export const renderFileSize = (fileSize?: number) => ( + style={{ minWidth: "45px" }} + > {formatFileSize(fileSize)} ); @@ -876,7 +897,8 @@ const _resourceWithName = withStyles( + noWrap + > {uuid} ); @@ -886,7 +908,8 @@ const _resourceWithName = withStyles( + noWrap + > {userFullname} ({uuid}) ); @@ -953,7 +976,8 @@ export const ResponsiblePerson = compose( + noWrap + > {uuid} ); @@ -963,7 +987,8 @@ export const ResponsiblePerson = compose( + noWrap + > {responsiblePersonName} ({uuid}) ); @@ -1036,7 +1061,8 @@ export const ProcessStartDate = connect((state: RootState, props: { uuid: string export const renderRunTime = (time: number) => ( + style={{ minWidth: "45px" }} + > {formatTime(time, true)} ); -- 2.30.2