-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add local frontend validation of app manifest fields #5997
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
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9752c2b
base validation of app manifest
lkostrowski a3c5c5d
validation logic
lkostrowski 0c540ab
wip
lkostrowski b11272c
fixes
lkostrowski 5f5a790
Update SDK and add test
lkostrowski 2878ec0
Fix jest config
lkostrowski 02f55f5
tests
lkostrowski 85239f0
tests
lkostrowski 3c1d14d
wip
lkostrowski 083033c
wip
lkostrowski 41304f3
display issues
lkostrowski 3980952
Print errors
lkostrowski 470e51b
test
lkostrowski 69439b1
fix test
lkostrowski 8759420
fix types
lkostrowski 278c2ba
fix import
lkostrowski 5b708a1
Merge branch 'main' into ENG-929-manifest-validation
lkostrowski 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "saleor-dashboard": patch | ||
| --- | ||
|
|
||
| Added local-frontend validation of a subset of App Manifest fields during installation. Installing apps will be now more liberal, some errors initially thrown on the API level will be now warnings that don't block app installation. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
59 changes: 59 additions & 0 deletions
59
src/extensions/domain/app-extension-manifest-available-mounts.ts
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,59 @@ | ||
| import { z } from "zod"; | ||
|
|
||
| const PRODUCT_MOUNTS = [ | ||
| "PRODUCT_OVERVIEW_CREATE", | ||
| "PRODUCT_OVERVIEW_MORE_ACTIONS", | ||
| "PRODUCT_DETAILS_MORE_ACTIONS", | ||
| "PRODUCT_DETAILS_WIDGETS", | ||
| ] as const; | ||
|
|
||
| const NAVIGATION_MOUNTS = [ | ||
| "NAVIGATION_CATALOG", | ||
| "NAVIGATION_ORDERS", | ||
| "NAVIGATION_CUSTOMERS", | ||
| "NAVIGATION_DISCOUNTS", | ||
| "NAVIGATION_TRANSLATIONS", | ||
| "NAVIGATION_PAGES", | ||
| ] as const; | ||
|
|
||
| const ORDER_MOUNTS = [ | ||
| "ORDER_DETAILS_MORE_ACTIONS", | ||
| "ORDER_OVERVIEW_CREATE", | ||
| "ORDER_DETAILS_WIDGETS", | ||
| "DRAFT_ORDER_DETAILS_WIDGETS", | ||
| "ORDER_OVERVIEW_MORE_ACTIONS", | ||
| ] as const; | ||
|
|
||
| const CUSTOMER_MOUNTS = [ | ||
| "CUSTOMER_OVERVIEW_CREATE", | ||
| "CUSTOMER_OVERVIEW_MORE_ACTIONS", | ||
| "CUSTOMER_DETAILS_MORE_ACTIONS", | ||
| "CUSTOMER_DETAILS_WIDGETS", | ||
| ] as const; | ||
|
|
||
| const COLLECTION_MOUNTS = ["COLLECTION_DETAILS_WIDGETS"] as const; | ||
|
|
||
| const GIFT_CARD_MOUNTS = ["GIFT_CARD_DETAILS_WIDGETS"] as const; | ||
|
|
||
| const VOUCHER_MOUNTS = ["VOUCHER_DETAILS_WIDGETS"] as const; | ||
|
|
||
| export const ALL_APP_EXTENSION_MOUNTS = z.enum([ | ||
| ...PRODUCT_MOUNTS, | ||
| ...NAVIGATION_MOUNTS, | ||
| ...ORDER_MOUNTS, | ||
| ...COLLECTION_MOUNTS, | ||
| ...GIFT_CARD_MOUNTS, | ||
| ...VOUCHER_MOUNTS, | ||
| ...CUSTOMER_MOUNTS, | ||
| ] as const); | ||
|
|
||
| // Subset of mounts available for WIDGET target | ||
| export const WIDGET_AVAILABLE_MOUNTS = [ | ||
| "ORDER_DETAILS_WIDGETS", | ||
| "PRODUCT_DETAILS_WIDGETS", | ||
| "VOUCHER_DETAILS_WIDGETS", | ||
| "DRAFT_ORDER_DETAILS_WIDGETS", | ||
| "GIFT_CARD_DETAILS_WIDGETS", | ||
| "CUSTOMER_DETAILS_WIDGETS", | ||
| "COLLECTION_DETAILS_WIDGETS", | ||
| ] as const; |
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.