From 851262322c7c5b35f4052b0351b77f190def77b0 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Tue, 24 May 2022 10:10:21 -0300 Subject: [PATCH] 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 --- .../sharing-dialog/sharing-dialog-component.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) => { -- 2.30.2