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: Boilerplate next steps component #1909

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Conversation

ianjon3s
Copy link
Contributor

@ianjon3s ianjon3s commented Jul 4, 2023

PR adds the boilerplate setup for the Next Steps component, based on the work of Jess https://github.com/theopensystemslab/planx-new/pull/1448/files

Bits I'm not sure about:

  • Classification of component, I've added under "Question" for now
  • Numbering system used in editor.planx.uk/src/@planx/components/types.ts, I've added to the end of the list with sequential number

Pizza preview here:
https://1909.planx.pizza/testing/next-steps-test/preview?analytics=false

@ianjon3s ianjon3s requested a review from a team July 4, 2023 21:19
@github-actions
Copy link

github-actions bot commented Jul 4, 2023

Removed vultr server and associated DNS entries

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.

Looking very solid 🎉

A few small comments, but no show stoppers - this'll be ready to merge soon !

Glad the docs were a helpful starting place, please feel to add any new points to them of anything you learned here that wasn't so clear !!

@@ -46,6 +46,7 @@ const NodeTypeSelect: React.FC<{
<optgroup label="Question">
<option value={TYPES.Statement}>Question</option>
<option value={TYPES.Checklist}>Checklist</option>
{/* <option value={TYPES.NextSteps}>Next steps</option> */}
Copy link
Member

Choose a reason for hiding this comment

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

This grouping makes sense to me too ➕

As long as the Public display shows "Under development", I'd actually be in favor of this not being commented out in this list so we can easily test/preview on the pizza! And that should be enough of a signal to Editors to not use it yet

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've updated so this is unhidden, also updated the description with a pizza preview link for the component.

@@ -29,4 +29,5 @@ export enum TYPES {
Send = 650,
Calculate = 700,
Confirmation = 725,
NextSteps = 730,
Copy link
Member

Choose a reason for hiding this comment

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

This works ➕ There's no obvious method here, but as long as it's a new unique number it'll be good to go!

One new thing the original docs don't cover I think is that this list of Component types is now also maintained in planx-core and will need to be updated here as well: https://github.com/theopensystemslab/planx-core/blob/main/src/types/component.ts

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've added as a new PR to planx-core:
theopensystemslab/planx-core#53

function Component(props: Props) {
return (
<Card handleSubmit={props.handleSubmit} isValid>
<QuestionHeader title={props.title} description={props.description} />
Copy link
Member

@jessicamcinchak jessicamcinchak Jul 5, 2023

Choose a reason for hiding this comment

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

A more flexible option is to use <QuestionHeader {...props} /> here which will then also automatically pick up help text if it's defined.

Otherwise, as-is:

  • you'd define help text in the editor but it wouldn't be picked up in the Public preview
  • you'll have to keep adding those prop fields manually like howMeasured={props.howMeasured} and so on

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, updated.

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.

🎉

@ianjon3s ianjon3s merged commit 594e978 into main Jul 6, 2023
10 checks passed
@ianjon3s ianjon3s deleted the ian/next-steps-component branch July 6, 2023 09:21
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