From: Stephen Smith Date: Tue, 14 Dec 2021 02:45:40 +0000 (-0500) Subject: 18123: Add optional disabled prop to active checkbox. X-Git-Tag: 2.4.0~22^2~4 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/311448f71e5a5cc1ffcfe6d5b7c5214fa196f1b1 18123: Add optional disabled prop to active checkbox. Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index 2ec4bf51..11752a5a 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -188,11 +188,12 @@ export const ResourceEmail = connect( return resource || { email: '' }; })(renderEmail); -const renderIsActive = (props: { uuid: string, kind: ResourceKind, isActive: boolean, toggleIsActive: (uuid: string) => void }) => { +const renderIsActive = (props: { uuid: string, kind: ResourceKind, isActive: boolean, toggleIsActive: (uuid: string) => void, disabled?: boolean }) => { if (props.kind === ResourceKind.USER) { return props.toggleIsActive(props.uuid)} />; } else { return ; @@ -200,18 +201,18 @@ const renderIsActive = (props: { uuid: string, kind: ResourceKind, isActive: boo } export const ResourceIsActive = connect( - (state: RootState, props: { uuid: string }) => { + (state: RootState, props: { uuid: string, disabled?: boolean }) => { const resource = getResource(props.uuid)(state.resources); - return resource || { isActive: false, kind: ResourceKind.NONE }; + return resource ? {...resource, disabled: !!props.disabled} : { isActive: false, kind: ResourceKind.NONE }; }, { toggleIsActive } )(renderIsActive); export const ResourceLinkTailIsActive = connect( - (state: RootState, props: { uuid: string }) => { + (state: RootState, props: { uuid: string, disabled?: boolean }) => { const link = getResource(props.uuid)(state.resources); const tailResource = getResource(link?.tailUuid || '')(state.resources); - return tailResource || { isActive: false, kind: ResourceKind.NONE }; + return tailResource ? {...tailResource, disabled: !!props.disabled} : { isActive: false, kind: ResourceKind.NONE }; }, { toggleIsActive } )(renderIsActive); diff --git a/src/views/group-details-panel/group-details-panel.tsx b/src/views/group-details-panel/group-details-panel.tsx index 9f2d3f41..e47ff8c0 100644 --- a/src/views/group-details-panel/group-details-panel.tsx +++ b/src/views/group-details-panel/group-details-panel.tsx @@ -55,7 +55,7 @@ export const groupDetailsMembersPanelColumns: DataColumns = [ selected: true, configurable: true, filters: createTree(), - render: uuid => + render: uuid => }, { name: GroupDetailsPanelMembersColumnNames.VISIBLE,