Skip to content
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

feat: feedback editor component #3866

Merged
merged 19 commits into from
Nov 1, 2024
Merged

feat: feedback editor component #3866

merged 19 commits into from
Nov 1, 2024

Conversation

jamdelion
Copy link
Contributor

@jamdelion jamdelion commented Oct 28, 2024

In this PR ✨ :

  • Add 'Feedback' component to editor component drop-down under feature flag FEEDBACK_COMPONENT.
  • Add editor modal for feedback component with configurations for: question wordings, title, description, disclaimer text and whether or not the feedback is mandatory (last one not used yet)
  • Update public component to use inputs from editor (e.g. question wordings).
  • Improve documentation

⚠️ NOT in this PR: wiring up the form data to the API.

Figma link: https://www.figma.com/design/bnUUrsVRG6qPwDkTmVKACI/PlanX-Design?node-id=16904-1689&t=EmDePU6bogpOSjv9-4

Trello link: https://trello.com/c/jEOLoubW/3034-can-we-introduce-in-house-end-of-service-feedback

How to test 🧪

  • Turn on the feature flag with `window.featureFlags.toggle("FEEDBACK_COMPONENT").
  • Try to add a Feedback component to a flow, publish it etc!

I'm expecting to need to improve this a fair bit, but thought this length of PR was a fine place to stop!

To do in future PRs 🔮 :

  • wire up to feedback API
  • validation and error handling, with testing
  • e2e testing
  • Fix uppercase text in face boxes ('EXCELLENT')

Screenshots

Screenshot 2024-10-30 at 16 37 43

Copy link

github-actions bot commented Oct 28, 2024

Removed vultr server and associated DNS entries

@jamdelion jamdelion marked this pull request as ready for review October 30, 2024 16:38
@jamdelion jamdelion requested a review from a team October 30, 2024 16:38
<Typography pt={2}>
Don't share any personal or financial information in your feedback. If
you do we will act according to our{" "}
<Link href={props.privacyPolicyLink ?? ""}>privacy policy</Link>.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now up to the user to put a privacy policy link in the description via RichTextInput if they want to.

disclaimer: data?.disclaimer || disclaimerPlaceholder,
feedbackRequired: data?.feedbackRequired || false,
...parseBaseNodeData(data),
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that all of the editor inputs are optional and there are default descriptions/question wordings to fallback to if no changes needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of lint changes seem to have crept in since sorting some merge conflicts from main, sorry!

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really solid start !

A couple minor bugs & alignment notes - but since this is feature flagged (and already quite large based on lint changes), happy to leave it up to you to fix here or fix-forward !

editor.planx.uk/docs/adding-a-new-component.md Outdated Show resolved Hide resolved
@@ -45,18 +43,23 @@ const FeedbackComponent = (
return (
<Card handleSubmit={formik.handleSubmit}>
<CardHeader title={props.title} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor bug: when I add more information/help text in the editor modal, I'm not seeing the "More information" link appear as I would expect on public component! Might want to double check how other component headers are handling this!

value={formik.values.feedback}
placeholder="What did you think?"
onChange={formik.handleChange}
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RichTextInput is reserved for editor modals, I'd take a look at the @planx/components/TextInput Public component files for examples of what we expect for the public display here !

(Feel like this points to bigger organisation thing around it being easy to confuse which components are for what currently - let's keep this in mind as we continue to think about how to better organise files!)

The information collected here isn't monitored by planning officers.
Don't use it to give extra information about your project or submission.
If you do, it cannot be used to assess your project.
<ReactMarkdownOrHtml source={props?.disclaimer} id={"DISCLAIMER"} />
</Typography>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Rather than a "caption" style here we probably want to mimic the existing disclaimer styles in use on other components as those have passed a11y audits and feel a bit more Gov UK Design system-y I think - check out PlanningConstraints & Result for examples!

export const disclaimerPlaceholder =
"The information collected here isn't monitored by planning officers. Don't use it to give extra information about your project or submission. If you do, it cannot be used to assess your project.";

export const titlePlaceholder = "Tell us what you think";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm slighty hesitant about introducing "placeholders" file naming into our structure as this is going to mean something new soon in the world of "templates" !

Would the defaultContent structure currently used in @planx/components/DrawBoundary/model work here? Has small benefit of also being type-able based on component prop types 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all these suggestions! They're in the next PR :)

@jamdelion jamdelion merged commit 363cc94 into main Nov 1, 2024
12 checks passed
@jamdelion jamdelion deleted the jh/feedback-editor-side branch November 1, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants