Skip to content

Changed DataFilters to add layer #6600

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

Merged
merged 6 commits into from
Jan 31, 2023
Merged

Conversation

ericsoderberghp
Copy link
Contributor

What does this PR do?

Changed DataFilters to add layer.

Where should the reviewer start?

DataFilters.js

What testing has been done on this PR?

Added a story and a unit test

How should this be manually tested?

new story

Do Jest tests follow these best practices?

no change to unit test structure

Any background context you want to provide?

What are the relevant issues?

#6598

Screenshots (if appropriate)

Do the grommet docs need to be updated?

yes

Should this PR be mentioned in the release notes?

yes

Is this change backwards compatible or is it a breaking change?

backwards compatible

@ericsoderberghp ericsoderberghp linked an issue Jan 25, 2023 that may be closed by this pull request
<Box fill align="center" justify="start" pad="large">
<Data data={DATA}>
<DataFilters layer>
<DataFilter property="location" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<DataFilter property="location" />
<DataFilter property="location" contentProps={{ width: 'medium' }} />

We've been defaulting to medium width for formfields.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does DataFilter pass FormField props through?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DataFilter does pass contentProps through.

However, the desired behavior feels like something that should be built in or theme driven so that the caller doesn't need to pass this to every DataFilter. I'm actually wondering if we should build this into the theme at theme.formField.content.width. Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like that idea, it's a lot of repeated implementation to have to do it each time.

@@ -99,6 +106,13 @@ export const DataFilters = ({ drop, children, heading, ...rest }) => {
})}
</Heading>
{!controlled && clearControl}
{layer && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Small comment about the Heading with size="small" above (not changed in this PR but just noticing it) in relation to this being BETA and the upcoming HPE typography changes. We are going to steer away from having to apply size on Heading and just leverage the theme definitions. For this, we should:

  • Remove size now in prep for brand updates
  • Leave, but note that once the next theme version is released we should remove size="small" from the heading
  • Add as theme-able thing (but this is probably a bit overkill / opening an unnecessary can of worms

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming there are other places, such as Calendar's Heading that would be affected. So, I'm inclined to be consistent with the current master branch and update them all together. I believe this is option two in the list above.

</Grommet>,
);

expect(container.firstChild).toMatchSnapshot();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this test capturing the layer? or do we have to set it to open to capture the layer in the snapshot?

@ericsoderberghp ericsoderberghp merged commit aef2ee3 into master Jan 31, 2023
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.

Add DataFilters layer prop
2 participants