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(labware-creator): split apart sections into separate components #7735

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

shlokamin
Copy link
Member

@shlokamin shlokamin commented Apr 28, 2021

Overview

This PR splits the first three sections (create new definition, upload existing, and regularity) into their own components.

Each section component is responsible for getting formik values for displaying errors via useFormikContext. Each new section we make can take advantage of the function getFormAlerts that takes formik props and returns all relevant errors that should be displayed. See CreateNewDefinition and Regularity for how to use it.

New sections should also use the SectionBody UI component to format content + alerts (this was extracted from the old Section component). Again see CreateNewDefinition and Regularity for how to use it.

I was bad and did not include test coverage here (soon to come!). In future PRs breaking out sections let's please take the time to add test coverage (preferably using testing library). In the next PR I'll have a few tests to serve as an example.

Partially addresses #7707

Changelog

  • Extract create new definition, upload existing, and regularity into separate sections

Review requests

Smoke test to see if things still work, code review

Risk assessment

Low/Medium

@shlokamin shlokamin requested review from Kadee80, a team and IanLondon and removed request for a team April 28, 2021 16:16
Copy link
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

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

🐅 Really like this pattern!

@shlokamin shlokamin merged commit 077aa25 into edge Apr 28, 2021
@shlokamin shlokamin deleted the lc_split-sections branch April 28, 2021 18:34
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