fix(webui): submit scheduling option revisions
This commit is contained in:
@@ -52,6 +52,7 @@ assert.match(page, /type="email"[\s\S]*aria-label=\{I18N\.participantEmail\}/);
|
|||||||
assert.doesNotMatch(page, /header: I18N\.required|<table|scheduling-table|scheduling-card(?:\s|"|`)/);
|
assert.doesNotMatch(page, /header: I18N\.required|<table|scheduling-table|scheduling-card(?:\s|"|`)/);
|
||||||
assert.match(page, /aria-label=\{i18nMessage\("i18n:govoplan-scheduling\.decide_on_value/);
|
assert.match(page, /aria-label=\{i18nMessage\("i18n:govoplan-scheduling\.decide_on_value/);
|
||||||
assert.match(page, /submitSchedulingAvailability\(settings, selected\.id/);
|
assert.match(page, /submitSchedulingAvailability\(settings, selected\.id/);
|
||||||
|
assert.match(page, /option_revision: slot\.revision/);
|
||||||
assert.match(page, /getSchedulingAvailabilityResponse\(settings, selected\.id\)/);
|
assert.match(page, /getSchedulingAvailabilityResponse\(settings, selected\.id\)/);
|
||||||
assert.match(page, /setAvailability\(Object\.fromEntries\(response\.answers\.map/);
|
assert.match(page, /setAvailability\(Object\.fromEntries\(response\.answers\.map/);
|
||||||
assert.doesNotMatch(page, /<p>\{selected\.calendar_id\}<\/p>/);
|
assert.doesNotMatch(page, /<p>\{selected\.calendar_id\}<\/p>/);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export type SchedulingCandidateSlot = {
|
|||||||
timezone: string;
|
timezone: string;
|
||||||
location?: string | null;
|
location?: string | null;
|
||||||
position: number;
|
position: number;
|
||||||
|
revision: string;
|
||||||
freebusy_checked_at?: string | null;
|
freebusy_checked_at?: string | null;
|
||||||
freebusy_status?: string | null;
|
freebusy_status?: string | null;
|
||||||
freebusy_conflicts: Record<string, unknown>[];
|
freebusy_conflicts: Record<string, unknown>[];
|
||||||
@@ -121,6 +122,7 @@ export type SchedulingAvailabilityPayload = {
|
|||||||
answers: Array<{
|
answers: Array<{
|
||||||
slot_id: string;
|
slot_id: string;
|
||||||
value: SchedulingAvailabilityValue;
|
value: SchedulingAvailabilityValue;
|
||||||
|
option_revision: string;
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -403,8 +403,16 @@ export default function SchedulingPage({ settings, auth }: { settings: ApiSettin
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!selected || !selectedParticipant || !canRespond || availabilityLoading) return;
|
if (!selected || !selectedParticipant || !canRespond || availabilityLoading) return;
|
||||||
const answers = selected.slots
|
const answers = selected.slots
|
||||||
.map((slot) => ({ slot_id: slot.id, value: availability[slot.id] }))
|
.map((slot) => ({
|
||||||
.filter((answer): answer is { slot_id: string; value: SchedulingAvailabilityValue } => Boolean(answer.value));
|
slot_id: slot.id,
|
||||||
|
value: availability[slot.id],
|
||||||
|
option_revision: slot.revision
|
||||||
|
}))
|
||||||
|
.filter((answer): answer is {
|
||||||
|
slot_id: string;
|
||||||
|
value: SchedulingAvailabilityValue;
|
||||||
|
option_revision: string;
|
||||||
|
} => Boolean(answer.value));
|
||||||
if (!answers.length) {
|
if (!answers.length) {
|
||||||
setError(I18N.selectResponse);
|
setError(I18N.selectResponse);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user