-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into issue-14132
- Loading branch information
Showing
114 changed files
with
3,535 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import app from "../../box.app.mjs"; | ||
import utils from "../../common/utils.mjs"; | ||
|
||
export default { | ||
name: "Get Comments", | ||
description: "Fetches comments for a file. [See the documentation](https://developer.box.com/reference/get-files-id-comments/).", | ||
key: "box-get-comments", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
app, | ||
folderId: { | ||
propDefinition: [ | ||
app, | ||
"parentId", | ||
], | ||
label: "Parent Folder", | ||
description: "Use this option to select your File ID from a dropdown list.", | ||
}, | ||
fileId: { | ||
propDefinition: [ | ||
app, | ||
"fileId", | ||
(c) => ({ | ||
folderId: c.folderId, | ||
}), | ||
], | ||
label: "File ID", | ||
description: "The file ID to get comments from. Use a custom expression to reference a file from your workflow or select it from the dropdown list.", | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const results = []; | ||
const resourcesStream = utils.getResourcesStream({ | ||
resourceFn: this.app.getComments, | ||
resourceFnArgs: { | ||
$, | ||
fileId: this.fileId, | ||
}, | ||
}); | ||
for await (const resource of resourcesStream) { | ||
results.push(resource); | ||
} | ||
// eslint-disable-next-line multiline-ternary | ||
$.export("$summary", results.length ? `Successfully fetched ${results.length} comment${results.length === 1 ? "" : "s"}.` : "No comments found."); | ||
return results; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ export default { | |
console.log(Object.keys(this.$auth)); | ||
}, | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
export default { | ||
assignees: { | ||
label: "Assignees", | ||
description: "One or more Users to assign to this issue", | ||
type: "string[]", | ||
optional: true, | ||
options: async () => { | ||
const collaborators = await this.github.getRepositoryCollaborators({ | ||
repoFullname: this.repoFullname, | ||
}); | ||
|
||
return collaborators.map(({ login }) => login); | ||
}, | ||
}, | ||
labels: { | ||
label: "Labels", | ||
description: "The label(s) to add to the issue", | ||
type: "string[]", | ||
optional: true, | ||
options: async () => { | ||
const labels = await this.github.getRepositoryLabels({ | ||
repoFullname: this.repoFullname, | ||
}); | ||
|
||
return labels.map(({ name }) => name); | ||
}, | ||
}, | ||
milestoneNumber: { | ||
type: "integer", | ||
label: "Milestone Number", | ||
description: "The number of a milestone to associate the issue with", | ||
optional: true, | ||
options: async () => { | ||
const items = await this.github.getRepositoryMilestones({ | ||
repoFullname: this.repoFullname, | ||
}); | ||
|
||
return items.map((item) => ({ | ||
label: item.title, | ||
value: +item.number, | ||
})); | ||
}, | ||
}, | ||
pullNumber: { | ||
type: "integer", | ||
label: "Pull Request Number", | ||
description: "The pull request to get reviewers for", | ||
options: async ({ page }) => { | ||
const prs = await this.github.getRepositoryPullRequests({ | ||
page: page + 1, | ||
repoFullname: this.repoFullname, | ||
}); | ||
|
||
return prs.map((pr) => ({ | ||
label: pr.title, | ||
value: +pr.number, | ||
})); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.