Add presentation settings page#48
Open
robinmolen wants to merge 9 commits intofeature/12-information-pagefrom
Open
Add presentation settings page#48robinmolen wants to merge 9 commits intofeature/12-information-pagefrom
robinmolen wants to merge 9 commits intofeature/12-information-pagefrom
Conversation
6 tasks
33acbe1 to
5cc3b84
Compare
5cc3b84 to
d8e94cd
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/12-information-page #48 +/- ##
===============================================================
+ Coverage 86.16% 87.73% +1.56%
===============================================================
Files 42 47 +5
Lines 318 375 +57
Branches 54 58 +4
===============================================================
+ Hits 274 329 +55
- Misses 37 38 +1
- Partials 7 8 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d8e94cd to
86a3d01
Compare
Added a mock get request for the v2 themes api. On closer inspection, the v3 form api endpoint expects the `theme` to be a string/uuid value. This detail has been updated in the form type definition, and clearified with a comment.
As all form steps in the new admin-ui share their literals, we need a single point of truth for these step literals. By adding the internal (frontend-only) value `_stepLiterals`, the form can easily manage one collection of literals. This also ensures that, even if all form steps are removed, we keep the literals stored in a safe place. Before submitting the form details to the backend, we simply replace the step literals with the literals set by `_stepLiterals` and all step literals will be synced.
Added the basic configuration fields for the presentation settings page.
The form literals are handled and updated by a separate Formik Form. This LiteralsForm is used in a Modal dialog on the presentation settings page.
The `useLoaderData` would always return the initially cached form details, not the updated details. Because the form submission updates the queryClient, which resets the Formik form, we need the FormLayout to fetch and use the most recent form details. Using queryClient useQuery we fetch the data from the current queryClient cache, instead of the initial queryClient cache. The React-router loader is kept in place to provide preloading on the router level.
The interaction test includes the entire process of filling in the form fields, validating their values and submitting the form to the backend. The submission validates that the form fields are correctly represented in the PUT request to the backend.
470c3ad to
c25e402
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Partly closes #12
This PR depends on #51.
Adding the presentation settings page.
The buttons preview will require future changes, to display the actual button styling used in the form and the selected theme. This will be picked up with #47.
The "Go to general settings" button will be included in another PR #49.
The 'Knopteksten formulier' modal isn't exactly like the design describes it. It will require quite some changes to make it closer resemble the look and feel of the design. I've discussed it with Lidwien, and we decided to keep it as is for now.
I've made a PR to the Maykin admin-ui so we can adjust the modal padding a bit better, but still a lot of work is required to make the modal similar to the design.