Skip to content

Commit ff1e502

Browse files
committed
updates
1 parent 33f8a6c commit ff1e502

File tree

4 files changed

+50
-52
lines changed

4 files changed

+50
-52
lines changed

components/calendly_v2/actions/list-events/list-events.mjs

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,16 @@ export default {
99
props: {
1010
calendly,
1111
alert: {
12-
type: "alert",
13-
alertType: "info",
14-
content: `
15-
Select "authenticatedUser" scope to return events for the authenticated user
16-
Select "organization" scope to return events for that organization (requires admin/owner privilege)
17-
Select "user" scope to return events for a specific User in your organization (requires admin/owner privilege)
18-
Select "group" scope to return events for a specific Group (requires organization admin/owner or group admin privilege)`,
12+
propDefinition: [
13+
calendly,
14+
"listEventsAlert",
15+
],
1916
},
2017
scope: {
21-
type: "string",
22-
label: "Scope",
23-
description: "The scope to fetch events for",
24-
options: [
25-
"authenticatedUser",
26-
"organization",
27-
"user",
28-
"group",
18+
propDefinition: [
19+
calendly,
20+
"listEventsScope",
2921
],
30-
default: "authenticatedUser",
3122
reloadProps: true,
3223
},
3324
organization: {
@@ -89,16 +80,7 @@ export default {
8980
},
9081
},
9182
async additionalProps(props) {
92-
props.organization.hidden = this.scope === "authenticatedUser";
93-
props.organization.optional = this.scope === "authenticatedUser";
94-
95-
props.group.hidden = this.scope !== "group";
96-
props.group.optional = this.scope !== "group";
97-
98-
props.user.hidden = this.scope !== "user";
99-
props.user.optional = this.scope !== "user";
100-
101-
return {};
83+
return this.calendly.listEventsAdditionalProps(props, this.scope);
10284
},
10385
async run({ $ }) {
10486
const params = {

components/calendly_v2/calendly_v2.app.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ export default {
108108
description: "Indicates if the webhook subscription scope will be `organization` or `user`",
109109
options: constants.scopes,
110110
},
111+
listEventsScope: {
112+
type: "string",
113+
label: "Scope",
114+
description: "The scope to fetch events for",
115+
options: constants.listEventsScopes,
116+
default: "authenticatedUser",
117+
},
118+
listEventsAlert: {
119+
type: "alert",
120+
alertType: "info",
121+
content: `
122+
Select "authenticatedUser" scope to return events for the authenticated user
123+
Select "organization" scope to return events for that organization (requires admin/owner privilege)
124+
Select "user" scope to return events for a specific User in your organization (requires admin/owner privilege)
125+
Select "group" scope to return events for a specific Group (requires organization admin/owner or group admin privilege)`,
126+
},
111127
},
112128
methods: {
113129
_baseUri() {
@@ -375,5 +391,17 @@ export default {
375391
this._makeRequestOpts(opts),
376392
);
377393
},
394+
listEventsAdditionalProps(props, scope) {
395+
props.organization.hidden = scope === "authenticatedUser";
396+
props.organization.optional = scope === "authenticatedUser";
397+
398+
props.group.hidden = scope !== "group";
399+
props.group.optional = scope !== "group";
400+
401+
props.user.hidden = scope !== "user";
402+
props.user.optional = scope !== "user";
403+
404+
return {};
405+
},
378406
},
379407
};

components/calendly_v2/common/constants.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export default {
77
"active",
88
"canceled",
99
],
10+
listEventsScopes: [
11+
"authenticatedUser",
12+
"organization",
13+
"user",
14+
"group",
15+
],
1016
};

components/calendly_v2/sources/new-event-scheduled/new-event-scheduled.mjs

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,16 @@ export default {
1919
},
2020
},
2121
alert: {
22-
type: "alert",
23-
alertType: "info",
24-
content: `
25-
Select "authenticatedUser" scope to return events for the authenticated user
26-
Select "organization" scope to return events for that organization (requires admin/owner privilege)
27-
Select "user" scope to return events for a specific User in your organization (requires admin/owner privilege)
28-
Select "group" scope to return events for a specific Group (requires organization admin/owner or group admin privilege)`,
22+
propDefinition: [
23+
app,
24+
"listEventsAlert",
25+
],
2926
},
3027
scope: {
31-
type: "string",
32-
label: "Scope",
33-
description: "The scope to fetch events for",
34-
options: [
35-
"authenticatedUser",
36-
"organization",
37-
"user",
38-
"group",
28+
propDefinition: [
29+
app,
30+
"listEventsScope",
3931
],
40-
default: "authenticatedUser",
4132
reloadProps: true,
4233
},
4334
organization: {
@@ -74,16 +65,7 @@ export default {
7465
},
7566
},
7667
async additionalProps(props) {
77-
props.organization.hidden = this.scope === "authenticatedUser";
78-
props.organization.optional = this.scope === "authenticatedUser";
79-
80-
props.group.hidden = this.scope !== "group";
81-
props.group.optional = this.scope !== "group";
82-
83-
props.user.hidden = this.scope !== "user";
84-
props.user.optional = this.scope !== "user";
85-
86-
return {};
68+
return this.app.listEventsAdditionalProps(props, this.scope);
8769
},
8870
methods: {
8971
emitEvent(data) {

0 commit comments

Comments
 (0)