From: Lucas Di Pentima Date: Tue, 24 May 2022 13:10:21 +0000 (-0300) Subject: 16115: Sets expiration date's minutes & seconds to zero. X-Git-Tag: 2.4.1~1^2~2^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/851262322c7c5b35f4052b0351b77f190def77b0 16115: Sets expiration date's minutes & seconds to zero. Default expiration date is now set in a way that it gives the sharing link at least 1:01h of lifetime and up to 2h. The user can select other dates with a minimum step resolution of 1h. Also, the "Create sharing URL" button won't be enabled if the selected date is in the past. This is done this way because the Time picker doesn't seem to support a "minDate" (or minHour?) property. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/views-components/sharing-dialog/sharing-dialog-component.tsx b/src/views-components/sharing-dialog/sharing-dialog-component.tsx index cd7ea9bb..b54b3455 100644 --- a/src/views-components/sharing-dialog/sharing-dialog-component.tsx +++ b/src/views-components/sharing-dialog/sharing-dialog-component.tsx @@ -73,7 +73,7 @@ export default (props: SharingDialogDataProps & SharingDialogActionProps) => { if (!withExpiration) { setExpDate(undefined); } else { - setExpDate(moment().add(1, 'hour').toDate()); + setExpDate(moment().add(2, 'hour').minutes(0).seconds(0).toDate()); } }, [withExpiration]); @@ -155,6 +155,7 @@ export default (props: SharingDialogDataProps & SharingDialogActionProps) => {