@sprucelabs/spruce-people-utils 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,4 +12,5 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
12
12
  clearOrgId(): void;
13
13
  getShouldAllowAddAnonymous(): boolean;
14
14
  InvitePersonVc(onDone?: DoneHandler): SpyInviteInviteViewController;
15
+ clearOrganizationId(): void;
15
16
  }
@@ -33,5 +33,8 @@ class SpyPersonSelectInput extends PersonSelectInput_vc_1.default {
33
33
  const vc = super.InvitePersonVc(onDone);
34
34
  return vc;
35
35
  }
36
+ clearOrganizationId() {
37
+ this.organizationId = undefined;
38
+ }
36
39
  }
37
40
  exports.default = SpyPersonSelectInput;
@@ -12,4 +12,5 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
12
12
  clearOrgId(): void;
13
13
  getShouldAllowAddAnonymous(): boolean;
14
14
  InvitePersonVc(onDone?: DoneHandler): SpyInviteInviteViewController;
15
+ clearOrganizationId(): void;
15
16
  }
@@ -42,4 +42,7 @@ export default class SpyPersonSelectInput extends PersonSelectInputViewControlle
42
42
  const vc = super.InvitePersonVc(onDone);
43
43
  return vc;
44
44
  }
45
+ clearOrganizationId() {
46
+ this.organizationId = undefined;
47
+ }
45
48
  }
@@ -51,14 +51,14 @@ export default class PersonSelectInputViewController extends AbstractViewControl
51
51
  try {
52
52
  const people = yield this.search(value);
53
53
  const suggestions = searchPeopleToSuggestions(people, (person) => __awaiter(this, void 0, void 0, function* () { return this.handleClickSuggestion(person); }));
54
- const allSuggestions = [
55
- ...suggestions,
56
- {
54
+ const allSuggestions = [...suggestions];
55
+ if (this.organizationId) {
56
+ allSuggestions.push({
57
57
  id: 'invite',
58
58
  label: 'Invite person',
59
59
  onClick: this.handleClickInvitePerson.bind(this),
60
- },
61
- ];
60
+ });
61
+ }
62
62
  if (this.shouldAllowAddAnonymous) {
63
63
  allSuggestions.push(this.renderAnonSuggestion());
64
64
  }
@@ -65,14 +65,14 @@ class PersonSelectInputViewController extends heartwood_view_controllers_1.Abstr
65
65
  try {
66
66
  const people = await this.search(value);
67
67
  const suggestions = (0, searchPeopleToSuggestions_1.default)(people, async (person) => this.handleClickSuggestion(person));
68
- const allSuggestions = [
69
- ...suggestions,
70
- {
68
+ const allSuggestions = [...suggestions];
69
+ if (this.organizationId) {
70
+ allSuggestions.push({
71
71
  id: 'invite',
72
72
  label: 'Invite person',
73
73
  onClick: this.handleClickInvitePerson.bind(this),
74
- },
75
- ];
74
+ });
75
+ }
76
76
  if (this.shouldAllowAddAnonymous) {
77
77
  allSuggestions.push(this.renderAnonSuggestion());
78
78
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-people-utils",
3
3
  "description": "People Utilities",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "skill": {
6
6
  "namespace": "invite"
7
7
  },