From cbebc4630ca0e966b10193d77c41f3ed72567e7e Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 31 Mar 2023 15:39:23 -0400 Subject: [PATCH] 20085: Moving the (+) button trying to restyle it Typescript is fighting me every step of the way, something that should take like 15 minutes is taking 3 hours, argh. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- .../sharing-dialog-component.tsx | 147 ++++++++---------- .../sharing-invitation-form-component.tsx | 24 ++- .../sharing-invitation-form.tsx | 20 ++- .../sharing-management-form-component.tsx | 5 +- 4 files changed, 107 insertions(+), 89 deletions(-) diff --git a/src/views-components/sharing-dialog/sharing-dialog-component.tsx b/src/views-components/sharing-dialog/sharing-dialog-component.tsx index 6c4d4f02..74e44550 100644 --- a/src/views-components/sharing-dialog/sharing-dialog-component.tsx +++ b/src/views-components/sharing-dialog/sharing-dialog-component.tsx @@ -107,100 +107,91 @@ export default (props: SharingDialogComponentProps) => { Sharing settings - { showTabs && - { - if (tb === SharingDialogTab.PERMISSIONS) { - refreshPermissions(); + {showTabs && + { + if (tb === SharingDialogTab.PERMISSIONS) { + refreshPermissions(); + } + setTabNr(tb) } - setTabNr(tb)} - }> - - 0 ? '('+sharingURLsNr+')' : ''}`} disabled={saveEnabled} /> - + }> + + 0 ? '(' + sharingURLsNr + ')' : ''}`} disabled={saveEnabled} /> + } - { tabNr === SharingDialogTab.PERMISSIONS && - - - - - - + {tabNr === SharingDialogTab.PERMISSIONS && + + + + + + + - } - { tabNr === SharingDialogTab.URLS && - + {tabNr === SharingDialogTab.URLS && + } - { tabNr === SharingDialogTab.PERMISSIONS && - - - + {tabNr === SharingDialogTab.PERMISSIONS && + + + } - { tabNr === SharingDialogTab.URLS && withExpiration && <> - - - - {({ date, handleChange }) => (<> - - - - - {}} - onSecondsChange={() => {}} - onHourChange={handleChange} - /> - - )} - - - - - - Maximum expiration date may be limited by the cluster configuration. - - + {tabNr === SharingDialogTab.URLS && withExpiration && <> + + + + {({ date, handleChange }) => (<> + + + + + { }} + onSecondsChange={() => { }} + onHourChange={handleChange} + /> + + )} + + + + + + Maximum expiration date may be limited by the cluster configuration. + + } - { tabNr === SharingDialogTab.PERMISSIONS && !sharingURLsDisabled && + {tabNr === SharingDialogTab.PERMISSIONS && !sharingURLsDisabled && privateAccess && sharingURLsNr > 0 && - - - Although there aren't specific permissions set, this is publicly accessible via Sharing URL(s). - - + + + Although there aren't specific permissions set, this is publicly accessible via Sharing URL(s). + + } - { tabNr === SharingDialogTab.URLS && <> - setWithExpiration(e.target.checked)} />} - label="With expiration" /> - - - - - - } - { tabNr === SharingDialogTab.PERMISSIONS && - - - - - + + }