diff --git a/components/TableScheduleEvents.vue b/components/TableScheduleEvents.vue index 84871a9..2da2849 100644 --- a/components/TableScheduleEvents.vue +++ b/components/TableScheduleEvents.vue @@ -158,6 +158,7 @@ function newEvent() { !newEventPublic.value, "", false, + "", newEventDescription.value, 0, new Set(), diff --git a/shared/types/api.ts b/shared/types/api.ts index d1994e0..eb192a4 100644 --- a/shared/types/api.ts +++ b/shared/types/api.ts @@ -92,6 +92,7 @@ export const apiScheduleEventSchema = defineApiEntity({ crew: z.optional(z.boolean()), host: z.optional(z.string()), cancelled: z.optional(z.boolean()), + notice: z.optional(z.string()), description: z.optional(z.string()), interested: z.optional(z.number()), slots: z.array(apiScheduleEventSlotSchema), diff --git a/utils/client-schedule.nuxt.test.ts b/utils/client-schedule.nuxt.test.ts index e422633..9222301 100644 --- a/utils/client-schedule.nuxt.test.ts +++ b/utils/client-schedule.nuxt.test.ts @@ -21,10 +21,10 @@ function fixtureClientSchedule(multiSlot = false) { const events = [ new ClientScheduleEvent( - 1, now, false, "Up", false, "", false, "What's Up?", 0, new Set(multiSlot ? [1, 2] : [1]), + 1, now, false, "Up", false, "", false, "", "What's Up?", 0, new Set(multiSlot ? [1, 2] : [1]), ), new ClientScheduleEvent( - 2, now, false, "Down", false, "", false, "", 0, new Set(multiSlot ? [] : [2]), + 2, now, false, "Down", false, "", false, "", "", 0, new Set(multiSlot ? [] : [2]), ), ]; const eventSlots = idMap([ @@ -174,7 +174,7 @@ describe("class ClientSchedule", () => { ], [ "event", - (schedule) => ClientScheduleEvent.create(schedule, 3, "New location", false, "", false, "", 0, new Set(), { zone, locale }) + (schedule) => ClientScheduleEvent.create(schedule, 3, "New location", false, "", false, "", "", 0, new Set(), { zone, locale }) ], [ "role", diff --git a/utils/client-schedule.ts b/utils/client-schedule.ts index 7334163..17db51b 100644 --- a/utils/client-schedule.ts +++ b/utils/client-schedule.ts @@ -136,6 +136,7 @@ export class ClientScheduleEvent extends ClientEntity { serverCrew: boolean; serverHost: string; serverCancelled: boolean; + serverNotice: string; serverDescription: string; serverInterested: number; serverSlotIds: Set; @@ -148,6 +149,7 @@ export class ClientScheduleEvent extends ClientEntity { public crew: boolean, public host: string, public cancelled: boolean, + public notice: string, public description: string, public interested: number, public slotIds: Set, @@ -157,6 +159,7 @@ export class ClientScheduleEvent extends ClientEntity { this.serverCrew = crew; this.serverHost = host; this.serverCancelled = cancelled; + this.serverNotice = notice; this.serverDescription = description; this.serverInterested = interested; this.serverSlotIds = new Set(slotIds); @@ -173,6 +176,7 @@ export class ClientScheduleEvent extends ClientEntity { || this.crew !== this.serverCrew || this.host !== this.serverHost || this.cancelled !== this.serverCancelled + || this.notice !== this.serverNotice || this.description !== this.serverDescription || this.interested !== this.serverInterested || !setEquals(this.slotIds, this.serverSlotIds) @@ -190,6 +194,7 @@ export class ClientScheduleEvent extends ClientEntity { this.crew = this.serverCrew; this.host = this.serverHost; this.cancelled = this.serverCancelled; + this.notice = this.serverNotice; this.description = this.serverDescription; this.interested = this.serverInterested; for (const id of this.serverSlotIds) { @@ -208,6 +213,7 @@ export class ClientScheduleEvent extends ClientEntity { crew: boolean, host: string, cancelled: boolean, + notice: string, description: string, interested: number, slotIds: Set, @@ -221,6 +227,7 @@ export class ClientScheduleEvent extends ClientEntity { crew, host, cancelled, + notice, description, interested, slotIds, @@ -241,6 +248,7 @@ export class ClientScheduleEvent extends ClientEntity { api.crew ?? false, api.host ?? "", api.cancelled ?? false, + api.notice ?? "", api.description ?? "", api.interested ?? 0, new Set(api.slots.map(slot => slot.id)), @@ -258,6 +266,7 @@ export class ClientScheduleEvent extends ClientEntity { this.serverCrew = api.crew ?? false; this.serverHost = api.host ?? ""; this.serverCancelled = api.cancelled ?? false; + this.serverNotice = api.notice ?? ""; this.serverDescription = api.description ?? ""; this.serverInterested = api.interested ?? 0; this.serverSlotIds = new Set(api.slots.map(slot => slot.id)); @@ -281,6 +290,7 @@ export class ClientScheduleEvent extends ClientEntity { crew: this.crew || undefined, host: this.host || undefined, cancelled: this.cancelled || undefined, + notice: this.notice || undefined, description: this.description || undefined, interested: this.interested || undefined, slots: [...this.slots.values()].filter(slot => !slot.deleted).map(slot => slot.toApi()),