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: Styled feedback table #3208

Merged
merged 8 commits into from
Jun 4, 2024
Merged

feat: Styled feedback table #3208

merged 8 commits into from
Jun 4, 2024

Conversation

ianjon3s
Copy link
Contributor

@ianjon3s ianjon3s commented May 29, 2024

What does this PR do?

Adds a styled feedback table using the 'feed' style used for the submissions log.

  • Data is separated into a summary row and further feedback on expand.
  • Comments are truncated to 50 characters within the table, full comment in the expanded content. The first (bottom) example shows this.
  • Help text is shown only for helpful/unhelpful help text feedback.
  • User context is shown as the first item for "issue" type feedback, which corresponds to "What were you doing?" in the feedback form.

Example:
https://3208.planx.pizza/testing/find-out-if-you-need-planning-permission/feedback

Copy link

github-actions bot commented May 29, 2024

Removed vultr server and associated DNS entries

@ianjon3s ianjon3s marked this pull request as ready for review May 30, 2024 15:43
@ianjon3s ianjon3s requested a review from a team May 30, 2024 15:43
@ianjon3s ianjon3s changed the title wip: Styled feedback table feat: Styled feedback table May 30, 2024
@ianjon3s ianjon3s force-pushed the ian/feedback-table branch from 5ce90c7 to 9619640 Compare June 3, 2024 08:12
@ianjon3s ianjon3s requested a review from a team June 3, 2024 11:00
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.

Changes look great here! A few final minor comments, but no stoppers - very happy for this to merge!

Perhaps in a follow-up PR we can add a simple "Feedback" tab alongside "Submissions" & similar under "Flow settings"?


const combinedHelpText = `${detailedFeedback.helpText || ""} ${
detailedFeedback.helpDefinition || ""
} ${detailedFeedback.helpSources || ""}`.trim();
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe this is a bit more readable for concatenating strings & filtering out any null ones?

[detailedFeedback.helpText, detailedFeedback.helpDefinition, detailedFeedback.helpSources].filter(Boolean).join(" ").trim()

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, I wasn't aware of the simplicity of .filter(Boolean)

const truncatedHelpText =
combinedHelpText.length > 65
? `${combinedHelpText.slice(0, 65)}...`
: combinedHelpText;
Copy link
Member

Choose a reason for hiding this comment

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

👍 clever! I always forget the css syntax to do this, good reminder it can be clearly handled this way too


const labelMap: Record<string, string> = {
userComment: item.type === "issue" ? "What went wrong?" : "User comment",
address: "Project address",
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 not sure we use "Project address" anywhere else - is "Property address" or "Site address" perhaps more consistent with service content ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change to "Property address" as this matches the question "Enter the postcode of the property" where the data is gathered

@ianjon3s ianjon3s merged commit 46de65e into main Jun 4, 2024
12 checks passed
@ianjon3s ianjon3s deleted the ian/feedback-table branch June 4, 2024 08:57
RODO94 pushed a commit that referenced this pull request Jun 4, 2024
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.

3 participants