Skip to content

Commit 4696f1c

Browse files
committed
Merge remote-tracking branch 'upstream/master' into patch-3
2 parents 8d8ef41 + 0dfb5b2 commit 4696f1c

File tree

75 files changed

+1374
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1374
-366
lines changed

components/basecamp/actions/create-campfire-chatbot-message/create-campfire-chatbot-message.mjs

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
import app from "../../basecamp.app.mjs";
2+
import common from "../../common/common.mjs";
23

34
export default {
45
key: "basecamp-create-campfire-chatbot-message",
56
name: "Create Campfire Chatbot Message",
6-
description: "Creates a line in the Campfire for a Basecamp Chatbot. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/chatbots.md#create-a-line)",
7+
description: "Creates a message in a Campfire for a Basecamp Chatbot. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/chatbots.md#create-a-line)",
78
type: "action",
8-
version: "0.0.3",
9+
version: "0.0.4",
910
props: {
10-
app,
11-
accountId: {
12-
propDefinition: [
13-
app,
14-
"accountId",
15-
],
16-
},
17-
projectId: {
18-
propDefinition: [
19-
app,
20-
"projectId",
21-
({ accountId }) => ({
22-
accountId,
23-
}),
24-
],
25-
},
11+
...common.props,
2612
campfireId: {
2713
propDefinition: [
2814
app,
@@ -54,7 +40,7 @@ export default {
5440
content: {
5541
type: "string",
5642
label: "Content",
57-
description: "The plain text body for the Campfire line.",
43+
description: "The plain text body for the Campfire message.",
5844
},
5945
},
6046
async run({ $ }) {
@@ -84,7 +70,9 @@ export default {
8470
},
8571
});
8672

87-
$.export("$summary", "Successfully posted campfire chatbot message.");
88-
return message;
73+
$.export("$summary", "Successfully posted campfire chatbot message");
74+
return message ?? {
75+
content,
76+
};
8977
},
9078
};

components/basecamp/actions/create-campfire-message/create-campfire-message.mjs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
import app from "../../basecamp.app.mjs";
2+
import common from "../../common/common.mjs";
23

34
export default {
45
key: "basecamp-create-campfire-message",
56
name: "Create Campfire Message",
6-
description: "Creates a line in the Campfire for the selected project. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/campfires.md#create-a-campfire-line)",
7+
description: "Creates a message in a selected Campfire. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/campfires.md#create-a-campfire-line)",
78
type: "action",
8-
version: "0.0.7",
9+
version: "0.0.8",
910
props: {
10-
app,
11-
accountId: {
12-
propDefinition: [
13-
app,
14-
"accountId",
15-
],
16-
},
17-
projectId: {
18-
propDefinition: [
19-
app,
20-
"projectId",
21-
({ accountId }) => ({
22-
accountId,
23-
}),
24-
],
25-
},
11+
...common.props,
2612
campfireId: {
2713
propDefinition: [
2814
app,
@@ -39,7 +25,7 @@ export default {
3925
content: {
4026
type: "string",
4127
label: "Content",
42-
description: "The plain text body for the Campfire line.",
28+
description: "The plain text body for the Campfire message.",
4329
},
4430
},
4531
async run({ $ }) {
@@ -60,7 +46,7 @@ export default {
6046
},
6147
});
6248

63-
$.export("$summary", `Successfully posted campfire message with ID ${message.id}`);
49+
$.export("$summary", `Successfully created campfire message (ID: ${message.id})`);
6450
return message;
6551
},
6652
};

components/basecamp/actions/create-card/create-card.mjs

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
import app from "../../basecamp.app.mjs";
2+
import common from "../../common/common.mjs";
23

34
export default {
45
key: "basecamp-create-card",
56
name: "Create a Card",
6-
description: "Creates a card in the select column. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card)",
7+
description: "Creates a card in a selected column. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card)",
78
type: "action",
8-
version: "0.1.0",
9+
version: "0.1.1",
910
props: {
10-
app,
11-
accountId: {
12-
propDefinition: [
13-
app,
14-
"accountId",
15-
],
16-
},
17-
projectId: {
18-
propDefinition: [
19-
app,
20-
"projectId",
21-
({ accountId }) => ({
22-
accountId,
23-
}),
24-
],
25-
},
11+
...common.props,
2612
cardTableId: {
2713
propDefinition: [
2814
app,
@@ -51,25 +37,26 @@ export default {
5137
title: {
5238
type: "string",
5339
label: "Title",
54-
description: "Title of the card",
40+
description: "The title of the new card.",
5541
},
5642
content: {
5743
type: "string",
5844
label: "Content",
59-
description: "Content of the card",
45+
description: "The content of the card. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card) for information on using HTML tags.",
6046
optional: true,
6147
},
6248
dueOn: {
6349
type: "string",
64-
label: "Due on",
65-
description: "Due date (ISO 8601) of the card, e.g.: `2023-12-12`",
50+
label: "Due On",
51+
description: "The due date of the card, in `YYYY-MM-DD` format.",
6652
optional: true,
6753
},
6854
notify: {
6955
type: "boolean",
70-
label: "Notify",
71-
description: "Whether to notify assignees. Defaults to false",
56+
label: "Notify Assignees",
57+
description: "Whether to notify assignees.",
7258
optional: true,
59+
default: false,
7360
},
7461
},
7562
async run({ $ }) {
@@ -96,7 +83,7 @@ export default {
9683
},
9784
});
9885

99-
$.export("$summary", `Successfully created card with ID ${card.id}`);
86+
$.export("$summary", `Successfully created card (ID: ${card.id})`);
10087
return card;
10188
},
10289
};
Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,110 @@
11
import app from "../../basecamp.app.mjs";
2+
import common from "../../common/common.mjs";
23

34
export default {
45
key: "basecamp-create-comment",
56
name: "Create a Comment",
6-
description: "Publishes a comment to the select recording. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment)",
7+
description: "Creates a comment in a selected recording. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment)",
78
type: "action",
8-
version: "0.0.7",
9+
version: "0.1.0",
910
props: {
10-
app,
11-
accountId: {
11+
...common.props,
12+
recordingTypeAlert: {
13+
type: "alert",
14+
alertType: "info",
15+
content: `You can select either a **Recording** (by selecting the recording type) or a **Card** (by selecting the card table and column) to create the comment on.
16+
\\
17+
If both are specified, the **Card** will take precedence.`,
18+
},
19+
recordingType: {
1220
propDefinition: [
1321
app,
14-
"accountId",
22+
"recordingType",
1523
],
24+
optional: true,
1625
},
17-
projectId: {
26+
recordingId: {
1827
propDefinition: [
1928
app,
20-
"projectId",
21-
({ accountId }) => ({
29+
"recordingId",
30+
({
2231
accountId,
32+
projectId,
33+
recordingType,
34+
}) => ({
35+
accountId,
36+
projectId,
37+
recordingType,
2338
}),
2439
],
40+
optional: true,
2541
},
26-
recordingType: {
42+
cardTableId: {
2743
propDefinition: [
2844
app,
29-
"recordingType",
45+
"cardTableId",
46+
({
47+
accountId, projectId,
48+
}) => ({
49+
accountId,
50+
projectId,
51+
}),
3052
],
53+
optional: true,
3154
},
32-
recordingId: {
55+
columnId: {
3356
propDefinition: [
3457
app,
35-
"recordingId",
58+
"columnId",
3659
({
60+
accountId, projectId, cardTableId,
61+
}) => ({
3762
accountId,
3863
projectId,
39-
recordingType,
64+
cardTableId,
65+
}),
66+
],
67+
optional: true,
68+
},
69+
cardId: {
70+
propDefinition: [
71+
app,
72+
"cardId",
73+
({
74+
accountId, projectId, cardTableId, columnId,
4075
}) => ({
4176
accountId,
4277
projectId,
43-
recordingType,
78+
cardTableId,
79+
columnId,
4480
}),
4581
],
82+
optional: true,
4683
},
4784
content: {
4885
type: "string",
4986
label: "Content",
50-
description: "The body of the comment. See [Rich text guide](https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md) for what HTML tags are allowed.",
87+
description: "The body of the comment. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment) for information on using HTML tags.",
5188
},
5289
},
5390
async run({ $ }) {
5491
const {
5592
accountId,
5693
projectId,
57-
recordingId,
5894
content,
5995
} = this;
6096

6197
const comment = await this.app.createComment({
6298
$,
6399
accountId,
64100
projectId,
65-
recordingId,
101+
recordingId: this.cardId ?? this.recordingId,
66102
data: {
67103
content,
68104
},
69105
});
70106

71-
$.export("$summary", `Successfully posted comment with ID ${comment.id}`);
107+
$.export("$summary", `Successfully posted comment (ID: ${comment.id})`);
72108
return comment;
73109
},
74110
};

components/basecamp/actions/create-message/create-message.mjs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
import app from "../../basecamp.app.mjs";
2+
import common from "../../common/common.mjs";
23

34
export default {
45
key: "basecamp-create-message",
56
name: "Create Message",
6-
description: "Publishes a message in the project and message board selected. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message)",
7+
description: "Creates a message in a selected message board. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message)",
78
type: "action",
8-
version: "0.0.7",
9+
version: "0.0.8",
910
props: {
10-
app,
11-
accountId: {
12-
propDefinition: [
13-
app,
14-
"accountId",
15-
],
16-
},
17-
projectId: {
18-
propDefinition: [
19-
app,
20-
"projectId",
21-
({ accountId }) => ({
22-
accountId,
23-
}),
24-
],
25-
},
11+
...common.props,
2612
messageBoardId: {
2713
propDefinition: [
2814
app,
@@ -44,7 +30,7 @@ export default {
4430
content: {
4531
type: "string",
4632
label: "Content",
47-
description: "The body of the message. See [Rich text guide](https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md) for what HTML tags are allowed.",
33+
description: "The body of the message. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message) for information on using HTML tags.",
4834
optional: true,
4935
},
5036
messageTypeId: {
@@ -85,7 +71,7 @@ export default {
8571
},
8672
});
8773

88-
$.export("$summary", `Successfully posted message with ID ${message.id}`);
74+
$.export("$summary", `Successfully posted message (ID: ${message.id})`);
8975
return message;
9076
},
9177
};

0 commit comments

Comments
 (0)