This is a draft of an updated example for the app tempalte.
The current example of "populate 5 products" is outdated and doesn't provide a good example for something an app developer will build.
WHAT is this pull request doing?
Added 2 new pages:
Landing page with intro card
Product tagger page to allow a user to add or remove multiple tags to one or more products
These 2 pages demonstrate the following concepts:
How to use a Page and Layout
How to link to an internal page with useNavigate() and a Polaris Link component
How to organize a page that includes multiple components with shared state
Calling an internal API from a component
Loading from the API on user input, showing the loading state
Passing state objects and functions down to child components
Uses Polaris components IndexTable, ListBox, ComboBox, and Tag
Added new API functions under /api/producttags
GET, POST, and DELETE actions
shows the GraphQL client and how to crate queries with variables
show how to structure a single file for multiple actions
shows Promise.all()when multiple API calls need to be made
Existing Issues
We're stuck in a limbo state while Polaris is doing major updates, do we use Legacy components or Alpha components?
We're using React 17. It might be nice to update to React 18 to show a demo of Suspense that fetches on a page load (without having to use a useEffect hook)
The UI for the product tagger is not clear. It probably needs a refactor and an instructions card.
Checklist
Note: once this PR is merged, it becomes a new release for this template.
[ ] I have added/updated tests for this change
[ ] I have made changes to the README.md file and other related documentation, if applicable
WHY are these changes introduced?
This is a draft of an updated example for the app tempalte.
The current example of "populate 5 products" is outdated and doesn't provide a good example for something an app developer will build.
WHAT is this pull request doing?
Added 2 new pages:
These 2 pages demonstrate the following concepts:
useNavigate()
and a PolarisLink
componentIndexTable
,ListBox
,ComboBox
, andTag
Added new API functions under
/api/producttags
Promise.all()
when multiple API calls need to be madeExisting Issues
Suspense
that fetches on a page load (without having to use auseEffect
hook)Checklist
Note: once this PR is merged, it becomes a new release for this template.
README.md
file and other related documentation, if applicable