ISSUE-713 Inform user of COUNTER success (#714)
This commit is contained in:
@@ -4,6 +4,7 @@ import { DateTimeFields } from "@/components/Event/components/DateTimeFields";
|
|||||||
import { FieldWithLabel } from "@/components/Event/components/FieldWithLabel";
|
import { FieldWithLabel } from "@/components/Event/components/FieldWithLabel";
|
||||||
import { splitDateTime } from "@/components/Event/utils/dateTimeHelpers";
|
import { splitDateTime } from "@/components/Event/utils/dateTimeHelpers";
|
||||||
import { Box, Button, TextField, Typography } from "@linagora/twake-mui";
|
import { Box, Button, TextField, Typography } from "@linagora/twake-mui";
|
||||||
|
import { SnackbarAlert } from "@/components/Loading/SnackBarAlert";
|
||||||
import moment from "moment-timezone";
|
import moment from "moment-timezone";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useI18n } from "twake-i18n";
|
import { useI18n } from "twake-i18n";
|
||||||
@@ -22,6 +23,7 @@ export function EventCounterModal({
|
|||||||
}) {
|
}) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
|
const [showSuccessToast, setShowSuccessToast] = useState(false);
|
||||||
|
|
||||||
const allday = contextualizedEvent.event.allday ?? false;
|
const allday = contextualizedEvent.event.allday ?? false;
|
||||||
|
|
||||||
@@ -128,6 +130,7 @@ export function EventCounterModal({
|
|||||||
: `${endDate}T${endTime}`,
|
: `${endDate}T${endTime}`,
|
||||||
message,
|
message,
|
||||||
});
|
});
|
||||||
|
setShowSuccessToast(true);
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -150,6 +153,12 @@ export function EventCounterModal({
|
|||||||
}, [open, startSplit.date, startSplit.time, endSplit.date, endSplit.time]);
|
}, [open, startSplit.date, startSplit.time, endSplit.date, endSplit.time]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<SnackbarAlert
|
||||||
|
open={showSuccessToast}
|
||||||
|
setOpen={setShowSuccessToast}
|
||||||
|
message={t("eventPreview.proposalSubmitted")}
|
||||||
|
/>
|
||||||
<ResponsiveDialog
|
<ResponsiveDialog
|
||||||
open={open}
|
open={open}
|
||||||
onClose={() => setOpen(false)}
|
onClose={() => setOpen(false)}
|
||||||
@@ -176,7 +185,10 @@ export function EventCounterModal({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Your proposal label */}
|
{/* Your proposal label */}
|
||||||
<FieldWithLabel label={t("eventPreview.yourProposal")} isExpanded={false}>
|
<FieldWithLabel
|
||||||
|
label={t("eventPreview.yourProposal")}
|
||||||
|
isExpanded={false}
|
||||||
|
>
|
||||||
<DateTimeFields
|
<DateTimeFields
|
||||||
startDate={startDate}
|
startDate={startDate}
|
||||||
startTime={startTime}
|
startTime={startTime}
|
||||||
@@ -239,5 +251,6 @@ export function EventCounterModal({
|
|||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</ResponsiveDialog>
|
</ResponsiveDialog>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,6 +286,7 @@
|
|||||||
"yourProposal": "Your proposal",
|
"yourProposal": "Your proposal",
|
||||||
"optionalMessage": "Add optional message to the organizer",
|
"optionalMessage": "Add optional message to the organizer",
|
||||||
"sendProposal": "Send proposal",
|
"sendProposal": "Send proposal",
|
||||||
|
"proposalSubmitted": "New time proposal submitted",
|
||||||
"ACCEPTED": "Yes",
|
"ACCEPTED": "Yes",
|
||||||
"TENTATIVE": "Maybe",
|
"TENTATIVE": "Maybe",
|
||||||
"DECLINED": "No",
|
"DECLINED": "No",
|
||||||
|
|||||||
@@ -287,6 +287,7 @@
|
|||||||
"yourProposal": "Votre proposition",
|
"yourProposal": "Votre proposition",
|
||||||
"optionalMessage": "Ajouter un message optionnel à l'organisateur",
|
"optionalMessage": "Ajouter un message optionnel à l'organisateur",
|
||||||
"sendProposal": "Envoyer la proposition",
|
"sendProposal": "Envoyer la proposition",
|
||||||
|
"proposalSubmitted": "Proposition de nouvel horaire envoyée",
|
||||||
"ACCEPTED": "Oui",
|
"ACCEPTED": "Oui",
|
||||||
"TENTATIVE": "Peut-être",
|
"TENTATIVE": "Peut-être",
|
||||||
"DECLINED": "Non",
|
"DECLINED": "Non",
|
||||||
|
|||||||
@@ -287,6 +287,7 @@
|
|||||||
"yourProposal": "Ваше предложение",
|
"yourProposal": "Ваше предложение",
|
||||||
"optionalMessage": "Добавить необязательное сообщение организатору",
|
"optionalMessage": "Добавить необязательное сообщение организатору",
|
||||||
"sendProposal": "Отправить предложение",
|
"sendProposal": "Отправить предложение",
|
||||||
|
"proposalSubmitted": "Новое предложение по времени отправлено",
|
||||||
"ACCEPTED": "Да",
|
"ACCEPTED": "Да",
|
||||||
"TENTATIVE": "Возможно",
|
"TENTATIVE": "Возможно",
|
||||||
"DECLINED": "Нет",
|
"DECLINED": "Нет",
|
||||||
|
|||||||
@@ -285,6 +285,7 @@
|
|||||||
"yourProposal": "Đề xuất của bạn",
|
"yourProposal": "Đề xuất của bạn",
|
||||||
"optionalMessage": "Thêm tin nhắn tùy chọn cho người tổ chức",
|
"optionalMessage": "Thêm tin nhắn tùy chọn cho người tổ chức",
|
||||||
"sendProposal": "Gửi đề xuất",
|
"sendProposal": "Gửi đề xuất",
|
||||||
|
"proposalSubmitted": "Đề xuất thời gian mới đã được gửi",
|
||||||
"ACCEPTED": "Có",
|
"ACCEPTED": "Có",
|
||||||
"TENTATIVE": "Có thể",
|
"TENTATIVE": "Có thể",
|
||||||
"DECLINED": "Không",
|
"DECLINED": "Không",
|
||||||
|
|||||||
Reference in New Issue
Block a user