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(works-to-trees): Add DateInputField to List component #3519

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Aug 15, 2024

What does this PR do?

Allows dates to be added to list component schemas

Why

Required for works to trees feature, useful for other list schemas.

image

@DafyddLlyr DafyddLlyr changed the title feat: Add DateInputField to List component feat(works-to-trees): Add DateInputField to List component Aug 15, 2024
Copy link

github-actions bot commented Aug 15, 2024

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.

Thanks for picking this one up, works perfect !

id,
data,
}) => {
const { formik, activeIndex } = useListContext();
Copy link
Member

Choose a reason for hiding this comment

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

As we think next about how to better share "schemas" between components that may use them (List here, MapAndLabel next) - I'm very interested if this useListContext() could be extracted out into a useSchemaContext or similar ?? Then the "Schema" becomes a Context & formik aware component that can be referenced in many components?

Was anticipating "fields" would be something I could externally reference/"just pull into" initial MapAndLabel setup - but this bit of context very much collided / lead me to initially just duplicating field definitions with a minor useMapAndLabelContext() difference.

Definitely not a thing to address in this PR, just starting to think bigger direction!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally - this is the exact issue I hit when I was trying to rush out Page before show and tell 😅

There's really two layers of responsibility here - something which handles fields, and something which handles lists (or the wider component). So errors relating to min, max, etc would be in the lists "layer" and the field validation logic etc can we handled elsewhere.

Planning on taking a look at this next pretty much as I know it's a bit of a blocker atm 👍

@DafyddLlyr DafyddLlyr merged commit 110d062 into main Aug 16, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/date-field-list branch August 16, 2024 08:01
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