@sprucelabs/spruce-calendar-components 23.0.0 → 23.0.1
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/build/__tests__/support/SpyEventManager.d.ts +2 -0
- package/build/__tests__/support/SpyEventManager.js +5 -0
- package/build/calendar/CalendarEventManager.d.ts +5 -4
- package/build/calendar/CalendarEventManager.js +1 -0
- package/build/esm/__tests__/support/SpyEventManager.d.ts +2 -0
- package/build/esm/__tests__/support/SpyEventManager.js +5 -0
- package/build/esm/calendar/CalendarEventManager.d.ts +5 -4
- package/build/esm/calendar/CalendarEventManager.js +1 -0
- package/build/esm/stores/RemoteEventStore.d.ts +1 -0
- package/build/stores/RemoteEventStore.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4,8 +4,10 @@ import SpyRemoteEventStore from './SpyRemoteEventStore';
|
|
|
4
4
|
import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
|
|
5
5
|
export default class SpyEventManager extends CalendarEventManager {
|
|
6
6
|
updateContext?: UpdateCalendarToolBeltContextHandler<CalendarToolBeltContext>;
|
|
7
|
+
wereShiftsRefreshed: boolean;
|
|
7
8
|
getShouldIgnoreNextContextUpdate(): boolean;
|
|
8
9
|
constructor(options: SpyEventManagerOptions);
|
|
10
|
+
protected refreshShifts(): void;
|
|
9
11
|
getRemoteEventsStore(): SpyRemoteEventStore;
|
|
10
12
|
getStateMachine(): import("../../types/calendar.types").CalendarToolBeltStateMachine<CalendarToolBeltContext>;
|
|
11
13
|
getPreferences(): SpyRemotePreferencesStore;
|
|
@@ -10,6 +10,11 @@ class SpyEventManager extends CalendarEventManager_1.default {
|
|
|
10
10
|
}
|
|
11
11
|
constructor(options) {
|
|
12
12
|
super(options);
|
|
13
|
+
this.wereShiftsRefreshed = false;
|
|
14
|
+
}
|
|
15
|
+
refreshShifts() {
|
|
16
|
+
this.wereShiftsRefreshed = true;
|
|
17
|
+
return super.refreshShifts();
|
|
13
18
|
}
|
|
14
19
|
getRemoteEventsStore() {
|
|
15
20
|
return this.events;
|
|
@@ -28,7 +28,7 @@ export default class CalendarEventManager {
|
|
|
28
28
|
protected get visibleCalendarIds(): string[];
|
|
29
29
|
constructor(options: CalendarEventManagerOptions);
|
|
30
30
|
replaceEventsInRange(events: CalendarEvent[], startMs: number, endMs: number): void;
|
|
31
|
-
|
|
31
|
+
protected refreshShifts(): void;
|
|
32
32
|
private isCalendarSelected;
|
|
33
33
|
private doesCalenderExist;
|
|
34
34
|
getEvents(): CalendarEvent[];
|
|
@@ -45,9 +45,7 @@ export default class CalendarEventManager {
|
|
|
45
45
|
reset(): Promise<void>;
|
|
46
46
|
restoreEventToDraftOnStateLoadError(): Promise<void>;
|
|
47
47
|
getVisibleCalendarIds(): string[];
|
|
48
|
-
cancelEvent(id: string, options?:
|
|
49
|
-
shouldPersist?: boolean;
|
|
50
|
-
}): Promise<void>;
|
|
48
|
+
cancelEvent(id: string, options?: CancelOptions): Promise<void>;
|
|
51
49
|
makeCalendarVisible(calendarId: string): Promise<void>;
|
|
52
50
|
makeCalendarHidden(calendarId: string): Promise<void>;
|
|
53
51
|
updateEvent(id: string, updates: Partial<CalendarEvent> & {
|
|
@@ -118,4 +116,7 @@ type AskForUpdateStrategyHandler = (event: UpdateEvent, action: RepeatingUpdateA
|
|
|
118
116
|
export type SavedEvent = Partial<CalendarEvent> & {
|
|
119
117
|
id: string;
|
|
120
118
|
};
|
|
119
|
+
export interface CancelOptions {
|
|
120
|
+
shouldPersist?: boolean;
|
|
121
|
+
}
|
|
121
122
|
export {};
|
|
@@ -150,6 +150,7 @@ class CalendarEventManager {
|
|
|
150
150
|
shouldCancelAllEventsGoingForward: this.shouldUpdateAllEventsGoingForward,
|
|
151
151
|
dateToCancel: this.dateToUpdate,
|
|
152
152
|
});
|
|
153
|
+
this.refreshShifts();
|
|
153
154
|
}
|
|
154
155
|
catch (err) {
|
|
155
156
|
console.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
@@ -4,8 +4,10 @@ import SpyRemoteEventStore from './SpyRemoteEventStore';
|
|
|
4
4
|
import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
|
|
5
5
|
export default class SpyEventManager extends CalendarEventManager {
|
|
6
6
|
updateContext?: UpdateCalendarToolBeltContextHandler<CalendarToolBeltContext>;
|
|
7
|
+
wereShiftsRefreshed: boolean;
|
|
7
8
|
getShouldIgnoreNextContextUpdate(): boolean;
|
|
8
9
|
constructor(options: SpyEventManagerOptions);
|
|
10
|
+
protected refreshShifts(): void;
|
|
9
11
|
getRemoteEventsStore(): SpyRemoteEventStore;
|
|
10
12
|
getStateMachine(): import("../../types/calendar.types").CalendarToolBeltStateMachine<CalendarToolBeltContext>;
|
|
11
13
|
getPreferences(): SpyRemotePreferencesStore;
|
|
@@ -14,6 +14,11 @@ export default class SpyEventManager extends CalendarEventManager {
|
|
|
14
14
|
}
|
|
15
15
|
constructor(options) {
|
|
16
16
|
super(options);
|
|
17
|
+
this.wereShiftsRefreshed = false;
|
|
18
|
+
}
|
|
19
|
+
refreshShifts() {
|
|
20
|
+
this.wereShiftsRefreshed = true;
|
|
21
|
+
return super.refreshShifts();
|
|
17
22
|
}
|
|
18
23
|
getRemoteEventsStore() {
|
|
19
24
|
return this.events;
|
|
@@ -28,7 +28,7 @@ export default class CalendarEventManager {
|
|
|
28
28
|
protected get visibleCalendarIds(): string[];
|
|
29
29
|
constructor(options: CalendarEventManagerOptions);
|
|
30
30
|
replaceEventsInRange(events: CalendarEvent[], startMs: number, endMs: number): void;
|
|
31
|
-
|
|
31
|
+
protected refreshShifts(): void;
|
|
32
32
|
private isCalendarSelected;
|
|
33
33
|
private doesCalenderExist;
|
|
34
34
|
getEvents(): CalendarEvent[];
|
|
@@ -45,9 +45,7 @@ export default class CalendarEventManager {
|
|
|
45
45
|
reset(): Promise<void>;
|
|
46
46
|
restoreEventToDraftOnStateLoadError(): Promise<void>;
|
|
47
47
|
getVisibleCalendarIds(): string[];
|
|
48
|
-
cancelEvent(id: string, options?:
|
|
49
|
-
shouldPersist?: boolean;
|
|
50
|
-
}): Promise<void>;
|
|
48
|
+
cancelEvent(id: string, options?: CancelOptions): Promise<void>;
|
|
51
49
|
makeCalendarVisible(calendarId: string): Promise<void>;
|
|
52
50
|
makeCalendarHidden(calendarId: string): Promise<void>;
|
|
53
51
|
updateEvent(id: string, updates: Partial<CalendarEvent> & {
|
|
@@ -118,4 +116,7 @@ type AskForUpdateStrategyHandler = (event: UpdateEvent, action: RepeatingUpdateA
|
|
|
118
116
|
export type SavedEvent = Partial<CalendarEvent> & {
|
|
119
117
|
id: string;
|
|
120
118
|
};
|
|
119
|
+
export interface CancelOptions {
|
|
120
|
+
shouldPersist?: boolean;
|
|
121
|
+
}
|
|
121
122
|
export {};
|
|
@@ -165,6 +165,7 @@ export default class CalendarEventManager {
|
|
|
165
165
|
shouldCancelAllEventsGoingForward: this.shouldUpdateAllEventsGoingForward,
|
|
166
166
|
dateToCancel: this.dateToUpdate,
|
|
167
167
|
});
|
|
168
|
+
this.refreshShifts();
|
|
168
169
|
}
|
|
169
170
|
catch (err) {
|
|
170
171
|
console.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
@@ -57,6 +57,7 @@ export interface RemoteEventStore {
|
|
|
57
57
|
getEventTypes(): Promise<CalendarEventType[]>;
|
|
58
58
|
getCalendars(): Promise<Calendar[]>;
|
|
59
59
|
}
|
|
60
|
+
export type RemoteEventStoreConstructor = new (options: any) => RemoteEventStore;
|
|
60
61
|
export type GetScheduleOptions = {
|
|
61
62
|
calendarIds: string[];
|
|
62
63
|
peopleIds: string[];
|
|
@@ -57,6 +57,7 @@ export interface RemoteEventStore {
|
|
|
57
57
|
getEventTypes(): Promise<CalendarEventType[]>;
|
|
58
58
|
getCalendars(): Promise<Calendar[]>;
|
|
59
59
|
}
|
|
60
|
+
export type RemoteEventStoreConstructor = new (options: any) => RemoteEventStore;
|
|
60
61
|
export type GetScheduleOptions = {
|
|
61
62
|
calendarIds: string[];
|
|
62
63
|
peopleIds: string[];
|