-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTIONS] picqer - new components #19383
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
Open
jcortes
wants to merge
1
commit into
master
Choose a base branch
from
picqer-new-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
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
41 changes: 41 additions & 0 deletions
41
components/picqer/actions/add-order-tags/add-order-tags.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,41 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-add-order-tags", | ||
| name: "Add Order Tags", | ||
| description: "Associates a tag with an order. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| tagId: { | ||
| propDefinition: [ | ||
| app, | ||
| "tagId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.addOrderTags({ | ||
| $, | ||
| orderId: this.orderId, | ||
| data: { | ||
| idtag: this.tagId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully added tag to order ${this.orderId}`); | ||
| return response; | ||
| }, | ||
| }; |
74 changes: 74 additions & 0 deletions
74
components/picqer/actions/add-product-to-order/add-product-to-order.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,74 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-add-product-to-order", | ||
| name: "Add Product To Order", | ||
| description: "Adds a single product to concept orders only. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| () => ({ | ||
| params: { | ||
| status: "concept", | ||
| }, | ||
| }), | ||
| ], | ||
| }, | ||
| productId: { | ||
| propDefinition: [ | ||
| app, | ||
| "productId", | ||
| ], | ||
| }, | ||
| amount: { | ||
| type: "integer", | ||
| label: "Amount", | ||
| description: "The quantity of the product to add", | ||
| default: 1, | ||
| }, | ||
| price: { | ||
| type: "string", | ||
| label: "Price", | ||
| description: "The price of the product", | ||
| optional: true, | ||
| }, | ||
| name: { | ||
| type: "string", | ||
| label: "Name", | ||
| description: "The name of the product", | ||
| optional: true, | ||
| }, | ||
| remarks: { | ||
| type: "string", | ||
| label: "Remarks", | ||
| description: "Remarks for the product", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.addProductToOrder({ | ||
| $, | ||
| orderId: this.orderId, | ||
| data: { | ||
| idproduct: this.productId, | ||
| amount: this.amount, | ||
| price: this.price, | ||
| name: this.name, | ||
| remarks: this.remarks, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully added product to order ${this.orderId}`); | ||
| return response; | ||
| }, | ||
| }; | ||
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
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,48 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-cancel-order", | ||
| name: "Cancel Order", | ||
| description: "Removes orders with 'concept' or 'expected' status only. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: true, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| force: { | ||
| type: "boolean", | ||
| label: "Force Cancel", | ||
| description: "If enabled, cancels orders regardless of status, removing attached picklists even if picked", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { | ||
| app, | ||
| orderId, | ||
| force, | ||
| } = this; | ||
|
|
||
| await app.cancelOrder({ | ||
| $, | ||
| orderId, | ||
| params: { | ||
| force, | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
| $.export("$summary", "Successfully canceled order"); | ||
| return { | ||
| success: true, | ||
| }; | ||
| }, | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
37 changes: 37 additions & 0 deletions
37
components/picqer/actions/change-order-to-concept/change-order-to-concept.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,37 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-change-order-to-concept", | ||
| name: "Change Order To Concept", | ||
| description: "Converts expected orders back to concept status for editing. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| () => ({ | ||
| params: { | ||
| status: "expected", | ||
| }, | ||
| }), | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.changeOrderToConcept({ | ||
| $, | ||
| orderId: this.orderId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully changed order ${this.orderId} to concept status`); | ||
| return response; | ||
| }, | ||
| }; |
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
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
32 changes: 32 additions & 0 deletions
32
components/picqer/actions/get-order-comments/get-order-comments.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,32 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-get-order-comments", | ||
| name: "Get Order Comments", | ||
| description: "Retrieves comments linked to an order. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getOrderComments({ | ||
| $, | ||
| orderId: this.orderId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response.length} comment(s) for order ${this.orderId}`); | ||
| return response; | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }; | ||
32 changes: 32 additions & 0 deletions
32
components/picqer/actions/get-order-tags/get-order-tags.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,32 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-get-order-tags", | ||
| name: "Get Order Tags", | ||
| description: "Retrieves all tags associated with an order. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.getOrderTags({ | ||
| $, | ||
| orderId: this.orderId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response.length} tag(s) for order ${this.orderId}`); | ||
jcortes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return response; | ||
| }, | ||
| }; | ||
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
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
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
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,40 @@ | ||
| import app from "../../picqer.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "picqer-pause-order", | ||
| name: "Pause Order", | ||
| description: "Suspends processing of orders with 'processing' status. Pauses underlying picklists. [See the documentation](https://picqer.com/en/api/orders)", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| orderId: { | ||
| propDefinition: [ | ||
| app, | ||
| "orderId", | ||
| ], | ||
| }, | ||
| reason: { | ||
| type: "string", | ||
| label: "Reason", | ||
| description: "A reason for pausing the order", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.app.pauseOrder({ | ||
| $, | ||
| orderId: this.orderId, | ||
| data: { | ||
| reason: this.reason, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully paused order ${this.orderId}`); | ||
| return response; | ||
| }, | ||
| }; |
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.