-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix broken referenceKey prop on SelectColumnsButton #8432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test are failing
packages/ra-ui-materialui/src/list/datagrid/SelectColumnsButton.tsx
Outdated
Show resolved
Hide resolved
@WiXSL My bad, updated the codestyle and added some extra tests to verify working. |
packages/ra-ui-materialui/src/list/datagrid/SelectColumnsButton.spec.tsx
Show resolved
Hide resolved
const preferenceKey = props.preferenceKey | ||
? `preferences.${props.preferenceKey}` | ||
: `preferences.${resource}.datagrid`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, please use the same syntax as in DatagridConfigurable
:
const finalPreferenceKey = preferenceKey || `${resource}.datagrid`;
const [availableColumns, setAvailableColumns] = useStore<
ConfigurableDatagridColumn[]
>(`preferences.${finalPreferenceKey}.availableColumns`, []);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_, setOmit] = useStore<string[]>(
`preferences.${finalPreferenceKey}.omit`,
omit
);
Sorry, needs rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also apply the changes regarding the props
type that are suggested in #8479
- typing
props
withSelectColumnsButtonProps
- using the
sanitizeRestProps
function
Also, there are 2 linter warnings you need to fix:
Thanks
Hi @wcoppens I did not see your PR, sorry about that! |
No problem, as long we have the same goal ;-). I've took your TS typings and Sanitizeprops function and applied a separate commit, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #8431
This commit fixes the broken referenceKey prop for the SelectColumnsButton.