feat: New gcds-page-feedback component #638
Draft
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.
This is a work in progress, further changes, code review, writing test, documentation, stories, detaching changes in another PR... are on it's way. The main intent with this draft PR is to give you an early opportunity to see my progress and to benefit from your early feedback if you have some.
Also, I created and published a working demo here: https://duboisp.github.io/gcds-components/src/index.html
Summary | Résumé
This add to GCDS a new Page Feedback Tool component to collect in-page user feedback which are going to be compatible with the current way that DTO are collecting feedback on Canada.ca. It does also provide a very similar but different user experience when compared with the current Canada.ca implementation that leverage the WET-BOEW/GCWeb framework.
However, considering all the override complexity (which was kind of almost exponential, up to be impossible without a lot of rewrite), this page feedback tool are not compliant with the DTO design specification as specified here: https://design.canada.ca/common-design-patterns/page-feedback.html . IMHO this GCDS Page Feedback Tool proposal are going to provide an equivalent behaviour, an equivalent structure, an equivalent style and the same technical user feedback information which, in my opinion, would meet the desired user experience and desired outcome expressed by the page feedback tool DTO guidance.
It does support a few way to customize the feedback form (inline
<slot>
and via fetch), a way to customize the form submission end point and it should technically work well with a single page application.It is primarily designed to be located inside the page details section, along where is located the date modified which is the footer of the main page section.
Test instructions | Instructions pour tester la modification
I am going to create more refined example with every configurable possibility via the story book.
Note: The button "RESET the previous PFT" is only there to facilitate development and for quick testing. The intend is to remove it along with its preceding and succeeding horizontal line.
Positive feedback
Negative feedback
Single page application
history.pushState({},"", "page-feedback.html");
history.back();
(You should have pushed a state before)Override the default form submission end point
action
on the<gcds-page-feedback>
component by using the live browser DOM editor.Override of the feedback form on runtime
feedback-form
on the<gcds-page-feedback>
component by using the live browser DOM editor.a. via the
<gcds-page-feedback>
component : Configure the attributeaction
with the end point URLb. via the fetched html fragment: Add anywhere an attribute named
data-feedback-form-action
containing the end point URLc. There is a test file located here
../src/components/gcds-page-feedback/ajax/custom-feedback-alternate.html
in my working demoNote: It also work if the custom feedback form contain field requiring validation. It is also compatible with native HTML form field and GCDS form capable component.
Responsive
Known issue