@myclub_se/data-access 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/api-models/api-event.mjs +1 -1
- package/esm2022/lib/models/event.mjs +4 -2
- package/esm2022/lib/services/factories/event-factory.mjs +2 -2
- package/esm2022/lib/store/reducers/booking.reducers.mjs +4 -1
- package/esm2022/lib/store/reducers/calendar.reducer.mjs +4 -4
- package/fesm2022/myclub_se-data-access.mjs +10 -5
- package/fesm2022/myclub_se-data-access.mjs.map +1 -1
- package/lib/api-models/api-event.d.ts +1 -0
- package/lib/models/event.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2260,7 +2260,7 @@ const fileFactory = (file) => new FileObject(file.id, file.created, null, typeof
|
|
|
2260
2260
|
|
|
2261
2261
|
const directoryFactory = (directory) => new Directory(directory.id, directory.club_id, directory.section_id, directory.team_id, directory.created, directory.files.map((file) => fileFactory(file)), directory.name, directory.location_name, directory.updated);
|
|
2262
2262
|
|
|
2263
|
-
const eventFactory = (apiEvent) => new Event(apiEvent.id, apiEvent.activity_id, apiEvent.activity_type, apiEvent.base_background_color, apiEvent.base_color, apiEvent.base_name, apiEvent.calendar_name, apiEvent.description, apiEvent.end, apiEvent.invitation_id, apiEvent.invitation_response, (apiEvent.invited_members && apiEvent.invited_members.length) ? apiEvent.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiEvent.location, apiEvent.meet_up_place, apiEvent.meet_up_time, apiEvent.member_id, apiEvent.open_activity, (apiEvent.participants && apiEvent.participants.length) ? apiEvent.participants.map((participant) => activityParticipantFactory(participant)) : [], apiEvent.start, apiEvent.title, apiEvent.type, apiEvent.allow_waiting_list ?? false, apiEvent.member_waiting_list_status ?? null, apiEvent.member_waiting_list_position ?? null, apiEvent.waiting_list_offer_expires_at ?? null, apiEvent.waiting_list_offered_slots ?? null);
|
|
2263
|
+
const eventFactory = (apiEvent) => new Event(apiEvent.id, apiEvent.activity_id, apiEvent.activity_type, apiEvent.base_background_color, apiEvent.base_color, apiEvent.base_name, apiEvent.calendar_name, apiEvent.description, apiEvent.end, apiEvent.invitation_id, apiEvent.invitation_response, (apiEvent.invited_members && apiEvent.invited_members.length) ? apiEvent.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiEvent.last_response_date, apiEvent.location, apiEvent.meet_up_place, apiEvent.meet_up_time, apiEvent.member_id, apiEvent.open_activity, (apiEvent.participants && apiEvent.participants.length) ? apiEvent.participants.map((participant) => activityParticipantFactory(participant)) : [], apiEvent.start, apiEvent.title, apiEvent.type, apiEvent.allow_waiting_list ?? false, apiEvent.member_waiting_list_status ?? null, apiEvent.member_waiting_list_position ?? null, apiEvent.waiting_list_offer_expires_at ?? null, apiEvent.waiting_list_offered_slots ?? null);
|
|
2264
2264
|
|
|
2265
2265
|
const externalLinkFactory = (apiExternalLink) => new ExternalLink(apiExternalLink.text, apiExternalLink.value);
|
|
2266
2266
|
|
|
@@ -4193,6 +4193,7 @@ class Event {
|
|
|
4193
4193
|
invitation_id;
|
|
4194
4194
|
invitation_response;
|
|
4195
4195
|
invited_members;
|
|
4196
|
+
last_response_date;
|
|
4196
4197
|
location;
|
|
4197
4198
|
meet_up_place;
|
|
4198
4199
|
meet_up_time;
|
|
@@ -4207,7 +4208,7 @@ class Event {
|
|
|
4207
4208
|
member_waiting_list_position;
|
|
4208
4209
|
waiting_list_offer_expires_at;
|
|
4209
4210
|
waiting_list_offered_slots;
|
|
4210
|
-
constructor(id, activity_id, activity_type, base_background_color, base_color, base_name, calendar_name, description, end, invitation_id, invitation_response, invited_members, location, meet_up_place, meet_up_time, member_id, open_activity, participants, start, title, type, allow_waiting_list = false, member_waiting_list_status = null, member_waiting_list_position = null, waiting_list_offer_expires_at = null, waiting_list_offered_slots = null) {
|
|
4211
|
+
constructor(id, activity_id, activity_type, base_background_color, base_color, base_name, calendar_name, description, end, invitation_id, invitation_response, invited_members, last_response_date = null, location, meet_up_place, meet_up_time, member_id, open_activity, participants, start, title, type, allow_waiting_list = false, member_waiting_list_status = null, member_waiting_list_position = null, waiting_list_offer_expires_at = null, waiting_list_offered_slots = null) {
|
|
4211
4212
|
this.id = id;
|
|
4212
4213
|
this.activity_id = activity_id;
|
|
4213
4214
|
this.activity_type = activity_type;
|
|
@@ -4220,6 +4221,7 @@ class Event {
|
|
|
4220
4221
|
this.invitation_id = invitation_id;
|
|
4221
4222
|
this.invitation_response = invitation_response;
|
|
4222
4223
|
this.invited_members = invited_members;
|
|
4224
|
+
this.last_response_date = last_response_date;
|
|
4223
4225
|
this.location = location;
|
|
4224
4226
|
this.meet_up_place = meet_up_place;
|
|
4225
4227
|
this.meet_up_time = meet_up_time;
|
|
@@ -11409,7 +11411,7 @@ const updateMemberActivityInvites = (invites, payload) => {
|
|
|
11409
11411
|
const updateEventInvites = (events, payload) => {
|
|
11410
11412
|
return events.map((event) => {
|
|
11411
11413
|
if (event.invitation_id === payload.id) {
|
|
11412
|
-
return new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, event.invitation_id, payload.status, event.invited_members ? [...event.invited_members] : event.invited_members, event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type,
|
|
11414
|
+
return new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, event.invitation_id, payload.status, event.invited_members ? [...event.invited_members] : event.invited_members, event.last_response_date, event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type,
|
|
11413
11415
|
// Carry the waiting-list state from the (re-fetched) invite's activity so the calendar
|
|
11414
11416
|
// event keeps/updates its queue status — e.g. after joining or leaving the waiting list,
|
|
11415
11417
|
// or responding — instead of being reset to the Event defaults.
|
|
@@ -11424,7 +11426,7 @@ const updateEventInvites = (events, payload) => {
|
|
|
11424
11426
|
const removeEventInvite = (events, invite) => {
|
|
11425
11427
|
return events.map((event) => {
|
|
11426
11428
|
if (event.invitation_id === invite.id) {
|
|
11427
|
-
return new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, null, null, (event.invited_members ?? []).filter((member) => member.id !== invite.id), event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type, event.allow_waiting_list, null, null, null, event.waiting_list_offered_slots);
|
|
11429
|
+
return new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, null, null, (event.invited_members ?? []).filter((member) => member.id !== invite.id), event.last_response_date, event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type, event.allow_waiting_list, null, null, null, event.waiting_list_offered_slots);
|
|
11428
11430
|
}
|
|
11429
11431
|
return event;
|
|
11430
11432
|
});
|
|
@@ -11432,7 +11434,7 @@ const removeEventInvite = (events, invite) => {
|
|
|
11432
11434
|
// Rebuilds an Event preserving everything except the member's waiting-list state. An optional
|
|
11433
11435
|
// `invite` also updates the member's invite id + response (e.g. after responding to an open
|
|
11434
11436
|
// activity); when omitted the existing invite is kept (join/leave the queue must not touch it).
|
|
11435
|
-
const cloneEventWithWaitlist = (event, waitlist, invite) => new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, invite ? invite.invitation_id : event.invitation_id, invite ? invite.invitation_response : event.invitation_response, event.invited_members ? [...event.invited_members] : event.invited_members, event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type, waitlist.allow_waiting_list, waitlist.member_waiting_list_status, waitlist.member_waiting_list_position, waitlist.waiting_list_offer_expires_at, waitlist.waiting_list_offered_slots);
|
|
11437
|
+
const cloneEventWithWaitlist = (event, waitlist, invite) => new Event(event.id, event.activity_id, event.activity_type, event.base_background_color, event.base_color, event.base_name, event.calendar_name, event.description, event.end, invite ? invite.invitation_id : event.invitation_id, invite ? invite.invitation_response : event.invitation_response, event.invited_members ? [...event.invited_members] : event.invited_members, event.last_response_date, event.location, event.meet_up_place, event.meet_up_time, event.member_id, event.open_activity, [...event.participants], event.start, event.title, event.type, waitlist.allow_waiting_list, waitlist.member_waiting_list_status, waitlist.member_waiting_list_position, waitlist.waiting_list_offer_expires_at, waitlist.waiting_list_offered_slots);
|
|
11436
11438
|
// Updates the waiting-list state of a member's calendar event for a given activity. Open
|
|
11437
11439
|
// activities have no invite, so the event is matched on the activity id (within that member's
|
|
11438
11440
|
// events). Used to keep the calendar in sync after joining/leaving the queue, since the
|
|
@@ -13002,6 +13004,9 @@ const bookingReducer = createReducer(initialBookingState, on(clearStoreAction, (
|
|
|
13002
13004
|
teams: null,
|
|
13003
13005
|
settings: null,
|
|
13004
13006
|
calendars: null,
|
|
13007
|
+
// Reset the selected calendar too, otherwise selectCurrentCalendar keeps emitting the
|
|
13008
|
+
// previous club's calendar after a club/role switch (stale resources, cross-club leak).
|
|
13009
|
+
currentCalendar: null,
|
|
13005
13010
|
locations: null,
|
|
13006
13011
|
bookableItems: null,
|
|
13007
13012
|
bookableTags: null,
|