Skip to content

Commit 6a31b48

Browse files
committed
[Components] Figma - Remove Async Options on Project prop
1 parent 2c5f4f2 commit 6a31b48

File tree

7 files changed

+31
-209
lines changed

7 files changed

+31
-209
lines changed

components/figma/actions/delete-comment/delete-comment.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Delete a Comment",
77
description: "Delete a comment to a file. [See the docs here](https://www.figma.com/developers/api#delete-comments-endpoint)",
88
key: "figma-delete-comment",
9-
version: "0.0.4",
9+
version: "0.0.5",
1010
annotations: {
1111
destructiveHint: true,
1212
openWorldHint: true,
@@ -19,18 +19,12 @@ export default {
1919
propDefinition: [
2020
figmaApp,
2121
"projectId",
22-
({ teamId }) => ({
23-
teamId,
24-
}),
2522
],
2623
},
2724
fileId: {
2825
propDefinition: [
2926
figmaApp,
3027
"fileId",
31-
({ projectId }) => ({
32-
projectId,
33-
}),
3428
],
3529
},
3630
commentId: {

components/figma/actions/list-comments/list-comments.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "List Comments",
77
description: "Lists all comments left on a file. [See the docs here](https://www.figma.com/developers/api#get-comments-endpoint)",
88
key: "figma-list-comments",
9-
version: "0.0.4",
9+
version: "0.0.5",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,
@@ -19,18 +19,12 @@ export default {
1919
propDefinition: [
2020
figmaApp,
2121
"projectId",
22-
({ teamId }) => ({
23-
teamId,
24-
}),
2522
],
2623
},
2724
fileId: {
2825
propDefinition: [
2926
figmaApp,
3027
"fileId",
31-
({ projectId }) => ({
32-
projectId,
33-
}),
3428
],
3529
},
3630
},

components/figma/actions/post-a-comment/post-a-comment.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Post a Comment",
77
description: "Posts a comment to a file. [See the docs here](https://www.figma.com/developers/api#post-comments-endpoint)",
88
key: "figma-post-a-comment",
9-
version: "0.0.4",
9+
version: "0.0.5",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,
@@ -19,18 +19,12 @@ export default {
1919
propDefinition: [
2020
figmaApp,
2121
"projectId",
22-
({ teamId }) => ({
23-
teamId,
24-
}),
2522
],
2623
},
2724
fileId: {
2825
propDefinition: [
2926
figmaApp,
3027
"fileId",
31-
({ projectId }) => ({
32-
projectId,
33-
}),
3428
],
3529
},
3630
message: {

components/figma/figma.app.mjs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,12 @@ export default {
1212
projectId: {
1313
type: "string",
1414
label: "Project Id",
15-
description: "Id of the project to list files from",
16-
async options({ teamId = this._getTeamId() }) {
17-
const projects = await this.listTeamProjects(teamId);
18-
return projects.map((item) => ({
19-
label: item.name,
20-
value: item.id,
21-
}));
22-
},
15+
description: "Navigate to your project in Figma. You can find your Project ID in the URL between `/project/` and the project name. For example, if your project URL is `https://www.figma.com/files/team/1562118717370912711/project/478297666/Team-project?fuid=1562118714608714352`, enter `478297666` here.",
2316
},
2417
fileId: {
2518
type: "string",
2619
label: "File Id",
27-
description: "Id of the file to perform your action.",
28-
async options({ projectId }) {
29-
const files = await this.listProjectFiles(projectId);
30-
return files.map((item) => ({
31-
label: item.name,
32-
value: item.key,
33-
}));
34-
},
20+
description: "Navigate to your file in Figma and open it. You can find your File ID in the URL after `/file/`. For example, if your file URL is `https://www.figma.com/file/ABC123xyz456/My-Design-File`, enter `ABC123xyz456` here.",
3521
},
3622
commentId: {
3723
type: "string",
@@ -74,20 +60,6 @@ export default {
7460
};
7561
return res;
7662
},
77-
async listTeamProjects(teamId, ctx = this) {
78-
const res = await axios(ctx, this._getAxiosParams({
79-
method: "GET",
80-
path: `/v1/teams/${teamId}/projects`,
81-
}));
82-
return res?.projects || [];
83-
},
84-
async listProjectFiles(projectId, ctx = this) {
85-
const res = await axios(ctx, this._getAxiosParams({
86-
method: "GET",
87-
path: `/v1/projects/${projectId}/files`,
88-
}));
89-
return res?.files || [];
90-
},
9163
async listFileComments(fileId, ctx = this) {
9264
const res = await axios(ctx, this._getAxiosParams({
9365
method: "GET",

components/figma/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/figma",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Pipedream Figma Components",
55
"main": "figma.app.mjs",
66
"keywords": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.6.1"
16+
"@pipedream/platform": "^3.1.0"
1717
}
1818
}

components/figma/sources/new-comment/new-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "figma-new-comment",
88
name: "New Comment (Instant)",
99
description: "Emit new event when someone comments on a file",
10-
version: "0.0.3",
10+
version: "0.0.4",
1111
type: "source",
1212
dedupe: "unique",
1313
props: {

0 commit comments

Comments
 (0)