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(page): Handle submit and "back" functionality #3678

Merged
merged 3 commits into from
Sep 16, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Sep 16, 2024

What does this PR do?

  • Handles submission of payload data
  • Sets up state when navigating "back"
  • Tests for Page component
  • Bumps planx-core to latest main commit across projects
image

@DafyddLlyr DafyddLlyr changed the base branch from main to dp/page-public-interface September 16, 2024 08:05
@DafyddLlyr DafyddLlyr force-pushed the dp/page-public-interface branch from e315223 to 43e9455 Compare September 16, 2024 08:14
@DafyddLlyr DafyddLlyr force-pushed the dp/page-handle-submit branch from 8049191 to 0e6b5df Compare September 16, 2024 08:15
Copy link

github-actions bot commented Sep 16, 2024

Removed vultr server and associated DNS entries

Base automatically changed from dp/page-public-interface to dp/page-editor September 16, 2024 09:09
Base automatically changed from dp/page-editor to dp/page-boilerplate September 16, 2024 09:46
previousValues: getPreviouslySubmittedData(props),
});

const onSubmit: FormikConfig<SchemaUserData>["onSubmit"] = (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.

As with the List component, we're preversing both forms of data here as opposed to writing to and parsing from a single format.

This seems like an ok approach, especially as it's following an established pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

By "preversing both forms of data" you're referring to defaultPassportData and flattenedData?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's right. We could parse/map/serialise both into a single structure and then unpack that on "back" navigation, but I'm proposing we allow both just now 👍

Base automatically changed from dp/page-boilerplate to main September 16, 2024 09:59
@DafyddLlyr DafyddLlyr force-pushed the dp/page-handle-submit branch from a119474 to ed12378 Compare September 16, 2024 10:07
@DafyddLlyr DafyddLlyr requested a review from a team September 16, 2024 10:08
@DafyddLlyr DafyddLlyr marked this pull request as ready for review September 16, 2024 10:08
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.

Data structures make sense to me here, agree List is right precedent/pattern to follow here 👍

@DafyddLlyr DafyddLlyr merged commit 76c4f9d into main Sep 16, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/page-handle-submit branch September 16, 2024 11:56
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