@sprucelabs/spruce-people-utils 1.0.56 → 1.0.60
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__/behavioral/inviting/{SpyPersonInviteViewController.d.ts → SpyInvitePersonViewController.d.ts} +2 -1
- package/build/__tests__/behavioral/inviting/{SpyPersonInviteViewController.js → SpyInvitePersonViewController.js} +6 -2
- package/build/__tests__/behavioral/searching/SpyPersonSelectInput.d.ts +3 -2
- package/build/__tests__/behavioral/searching/SpyPersonSelectInput.js +2 -2
- package/build/esm/__tests__/behavioral/inviting/{SpyPersonInviteViewController.d.ts → SpyInvitePersonViewController.d.ts} +2 -1
- package/build/esm/__tests__/behavioral/inviting/SpyInvitePersonViewController.js +24 -0
- package/build/esm/__tests__/behavioral/searching/SpyPersonSelectInput.d.ts +3 -2
- package/build/esm/__tests__/behavioral/searching/SpyPersonSelectInput.js +2 -2
- package/build/esm/index-module.d.ts +1 -1
- package/build/esm/index-module.js +1 -1
- package/build/esm/inviting/InvitePersonCard.vc.d.ts +5 -3
- package/build/esm/inviting/InvitePersonCard.vc.js +28 -7
- package/build/esm/viewControllers/PersonSelectInput.vc.d.ts +2 -2
- package/build/esm/viewControllers/PersonSelectInput.vc.js +8 -3
- package/build/index-module.d.ts +1 -1
- package/build/index-module.js +2 -2
- package/build/inviting/InvitePersonCard.vc.d.ts +5 -3
- package/build/inviting/InvitePersonCard.vc.js +28 -7
- package/build/viewControllers/PersonSelectInput.vc.d.ts +2 -2
- package/build/viewControllers/PersonSelectInput.vc.js +8 -3
- package/package.json +5 -5
- package/build/esm/__tests__/behavioral/inviting/SpyPersonInviteViewController.js +0 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import InvitePersonCardViewController from '../../../inviting/InvitePersonCard.vc';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SpyInviteInviteViewController extends InvitePersonCardViewController {
|
|
3
3
|
getLocationId(): string | undefined;
|
|
4
4
|
getOrganizationId(): string;
|
|
5
|
+
clickDone(personId: string): Promise<void>;
|
|
5
6
|
}
|
|
@@ -4,12 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const InvitePersonCard_vc_1 = __importDefault(require("../../../inviting/InvitePersonCard.vc"));
|
|
7
|
-
class
|
|
7
|
+
class SpyInviteInviteViewController extends InvitePersonCard_vc_1.default {
|
|
8
8
|
getLocationId() {
|
|
9
9
|
return this.locationId;
|
|
10
10
|
}
|
|
11
11
|
getOrganizationId() {
|
|
12
12
|
return this.organizationId;
|
|
13
13
|
}
|
|
14
|
+
async clickDone(personId) {
|
|
15
|
+
var _a;
|
|
16
|
+
await ((_a = this.doneHandler) === null || _a === void 0 ? void 0 : _a.call(this, personId));
|
|
17
|
+
}
|
|
14
18
|
}
|
|
15
|
-
exports.default =
|
|
19
|
+
exports.default = SpyInviteInviteViewController;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DoneHandler } from '../../../inviting/InvitePersonCard.vc';
|
|
1
2
|
import { SearchPerson } from '../../../types/people-module.types';
|
|
2
3
|
import PersonSelectInputViewController from '../../../viewControllers/PersonSelectInput.vc';
|
|
3
|
-
import
|
|
4
|
+
import SpyInviteInviteViewController from '../inviting/SpyInvitePersonViewController';
|
|
4
5
|
export default class SpyPersonSelectInput extends PersonSelectInputViewController {
|
|
5
6
|
getLastLoadedPersonId(): string | undefined;
|
|
6
7
|
getOrganizationId(): string | undefined;
|
|
@@ -8,5 +9,5 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
|
|
|
8
9
|
getAutocompleteVc(): import("@sprucelabs/heartwood-view-controllers").AutocompleteInputViewController;
|
|
9
10
|
handleClickSuggestion(person: SearchPerson): Promise<void>;
|
|
10
11
|
clearOrgId(): void;
|
|
11
|
-
InvitePersonVc():
|
|
12
|
+
InvitePersonVc(onDone?: DoneHandler): SpyInviteInviteViewController;
|
|
12
13
|
}
|
|
@@ -23,8 +23,8 @@ class SpyPersonSelectInput extends PersonSelectInput_vc_1.default {
|
|
|
23
23
|
clearOrgId() {
|
|
24
24
|
this.organizationId = undefined;
|
|
25
25
|
}
|
|
26
|
-
InvitePersonVc() {
|
|
27
|
-
const vc = super.InvitePersonVc();
|
|
26
|
+
InvitePersonVc(onDone) {
|
|
27
|
+
const vc = super.InvitePersonVc(onDone);
|
|
28
28
|
return vc;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import InvitePersonCardViewController from '../../../inviting/InvitePersonCard.vc';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SpyInviteInviteViewController extends InvitePersonCardViewController {
|
|
3
3
|
getLocationId(): string | undefined;
|
|
4
4
|
getOrganizationId(): string;
|
|
5
|
+
clickDone(personId: string): Promise<void>;
|
|
5
6
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import InvitePersonCardViewController from '../../../inviting/InvitePersonCard.vc.js';
|
|
11
|
+
export default class SpyInviteInviteViewController extends InvitePersonCardViewController {
|
|
12
|
+
getLocationId() {
|
|
13
|
+
return this.locationId;
|
|
14
|
+
}
|
|
15
|
+
getOrganizationId() {
|
|
16
|
+
return this.organizationId;
|
|
17
|
+
}
|
|
18
|
+
clickDone(personId) {
|
|
19
|
+
var _a;
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
yield ((_a = this.doneHandler) === null || _a === void 0 ? void 0 : _a.call(this, personId));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DoneHandler } from '../../../inviting/InvitePersonCard.vc';
|
|
1
2
|
import { SearchPerson } from '../../../types/people-module.types';
|
|
2
3
|
import PersonSelectInputViewController from '../../../viewControllers/PersonSelectInput.vc';
|
|
3
|
-
import
|
|
4
|
+
import SpyInviteInviteViewController from '../inviting/SpyInvitePersonViewController';
|
|
4
5
|
export default class SpyPersonSelectInput extends PersonSelectInputViewController {
|
|
5
6
|
getLastLoadedPersonId(): string | undefined;
|
|
6
7
|
getOrganizationId(): string | undefined;
|
|
@@ -8,5 +9,5 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
|
|
|
8
9
|
getAutocompleteVc(): import("@sprucelabs/heartwood-view-controllers").AutocompleteInputViewController;
|
|
9
10
|
handleClickSuggestion(person: SearchPerson): Promise<void>;
|
|
10
11
|
clearOrgId(): void;
|
|
11
|
-
InvitePersonVc():
|
|
12
|
+
InvitePersonVc(onDone?: DoneHandler): SpyInviteInviteViewController;
|
|
12
13
|
}
|
|
@@ -18,8 +18,8 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
|
|
|
18
18
|
clearOrgId() {
|
|
19
19
|
this.organizationId = undefined;
|
|
20
20
|
}
|
|
21
|
-
InvitePersonVc() {
|
|
22
|
-
const vc = super.InvitePersonVc();
|
|
21
|
+
InvitePersonVc(onDone) {
|
|
22
|
+
const vc = super.InvitePersonVc(onDone);
|
|
23
23
|
return vc;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -2,7 +2,7 @@ import PersonSelectInputViewController from './viewControllers/PersonSelectInput
|
|
|
2
2
|
export { default as PersonSelectInputViewController } from './viewControllers/PersonSelectInput.vc';
|
|
3
3
|
export * from './viewControllers/PersonSelectInput.vc';
|
|
4
4
|
export { default as SpyPersonSelectInput } from './__tests__/behavioral/searching/SpyPersonSelectInput';
|
|
5
|
-
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/
|
|
5
|
+
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/SpyInvitePersonViewController';
|
|
6
6
|
export { default as InvitePersonCardViewController } from './inviting/InvitePersonCard.vc';
|
|
7
7
|
declare module '@sprucelabs/heartwood-view-controllers/build/types/heartwood.types' {
|
|
8
8
|
interface ViewControllerMap {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as PersonSelectInputViewController } from './viewControllers/PersonSelectInput.vc.js';
|
|
2
2
|
export * from './viewControllers/PersonSelectInput.vc.js';
|
|
3
3
|
export { default as SpyPersonSelectInput } from './__tests__/behavioral/searching/SpyPersonSelectInput.js';
|
|
4
|
-
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/
|
|
4
|
+
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/SpyInvitePersonViewController.js';
|
|
5
5
|
export { default as InvitePersonCardViewController } from './inviting/InvitePersonCard.vc.js';
|
|
@@ -6,14 +6,16 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
6
6
|
protected organizationId: string;
|
|
7
7
|
protected locationId?: string;
|
|
8
8
|
protected formVc: FormViewController<InviteFormSchema>;
|
|
9
|
-
protected
|
|
9
|
+
protected waitingTalkingVc: TalkingSprucebotViewController;
|
|
10
|
+
protected successTalkingVc: TalkingSprucebotViewController;
|
|
10
11
|
protected pendingInvite?: SendInvite;
|
|
12
|
+
protected doneHandler?: DoneHandler;
|
|
11
13
|
private isLoaded;
|
|
12
|
-
private doneHandler?;
|
|
13
14
|
private client;
|
|
14
15
|
private invitedPersonId?;
|
|
15
16
|
constructor(options: ViewControllerOptions & InvitePersonOptions);
|
|
16
|
-
|
|
17
|
+
SuccessTalkingVc(): TalkingSprucebotViewController;
|
|
18
|
+
private WaitingTalkingVc;
|
|
17
19
|
private CardVc;
|
|
18
20
|
private handleSlideChange;
|
|
19
21
|
private updateTalkingSprucebot;
|
|
@@ -24,13 +24,29 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
24
24
|
const { organizationId, locationId, onDone } = assertOptions(options, required);
|
|
25
25
|
this.organizationId = organizationId;
|
|
26
26
|
this.locationId = locationId;
|
|
27
|
-
this.
|
|
27
|
+
this.waitingTalkingVc = this.WaitingTalkingVc();
|
|
28
|
+
this.successTalkingVc = this.SuccessTalkingVc();
|
|
28
29
|
this.formVc = this.FormVc();
|
|
29
30
|
this.cardVc = this.CardVc();
|
|
30
31
|
this.doneHandler = onDone;
|
|
31
32
|
this._handleDidAcceptInvite = this._handleDidAcceptInvite.bind(this);
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
SuccessTalkingVc() {
|
|
35
|
+
return this.Controller('talkingSprucebot', {
|
|
36
|
+
id: 'success',
|
|
37
|
+
avatar: {
|
|
38
|
+
size: 'medium',
|
|
39
|
+
stateOfMind: 'accomplished',
|
|
40
|
+
},
|
|
41
|
+
isPlaying: false,
|
|
42
|
+
sentences: [
|
|
43
|
+
{
|
|
44
|
+
words: `First name has accepted the invite, let's go!`,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
WaitingTalkingVc() {
|
|
34
50
|
return this.Controller('talkingSprucebot', {
|
|
35
51
|
id: 'wait',
|
|
36
52
|
avatar: {
|
|
@@ -46,7 +62,7 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
46
62
|
words: `Have them tap the link and follow the instructions!`,
|
|
47
63
|
},
|
|
48
64
|
{
|
|
49
|
-
words: "Once they
|
|
65
|
+
words: "Once they have accepted the invite we'll be onto the next step!",
|
|
50
66
|
},
|
|
51
67
|
],
|
|
52
68
|
});
|
|
@@ -63,7 +79,10 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
63
79
|
form: this.formVc.render(),
|
|
64
80
|
},
|
|
65
81
|
{
|
|
66
|
-
talkingSprucebot: this.
|
|
82
|
+
talkingSprucebot: this.waitingTalkingVc.render(),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
talkingSprucebot: this.successTalkingVc.render(),
|
|
67
86
|
},
|
|
68
87
|
],
|
|
69
88
|
});
|
|
@@ -80,15 +99,15 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
80
99
|
const name = this.formVc.getValue('firstName');
|
|
81
100
|
switch (this.slideIdx) {
|
|
82
101
|
case 1:
|
|
83
|
-
this.
|
|
102
|
+
this.waitingTalkingVc.setSentences([
|
|
84
103
|
{
|
|
85
104
|
words: `Tell ${name} to check their phone and to click the link I just sent!`,
|
|
86
105
|
},
|
|
87
106
|
]);
|
|
88
|
-
yield this.
|
|
107
|
+
yield this.waitingTalkingVc.play();
|
|
89
108
|
break;
|
|
90
109
|
default:
|
|
91
|
-
this.
|
|
110
|
+
this.waitingTalkingVc.pause();
|
|
92
111
|
}
|
|
93
112
|
});
|
|
94
113
|
}
|
|
@@ -97,6 +116,7 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
97
116
|
this.cardVc.setFooter({
|
|
98
117
|
buttons: [
|
|
99
118
|
{
|
|
119
|
+
type: this.invitedPersonId ? 'primary' : 'secondary',
|
|
100
120
|
id: this.slideIdx === 2 ? 'done' : 'back',
|
|
101
121
|
label: this.slideIdx === 2 ? 'Done' : 'Back',
|
|
102
122
|
onClick: this.slideIdx === 2
|
|
@@ -203,6 +223,7 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
203
223
|
if (((_a = this.pendingInvite) === null || _a === void 0 ? void 0 : _a.id) === inviteId) {
|
|
204
224
|
yield this.cardVc.jumpToSlide(2);
|
|
205
225
|
this.invitedPersonId = personId;
|
|
226
|
+
this.updateFooter();
|
|
206
227
|
}
|
|
207
228
|
});
|
|
208
229
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, AutocompleteInputViewController, FormInputHandlers, FormInputOptions, FormInputViewController, SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import InvitePersonCardViewController from '../inviting/InvitePersonCard.vc';
|
|
2
|
+
import InvitePersonCardViewController, { DoneHandler } from '../inviting/InvitePersonCard.vc';
|
|
3
3
|
import { SearchPerson } from '../types/people-module.types';
|
|
4
4
|
export default class PersonSelectInputViewController extends AbstractViewController<AutocompleteInput> implements FormInputViewController<AutocompleteInput> {
|
|
5
5
|
static id: string;
|
|
@@ -17,7 +17,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
|
|
|
17
17
|
setHandlers(options: FormInputHandlers<AutocompleteInput>): void;
|
|
18
18
|
private handleClickInviteAnonymous;
|
|
19
19
|
private handleClickInvitePerson;
|
|
20
|
-
protected InvitePersonVc(): InvitePersonCardViewController;
|
|
20
|
+
protected InvitePersonVc(onDone?: DoneHandler): InvitePersonCardViewController;
|
|
21
21
|
private search;
|
|
22
22
|
protected handleClickSuggestion(person: SearchPerson): Promise<void>;
|
|
23
23
|
setOrganizationId(orgId: string): void;
|
|
@@ -94,15 +94,20 @@ export default class PersonSelectInputViewController extends AbstractViewControl
|
|
|
94
94
|
}
|
|
95
95
|
handleClickInvitePerson() {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
const vc = this.InvitePersonVc()
|
|
98
|
-
|
|
97
|
+
const vc = this.InvitePersonVc((personId) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
yield this.setValue(personId);
|
|
99
|
+
yield dlg.hide();
|
|
100
|
+
yield this.loadCurrentPerson();
|
|
101
|
+
}));
|
|
102
|
+
const dlg = this.renderInDialog(vc.render());
|
|
99
103
|
yield vc.load();
|
|
100
104
|
});
|
|
101
105
|
}
|
|
102
|
-
InvitePersonVc() {
|
|
106
|
+
InvitePersonVc(onDone) {
|
|
103
107
|
const vc = this.Controller('people.invite-person-card', {
|
|
104
108
|
organizationId: this.organizationId,
|
|
105
109
|
locationId: this.locationId,
|
|
110
|
+
onDone,
|
|
106
111
|
});
|
|
107
112
|
return vc;
|
|
108
113
|
}
|
package/build/index-module.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import PersonSelectInputViewController from './viewControllers/PersonSelectInput
|
|
|
2
2
|
export { default as PersonSelectInputViewController } from './viewControllers/PersonSelectInput.vc';
|
|
3
3
|
export * from './viewControllers/PersonSelectInput.vc';
|
|
4
4
|
export { default as SpyPersonSelectInput } from './__tests__/behavioral/searching/SpyPersonSelectInput';
|
|
5
|
-
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/
|
|
5
|
+
export { default as SpyPersonInviteViewController } from './__tests__/behavioral/inviting/SpyInvitePersonViewController';
|
|
6
6
|
export { default as InvitePersonCardViewController } from './inviting/InvitePersonCard.vc';
|
|
7
7
|
declare module '@sprucelabs/heartwood-view-controllers/build/types/heartwood.types' {
|
|
8
8
|
interface ViewControllerMap {
|
package/build/index-module.js
CHANGED
|
@@ -23,7 +23,7 @@ Object.defineProperty(exports, "PersonSelectInputViewController", { enumerable:
|
|
|
23
23
|
__exportStar(require("./viewControllers/PersonSelectInput.vc"), exports);
|
|
24
24
|
var SpyPersonSelectInput_1 = require("./__tests__/behavioral/searching/SpyPersonSelectInput");
|
|
25
25
|
Object.defineProperty(exports, "SpyPersonSelectInput", { enumerable: true, get: function () { return __importDefault(SpyPersonSelectInput_1).default; } });
|
|
26
|
-
var
|
|
27
|
-
Object.defineProperty(exports, "SpyPersonInviteViewController", { enumerable: true, get: function () { return __importDefault(
|
|
26
|
+
var SpyInvitePersonViewController_1 = require("./__tests__/behavioral/inviting/SpyInvitePersonViewController");
|
|
27
|
+
Object.defineProperty(exports, "SpyPersonInviteViewController", { enumerable: true, get: function () { return __importDefault(SpyInvitePersonViewController_1).default; } });
|
|
28
28
|
var InvitePersonCard_vc_1 = require("./inviting/InvitePersonCard.vc");
|
|
29
29
|
Object.defineProperty(exports, "InvitePersonCardViewController", { enumerable: true, get: function () { return __importDefault(InvitePersonCard_vc_1).default; } });
|
|
@@ -6,14 +6,16 @@ export default class InvitePersonCardViewController extends AbstractViewControll
|
|
|
6
6
|
protected organizationId: string;
|
|
7
7
|
protected locationId?: string;
|
|
8
8
|
protected formVc: FormViewController<InviteFormSchema>;
|
|
9
|
-
protected
|
|
9
|
+
protected waitingTalkingVc: TalkingSprucebotViewController;
|
|
10
|
+
protected successTalkingVc: TalkingSprucebotViewController;
|
|
10
11
|
protected pendingInvite?: SendInvite;
|
|
12
|
+
protected doneHandler?: DoneHandler;
|
|
11
13
|
private isLoaded;
|
|
12
|
-
private doneHandler?;
|
|
13
14
|
private client;
|
|
14
15
|
private invitedPersonId?;
|
|
15
16
|
constructor(options: ViewControllerOptions & InvitePersonOptions);
|
|
16
|
-
|
|
17
|
+
SuccessTalkingVc(): TalkingSprucebotViewController;
|
|
18
|
+
private WaitingTalkingVc;
|
|
17
19
|
private CardVc;
|
|
18
20
|
private handleSlideChange;
|
|
19
21
|
private updateTalkingSprucebot;
|
|
@@ -17,13 +17,29 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
17
17
|
const { organizationId, locationId, onDone } = (0, schema_1.assertOptions)(options, required);
|
|
18
18
|
this.organizationId = organizationId;
|
|
19
19
|
this.locationId = locationId;
|
|
20
|
-
this.
|
|
20
|
+
this.waitingTalkingVc = this.WaitingTalkingVc();
|
|
21
|
+
this.successTalkingVc = this.SuccessTalkingVc();
|
|
21
22
|
this.formVc = this.FormVc();
|
|
22
23
|
this.cardVc = this.CardVc();
|
|
23
24
|
this.doneHandler = onDone;
|
|
24
25
|
this._handleDidAcceptInvite = this._handleDidAcceptInvite.bind(this);
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
+
SuccessTalkingVc() {
|
|
28
|
+
return this.Controller('talkingSprucebot', {
|
|
29
|
+
id: 'success',
|
|
30
|
+
avatar: {
|
|
31
|
+
size: 'medium',
|
|
32
|
+
stateOfMind: 'accomplished',
|
|
33
|
+
},
|
|
34
|
+
isPlaying: false,
|
|
35
|
+
sentences: [
|
|
36
|
+
{
|
|
37
|
+
words: `First name has accepted the invite, let's go!`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
WaitingTalkingVc() {
|
|
27
43
|
return this.Controller('talkingSprucebot', {
|
|
28
44
|
id: 'wait',
|
|
29
45
|
avatar: {
|
|
@@ -39,7 +55,7 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
39
55
|
words: `Have them tap the link and follow the instructions!`,
|
|
40
56
|
},
|
|
41
57
|
{
|
|
42
|
-
words: "Once they
|
|
58
|
+
words: "Once they have accepted the invite we'll be onto the next step!",
|
|
43
59
|
},
|
|
44
60
|
],
|
|
45
61
|
});
|
|
@@ -56,7 +72,10 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
56
72
|
form: this.formVc.render(),
|
|
57
73
|
},
|
|
58
74
|
{
|
|
59
|
-
talkingSprucebot: this.
|
|
75
|
+
talkingSprucebot: this.waitingTalkingVc.render(),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
talkingSprucebot: this.successTalkingVc.render(),
|
|
60
79
|
},
|
|
61
80
|
],
|
|
62
81
|
});
|
|
@@ -70,15 +89,15 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
70
89
|
const name = this.formVc.getValue('firstName');
|
|
71
90
|
switch (this.slideIdx) {
|
|
72
91
|
case 1:
|
|
73
|
-
this.
|
|
92
|
+
this.waitingTalkingVc.setSentences([
|
|
74
93
|
{
|
|
75
94
|
words: `Tell ${name} to check their phone and to click the link I just sent!`,
|
|
76
95
|
},
|
|
77
96
|
]);
|
|
78
|
-
await this.
|
|
97
|
+
await this.waitingTalkingVc.play();
|
|
79
98
|
break;
|
|
80
99
|
default:
|
|
81
|
-
this.
|
|
100
|
+
this.waitingTalkingVc.pause();
|
|
82
101
|
}
|
|
83
102
|
}
|
|
84
103
|
updateFooter() {
|
|
@@ -86,6 +105,7 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
86
105
|
this.cardVc.setFooter({
|
|
87
106
|
buttons: [
|
|
88
107
|
{
|
|
108
|
+
type: this.invitedPersonId ? 'primary' : 'secondary',
|
|
89
109
|
id: this.slideIdx === 2 ? 'done' : 'back',
|
|
90
110
|
label: this.slideIdx === 2 ? 'Done' : 'Back',
|
|
91
111
|
onClick: this.slideIdx === 2
|
|
@@ -176,6 +196,7 @@ class InvitePersonCardViewController extends heartwood_view_controllers_1.Abstra
|
|
|
176
196
|
if (((_a = this.pendingInvite) === null || _a === void 0 ? void 0 : _a.id) === inviteId) {
|
|
177
197
|
await this.cardVc.jumpToSlide(2);
|
|
178
198
|
this.invitedPersonId = personId;
|
|
199
|
+
this.updateFooter();
|
|
179
200
|
}
|
|
180
201
|
}
|
|
181
202
|
render() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractViewController, AutocompleteInputViewController, FormInputHandlers, FormInputOptions, FormInputViewController, SpruceSchemas, ViewControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import InvitePersonCardViewController from '../inviting/InvitePersonCard.vc';
|
|
2
|
+
import InvitePersonCardViewController, { DoneHandler } from '../inviting/InvitePersonCard.vc';
|
|
3
3
|
import { SearchPerson } from '../types/people-module.types';
|
|
4
4
|
export default class PersonSelectInputViewController extends AbstractViewController<AutocompleteInput> implements FormInputViewController<AutocompleteInput> {
|
|
5
5
|
static id: string;
|
|
@@ -17,7 +17,7 @@ export default class PersonSelectInputViewController extends AbstractViewControl
|
|
|
17
17
|
setHandlers(options: FormInputHandlers<AutocompleteInput>): void;
|
|
18
18
|
private handleClickInviteAnonymous;
|
|
19
19
|
private handleClickInvitePerson;
|
|
20
|
-
protected InvitePersonVc(): InvitePersonCardViewController;
|
|
20
|
+
protected InvitePersonVc(onDone?: DoneHandler): InvitePersonCardViewController;
|
|
21
21
|
private search;
|
|
22
22
|
protected handleClickSuggestion(person: SearchPerson): Promise<void>;
|
|
23
23
|
setOrganizationId(orgId: string): void;
|
|
@@ -104,14 +104,19 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
|
|
|
104
104
|
await this.setRenderedValue(person.casualName);
|
|
105
105
|
}
|
|
106
106
|
async handleClickInvitePerson() {
|
|
107
|
-
const vc = this.InvitePersonVc()
|
|
108
|
-
|
|
107
|
+
const vc = this.InvitePersonVc(async (personId) => {
|
|
108
|
+
await this.setValue(personId);
|
|
109
|
+
await dlg.hide();
|
|
110
|
+
await this.loadCurrentPerson();
|
|
111
|
+
});
|
|
112
|
+
const dlg = this.renderInDialog(vc.render());
|
|
109
113
|
await vc.load();
|
|
110
114
|
}
|
|
111
|
-
InvitePersonVc() {
|
|
115
|
+
InvitePersonVc(onDone) {
|
|
112
116
|
const vc = this.Controller('people.invite-person-card', {
|
|
113
117
|
organizationId: this.organizationId,
|
|
114
118
|
locationId: this.locationId,
|
|
119
|
+
onDone,
|
|
115
120
|
});
|
|
116
121
|
return vc;
|
|
117
122
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/spruce-people-utils",
|
|
3
3
|
"description": "People Utilities",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.60",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "invite"
|
|
7
7
|
},
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"build/__tests__/behavioral/searching/SpyPersonSelectInput.d.ts",
|
|
43
43
|
"build/esm/__tests__/behavioral/searching/SpyPersonSelectInput.js",
|
|
44
44
|
"build/esm/__tests__/behavioral/searching/SpyPersonSelectInput.d.ts",
|
|
45
|
-
"build/__tests__/behavioral/inviting/
|
|
46
|
-
"build/__tests__/behavioral/inviting/
|
|
47
|
-
"build/esm/__tests__/behavioral/inviting/
|
|
48
|
-
"build/esm/__tests__/behavioral/inviting/
|
|
45
|
+
"build/__tests__/behavioral/inviting/SpyInvitePersonViewController.js",
|
|
46
|
+
"build/__tests__/behavioral/inviting/SpyInvitePersonViewController.d.ts",
|
|
47
|
+
"build/esm/__tests__/behavioral/inviting/SpyInvitePersonViewController.js",
|
|
48
|
+
"build/esm/__tests__/behavioral/inviting/SpyInvitePersonViewController.d.ts"
|
|
49
49
|
],
|
|
50
50
|
"keywords": [],
|
|
51
51
|
"scripts": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import InvitePersonCardViewController from '../../../inviting/InvitePersonCard.vc.js';
|
|
2
|
-
export default class SpyPersonInviteViewController extends InvitePersonCardViewController {
|
|
3
|
-
getLocationId() {
|
|
4
|
-
return this.locationId;
|
|
5
|
-
}
|
|
6
|
-
getOrganizationId() {
|
|
7
|
-
return this.organizationId;
|
|
8
|
-
}
|
|
9
|
-
}
|