chore: improve text for booker active booking limit (#24526)
* chore: improve text for booker active booking limit * update keys to new one for lingo .dev future recognition
This commit is contained in:
1 parent
f8614f11ff
commit
1fd64c5d7b
4 files changed
+17
-7
No files matched your search
@@ -1893,7 +1893,7 @@
|
||||
"only_show_first_available_slot_description": "This will limit your availability for this event type to one slot per day, scheduled at the earliest available time.",
|
||||
"limit_total_booking_duration": "Limit total booking duration",
|
||||
"limit_total_booking_duration_description": "Limit total amount of time that this event can be booked",
|
||||
"booker_booking_limit": "Booker active booking limit",
|
||||
"booker_upcoming_limit": "Limit number of upcoming bookings per booker",
|
||||
"booker_booking_limit_description": "Limit the number of active bookings a booker can make for this event type",
|
||||
"recurring_event_doesnt_support_booker_booking_limit": "Recurring events don't support booker booking limit",
|
||||
"add_limit": "Add Limit",
|
||||
@@ -3636,8 +3636,8 @@
|
||||
"error_downloading_expense_log": "Error downloading expense log",
|
||||
"require_booker_email_verification": "Prevent Impersonation on Bookings",
|
||||
"require_booker_email_verification_description": "When enabled, anyone trying to book events using your email address must verify they own it via a one time code or be logged in to prevent impersonation",
|
||||
"offer_to_reschedule_last_booking": "Offer to reschedule last active booking to chosen time slot",
|
||||
"booker_limit_exceeded_error": "Booker maximum active booking limit exceeded",
|
||||
"reschedule_last_booking_offer": "Offer to reschedule the last booking to the new time slot",
|
||||
"booker_upcoming_limit_reached": "You've reached the limit of {{count}} upcoming bookings for this event type",
|
||||
"booker_limit_exceeded_error_reschedule": "You already have a booking for this event on {{date}}. Would you like to reschedule to the new selected time?",
|
||||
"duration_min_error": "Duration must be at least {{min}} minute(s)",
|
||||
"duration_max_error": "Duration cannot exceed {{max}} minutes (24 hours)",
|
||||
|
||||
@@ -301,6 +301,7 @@ const getError = ({
|
||||
const error = dataError;
|
||||
|
||||
let date = "";
|
||||
let count = 0;
|
||||
|
||||
if (error.message === ErrorCode.BookerLimitExceededReschedule) {
|
||||
const formattedDate = formatEventFromTime({
|
||||
@@ -312,9 +313,16 @@ const getError = ({
|
||||
date = `${formattedDate.date} ${formattedDate.time}`;
|
||||
}
|
||||
|
||||
if (error.message === ErrorCode.BookerLimitExceeded && error.data?.count) {
|
||||
count = error.data.count;
|
||||
}
|
||||
|
||||
const messageKey =
|
||||
error.message === ErrorCode.BookerLimitExceeded ? "booker_upcoming_limit_reached" : error.message;
|
||||
|
||||
return error?.message ? (
|
||||
<>
|
||||
{responseVercelIdHeader ?? ""} {t(error.message, { date })}
|
||||
{responseVercelIdHeader ?? ""} {t(messageKey, { date, count })}
|
||||
</>
|
||||
) : (
|
||||
<>{t("can_you_try_again")}</>
|
||||
|
||||
+3
-1
@@ -61,7 +61,9 @@ const checkActiveBookingsLimit = async ({
|
||||
|
||||
if (bookingsCount >= maxActiveBookingsPerBooker) {
|
||||
log.warn(`Maximum booking limit reached for ${bookerEmail} for event type ${eventTypeId}`);
|
||||
throw new ErrorWithCode(ErrorCode.BookerLimitExceeded, ErrorCode.BookerLimitExceeded);
|
||||
throw new ErrorWithCode(ErrorCode.BookerLimitExceeded, ErrorCode.BookerLimitExceeded, {
|
||||
count: maxActiveBookingsPerBooker,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ export default function MaxActiveBookingsPerBookerController({
|
||||
isChecked && "rounded-b-none"
|
||||
)}
|
||||
childrenClassName={classNames("lg:ml-0")}
|
||||
title={t("booker_booking_limit")}
|
||||
title={t("booker_upcoming_limit")}
|
||||
description={t("booker_booking_limit_description")}
|
||||
checked={isChecked}
|
||||
onCheckedChange={(active) => {
|
||||
@@ -76,7 +76,7 @@ export default function MaxActiveBookingsPerBookerController({
|
||||
<CheckboxField
|
||||
checked={!!maxActiveBookingPerBookerOfferReschedule}
|
||||
descriptionAsLabel
|
||||
description={t("offer_to_reschedule_last_booking")}
|
||||
description={t("reschedule_last_booking_offer")}
|
||||
disabled={maxActiveBookingsPerBookerLocked.disabled}
|
||||
onChange={(e) => {
|
||||
formMethods.setValue("maxActiveBookingPerBookerOfferReschedule", e.target.checked, {
|
||||
|
||||
Reference in new issue
Block a user