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

refactor: Standardise error summary #3259

Merged
merged 3 commits into from
Jun 11, 2024
Merged

Conversation

ianjon3s
Copy link
Contributor

@ianjon3s ianjon3s commented Jun 7, 2024

What does this PR do?

  • Introduces a standardised error summary with three 'styles'; error, warning and info.
  • Updates replicated error summaries
  • Introduces error summary for feedback log with no entries
  • Storybook story with each permutation

Preview:
https://storybook.3259.planx.pizza/?path=/docs/design-system-molecules-errorsummary--docs

Copy link

github-actions bot commented Jun 7, 2024

Removed vultr server and associated DNS entries

@ianjon3s ianjon3s requested a review from a team June 7, 2024 15:36
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.

Super appreciated update, thanks for picking this one up!

Beyond these files, there's a couple more that come to mind that I think might good candidates for similar update/refactor to share this new standard component:

  • .../editor.planx.uk/src/@planx/components/shared/Preview/ErrorSummaryContainer.tsx
    • Which is then imported/used a couple of places like ErrorFallback, PlanningConstraints & PropertyInformation graph warnings

<ErrorSummary
format="info"
heading="No feedback found for this service"
message="If you're looking for feedback before January 1, 2024, please contact a PlanX developer."
Copy link
Member

Choose a reason for hiding this comment

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

nit: in the case of feedback, I think it should read "If you're looking for feedback from more than six months ago, please contact a PlanX developer" - because feedback availability is subject to our data sanitation policy (6 month retention) ! Submission event receipts are always retained (no personal data), and that view is actually filtered from January 2024 forwards for simplicity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I coped this over from the submission log and had made a note to clarify. Thanks for this, will update.

message: "Summary of information message.",
format: "info",
},
} satisfies Story;
Copy link
Member

Choose a reason for hiding this comment

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

💯

}

const Root = styled(Box, {
shouldForwardProp: (prop) => !["format"].includes(prop.toString()),
Copy link
Member

Choose a reason for hiding this comment

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

the syntax of shouldForwardProp is still never quite intuitive to me, but I think this can simply be ??

  shouldForwardProp: (prop) => prop !== "format",

and then on L14 just below, might need to adjust to <Props["format"]> rather than current <Props>, as we're just forwarding along the single property?

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, this works without adjusting line 14 👍

@ianjon3s
Copy link
Contributor Author

Thanks for the review @jessicamcinchak , I will follow up with a further PR to update ErrorSummaryContainer.tsx with this standard styling

@ianjon3s ianjon3s merged commit 0d0bc43 into main Jun 11, 2024
12 checks passed
@ianjon3s ianjon3s deleted the ian/standard-error-summary branch June 11, 2024 09:50
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