@sprucelabs/spruce-calendar-components 22.6.9 → 22.6.10
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.
|
@@ -121,7 +121,7 @@ export default class RemoteEventStoreImpl {
|
|
|
121
121
|
const client = yield this.connectToApi();
|
|
122
122
|
const results = yield client.emitAndFlattenResponses('calendar.update-calendar-event::v2021_05_19', {
|
|
123
123
|
target: Object.assign({ calendarEventId: event.id }, target),
|
|
124
|
-
payload: Object.assign({}, payload),
|
|
124
|
+
payload: Object.assign(Object.assign({}, payload), { isBusy: false }),
|
|
125
125
|
});
|
|
126
126
|
const [{ calendarEvent }] = results;
|
|
127
127
|
return calendarEvent;
|
|
@@ -139,7 +139,7 @@ export default class RemoteEventStoreImpl {
|
|
|
139
139
|
const { target, payload } = this.splitPayloadAndTarget(event);
|
|
140
140
|
const [{ calendarEvent }] = yield this.client.emitAndFlattenResponses('calendar.create-calendar-event::v2021_05_19', {
|
|
141
141
|
target: Object.assign(Object.assign({}, target), { calendarId: this.resolveCalendarId(event) }),
|
|
142
|
-
payload: Object.assign({}, payload),
|
|
142
|
+
payload: Object.assign(Object.assign({}, payload), { isBusy: false }),
|
|
143
143
|
});
|
|
144
144
|
return calendarEvent;
|
|
145
145
|
});
|
|
@@ -171,10 +171,10 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
updateEvent(id, updates) {
|
|
174
|
-
const { shouldPersist } = updates, rest = __rest(updates, ["shouldPersist"]);
|
|
174
|
+
const { shouldPersist = true } = updates, rest = __rest(updates, ["shouldPersist"]);
|
|
175
175
|
try {
|
|
176
|
-
const updated = super.updateEvent(id, Object.assign(Object.assign({}, rest), { isBusy:
|
|
177
|
-
if (shouldPersist
|
|
176
|
+
const updated = super.updateEvent(id, Object.assign(Object.assign({}, rest), { isBusy: shouldPersist }));
|
|
177
|
+
if (shouldPersist) {
|
|
178
178
|
void this.persist(updated);
|
|
179
179
|
}
|
|
180
180
|
return updated;
|
|
@@ -183,14 +183,13 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
183
183
|
catch (_a) { }
|
|
184
184
|
return Object.assign({}, updates);
|
|
185
185
|
}
|
|
186
|
-
persist(event
|
|
186
|
+
persist(event) {
|
|
187
187
|
const _super = Object.create(null, {
|
|
188
188
|
updateEvent: { get: () => super.updateEvent }
|
|
189
189
|
});
|
|
190
190
|
var _a, _b;
|
|
191
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
192
|
const id = event.id;
|
|
193
|
-
const isBusy = (options === null || options === void 0 ? void 0 : options.isBusy) === true;
|
|
194
193
|
try {
|
|
195
194
|
if (!this.activelyPersisting[id]) {
|
|
196
195
|
this.activelyPersisting[id] = 1;
|
|
@@ -198,7 +197,7 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
198
197
|
else {
|
|
199
198
|
this.activelyPersisting[id]++;
|
|
200
199
|
}
|
|
201
|
-
const saved = yield ((_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.persist(Object.assign(
|
|
200
|
+
const saved = yield ((_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.persist(Object.assign({}, event)));
|
|
202
201
|
this.activelyPersisting[id]--;
|
|
203
202
|
if (!saved) {
|
|
204
203
|
return;
|
|
@@ -216,7 +215,7 @@ export default class CalendarViewController extends CoreCalendarViewController {
|
|
|
216
215
|
}
|
|
217
216
|
}
|
|
218
217
|
else {
|
|
219
|
-
_super.updateEvent.call(this, saved.id, { isBusy, error: undefined });
|
|
218
|
+
_super.updateEvent.call(this, saved.id, { isBusy: false, error: undefined });
|
|
220
219
|
}
|
|
221
220
|
return saved;
|
|
222
221
|
}
|
|
@@ -110,7 +110,7 @@ class RemoteEventStoreImpl {
|
|
|
110
110
|
const client = await this.connectToApi();
|
|
111
111
|
const results = await client.emitAndFlattenResponses('calendar.update-calendar-event::v2021_05_19', {
|
|
112
112
|
target: Object.assign({ calendarEventId: event.id }, target),
|
|
113
|
-
payload: Object.assign({}, payload),
|
|
113
|
+
payload: Object.assign(Object.assign({}, payload), { isBusy: false }),
|
|
114
114
|
});
|
|
115
115
|
const [{ calendarEvent }] = results;
|
|
116
116
|
return calendarEvent;
|
|
@@ -124,7 +124,7 @@ class RemoteEventStoreImpl {
|
|
|
124
124
|
const { target, payload } = this.splitPayloadAndTarget(event);
|
|
125
125
|
const [{ calendarEvent }] = await this.client.emitAndFlattenResponses('calendar.create-calendar-event::v2021_05_19', {
|
|
126
126
|
target: Object.assign(Object.assign({}, target), { calendarId: this.resolveCalendarId(event) }),
|
|
127
|
-
payload: Object.assign({}, payload),
|
|
127
|
+
payload: Object.assign(Object.assign({}, payload), { isBusy: false }),
|
|
128
128
|
});
|
|
129
129
|
return calendarEvent;
|
|
130
130
|
}
|
|
@@ -152,10 +152,10 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
152
152
|
this.enableAnimation();
|
|
153
153
|
}
|
|
154
154
|
updateEvent(id, updates) {
|
|
155
|
-
const { shouldPersist } = updates, rest = __rest(updates, ["shouldPersist"]);
|
|
155
|
+
const { shouldPersist = true } = updates, rest = __rest(updates, ["shouldPersist"]);
|
|
156
156
|
try {
|
|
157
|
-
const updated = super.updateEvent(id, Object.assign(Object.assign({}, rest), { isBusy:
|
|
158
|
-
if (shouldPersist
|
|
157
|
+
const updated = super.updateEvent(id, Object.assign(Object.assign({}, rest), { isBusy: shouldPersist }));
|
|
158
|
+
if (shouldPersist) {
|
|
159
159
|
void this.persist(updated);
|
|
160
160
|
}
|
|
161
161
|
return updated;
|
|
@@ -164,10 +164,9 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
164
164
|
catch (_a) { }
|
|
165
165
|
return Object.assign({}, updates);
|
|
166
166
|
}
|
|
167
|
-
async persist(event
|
|
167
|
+
async persist(event) {
|
|
168
168
|
var _a, _b;
|
|
169
169
|
const id = event.id;
|
|
170
|
-
const isBusy = (options === null || options === void 0 ? void 0 : options.isBusy) === true;
|
|
171
170
|
try {
|
|
172
171
|
if (!this.activelyPersisting[id]) {
|
|
173
172
|
this.activelyPersisting[id] = 1;
|
|
@@ -175,7 +174,7 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
175
174
|
else {
|
|
176
175
|
this.activelyPersisting[id]++;
|
|
177
176
|
}
|
|
178
|
-
const saved = await ((_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.persist(Object.assign(
|
|
177
|
+
const saved = await ((_a = this.remoteEventStore) === null || _a === void 0 ? void 0 : _a.persist(Object.assign({}, event)));
|
|
179
178
|
this.activelyPersisting[id]--;
|
|
180
179
|
if (!saved) {
|
|
181
180
|
return;
|
|
@@ -193,7 +192,7 @@ class CalendarViewController extends heartwood_view_controllers_1.CalendarViewCo
|
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
194
|
else {
|
|
196
|
-
super.updateEvent(saved.id, { isBusy, error: undefined });
|
|
195
|
+
super.updateEvent(saved.id, { isBusy: false, error: undefined });
|
|
197
196
|
}
|
|
198
197
|
return saved;
|
|
199
198
|
}
|