@sprucelabs/spruce-calendar-components 22.10.40 → 22.10.46
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/CalendarToolBeltStateMachineTestFactory.d.ts +1 -1
- package/build/__tests__/support/CalendarToolBeltStateMachineTestFactory.js +1 -1
- package/build/__tests__/support/SpyEventManager.d.ts +1 -1
- package/build/__tests__/support/SpyEventManager.js +1 -1
- package/build/__tests__/support/SpyPeopleManager.d.ts +2 -2
- package/build/__tests__/support/SpyPeopleManager.js +1 -1
- package/build/__tests__/support/utilities/calendarSkillAssert.js +4 -4
- package/build/{esm/viewControllers → calendar}/Calendar.vc.d.ts +0 -0
- package/build/{viewControllers → calendar}/Calendar.vc.js +0 -0
- package/build/{esm/utilities → calendar}/CalendarEventManager.d.ts +3 -2
- package/build/{utilities → calendar}/CalendarEventManager.js +6 -2
- package/build/{utilities → calendar}/CalendarPeopleManager.d.ts +2 -2
- package/build/{utilities → calendar}/CalendarPeopleManager.js +0 -0
- package/build/esm/__tests__/support/CalendarToolBeltStateMachineTestFactory.d.ts +1 -1
- package/build/esm/__tests__/support/CalendarToolBeltStateMachineTestFactory.js +1 -1
- package/build/esm/__tests__/support/SpyEventManager.d.ts +1 -1
- package/build/esm/__tests__/support/SpyEventManager.js +1 -1
- package/build/esm/__tests__/support/SpyPeopleManager.d.ts +2 -2
- package/build/esm/__tests__/support/SpyPeopleManager.js +1 -1
- package/build/esm/__tests__/support/utilities/calendarSkillAssert.js +4 -4
- package/build/{viewControllers → esm/calendar}/Calendar.vc.d.ts +0 -0
- package/build/esm/{viewControllers → calendar}/Calendar.vc.js +0 -0
- package/build/{utilities → esm/calendar}/CalendarEventManager.d.ts +3 -2
- package/build/esm/{utilities → calendar}/CalendarEventManager.js +8 -2
- package/build/esm/{utilities → calendar}/CalendarPeopleManager.d.ts +2 -2
- package/build/esm/{utilities → calendar}/CalendarPeopleManager.js +0 -0
- package/build/esm/index-components.d.ts +12 -12
- package/build/esm/index-components.js +8 -8
- package/build/esm/skillViewControllers/Root.svc.d.ts +5 -5
- package/build/esm/skillViewControllers/Root.svc.js +3 -3
- package/build/esm/stores/RemotePreferencesStore.d.ts +1 -1
- package/build/esm/toolBelt/states/RootToolBeltState.d.ts +4 -4
- package/build/esm/toolBelt/states/RootToolBeltState.js +2 -2
- package/build/esm/{viewControllers → tools}/CalendarSelectTool.vc.d.ts +1 -1
- package/build/esm/{viewControllers → tools}/CalendarSelectTool.vc.js +0 -0
- package/build/esm/{viewControllers → tools}/EventDateTimeTool.vc.d.ts +0 -0
- package/build/esm/{viewControllers → tools}/EventDateTimeTool.vc.js +3 -3
- package/build/esm/{viewControllers → tools}/EventRepeatingTool.vc.d.ts +1 -1
- package/build/esm/{viewControllers → tools}/EventRepeatingTool.vc.js +0 -0
- package/build/esm/{viewControllers → tools}/EventTitleTool.vc.d.ts +0 -0
- package/build/esm/{viewControllers → tools}/EventTitleTool.vc.js +0 -0
- package/build/{viewControllers → esm/tools}/PersonSelectTool.vc.d.ts +1 -1
- package/build/esm/{viewControllers → tools}/PersonSelectTool.vc.js +0 -0
- package/build/esm/types/calendar.types.d.ts +3 -3
- package/build/esm/viewControllers/EventControlsCard.vc.js +2 -2
- package/build/index-components.d.ts +12 -12
- package/build/index-components.js +8 -8
- package/build/skillViewControllers/Root.svc.d.ts +5 -5
- package/build/skillViewControllers/Root.svc.js +3 -3
- package/build/stores/RemotePreferencesStore.d.ts +1 -1
- package/build/toolBelt/states/RootToolBeltState.d.ts +4 -4
- package/build/toolBelt/states/RootToolBeltState.js +2 -2
- package/build/{viewControllers → tools}/CalendarSelectTool.vc.d.ts +1 -1
- package/build/{viewControllers → tools}/CalendarSelectTool.vc.js +0 -0
- package/build/{viewControllers → tools}/EventDateTimeTool.vc.d.ts +0 -0
- package/build/{viewControllers → tools}/EventDateTimeTool.vc.js +3 -3
- package/build/{viewControllers → tools}/EventRepeatingTool.vc.d.ts +1 -1
- package/build/{viewControllers → tools}/EventRepeatingTool.vc.js +0 -0
- package/build/{viewControllers → tools}/EventTitleTool.vc.d.ts +0 -0
- package/build/{viewControllers → tools}/EventTitleTool.vc.js +0 -0
- package/build/{esm/viewControllers → tools}/PersonSelectTool.vc.d.ts +1 -1
- package/build/{viewControllers → tools}/PersonSelectTool.vc.js +0 -0
- package/build/types/calendar.types.d.ts +3 -3
- package/build/viewControllers/EventControlsCard.vc.js +2 -2
- package/package.json +33 -33
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SpruceSchemas } from '@sprucelabs/calendar-utils';
|
|
2
2
|
import { ToolBeltViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
3
3
|
import { ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
4
|
+
import CalendarViewController from '../../calendar/Calendar.vc';
|
|
4
5
|
import { GetScheduleOptions, RemoteEventStore } from '../../stores/RemoteEventStore';
|
|
5
6
|
import { CalendarToolBeltStateMachine, UpdateEvent } from '../../types/calendar.types';
|
|
6
|
-
import CalendarViewController from '../../viewControllers/Calendar.vc';
|
|
7
7
|
import SpyEventManager from './SpyEventManager';
|
|
8
8
|
export default class CalendarToolBeltStateMachineTestFactory {
|
|
9
9
|
static StateMachine(views: ViewFixture): Promise<{
|
|
@@ -8,9 +8,9 @@ const calendar_utils_1 = require("@sprucelabs/calendar-utils");
|
|
|
8
8
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
9
9
|
const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
|
|
10
10
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
11
|
+
const Calendar_vc_1 = __importDefault(require("../../calendar/Calendar.vc"));
|
|
11
12
|
const RemotePreferencesStore_1 = __importDefault(require("../../stores/RemotePreferencesStore"));
|
|
12
13
|
const draftGenerator_1 = __importDefault(require("../../utilities/draftGenerator"));
|
|
13
|
-
const Calendar_vc_1 = __importDefault(require("../../viewControllers/Calendar.vc"));
|
|
14
14
|
const SpyEventManager_1 = __importDefault(require("./SpyEventManager"));
|
|
15
15
|
const SpyPeopleManager_1 = __importDefault(require("./SpyPeopleManager"));
|
|
16
16
|
class CalendarToolBeltStateMachineTestFactory {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CalendarEventManager, { CalendarEventManagerOptions, SavedEvent } from '../../calendar/CalendarEventManager';
|
|
1
2
|
import { CalendarEvent, CalendarToolBeltContext, UpdateCalendarToolBeltContextHandler } from '../../types/calendar.types';
|
|
2
|
-
import CalendarEventManager, { CalendarEventManagerOptions, SavedEvent } from '../../utilities/CalendarEventManager';
|
|
3
3
|
import SpyRemoteEventStore from './SpyRemoteEventStore';
|
|
4
4
|
import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
|
|
5
5
|
export default class SpyEventManager extends CalendarEventManager {
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const CalendarEventManager_1 = __importDefault(require("../../
|
|
6
|
+
const CalendarEventManager_1 = __importDefault(require("../../calendar/CalendarEventManager"));
|
|
7
7
|
class SpyEventManager extends CalendarEventManager_1.default {
|
|
8
8
|
constructor(options) {
|
|
9
9
|
super(options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CalendarPeopleManager, { PeopleManagerOptions, SetVisiblePeolpeOptions } from '../../
|
|
2
|
-
import { PersonMode } from '../../
|
|
1
|
+
import CalendarPeopleManager, { PeopleManagerOptions, SetVisiblePeolpeOptions } from '../../calendar/CalendarPeopleManager';
|
|
2
|
+
import { PersonMode } from '../../tools/PersonSelectTool.vc';
|
|
3
3
|
export default class SpyPeopleManager extends CalendarPeopleManager {
|
|
4
4
|
visiblePeopleIds?: string[];
|
|
5
5
|
peopleVisibilityMode?: PersonMode;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const CalendarPeopleManager_1 = __importDefault(require("../../
|
|
6
|
+
const CalendarPeopleManager_1 = __importDefault(require("../../calendar/CalendarPeopleManager"));
|
|
7
7
|
class SpyPeopleManager extends CalendarPeopleManager_1.default {
|
|
8
8
|
constructor(options) {
|
|
9
9
|
super(options);
|
|
@@ -9,12 +9,12 @@ const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
|
9
9
|
const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
|
|
10
10
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
11
11
|
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
12
|
+
const Calendar_vc_1 = __importDefault(require("../../../calendar/Calendar.vc"));
|
|
12
13
|
const AbstractCalendarEventToolBeltState_1 = __importDefault(require("../../../toolBelt/states/AbstractCalendarEventToolBeltState"));
|
|
13
|
-
const
|
|
14
|
+
const EventDateTimeTool_vc_1 = __importDefault(require("../../../tools/EventDateTimeTool.vc"));
|
|
15
|
+
const EventRepeatingTool_vc_1 = __importDefault(require("../../../tools/EventRepeatingTool.vc"));
|
|
16
|
+
const EventTitleTool_vc_1 = __importDefault(require("../../../tools/EventTitleTool.vc"));
|
|
14
17
|
const EventControlsCard_vc_1 = __importDefault(require("../../../viewControllers/EventControlsCard.vc"));
|
|
15
|
-
const EventDateTimeTool_vc_1 = __importDefault(require("../../../viewControllers/EventDateTimeTool.vc"));
|
|
16
|
-
const EventRepeatingTool_vc_1 = __importDefault(require("../../../viewControllers/EventRepeatingTool.vc"));
|
|
17
|
-
const EventTitleTool_vc_1 = __importDefault(require("../../../viewControllers/EventTitleTool.vc"));
|
|
18
18
|
const RepeatingControlsList_vc_1 = __importDefault(require("../../../viewControllers/RepeatingControlsList.vc"));
|
|
19
19
|
const CalendarToolBeltStateMachineTestFactory_1 = __importDefault(require("../CalendarToolBeltStateMachineTestFactory"));
|
|
20
20
|
class TestTool1 extends heartwood_view_controllers_1.CardViewControllerImpl {
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import { RemoteViewControllerFactory } from '@sprucelabs/spruce-heartwood-utils'
|
|
|
4
4
|
import { RemoteEventStore } from '../stores/RemoteEventStore';
|
|
5
5
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
6
6
|
import { CalendarToolBeltContext, CalendarToolBeltStateMachine, UpdateCalendarToolBeltContextHandler, UpdateEvent, UpdateRepeatingStrategyWithCancel } from '../types/calendar.types';
|
|
7
|
-
import CalendarViewController from '
|
|
7
|
+
import CalendarViewController from './Calendar.vc';
|
|
8
8
|
export default class CalendarEventManager {
|
|
9
9
|
private calendarVc;
|
|
10
10
|
protected allEvents: CalendarEvent[];
|
|
@@ -94,6 +94,7 @@ export default class CalendarEventManager {
|
|
|
94
94
|
private loadCalendars;
|
|
95
95
|
private handleWillUpdateContext;
|
|
96
96
|
deselectEvent(): Promise<void>;
|
|
97
|
+
setCurrentDate(dateMs: number): Promise<void>;
|
|
97
98
|
private handleDidUpdateContext;
|
|
98
99
|
protected saveEvent(event: SavedEvent): Promise<void>;
|
|
99
100
|
private clearPersistRepeatingOptions;
|
|
@@ -101,7 +102,7 @@ export default class CalendarEventManager {
|
|
|
101
102
|
hasEvent(id: string): boolean;
|
|
102
103
|
optionallyAskForUpdateRepeatingStrategy(event: UpdateEvent, action?: RepeatingUpdateAction): Promise<boolean>;
|
|
103
104
|
}
|
|
104
|
-
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents'>;
|
|
105
|
+
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents' | 'setStartDate'>;
|
|
105
106
|
declare type EventManagerRemoteViewControllerFactory = Pick<RemoteViewControllerFactory, 'fetchRemoteController'>;
|
|
106
107
|
export declare type RepeatingUpdateAction = 'update' | 'cancel';
|
|
107
108
|
export interface CalendarEventManagerOptions {
|
|
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
18
18
|
const schema_1 = require("@sprucelabs/schema");
|
|
19
19
|
const SpruceError_1 = __importDefault(require("../errors/SpruceError"));
|
|
20
|
-
const calendarShiftGenerator_1 = __importDefault(require("
|
|
21
|
-
const draftGenerator_1 = __importDefault(require("
|
|
20
|
+
const calendarShiftGenerator_1 = __importDefault(require("../utilities/calendarShiftGenerator"));
|
|
21
|
+
const draftGenerator_1 = __importDefault(require("../utilities/draftGenerator"));
|
|
22
22
|
class CalendarEventManager {
|
|
23
23
|
constructor(options) {
|
|
24
24
|
this.allEvents = [];
|
|
@@ -297,12 +297,16 @@ class CalendarEventManager {
|
|
|
297
297
|
async deselectEvent() {
|
|
298
298
|
await this.calendarVc.deselectEvent();
|
|
299
299
|
}
|
|
300
|
+
async setCurrentDate(dateMs) {
|
|
301
|
+
await this.calendarVc.setStartDate(dateMs);
|
|
302
|
+
}
|
|
300
303
|
async handleDidUpdateContext() {
|
|
301
304
|
if (this.shouldIgnoreNextContextUpdate) {
|
|
302
305
|
this.shouldIgnoreNextContextUpdate = false;
|
|
303
306
|
return;
|
|
304
307
|
}
|
|
305
308
|
const { event } = this.sm.getContext();
|
|
309
|
+
console.log('CalendarEventManager::handleDidUpdateContext', event);
|
|
306
310
|
if (event === null || event === void 0 ? void 0 : event.id) {
|
|
307
311
|
this.shouldUpdateContextOnNextSave = false;
|
|
308
312
|
await this.saveEvent(event);
|
|
@@ -2,9 +2,9 @@ import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
|
2
2
|
import { AbstractEventEmitter } from '@sprucelabs/mercury-event-emitter';
|
|
3
3
|
import { CalendarPerson } from '../skillViewControllers/Root.svc';
|
|
4
4
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
5
|
+
import { PersonMode } from '../tools/PersonSelectTool.vc';
|
|
5
6
|
import { CalendarEvent } from '../types/calendar.types';
|
|
6
|
-
import CalendarViewController from '
|
|
7
|
-
import { PersonMode } from '../viewControllers/PersonSelectTool.vc';
|
|
7
|
+
import CalendarViewController from './Calendar.vc';
|
|
8
8
|
export default class CalendarPeopleManager extends AbstractEventEmitter<PeopleContract> {
|
|
9
9
|
private connectToApi;
|
|
10
10
|
private prefs;
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SpruceSchemas } from '@sprucelabs/calendar-utils';
|
|
2
2
|
import { ToolBeltViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
3
3
|
import { ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
4
|
+
import CalendarViewController from '../../calendar/Calendar.vc';
|
|
4
5
|
import { GetScheduleOptions, RemoteEventStore } from '../../stores/RemoteEventStore';
|
|
5
6
|
import { CalendarToolBeltStateMachine, UpdateEvent } from '../../types/calendar.types';
|
|
6
|
-
import CalendarViewController from '../../viewControllers/Calendar.vc';
|
|
7
7
|
import SpyEventManager from './SpyEventManager';
|
|
8
8
|
export default class CalendarToolBeltStateMachineTestFactory {
|
|
9
9
|
static StateMachine(views: ViewFixture): Promise<{
|
|
@@ -11,9 +11,9 @@ import { dateUtil } from '@sprucelabs/calendar-utils';
|
|
|
11
11
|
import { calendarSeeder, ToolBeltStateMachine, } from '@sprucelabs/heartwood-view-controllers';
|
|
12
12
|
import { fake } from '@sprucelabs/spruce-test-fixtures';
|
|
13
13
|
import { generateId } from '@sprucelabs/test-utils';
|
|
14
|
+
import CalendarViewController from '../../calendar/Calendar.vc.js';
|
|
14
15
|
import RemotePreferencesStore from '../../stores/RemotePreferencesStore.js';
|
|
15
16
|
import draftEventGenerator from '../../utilities/draftGenerator.js';
|
|
16
|
-
import CalendarViewController from '../../viewControllers/Calendar.vc.js';
|
|
17
17
|
import SpyEventManager from './SpyEventManager.js';
|
|
18
18
|
import SpyPeopleManager from './SpyPeopleManager.js';
|
|
19
19
|
export default class CalendarToolBeltStateMachineTestFactory {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import CalendarEventManager, { CalendarEventManagerOptions, SavedEvent } from '../../calendar/CalendarEventManager';
|
|
1
2
|
import { CalendarEvent, CalendarToolBeltContext, UpdateCalendarToolBeltContextHandler } from '../../types/calendar.types';
|
|
2
|
-
import CalendarEventManager, { CalendarEventManagerOptions, SavedEvent } from '../../utilities/CalendarEventManager';
|
|
3
3
|
import SpyRemoteEventStore from './SpyRemoteEventStore';
|
|
4
4
|
import SpyRemotePreferencesStore from './SpyRemotePreferencesStore';
|
|
5
5
|
export default class SpyEventManager extends CalendarEventManager {
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import CalendarEventManager from '../../
|
|
10
|
+
import CalendarEventManager from '../../calendar/CalendarEventManager.js';
|
|
11
11
|
export default class SpyEventManager extends CalendarEventManager {
|
|
12
12
|
constructor(options) {
|
|
13
13
|
super(options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import CalendarPeopleManager, { PeopleManagerOptions, SetVisiblePeolpeOptions } from '../../
|
|
2
|
-
import { PersonMode } from '../../
|
|
1
|
+
import CalendarPeopleManager, { PeopleManagerOptions, SetVisiblePeolpeOptions } from '../../calendar/CalendarPeopleManager';
|
|
2
|
+
import { PersonMode } from '../../tools/PersonSelectTool.vc';
|
|
3
3
|
export default class SpyPeopleManager extends CalendarPeopleManager {
|
|
4
4
|
visiblePeopleIds?: string[];
|
|
5
5
|
peopleVisibilityMode?: PersonMode;
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import CalendarPeopleManager from '../../
|
|
10
|
+
import CalendarPeopleManager from '../../calendar/CalendarPeopleManager.js';
|
|
11
11
|
export default class SpyPeopleManager extends CalendarPeopleManager {
|
|
12
12
|
constructor(options) {
|
|
13
13
|
super(options);
|
|
@@ -13,12 +13,12 @@ import { AuthService } from '@sprucelabs/spruce-skill-utils';
|
|
|
13
13
|
import { eventFaker } from '@sprucelabs/spruce-test-fixtures';
|
|
14
14
|
import { assert } from '@sprucelabs/test-utils';
|
|
15
15
|
import { generateId } from '@sprucelabs/test-utils';
|
|
16
|
+
import CalendarViewController from '../../../calendar/Calendar.vc.js';
|
|
16
17
|
import AbstractCalendarEventToolBeltState from '../../../toolBelt/states/AbstractCalendarEventToolBeltState.js';
|
|
17
|
-
import
|
|
18
|
+
import EventDateTimeToolViewController from '../../../tools/EventDateTimeTool.vc.js';
|
|
19
|
+
import EventRepeatingToolViewController from '../../../tools/EventRepeatingTool.vc.js';
|
|
20
|
+
import EventTitleToolViewController from '../../../tools/EventTitleTool.vc.js';
|
|
18
21
|
import EventControlsCardViewController from '../../../viewControllers/EventControlsCard.vc.js';
|
|
19
|
-
import EventDateTimeToolViewController from '../../../viewControllers/EventDateTimeTool.vc.js';
|
|
20
|
-
import EventRepeatingToolViewController from '../../../viewControllers/EventRepeatingTool.vc.js';
|
|
21
|
-
import EventTitleToolViewController from '../../../viewControllers/EventTitleTool.vc.js';
|
|
22
22
|
import RepeatingControlsListViewController from '../../../viewControllers/RepeatingControlsList.vc.js';
|
|
23
23
|
import CalendarToolBeltStateMachineTestFactory from '../CalendarToolBeltStateMachineTestFactory.js';
|
|
24
24
|
class TestTool1 extends CardViewControllerImpl {
|
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import { RemoteViewControllerFactory } from '@sprucelabs/spruce-heartwood-utils'
|
|
|
4
4
|
import { RemoteEventStore } from '../stores/RemoteEventStore';
|
|
5
5
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
6
6
|
import { CalendarToolBeltContext, CalendarToolBeltStateMachine, UpdateCalendarToolBeltContextHandler, UpdateEvent, UpdateRepeatingStrategyWithCancel } from '../types/calendar.types';
|
|
7
|
-
import CalendarViewController from '
|
|
7
|
+
import CalendarViewController from './Calendar.vc';
|
|
8
8
|
export default class CalendarEventManager {
|
|
9
9
|
private calendarVc;
|
|
10
10
|
protected allEvents: CalendarEvent[];
|
|
@@ -94,6 +94,7 @@ export default class CalendarEventManager {
|
|
|
94
94
|
private loadCalendars;
|
|
95
95
|
private handleWillUpdateContext;
|
|
96
96
|
deselectEvent(): Promise<void>;
|
|
97
|
+
setCurrentDate(dateMs: number): Promise<void>;
|
|
97
98
|
private handleDidUpdateContext;
|
|
98
99
|
protected saveEvent(event: SavedEvent): Promise<void>;
|
|
99
100
|
private clearPersistRepeatingOptions;
|
|
@@ -101,7 +102,7 @@ export default class CalendarEventManager {
|
|
|
101
102
|
hasEvent(id: string): boolean;
|
|
102
103
|
optionallyAskForUpdateRepeatingStrategy(event: UpdateEvent, action?: RepeatingUpdateAction): Promise<boolean>;
|
|
103
104
|
}
|
|
104
|
-
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents'>;
|
|
105
|
+
export declare type EventManagerCalendarVc = Pick<CalendarViewController, 'replaceEventsInRange' | 'mixinEvents' | 'removeEvent' | 'addEvent' | 'hasEvent' | 'updateEvent' | 'setShifts' | 'getShifts' | 'getEvent' | 'getPeople' | 'setControllerForEventType' | 'setRemoteStore' | 'getSelectedEvent' | 'selectEvent' | 'deselectEvent' | 'removeEvents' | 'setStartDate'>;
|
|
105
106
|
declare type EventManagerRemoteViewControllerFactory = Pick<RemoteViewControllerFactory, 'fetchRemoteController'>;
|
|
106
107
|
export declare type RepeatingUpdateAction = 'update' | 'cancel';
|
|
107
108
|
export interface CalendarEventManagerOptions {
|
|
@@ -21,8 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import { calendarEventSchema, } from '@sprucelabs/heartwood-view-controllers';
|
|
22
22
|
import { assertOptions, normalizeSchemaValues } from '@sprucelabs/schema';
|
|
23
23
|
import SpruceError from '../errors/SpruceError.js';
|
|
24
|
-
import calendarShiftGenerator from '
|
|
25
|
-
import draftEventGenerator from '
|
|
24
|
+
import calendarShiftGenerator from '../utilities/calendarShiftGenerator.js';
|
|
25
|
+
import draftEventGenerator from '../utilities/draftGenerator.js';
|
|
26
26
|
export default class CalendarEventManager {
|
|
27
27
|
constructor(options) {
|
|
28
28
|
this.allEvents = [];
|
|
@@ -337,6 +337,11 @@ export default class CalendarEventManager {
|
|
|
337
337
|
yield this.calendarVc.deselectEvent();
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
+
setCurrentDate(dateMs) {
|
|
341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
+
yield this.calendarVc.setStartDate(dateMs);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
340
345
|
handleDidUpdateContext() {
|
|
341
346
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
347
|
if (this.shouldIgnoreNextContextUpdate) {
|
|
@@ -344,6 +349,7 @@ export default class CalendarEventManager {
|
|
|
344
349
|
return;
|
|
345
350
|
}
|
|
346
351
|
const { event } = this.sm.getContext();
|
|
352
|
+
console.log('CalendarEventManager::handleDidUpdateContext', event);
|
|
347
353
|
if (event === null || event === void 0 ? void 0 : event.id) {
|
|
348
354
|
this.shouldUpdateContextOnNextSave = false;
|
|
349
355
|
yield this.saveEvent(event);
|
|
@@ -2,9 +2,9 @@ import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
|
2
2
|
import { AbstractEventEmitter } from '@sprucelabs/mercury-event-emitter';
|
|
3
3
|
import { CalendarPerson } from '../skillViewControllers/Root.svc';
|
|
4
4
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
5
|
+
import { PersonMode } from '../tools/PersonSelectTool.vc';
|
|
5
6
|
import { CalendarEvent } from '../types/calendar.types';
|
|
6
|
-
import CalendarViewController from '
|
|
7
|
-
import { PersonMode } from '../viewControllers/PersonSelectTool.vc';
|
|
7
|
+
import CalendarViewController from './Calendar.vc';
|
|
8
8
|
export default class CalendarPeopleManager extends AbstractEventEmitter<PeopleContract> {
|
|
9
9
|
private connectToApi;
|
|
10
10
|
private prefs;
|
|
File without changes
|
|
@@ -4,25 +4,25 @@ export { default as CalendarToolTestFactory } from './toolBelt/CalendarToolTestF
|
|
|
4
4
|
export * from './toolBelt/CalendarToolTestFactory';
|
|
5
5
|
export { default as calendarToolBeltInteractor } from './__tests__/support/utilities/calendarToolBeltInteractor';
|
|
6
6
|
export { default as SpyEventManager } from './__tests__/support/SpyEventManager';
|
|
7
|
-
import CalendarViewController from './
|
|
7
|
+
import CalendarViewController from './calendar/Calendar.vc';
|
|
8
|
+
import EventDateTimeToolViewController from './tools/EventDateTimeTool.vc';
|
|
9
|
+
import EventRepeatingToolViewController from './tools/EventRepeatingTool.vc';
|
|
10
|
+
import EventTitleToolViewController from './tools/EventTitleTool.vc';
|
|
8
11
|
import EventControlsCardViewController from './viewControllers/EventControlsCard.vc';
|
|
9
|
-
import EventDateTimeToolViewController from './viewControllers/EventDateTimeTool.vc';
|
|
10
|
-
import EventRepeatingToolViewController from './viewControllers/EventRepeatingTool.vc';
|
|
11
|
-
import EventTitleToolViewController from './viewControllers/EventTitleTool.vc';
|
|
12
12
|
import RepeatingControlsListViewController from './viewControllers/RepeatingControlsList.vc';
|
|
13
13
|
/** COMPONENTS */
|
|
14
|
-
export { default as RepeatingCardViewController } from './
|
|
15
|
-
export * from './
|
|
14
|
+
export { default as RepeatingCardViewController } from './tools/EventRepeatingTool.vc';
|
|
15
|
+
export * from './tools/EventRepeatingTool.vc';
|
|
16
16
|
export { default as RepeatingControlsListViewController } from './viewControllers/RepeatingControlsList.vc';
|
|
17
17
|
export * from './viewControllers/RepeatingControlsList.vc';
|
|
18
|
-
export { default as CalendarViewController } from './
|
|
19
|
-
export * from './
|
|
18
|
+
export { default as CalendarViewController } from './calendar/Calendar.vc';
|
|
19
|
+
export * from './calendar/Calendar.vc';
|
|
20
20
|
export { default as EventControlsCardViewController } from './viewControllers/EventControlsCard.vc';
|
|
21
21
|
export * from './viewControllers/EventControlsCard.vc';
|
|
22
|
-
export { default as EventDateTimeToolViewController } from './
|
|
23
|
-
export * from './
|
|
24
|
-
export { default as EventRepeatingToolViewController } from './
|
|
25
|
-
export * from './
|
|
22
|
+
export { default as EventDateTimeToolViewController } from './tools/EventDateTimeTool.vc';
|
|
23
|
+
export * from './tools/EventDateTimeTool.vc';
|
|
24
|
+
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc';
|
|
25
|
+
export * from './tools/EventRepeatingTool.vc';
|
|
26
26
|
export { default as CalendarToolRegistrar } from './toolBelt/CalendarToolRegistrar';
|
|
27
27
|
export * from './toolBelt/CalendarToolRegistrar';
|
|
28
28
|
export { default as AbstractCalendarEventToolBeltState } from './toolBelt/states/AbstractCalendarEventToolBeltState';
|
|
@@ -5,18 +5,18 @@ export * from './toolBelt/CalendarToolTestFactory.js';
|
|
|
5
5
|
export { default as calendarToolBeltInteractor } from './__tests__/support/utilities/calendarToolBeltInteractor.js';
|
|
6
6
|
export { default as SpyEventManager } from './__tests__/support/SpyEventManager.js';
|
|
7
7
|
/** COMPONENTS */
|
|
8
|
-
export { default as RepeatingCardViewController } from './
|
|
9
|
-
export * from './
|
|
8
|
+
export { default as RepeatingCardViewController } from './tools/EventRepeatingTool.vc.js';
|
|
9
|
+
export * from './tools/EventRepeatingTool.vc.js';
|
|
10
10
|
export { default as RepeatingControlsListViewController } from './viewControllers/RepeatingControlsList.vc.js';
|
|
11
11
|
export * from './viewControllers/RepeatingControlsList.vc.js';
|
|
12
|
-
export { default as CalendarViewController } from './
|
|
13
|
-
export * from './
|
|
12
|
+
export { default as CalendarViewController } from './calendar/Calendar.vc.js';
|
|
13
|
+
export * from './calendar/Calendar.vc.js';
|
|
14
14
|
export { default as EventControlsCardViewController } from './viewControllers/EventControlsCard.vc.js';
|
|
15
15
|
export * from './viewControllers/EventControlsCard.vc.js';
|
|
16
|
-
export { default as EventDateTimeToolViewController } from './
|
|
17
|
-
export * from './
|
|
18
|
-
export { default as EventRepeatingToolViewController } from './
|
|
19
|
-
export * from './
|
|
16
|
+
export { default as EventDateTimeToolViewController } from './tools/EventDateTimeTool.vc.js';
|
|
17
|
+
export * from './tools/EventDateTimeTool.vc.js';
|
|
18
|
+
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc.js';
|
|
19
|
+
export * from './tools/EventRepeatingTool.vc.js';
|
|
20
20
|
export { default as CalendarToolRegistrar } from './toolBelt/CalendarToolRegistrar.js';
|
|
21
21
|
export * from './toolBelt/CalendarToolRegistrar.js';
|
|
22
22
|
export { default as AbstractCalendarEventToolBeltState } from './toolBelt/states/AbstractCalendarEventToolBeltState.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AbstractSkillViewController, SkillViewControllerLoadOptions, SpruceSchemas, ViewControllerOptions, ScopeFlag } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { RemoteViewControllerFactory } from '@sprucelabs/spruce-heartwood-utils';
|
|
3
|
+
import CalendarViewController from '../calendar/Calendar.vc';
|
|
4
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
5
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
3
6
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
4
7
|
import { CalendarToolBeltStateMachine } from '../types/calendar.types';
|
|
5
|
-
import CalendarEventManager from '../utilities/CalendarEventManager';
|
|
6
|
-
import CalendarPeopleManager from '../utilities/CalendarPeopleManager';
|
|
7
|
-
import CalendarViewController from '../viewControllers/Calendar.vc';
|
|
8
8
|
export default class RootSkillViewController extends AbstractSkillViewController<RootArgs> {
|
|
9
9
|
static id: string;
|
|
10
10
|
private calendarVc;
|
|
@@ -52,9 +52,9 @@ export default class RootSkillViewController extends AbstractSkillViewController
|
|
|
52
52
|
private handleEventSwapped;
|
|
53
53
|
private handleDropEvent;
|
|
54
54
|
private handleDraftEventRemoved;
|
|
55
|
-
getPersonSelectVc(): import("../
|
|
55
|
+
getPersonSelectVc(): import("../tools/PersonSelectTool.vc").default;
|
|
56
56
|
renderToolBelt(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ToolBelt;
|
|
57
|
-
getCalendarSelectVc(): import("../
|
|
57
|
+
getCalendarSelectVc(): import("../tools/CalendarSelectTool.vc").default | undefined;
|
|
58
58
|
getCalendarVc(): CalendarViewController;
|
|
59
59
|
load(options: SkillViewControllerLoadOptions<RootArgs>): Promise<void>;
|
|
60
60
|
private setupCalendarEventListeners;
|
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { AbstractSkillViewController, ToolBeltStateMachine, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
11
|
import { RemoteViewControllerFactory } from '@sprucelabs/spruce-heartwood-utils';
|
|
12
|
+
import CalendarEventManager from '../calendar/CalendarEventManager.js';
|
|
13
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager.js';
|
|
12
14
|
import RemoteEventStoreImpl from '../stores/RemoteEventStore.js';
|
|
13
15
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore.js';
|
|
14
16
|
import { PrerequisitesToolBeltState } from '../toolBelt/states/PrerequisitesToolBeltState.js';
|
|
15
17
|
import { RootToolBeltState } from '../toolBelt/states/RootToolBeltState.js';
|
|
16
|
-
import CalendarEventManager from '../utilities/CalendarEventManager.js';
|
|
17
|
-
import CalendarPeopleManager from '../utilities/CalendarPeopleManager.js';
|
|
18
18
|
export default class RootSkillViewController extends AbstractSkillViewController {
|
|
19
19
|
constructor(options) {
|
|
20
20
|
super(options);
|
|
@@ -317,7 +317,7 @@ export default class RootSkillViewController extends AbstractSkillViewController
|
|
|
317
317
|
const { startDate = this.dates.date(), visiblePeopleIds } = args;
|
|
318
318
|
yield this.calendarVc.renderOnce(() => __awaiter(this, void 0, void 0, function* () {
|
|
319
319
|
this.syncOffsetWithLocale(locale);
|
|
320
|
-
yield this.
|
|
320
|
+
yield this.events.setCurrentDate(startDate);
|
|
321
321
|
}));
|
|
322
322
|
yield this.transitionToRoot();
|
|
323
323
|
this.setSelectedDateInDateSelectVc(startDate);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
2
|
-
import { PersonMode } from '../
|
|
2
|
+
import { PersonMode } from '../tools/PersonSelectTool.vc';
|
|
3
3
|
export default class RemotePreferencesStore {
|
|
4
4
|
protected isLoaded: boolean;
|
|
5
5
|
protected client: MercuryClient;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SpruceSchemas, ToolBeltState } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
+
import CalendarEventManager from '../../calendar/CalendarEventManager';
|
|
3
|
+
import CalendarPeopleManager from '../../calendar/CalendarPeopleManager';
|
|
4
|
+
import CalendarSelectCardViewController from '../../tools/CalendarSelectTool.vc';
|
|
5
|
+
import PersonSelectToolViewController from '../../tools/PersonSelectTool.vc';
|
|
2
6
|
import { CalendarToolBeltStateMachine } from '../../types/calendar.types';
|
|
3
|
-
import CalendarEventManager from '../../utilities/CalendarEventManager';
|
|
4
|
-
import CalendarPeopleManager from '../../utilities/CalendarPeopleManager';
|
|
5
|
-
import CalendarSelectCardViewController from '../../viewControllers/CalendarSelectTool.vc';
|
|
6
7
|
import DateSelectCardViewController from '../../viewControllers/DateSelectCard.vc';
|
|
7
|
-
import PersonSelectToolViewController from '../../viewControllers/PersonSelectTool.vc';
|
|
8
8
|
export declare class RootToolBeltState implements ToolBeltState {
|
|
9
9
|
readonly id = "root";
|
|
10
10
|
private calendarSelectCardVc?;
|
|
@@ -55,8 +55,8 @@ export class RootToolBeltState {
|
|
|
55
55
|
}
|
|
56
56
|
handleSelectDate(date) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const {
|
|
59
|
-
yield
|
|
58
|
+
const { events } = this.sm.getContext();
|
|
59
|
+
yield events.setCurrentDate(date);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
resetToolBelt() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, ActiveRecordCardViewController, Scope, SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import CalendarEventManager from '../
|
|
2
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
3
3
|
export default class CalendarSelectCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private isLoaded;
|
|
File without changes
|
|
File without changes
|
|
@@ -60,9 +60,9 @@ export default class EventDateTimeToolViewController extends AbstractViewControl
|
|
|
60
60
|
label: `I'm done! Let's navigate to ${formattedDestination}.`,
|
|
61
61
|
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
62
62
|
shouldBail = true;
|
|
63
|
-
const {
|
|
64
|
-
yield
|
|
65
|
-
yield
|
|
63
|
+
const { events } = this.getContext();
|
|
64
|
+
yield events.setCurrentDate(dateTimeMs);
|
|
65
|
+
yield events.deselectEvent();
|
|
66
66
|
yield dlg.hide();
|
|
67
67
|
}),
|
|
68
68
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractViewController, Card, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { CalendarTool } from '../index-components';
|
|
3
3
|
import { CalendarToolBeltContext, CalendarToolOptions } from '../types/calendar.types';
|
|
4
|
-
import RepeatingControlsListViewController, { RepeatingOptions } from '
|
|
4
|
+
import RepeatingControlsListViewController, { RepeatingOptions } from '../viewControllers/RepeatingControlsList.vc';
|
|
5
5
|
export default class EventRepeatingToolViewController extends AbstractViewController<Card> implements CalendarTool {
|
|
6
6
|
static id: string;
|
|
7
7
|
private cardVc;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ButtonBarViewController, Card, ListViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import CalendarPeopleManager from '../
|
|
2
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
3
3
|
export default class PersonSelectToolViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private shouldUpdateVisibilityOnToggleChange;
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AbstractViewController, LineIcon, SkillViewControllerLoadOptions, ToolBeltState, ToolBeltStateMachine } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { SpruceSchemas } from '@sprucelabs/mercury-types';
|
|
3
3
|
import { EventTarget } from '@sprucelabs/spruce-event-utils';
|
|
4
|
+
import CalendarViewController from '../calendar/Calendar.vc';
|
|
5
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
6
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
4
7
|
import { UpdateRepeatingStrategy } from '../constants';
|
|
5
8
|
import Scheduler from '../schedulers/Scheduler';
|
|
6
9
|
import CalendarEventsStore from '../stores/CalendarEvents.store';
|
|
7
10
|
import CalendarsStore from '../stores/Calendars.store';
|
|
8
|
-
import CalendarEventManager from '../utilities/CalendarEventManager';
|
|
9
|
-
import CalendarPeopleManager from '../utilities/CalendarPeopleManager';
|
|
10
|
-
import CalendarViewController from '../viewControllers/Calendar.vc';
|
|
11
11
|
export interface Schedule {
|
|
12
12
|
target: EventTarget;
|
|
13
13
|
events: CalendarEventRecord[];
|
|
@@ -37,12 +37,12 @@ export default class EventControlsCardViewController extends AbstractViewControl
|
|
|
37
37
|
buttons: [
|
|
38
38
|
{
|
|
39
39
|
id: 'cancel',
|
|
40
|
-
label: '
|
|
40
|
+
label: 'Undo Last Changes',
|
|
41
41
|
onClick: this.handleClickCancel.bind(this),
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: 'save',
|
|
45
|
-
label: 'Save',
|
|
45
|
+
label: 'Save Changes',
|
|
46
46
|
type: 'primary',
|
|
47
47
|
onClick: this.handleClickSave.bind(this),
|
|
48
48
|
},
|
|
@@ -4,25 +4,25 @@ export { default as CalendarToolTestFactory } from './toolBelt/CalendarToolTestF
|
|
|
4
4
|
export * from './toolBelt/CalendarToolTestFactory';
|
|
5
5
|
export { default as calendarToolBeltInteractor } from './__tests__/support/utilities/calendarToolBeltInteractor';
|
|
6
6
|
export { default as SpyEventManager } from './__tests__/support/SpyEventManager';
|
|
7
|
-
import CalendarViewController from './
|
|
7
|
+
import CalendarViewController from './calendar/Calendar.vc';
|
|
8
|
+
import EventDateTimeToolViewController from './tools/EventDateTimeTool.vc';
|
|
9
|
+
import EventRepeatingToolViewController from './tools/EventRepeatingTool.vc';
|
|
10
|
+
import EventTitleToolViewController from './tools/EventTitleTool.vc';
|
|
8
11
|
import EventControlsCardViewController from './viewControllers/EventControlsCard.vc';
|
|
9
|
-
import EventDateTimeToolViewController from './viewControllers/EventDateTimeTool.vc';
|
|
10
|
-
import EventRepeatingToolViewController from './viewControllers/EventRepeatingTool.vc';
|
|
11
|
-
import EventTitleToolViewController from './viewControllers/EventTitleTool.vc';
|
|
12
12
|
import RepeatingControlsListViewController from './viewControllers/RepeatingControlsList.vc';
|
|
13
13
|
/** COMPONENTS */
|
|
14
|
-
export { default as RepeatingCardViewController } from './
|
|
15
|
-
export * from './
|
|
14
|
+
export { default as RepeatingCardViewController } from './tools/EventRepeatingTool.vc';
|
|
15
|
+
export * from './tools/EventRepeatingTool.vc';
|
|
16
16
|
export { default as RepeatingControlsListViewController } from './viewControllers/RepeatingControlsList.vc';
|
|
17
17
|
export * from './viewControllers/RepeatingControlsList.vc';
|
|
18
|
-
export { default as CalendarViewController } from './
|
|
19
|
-
export * from './
|
|
18
|
+
export { default as CalendarViewController } from './calendar/Calendar.vc';
|
|
19
|
+
export * from './calendar/Calendar.vc';
|
|
20
20
|
export { default as EventControlsCardViewController } from './viewControllers/EventControlsCard.vc';
|
|
21
21
|
export * from './viewControllers/EventControlsCard.vc';
|
|
22
|
-
export { default as EventDateTimeToolViewController } from './
|
|
23
|
-
export * from './
|
|
24
|
-
export { default as EventRepeatingToolViewController } from './
|
|
25
|
-
export * from './
|
|
22
|
+
export { default as EventDateTimeToolViewController } from './tools/EventDateTimeTool.vc';
|
|
23
|
+
export * from './tools/EventDateTimeTool.vc';
|
|
24
|
+
export { default as EventRepeatingToolViewController } from './tools/EventRepeatingTool.vc';
|
|
25
|
+
export * from './tools/EventRepeatingTool.vc';
|
|
26
26
|
export { default as CalendarToolRegistrar } from './toolBelt/CalendarToolRegistrar';
|
|
27
27
|
export * from './toolBelt/CalendarToolRegistrar';
|
|
28
28
|
export { default as AbstractCalendarEventToolBeltState } from './toolBelt/states/AbstractCalendarEventToolBeltState';
|
|
@@ -30,24 +30,24 @@ Object.defineProperty(exports, "calendarToolBeltInteractor", { enumerable: true,
|
|
|
30
30
|
var SpyEventManager_1 = require("./__tests__/support/SpyEventManager");
|
|
31
31
|
Object.defineProperty(exports, "SpyEventManager", { enumerable: true, get: function () { return __importDefault(SpyEventManager_1).default; } });
|
|
32
32
|
/** COMPONENTS */
|
|
33
|
-
var EventRepeatingTool_vc_1 = require("./
|
|
33
|
+
var EventRepeatingTool_vc_1 = require("./tools/EventRepeatingTool.vc");
|
|
34
34
|
Object.defineProperty(exports, "RepeatingCardViewController", { enumerable: true, get: function () { return __importDefault(EventRepeatingTool_vc_1).default; } });
|
|
35
|
-
__exportStar(require("./
|
|
35
|
+
__exportStar(require("./tools/EventRepeatingTool.vc"), exports);
|
|
36
36
|
var RepeatingControlsList_vc_1 = require("./viewControllers/RepeatingControlsList.vc");
|
|
37
37
|
Object.defineProperty(exports, "RepeatingControlsListViewController", { enumerable: true, get: function () { return __importDefault(RepeatingControlsList_vc_1).default; } });
|
|
38
38
|
__exportStar(require("./viewControllers/RepeatingControlsList.vc"), exports);
|
|
39
|
-
var Calendar_vc_1 = require("./
|
|
39
|
+
var Calendar_vc_1 = require("./calendar/Calendar.vc");
|
|
40
40
|
Object.defineProperty(exports, "CalendarViewController", { enumerable: true, get: function () { return __importDefault(Calendar_vc_1).default; } });
|
|
41
|
-
__exportStar(require("./
|
|
41
|
+
__exportStar(require("./calendar/Calendar.vc"), exports);
|
|
42
42
|
var EventControlsCard_vc_1 = require("./viewControllers/EventControlsCard.vc");
|
|
43
43
|
Object.defineProperty(exports, "EventControlsCardViewController", { enumerable: true, get: function () { return __importDefault(EventControlsCard_vc_1).default; } });
|
|
44
44
|
__exportStar(require("./viewControllers/EventControlsCard.vc"), exports);
|
|
45
|
-
var EventDateTimeTool_vc_1 = require("./
|
|
45
|
+
var EventDateTimeTool_vc_1 = require("./tools/EventDateTimeTool.vc");
|
|
46
46
|
Object.defineProperty(exports, "EventDateTimeToolViewController", { enumerable: true, get: function () { return __importDefault(EventDateTimeTool_vc_1).default; } });
|
|
47
|
-
__exportStar(require("./
|
|
48
|
-
var EventRepeatingTool_vc_2 = require("./
|
|
47
|
+
__exportStar(require("./tools/EventDateTimeTool.vc"), exports);
|
|
48
|
+
var EventRepeatingTool_vc_2 = require("./tools/EventRepeatingTool.vc");
|
|
49
49
|
Object.defineProperty(exports, "EventRepeatingToolViewController", { enumerable: true, get: function () { return __importDefault(EventRepeatingTool_vc_2).default; } });
|
|
50
|
-
__exportStar(require("./
|
|
50
|
+
__exportStar(require("./tools/EventRepeatingTool.vc"), exports);
|
|
51
51
|
var CalendarToolRegistrar_1 = require("./toolBelt/CalendarToolRegistrar");
|
|
52
52
|
Object.defineProperty(exports, "CalendarToolRegistrar", { enumerable: true, get: function () { return __importDefault(CalendarToolRegistrar_1).default; } });
|
|
53
53
|
__exportStar(require("./toolBelt/CalendarToolRegistrar"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AbstractSkillViewController, SkillViewControllerLoadOptions, SpruceSchemas, ViewControllerOptions, ScopeFlag } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { RemoteViewControllerFactory } from '@sprucelabs/spruce-heartwood-utils';
|
|
3
|
+
import CalendarViewController from '../calendar/Calendar.vc';
|
|
4
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
5
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
3
6
|
import RemotePreferencesStore from '../stores/RemotePreferencesStore';
|
|
4
7
|
import { CalendarToolBeltStateMachine } from '../types/calendar.types';
|
|
5
|
-
import CalendarEventManager from '../utilities/CalendarEventManager';
|
|
6
|
-
import CalendarPeopleManager from '../utilities/CalendarPeopleManager';
|
|
7
|
-
import CalendarViewController from '../viewControllers/Calendar.vc';
|
|
8
8
|
export default class RootSkillViewController extends AbstractSkillViewController<RootArgs> {
|
|
9
9
|
static id: string;
|
|
10
10
|
private calendarVc;
|
|
@@ -52,9 +52,9 @@ export default class RootSkillViewController extends AbstractSkillViewController
|
|
|
52
52
|
private handleEventSwapped;
|
|
53
53
|
private handleDropEvent;
|
|
54
54
|
private handleDraftEventRemoved;
|
|
55
|
-
getPersonSelectVc(): import("../
|
|
55
|
+
getPersonSelectVc(): import("../tools/PersonSelectTool.vc").default;
|
|
56
56
|
renderToolBelt(): SpruceSchemas.HeartwoodViewControllers.v2021_02_11.ToolBelt;
|
|
57
|
-
getCalendarSelectVc(): import("../
|
|
57
|
+
getCalendarSelectVc(): import("../tools/CalendarSelectTool.vc").default | undefined;
|
|
58
58
|
getCalendarVc(): CalendarViewController;
|
|
59
59
|
load(options: SkillViewControllerLoadOptions<RootArgs>): Promise<void>;
|
|
60
60
|
private setupCalendarEventListeners;
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
7
7
|
const spruce_heartwood_utils_1 = require("@sprucelabs/spruce-heartwood-utils");
|
|
8
|
+
const CalendarEventManager_1 = __importDefault(require("../calendar/CalendarEventManager"));
|
|
9
|
+
const CalendarPeopleManager_1 = __importDefault(require("../calendar/CalendarPeopleManager"));
|
|
8
10
|
const RemoteEventStore_1 = __importDefault(require("../stores/RemoteEventStore"));
|
|
9
11
|
const RemotePreferencesStore_1 = __importDefault(require("../stores/RemotePreferencesStore"));
|
|
10
12
|
const PrerequisitesToolBeltState_1 = require("../toolBelt/states/PrerequisitesToolBeltState");
|
|
11
13
|
const RootToolBeltState_1 = require("../toolBelt/states/RootToolBeltState");
|
|
12
|
-
const CalendarEventManager_1 = __importDefault(require("../utilities/CalendarEventManager"));
|
|
13
|
-
const CalendarPeopleManager_1 = __importDefault(require("../utilities/CalendarPeopleManager"));
|
|
14
14
|
class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkillViewController {
|
|
15
15
|
constructor(options) {
|
|
16
16
|
super(options);
|
|
@@ -278,7 +278,7 @@ class RootSkillViewController extends heartwood_view_controllers_1.AbstractSkill
|
|
|
278
278
|
const { startDate = this.dates.date(), visiblePeopleIds } = args;
|
|
279
279
|
await this.calendarVc.renderOnce(async () => {
|
|
280
280
|
this.syncOffsetWithLocale(locale);
|
|
281
|
-
await this.
|
|
281
|
+
await this.events.setCurrentDate(startDate);
|
|
282
282
|
});
|
|
283
283
|
await this.transitionToRoot();
|
|
284
284
|
this.setSelectedDateInDateSelectVc(startDate);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MercuryClient } from '@sprucelabs/mercury-client';
|
|
2
|
-
import { PersonMode } from '../
|
|
2
|
+
import { PersonMode } from '../tools/PersonSelectTool.vc';
|
|
3
3
|
export default class RemotePreferencesStore {
|
|
4
4
|
protected isLoaded: boolean;
|
|
5
5
|
protected client: MercuryClient;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SpruceSchemas, ToolBeltState } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
+
import CalendarEventManager from '../../calendar/CalendarEventManager';
|
|
3
|
+
import CalendarPeopleManager from '../../calendar/CalendarPeopleManager';
|
|
4
|
+
import CalendarSelectCardViewController from '../../tools/CalendarSelectTool.vc';
|
|
5
|
+
import PersonSelectToolViewController from '../../tools/PersonSelectTool.vc';
|
|
2
6
|
import { CalendarToolBeltStateMachine } from '../../types/calendar.types';
|
|
3
|
-
import CalendarEventManager from '../../utilities/CalendarEventManager';
|
|
4
|
-
import CalendarPeopleManager from '../../utilities/CalendarPeopleManager';
|
|
5
|
-
import CalendarSelectCardViewController from '../../viewControllers/CalendarSelectTool.vc';
|
|
6
7
|
import DateSelectCardViewController from '../../viewControllers/DateSelectCard.vc';
|
|
7
|
-
import PersonSelectToolViewController from '../../viewControllers/PersonSelectTool.vc';
|
|
8
8
|
export declare class RootToolBeltState implements ToolBeltState {
|
|
9
9
|
readonly id = "root";
|
|
10
10
|
private calendarSelectCardVc?;
|
|
@@ -46,8 +46,8 @@ class RootToolBeltState {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
async handleSelectDate(date) {
|
|
49
|
-
const {
|
|
50
|
-
await
|
|
49
|
+
const { events } = this.sm.getContext();
|
|
50
|
+
await events.setCurrentDate(date);
|
|
51
51
|
}
|
|
52
52
|
resetToolBelt() {
|
|
53
53
|
var _a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, ActiveRecordCardViewController, Scope, SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import CalendarEventManager from '../
|
|
2
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
3
3
|
export default class CalendarSelectCardViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private isLoaded;
|
|
File without changes
|
|
File without changes
|
|
@@ -50,9 +50,9 @@ class EventDateTimeToolViewController extends heartwood_view_controllers_1.Abstr
|
|
|
50
50
|
label: `I'm done! Let's navigate to ${formattedDestination}.`,
|
|
51
51
|
onClick: async () => {
|
|
52
52
|
shouldBail = true;
|
|
53
|
-
const {
|
|
54
|
-
await
|
|
55
|
-
await
|
|
53
|
+
const { events } = this.getContext();
|
|
54
|
+
await events.setCurrentDate(dateTimeMs);
|
|
55
|
+
await events.deselectEvent();
|
|
56
56
|
await dlg.hide();
|
|
57
57
|
},
|
|
58
58
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractViewController, Card, FormViewController, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { CalendarTool } from '../index-components';
|
|
3
3
|
import { CalendarToolBeltContext, CalendarToolOptions } from '../types/calendar.types';
|
|
4
|
-
import RepeatingControlsListViewController, { RepeatingOptions } from '
|
|
4
|
+
import RepeatingControlsListViewController, { RepeatingOptions } from '../viewControllers/RepeatingControlsList.vc';
|
|
5
5
|
export default class EventRepeatingToolViewController extends AbstractViewController<Card> implements CalendarTool {
|
|
6
6
|
static id: string;
|
|
7
7
|
private cardVc;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, SpruceSchemas, ViewControllerOptions, ButtonBarViewController, Card, ListViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import CalendarPeopleManager from '../
|
|
2
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
3
3
|
export default class PersonSelectToolViewController extends AbstractViewController<Card> {
|
|
4
4
|
static id: string;
|
|
5
5
|
private shouldUpdateVisibilityOnToggleChange;
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AbstractViewController, LineIcon, SkillViewControllerLoadOptions, ToolBeltState, ToolBeltStateMachine } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { SpruceSchemas } from '@sprucelabs/mercury-types';
|
|
3
3
|
import { EventTarget } from '@sprucelabs/spruce-event-utils';
|
|
4
|
+
import CalendarViewController from '../calendar/Calendar.vc';
|
|
5
|
+
import CalendarEventManager from '../calendar/CalendarEventManager';
|
|
6
|
+
import CalendarPeopleManager from '../calendar/CalendarPeopleManager';
|
|
4
7
|
import { UpdateRepeatingStrategy } from '../constants';
|
|
5
8
|
import Scheduler from '../schedulers/Scheduler';
|
|
6
9
|
import CalendarEventsStore from '../stores/CalendarEvents.store';
|
|
7
10
|
import CalendarsStore from '../stores/Calendars.store';
|
|
8
|
-
import CalendarEventManager from '../utilities/CalendarEventManager';
|
|
9
|
-
import CalendarPeopleManager from '../utilities/CalendarPeopleManager';
|
|
10
|
-
import CalendarViewController from '../viewControllers/Calendar.vc';
|
|
11
11
|
export interface Schedule {
|
|
12
12
|
target: EventTarget;
|
|
13
13
|
events: CalendarEventRecord[];
|
|
@@ -33,12 +33,12 @@ class EventControlsCardViewController extends heartwood_view_controllers_1.Abstr
|
|
|
33
33
|
buttons: [
|
|
34
34
|
{
|
|
35
35
|
id: 'cancel',
|
|
36
|
-
label: '
|
|
36
|
+
label: 'Undo Last Changes',
|
|
37
37
|
onClick: this.handleClickCancel.bind(this),
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
id: 'save',
|
|
41
|
-
label: 'Save',
|
|
41
|
+
label: 'Save Changes',
|
|
42
42
|
type: 'primary',
|
|
43
43
|
onClick: this.handleClickSave.bind(this),
|
|
44
44
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/spruce-calendar-components",
|
|
3
3
|
"description": "Calendar components for working with calendars and Sprucebot.",
|
|
4
|
-
"version": "22.10.
|
|
4
|
+
"version": "22.10.46",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "calendar"
|
|
7
7
|
},
|
|
@@ -106,14 +106,14 @@
|
|
|
106
106
|
"build/types/calendar.types.d.ts",
|
|
107
107
|
"build/esm/types/calendar.types.js",
|
|
108
108
|
"build/esm/types/calendar.types.d.ts",
|
|
109
|
-
"build/
|
|
110
|
-
"build/
|
|
111
|
-
"build/esm/
|
|
112
|
-
"build/esm/
|
|
113
|
-
"build/
|
|
114
|
-
"build/
|
|
115
|
-
"build/esm/
|
|
116
|
-
"build/esm/
|
|
109
|
+
"build/calendar/CalendarEventManager.js",
|
|
110
|
+
"build/calendar/CalendarEventManager.d.ts",
|
|
111
|
+
"build/esm/calendar/CalendarEventManager.js",
|
|
112
|
+
"build/esm/calendar/CalendarEventManager.d.ts",
|
|
113
|
+
"build/calendar/CalendarPeopleManager.js",
|
|
114
|
+
"build/calendar/CalendarPeopleManager.d.ts",
|
|
115
|
+
"build/esm/calendar/CalendarPeopleManager.js",
|
|
116
|
+
"build/esm/calendar/CalendarPeopleManager.d.ts",
|
|
117
117
|
"build/utilities/calendarShiftGenerator.js",
|
|
118
118
|
"build/utilities/calendarShiftGenerator.d.ts",
|
|
119
119
|
"build/esm/utilities/calendarShiftGenerator.js",
|
|
@@ -122,18 +122,18 @@
|
|
|
122
122
|
"build/utilities/draftGenerator.d.ts",
|
|
123
123
|
"build/esm/utilities/draftGenerator.js",
|
|
124
124
|
"build/esm/utilities/draftGenerator.d.ts",
|
|
125
|
-
"build/
|
|
126
|
-
"build/
|
|
127
|
-
"build/esm/
|
|
128
|
-
"build/esm/
|
|
125
|
+
"build/calendar/Calendar.vc.js",
|
|
126
|
+
"build/calendar/Calendar.vc.d.ts",
|
|
127
|
+
"build/esm/calendar/Calendar.vc.js",
|
|
128
|
+
"build/esm/calendar/Calendar.vc.d.ts",
|
|
129
129
|
"build/errors/SpruceError.js",
|
|
130
130
|
"build/errors/SpruceError.d.ts",
|
|
131
131
|
"build/esm/errors/SpruceError.js",
|
|
132
132
|
"build/esm/errors/SpruceError.d.ts",
|
|
133
|
-
"build/
|
|
134
|
-
"build/
|
|
135
|
-
"build/esm/
|
|
136
|
-
"build/esm/
|
|
133
|
+
"build/tools/CalendarSelectTool.vc.js",
|
|
134
|
+
"build/tools/CalendarSelectTool.vc.d.ts",
|
|
135
|
+
"build/esm/tools/CalendarSelectTool.vc.js",
|
|
136
|
+
"build/esm/tools/CalendarSelectTool.vc.d.ts",
|
|
137
137
|
"build/viewControllers/DateSelectCard.vc.js",
|
|
138
138
|
"build/viewControllers/DateSelectCard.vc.d.ts",
|
|
139
139
|
"build/esm/viewControllers/DateSelectCard.vc.js",
|
|
@@ -142,22 +142,22 @@
|
|
|
142
142
|
"build/viewControllers/EventControlsCard.vc.d.ts",
|
|
143
143
|
"build/esm/viewControllers/EventControlsCard.vc.js",
|
|
144
144
|
"build/esm/viewControllers/EventControlsCard.vc.d.ts",
|
|
145
|
-
"build/
|
|
146
|
-
"build/
|
|
147
|
-
"build/esm/
|
|
148
|
-
"build/esm/
|
|
149
|
-
"build/
|
|
150
|
-
"build/
|
|
151
|
-
"build/esm/
|
|
152
|
-
"build/esm/
|
|
153
|
-
"build/
|
|
154
|
-
"build/
|
|
155
|
-
"build/esm/
|
|
156
|
-
"build/esm/
|
|
157
|
-
"build/
|
|
158
|
-
"build/
|
|
159
|
-
"build/esm/
|
|
160
|
-
"build/esm/
|
|
145
|
+
"build/tools/EventDateTimeTool.vc.js",
|
|
146
|
+
"build/tools/EventDateTimeTool.vc.d.ts",
|
|
147
|
+
"build/esm/tools/EventDateTimeTool.vc.js",
|
|
148
|
+
"build/esm/tools/EventDateTimeTool.vc.d.ts",
|
|
149
|
+
"build/tools/EventRepeatingTool.vc.js",
|
|
150
|
+
"build/tools/EventRepeatingTool.vc.d.ts",
|
|
151
|
+
"build/esm/tools/EventRepeatingTool.vc.js",
|
|
152
|
+
"build/esm/tools/EventRepeatingTool.vc.d.ts",
|
|
153
|
+
"build/tools/EventTitleTool.vc.js",
|
|
154
|
+
"build/tools/EventTitleTool.vc.d.ts",
|
|
155
|
+
"build/esm/tools/EventTitleTool.vc.js",
|
|
156
|
+
"build/esm/tools/EventTitleTool.vc.d.ts",
|
|
157
|
+
"build/tools/PersonSelectTool.vc.js",
|
|
158
|
+
"build/tools/PersonSelectTool.vc.d.ts",
|
|
159
|
+
"build/esm/tools/PersonSelectTool.vc.js",
|
|
160
|
+
"build/esm/tools/PersonSelectTool.vc.d.ts",
|
|
161
161
|
"build/viewControllers/RepeatingControlsList.vc.js",
|
|
162
162
|
"build/viewControllers/RepeatingControlsList.vc.d.ts",
|
|
163
163
|
"build/esm/viewControllers/RepeatingControlsList.vc.js",
|