Skip to content

Commit 8d72c9d

Browse files
committed
update components to address review comments
1 parent e9699aa commit 8d72c9d

File tree

12 files changed

+29
-20
lines changed

12 files changed

+29
-20
lines changed

components/slack/actions/update-profile/update-profile.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default {
7272
&& !this.phone
7373
&& !this.pronouns
7474
&& !this.title
75+
&& !this.email
7576
) {
7677
throw new ConfigurationError("Please provide at least one value to update");
7778
}
@@ -83,6 +84,7 @@ export default {
8384
phone: this.phone,
8485
pronouns: this.pronouns,
8586
title: this.title,
87+
email: this.email,
8688
},
8789
user: this.user,
8890
});

components/slack_v2/actions/common/build-blocks.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default {
9494
if (!this.passArrayOrConfigure) {
9595
return props;
9696
}
97-
if (this.passArrayOrConfigure == "array") {
97+
if (this.passArrayOrConfigure === "array") {
9898
props.blocks = {
9999
type: common.props.slack.propDefinitions.blocks.type,
100100
label: common.props.slack.propDefinitions.blocks.label,
@@ -159,7 +159,7 @@ export default {
159159
},
160160
async run() {
161161
let blocks = [];
162-
if (this.passArrayOrConfigure == "array") {
162+
if (this.passArrayOrConfigure === "array") {
163163
blocks = this.blocks;
164164
} else {
165165
for (let i = 1; i <= 5; i++) {

components/slack_v2/actions/find-message/find-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
sortDirection: {
4040
type: "string",
4141
label: "Sort Direction",
42-
description: "Sort ascending (asc) or descending (desc)`",
42+
description: "Sort ascending (asc) or descending (desc)",
4343
options: [
4444
"desc",
4545
"asc",

components/slack_v2/actions/invite-user-to-channel/invite-user-to-channel.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default {
3535
$.export("$summary", `Successfully invited user ${this.user} to channel with ID ${this.conversation}`);
3636
return response;
3737
} catch (error) {
38-
if (error.includes("already_in_channel")) {
38+
if (`${error}`.includes("already_in_channel")) {
3939
$.export("$summary", `The user ${this.user} is already in the channel`);
4040
return;
4141
}

components/slack_v2/actions/kick-user/kick-user.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default {
4646
$.export("$summary", `Successfully kicked user ${this.user} from channel with ID ${this.conversation}`);
4747
return response;
4848
} catch (error) {
49-
if (error.includes("not_in_channel")) {
49+
if (`${error}`.includes("not_in_channel")) {
5050
$.export("$summary", `The user ${this.user} is not in the channel`);
5151
return;
5252
}

components/slack_v2/actions/list-users/list-users.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
users.push(...members);
4949
params.cursor = nextCursor;
5050
page++;
51-
} while (params.cursor && page < this.numPages);
51+
} while (params.cursor && page < (this.numPages ?? 1));
5252

5353
$.export("$summary", `Successfully retrieved ${users.length} user${users.length === 1
5454
? ""

components/slack_v2/actions/send-message-advanced/send-message-advanced.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
...buildBlocks,
77
key: "slack_v2-send-message-advanced",
88
name: "Send Message (Advanced)",
9-
description: "Customize advanced setttings and send a message to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
9+
description: "Customize advanced settings and send a message to a channel, group or user. See [postMessage](https://api.slack.com/methods/chat.postMessage) or [scheduleMessage](https://api.slack.com/methods/chat.scheduleMessage) docs here",
1010
version: "0.1.0",
1111
annotations: {
1212
destructiveHint: false,

components/slack_v2/actions/update-group-members/update-group-members.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import slack from "../../slack_v2.app.mjs";
22

33
export default {
44
key: "slack_v2-update-group-members",
5-
name: "Update Groups Members",
5+
name: "Update Group Members",
66
description: "Update the list of users for a User Group. [See the documentation](https://api.slack.com/methods/usergroups.users.update)",
77
version: "0.0.10",
88
annotations: {

components/slack_v2/actions/upload-file/upload-file.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export default {
8080
method: "POST",
8181
headers: {
8282
...formData.getHeaders(),
83-
Authorization: `Bearer ${this.slack.getToken()}`,
8483
},
8584
});
8685

components/slack_v2/slack_v2.app.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,8 @@ export default {
897897
},
898898
assistantSearch(args = {}) {
899899
args.count ||= constants.LIMIT;
900+
// Uses apiCall directly since assistant.search.context is not exposed as
901+
// a method on WebClient
900902
return this.sdk().apiCall("assistant.search.context", {
901903
...args,
902904
});

0 commit comments

Comments
 (0)