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

Data-grid filter improvements (+ external paginator) #3162

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

yusijs
Copy link
Contributor

@yusijs yusijs commented Nov 29, 2023

Fixes design-issues reported by @BirteThornquist

  • Filter
    • Add a filter-toggle-button instead of inlining the filters
    • Move inputs inside a popover
  • Paging
    • Added a prop to use external pagination (e.g for server-side paging)
  • Also fixed an error where the root package.json pointed tests to core-react
    • This identified another bug that I mentioned to @oddvernes , where eds-core-react breaks most tests due to babel-plugin-styled-components not handling .cjs correctly. This only applies when running tests, and does not fail in the browser.

The bug was worked around so I could run the tests by making a tweak in packages/eds-core-react/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/babel-plugin-styled-components/lib/utils/detectors.js, adding a null-check to tag.object:
state.styledRequired && t.isMemberExpression(tag) && t.isMemberExpression(tag.object) && tag.object?.property.name === 'default' && tag.object.object.name === state.styledRequired || state.styledRequired && t.isCallExpression(tag) && t.isMemberExpression(tag.callee) && tag.callee?.property.name === 'default' && tag.callee.object.name === state.styledRequired || state.styledRequired && t.isCallExpression(tag) && t.isSequenceExpression(tag.callee) && t.isMemberExpression((0, _getSequenceExpressionValue.default)(tag.callee)) && (0, _getSequenceExpressionValue.default)(tag.callee)?.property.name === 'default' && (0, _getSequenceExpressionValue.default)(tag.callee).object.name === state.styledRequired || importLocalName('default', state) && t.isMemberExpression(tag) && t.isMemberExpression(tag.object) && tag.object?.property.name === 'default' && tag.object.object.name === importLocalName('default', state) || importLocalName('default', state) && t.isCallExpression(tag) && t.isMemberExpression(tag.callee) && tag.object?.property.name === 'default' && tag.object.object.name === importLocalName('default', state);

resolves #3169

@oddvernes
Copy link
Collaborator

The test issue was resolved by mapping eds-core-react to it's esm index.js in jest config.moduleNameMapper 🤷

Copy link
Collaborator

@oddvernes oddvernes left a comment

Choose a reason for hiding this comment

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

LGTM

@oddvernes oddvernes merged commit f6fed15 into develop Dec 1, 2023
6 checks passed
@oddvernes oddvernes deleted the feature/rhenri-data-grid-filter-improvements branch December 1, 2023 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Data-grid-react: fix test setup
2 participants