-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Components] procore - new components #15843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
103 changes: 103 additions & 0 deletions
103
components/procore/actions/create-incident/create-incident.mjs
This file contains hidden or 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,103 @@ | ||
| import app from "../../procore.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "procore-create-incident", | ||
| name: "Create Incident", | ||
| description: "Create a new incident. [See the documentation](https://developers.procore.com/reference/rest/incidents?version=latest#create-incident).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| companyId: { | ||
| propDefinition: [ | ||
| app, | ||
| "companyId", | ||
| ], | ||
| }, | ||
| projectId: { | ||
| optional: false, | ||
| propDefinition: [ | ||
| app, | ||
| "projectId", | ||
| ({ companyId }) => ({ | ||
| companyId, | ||
| }), | ||
| ], | ||
| }, | ||
| title: { | ||
| type: "string", | ||
| label: "Title", | ||
| description: "Incident Title", | ||
| }, | ||
| eventDate: { | ||
| type: "string", | ||
| label: "Event Date", | ||
| description: "The date and time when the incident occurred, in ISO 8601 format. If the time is unknown, use `00:00` project time converted to UTC (e.g., `2025-04-01T00:00:00Z`).", | ||
| }, | ||
| description: { | ||
| type: "string", | ||
| label: "Description", | ||
| description: "Description of the Incident", | ||
| optional: true, | ||
| }, | ||
| isPrivate: { | ||
| type: "boolean", | ||
| label: "Private", | ||
| description: "Indicates whether an Incident is private", | ||
| optional: true, | ||
| }, | ||
| recordable: { | ||
| type: "boolean", | ||
| label: "Recordable", | ||
| description: "Indicates whether an Incident is recordable", | ||
| optional: true, | ||
| }, | ||
| timeUnknown: { | ||
| type: "boolean", | ||
| label: "Time Unknown", | ||
| description: "Indicates whether the time of the Incident occurrence is unknown", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| methods: { | ||
| createIncident({ | ||
| projectId, ...args | ||
| } = {}) { | ||
| return this.app.post({ | ||
| path: `/projects/${projectId}/incidents`, | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createIncident, | ||
| companyId, | ||
| projectId, | ||
| title, | ||
| description, | ||
| eventDate, | ||
| isPrivate, | ||
| recordable, | ||
| timeUnknown, | ||
| } = this; | ||
|
|
||
| const response = await createIncident({ | ||
| $, | ||
| companyId, | ||
| projectId, | ||
| data: { | ||
| incident: { | ||
| title, | ||
| description, | ||
| event_date: eventDate, | ||
| private: isPrivate, | ||
| recordable, | ||
| time_unknown: timeUnknown, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created incident with ID \`${response.id}\`.`); | ||
| return response; | ||
| }, | ||
| }; |
113 changes: 113 additions & 0 deletions
113
components/procore/actions/create-manpower-log/create-manpower-log.mjs
This file contains hidden or 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,113 @@ | ||
| import app from "../../procore.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "procore-create-manpower-log", | ||
| name: "Create Manpower Log", | ||
| description: "Create a new manpower log. [See the documentation](https://developers.procore.com/reference/rest/manpower-logs?version=latest#create-manpower-log).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| companyId: { | ||
| propDefinition: [ | ||
| app, | ||
| "companyId", | ||
| ], | ||
| }, | ||
| projectId: { | ||
| optional: false, | ||
| propDefinition: [ | ||
| app, | ||
| "projectId", | ||
| ({ companyId }) => ({ | ||
| companyId, | ||
| }), | ||
| ], | ||
| }, | ||
| notes: { | ||
| type: "string", | ||
| label: "Notes", | ||
| description: "The notes for the record", | ||
| }, | ||
| datetime: { | ||
| type: "string", | ||
| label: "Datetime", | ||
| description: "The datetime of the record. Eg. `2025-04-01T00:00:00Z`.", | ||
| optional: true, | ||
| }, | ||
| numWorkers: { | ||
| type: "integer", | ||
| label: "Number Of Workers", | ||
| description: "The number of workers", | ||
| optional: true, | ||
| }, | ||
| numHours: { | ||
| type: "string", | ||
| label: "Number Of Hours", | ||
| description: "The number of hours for each worker", | ||
| optional: true, | ||
| }, | ||
| userId: { | ||
| propDefinition: [ | ||
| app, | ||
| "userId", | ||
| ({ companyId }) => ({ | ||
| companyId, | ||
| }), | ||
| ], | ||
| }, | ||
| locationId: { | ||
| propDefinition: [ | ||
| app, | ||
| "locationId", | ||
| ({ | ||
| companyId, projectId, | ||
| }) => ({ | ||
| companyId, | ||
| projectId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| createManpowerLog({ | ||
| projectId, ...args | ||
| } = {}) { | ||
| return this.app.post({ | ||
| path: `/projects/${projectId}/manpower_logs`, | ||
| ...args, | ||
| }); | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createManpowerLog, | ||
| companyId, | ||
| projectId, | ||
| datetime, | ||
| notes, | ||
| numWorkers, | ||
| numHours, | ||
| userId, | ||
| locationId, | ||
| } = this; | ||
|
|
||
| const response = await createManpowerLog({ | ||
| $, | ||
| companyId, | ||
| projectId, | ||
| data: { | ||
| manpower_log: { | ||
| datetime, | ||
| notes, | ||
| num_workers: numWorkers, | ||
| num_hours: numHours, | ||
| user_id: userId, | ||
| location_id: locationId, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created manpower log with ID \`${response.id}\`.`); | ||
| return response; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or 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,135 @@ | ||
| import app from "../../procore.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "procore-create-rfi", | ||
| name: "Create RFI", | ||
| description: "Create a new RFI. [See the documentation](https://developers.procore.com/reference/rest/rfis?version=latest#create-rfi).", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| companyId: { | ||
| propDefinition: [ | ||
| app, | ||
| "companyId", | ||
| ], | ||
| }, | ||
| projectId: { | ||
| optional: false, | ||
| propDefinition: [ | ||
| app, | ||
| "projectId", | ||
| ({ companyId }) => ({ | ||
| companyId, | ||
| }), | ||
| ], | ||
| }, | ||
| subject: { | ||
| type: "string", | ||
| label: "Subject", | ||
| description: "The Subject of the RFI", | ||
| }, | ||
| questionBody: { | ||
| type: "string", | ||
| label: "Question Body", | ||
| description: "The Body of the Question", | ||
| }, | ||
| rfiManagerId: { | ||
| propDefinition: [ | ||
| app, | ||
| "rfiPotentialManagerId", | ||
| ({ | ||
| companyId, projectId, | ||
| }) => ({ | ||
| companyId, | ||
| projectId, | ||
| }), | ||
| ], | ||
| }, | ||
| assigneIds: { | ||
| type: "string[]", | ||
| label: "Assignee IDs", | ||
| description: "The Assignee IDs of the RFI", | ||
| optional: false, | ||
| propDefinition: [ | ||
| app, | ||
| "potentialAssigneeId", | ||
| ({ | ||
| companyId, projectId, | ||
| }) => ({ | ||
| companyId, | ||
| projectId, | ||
| }), | ||
| ], | ||
| }, | ||
| reference: { | ||
| type: "string", | ||
| label: "Reference", | ||
| description: "The Reference of the RFI", | ||
| optional: true, | ||
| }, | ||
| isPrivate: { | ||
| type: "boolean", | ||
| label: "Private", | ||
| description: "Whether the RFI is private or not", | ||
| optional: true, | ||
| }, | ||
| locationId: { | ||
| propDefinition: [ | ||
| app, | ||
| "locationId", | ||
| ({ | ||
| companyId, projectId, | ||
| }) => ({ | ||
| companyId, | ||
| projectId, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| methods: { | ||
| createRfi({ | ||
| projectId, ...args | ||
| } = {}) { | ||
| return this.app.post({ | ||
| path: `/projects/${projectId}/rfis`, | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| createRfi, | ||
| companyId, | ||
| projectId, | ||
| subject, | ||
| questionBody, | ||
| rfiManagerId, | ||
| assigneIds, | ||
| reference, | ||
| isPrivate, | ||
| locationId, | ||
| } = this; | ||
|
|
||
| const response = await createRfi({ | ||
| $, | ||
| companyId, | ||
| projectId, | ||
| data: { | ||
| rfi: { | ||
| subject, | ||
| question: { | ||
| body: questionBody, | ||
| }, | ||
| rfi_manager_id: rfiManagerId, | ||
| reference, | ||
| private: isPrivate, | ||
| location_id: locationId, | ||
| assignee_ids: assigneIds, | ||
| }, | ||
| }, | ||
| }); | ||
| $.export("$summary", `Successfully created RFI with ID \`${response.id}\`.`); | ||
| return response; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.