From 3f5d88f9f0a9d0ca9dd6c6a02684a2d83acc1f61 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Fri, 23 Jun 2023 13:02:32 +0530 Subject: [PATCH 1/4] fix: undo the changes for start date and end date init date for recurrning modal caledar --- .../RecurringModal/RecurringModal.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx b/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx index d2c005e65..e5dfac8bc 100644 --- a/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx +++ b/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx @@ -150,7 +150,7 @@ const RecurringModal = ({ return item; }), ); - } else setDataSource([...dateSource, test].sort((a, b) => (b.initDate < a.initDate ? 1 : -1))); + } else setDataSource([...dateSource, test].sort((a, b) => (b.startDate < a.startDate ? 1 : -1))); setTest(null); } }, [test]); @@ -162,7 +162,7 @@ const RecurringModal = ({ const newCopyArray = dateArrayCal.filter((item) => !checkDateExisting.includes(item.initDate)); const iterated = [...dateSource, [].concat.apply([], newCopyArray)]; - setDataSource([].concat.apply([], iterated).sort((a, b) => (b?.initDate < a?.initDate ? 1 : -1))); + setDataSource([].concat.apply([], iterated).sort((a, b) => (b.startDate < a.startDate ? 1 : -1))); } setDateArrayCal(null); } @@ -289,14 +289,14 @@ const RecurringModal = ({ const dateLength = await getNumberOfDays(e.startDate, e.endDate); if (dateLength && dateLength.length > 1) { const dateArray = dateLength.map((item) => { - // const date = moment(item, 'YYYY-MM-DD'); + const date = moment(item, 'YYYY-MM-DD'); const obj = { id: uniqid(), name: 'test name', location: 'test Location', - startDate: new Date(item), - endDate: new Date(item), - initDate: item, + startDate: new Date(date.format('YYYY-MM-DD')), + endDate: new Date(date.format('YYYY-MM-DD')), + initDate: moment(date).format('YYYY-MM-DD'), isDeleted: false, color: '#607EFC', }; From 189cda783b9ec7445d2d9f3c164790e93dfa9785 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Fri, 23 Jun 2023 15:21:04 +0530 Subject: [PATCH 2/4] fix: disabling the action buttons for event during image upload --- src/pages/Dashboard/AddEvent/AddEvent.jsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/Dashboard/AddEvent/AddEvent.jsx b/src/pages/Dashboard/AddEvent/AddEvent.jsx index fd20e6bb8..47d16770a 100644 --- a/src/pages/Dashboard/AddEvent/AddEvent.jsx +++ b/src/pages/Dashboard/AddEvent/AddEvent.jsx @@ -120,7 +120,7 @@ function AddEvent() { const [getEntities] = useLazyGetEntitiesQuery({ sessionId: timestampRef }); const [updateEventState, { isLoading: updateEventStateLoading }] = useUpdateEventStateMutation(); const [updateEvent, { isLoading: updateEventLoading }] = useUpdateEventMutation(); - const [addImage, { error: isAddImageError }] = useAddImageMutation(); + const [addImage, { error: isAddImageError, isLoading: addImageLoading }] = useAddImageMutation(); const [getAllTaxonomy] = useLazyGetAllTaxonomyQuery({ sessionId: timestampRef }); const [dateType, setDateType] = useState(); @@ -639,14 +639,16 @@ function AddEvent() { size="large" label={t('dashboard.events.addEditEvent.saveOptions.saveAsDraft')} onClick={(e) => saveAsDraftHandler(e)} - disabled={updateEventLoading || addEventLoading ? true : false} + disabled={updateEventLoading || addEventLoading || addImageLoading ? true : false} /> reviewPublishHandler(e)} - disabled={updateEventLoading || addEventLoading || updateEventStateLoading ? true : false} + disabled={ + updateEventLoading || addEventLoading || updateEventStateLoading || addImageLoading ? true : false + } /> @@ -659,7 +661,7 @@ function AddEvent() { size="large" label={t('dashboard.events.addEditEvent.saveOptions.saveAsDraft')} onClick={(e) => saveAsDraftHandler(e)} - disabled={updateEventLoading || addEventLoading ? true : false} + disabled={updateEventLoading || addEventLoading || addImageLoading ? true : false} /> @@ -667,7 +669,9 @@ function AddEvent() { reviewPublishHandler(e)} - disabled={updateEventLoading || addEventLoading || updateEventStateLoading ? true : false} + disabled={ + updateEventLoading || addEventLoading || updateEventStateLoading || addImageLoading ? true : false + } /> @@ -687,7 +691,7 @@ function AddEvent() { saveAsDraftHandler(e)} - disabled={updateEventLoading || addEventLoading ? true : false} + disabled={updateEventLoading || addEventLoading || addImageLoading ? true : false} /> From 64ed4988184e1d8d41a143ea7580a33886aa703c Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Fri, 23 Jun 2023 17:33:45 +0530 Subject: [PATCH 3/4] fix: removeitem for user and publication session storage added --- src/pages/Dashboard/Events/Events.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/Dashboard/Events/Events.jsx b/src/pages/Dashboard/Events/Events.jsx index 39014dee4..3fa37f756 100644 --- a/src/pages/Dashboard/Events/Events.jsx +++ b/src/pages/Dashboard/Events/Events.jsx @@ -215,7 +215,9 @@ function Events() { sessionStorage.setItem('order', filter?.order); sessionStorage.setItem('sortBy', filter?.sort); if (usersQuery) sessionStorage.setItem('users', usersQuery); + else sessionStorage.removeItem('users'); if (publicationQuery) sessionStorage.setItem('publication', publicationQuery); + else sessionStorage.removeItem('publication'); if (filter?.dates[0] && filter?.dates[0] !== '') sessionStorage.setItem('startDateRange', filter?.dates[0]); if (filter?.dates[1] && filter?.dates[1] !== '') sessionStorage.setItem('endDateRange', filter?.dates[1]); }, [calendarId, pageNumber, eventSearchQuery, filter, userFilter]); From 9e42af7d7dc7d52bae0336a76b68506708555b10 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Mon, 26 Jun 2023 04:09:06 -0400 Subject: [PATCH 4/4] fix: changed the date format for start date and end date --- .../RecurringEvents/RecurringModal/RecurringModal.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx b/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx index e5dfac8bc..3e12b96fc 100644 --- a/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx +++ b/src/components/RecurringEvents/RecurringModal/RecurringModal.jsx @@ -150,7 +150,7 @@ const RecurringModal = ({ return item; }), ); - } else setDataSource([...dateSource, test].sort((a, b) => (b.startDate < a.startDate ? 1 : -1))); + } else setDataSource([...dateSource, test].sort((a, b) => (b.initDate < a.initDate ? 1 : -1))); setTest(null); } }, [test]); @@ -162,7 +162,7 @@ const RecurringModal = ({ const newCopyArray = dateArrayCal.filter((item) => !checkDateExisting.includes(item.initDate)); const iterated = [...dateSource, [].concat.apply([], newCopyArray)]; - setDataSource([].concat.apply([], iterated).sort((a, b) => (b.startDate < a.startDate ? 1 : -1))); + setDataSource([].concat.apply([], iterated).sort((a, b) => (b.initDate < a.initDate ? 1 : -1))); } setDateArrayCal(null); } @@ -294,9 +294,9 @@ const RecurringModal = ({ id: uniqid(), name: 'test name', location: 'test Location', - startDate: new Date(date.format('YYYY-MM-DD')), - endDate: new Date(date.format('YYYY-MM-DD')), - initDate: moment(date).format('YYYY-MM-DD'), + startDate: new Date(date.format('YYYY/M/D')), + endDate: new Date(date.format('YYYY/M/D')), + initDate: date.format('YYYY-MM-DD'), isDeleted: false, color: '#607EFC', };