-
-
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
Add a *SELECT ALL* button in the <BulkActionsToolbar>
#10367
Merged
Merged
Changes from 3 commits
Commits
Show all changes
147 commits
Select commit
Hold shift + click to select a range
972e9dd
Add a "Select all" button + make it customizable + document jsDoc
erwanMarmelab 9656803
add logic in useList
erwanMarmelab 91b874f
wrap function with a useCallback
erwanMarmelab 4cd44ea
add more data in the story to be able to test the "SELECT ALL" button
erwanMarmelab 6178ee5
simplify the areAllSelected check
erwanMarmelab 9e26228
add select all button on ReferenceManyField
erwanMarmelab dc18571
add a full app story with ReferenceManyField
erwanMarmelab 426c9f5
remove the useless selectAllLimit prop from useList
erwanMarmelab 5721ae9
add a SELECT ALL button for ReferenceArrayField
erwanMarmelab 02eef0b
add SELECT ALL button on infiniteList + story + selectAllLimit
erwanMarmelab 60b0b9a
change call on mount to mutation on callback
erwanMarmelab 651ac4b
display error + fix getManyReference call
erwanMarmelab 73f8e7e
add stories for ReferenceManyField for Pagination and selectAllLimit
erwanMarmelab d214481
add stories for List with selectAllLimit
erwanMarmelab 76d9214
remove useless modification
erwanMarmelab 1885e48
Fix Datagrid and ExpandAllButton tests
erwanMarmelab 4c73b9c
Fix BulkUpdateButton test
erwanMarmelab 548968d
add selectAllLimit to UseReferenceArrayFieldControllerParams to fix b…
erwanMarmelab dd7cf02
rename `areAllSelected` to `displaySelectAllButton`
erwanMarmelab 9eb0f1c
test useListController
erwanMarmelab 4546b6e
test useInfiniteListController
erwanMarmelab a374f05
test useReferenceArrayFieldController
erwanMarmelab 38261a7
test useReferenceManyFieldController
erwanMarmelab 7d73c0d
test useList
erwanMarmelab 4182bb6
do not display "Select all" button if nb selected items > selectAllLimit
erwanMarmelab 4f28a99
test `<List>`
erwanMarmelab c49c28c
test `<ReferenceManyField>` + fix ts issues
erwanMarmelab 56db339
test `<ReferenceArrayField>` + fix ts issues
erwanMarmelab f82dd52
fix useInfiniteListController tests
erwanMarmelab db66a99
document `<List selectAllLimit>`
erwanMarmelab 473a9f9
document `<ReferenceManyField selectAllLimit>`
erwanMarmelab 0a6ff63
fix List tests
erwanMarmelab 9162761
fix typos
erwanMarmelab cadc723
Simplify tests
erwanMarmelab 538076c
simplify spacings in bulkActionToolbar
erwanMarmelab 5b30150
rename displaySelectAllButton to areAllItemsSelected
erwanMarmelab a30dd17
create the `useSelectAll` hook
erwanMarmelab 59024b4
fix ReferenceArrayInput
erwanMarmelab 0846132
change `useMutation` to `queryClient.fetchQuery`
erwanMarmelab a3a9b8b
Isolate test components in stories-> `useReferenceArrayField`
erwanMarmelab 30c1d28
Isolate test components in stories-> `useReferenceManyField`
erwanMarmelab 7e0f92d
Isolate test components in stories-> `useInfiniteListController`
erwanMarmelab d9f1a59
Isolate test components in stories-> `useListController`
erwanMarmelab 04ddc21
change `useMutation` to `queryClient.fetchQuery` in `useReferenceMany…
erwanMarmelab 31c996b
change the structure
erwanMarmelab 2b6e1d8
remove useless tests
erwanMarmelab f27f69b
remove useless stories
erwanMarmelab 1b94c81
remove useless props + improve comments
erwanMarmelab af1427b
Add stories for SelectAllButton
erwanMarmelab 52bcdd1
test SelectAllButton
erwanMarmelab 1b0e974
add a name + support onClick
erwanMarmelab eb73fbd
document select all
erwanMarmelab e8f64e3
Fix SelectAllButton tests
erwanMarmelab 97a338e
remove old structure with `selectAllLimit`
erwanMarmelab 472b81b
change (again) the structure to have a button and logic in hooks
erwanMarmelab 447d793
ReferenceArrayFieldController -> tests + stories
erwanMarmelab 588767c
make the callback stronger
erwanMarmelab 4573ae9
ReferenceManyFieldController -> tests + stories
erwanMarmelab 98c48c7
moove useRecordSelection and useResourceContext logic
erwanMarmelab 2f1f7db
InfiniteListController -> tests + stories
erwanMarmelab ad0a805
eListController -> tests + stories
erwanMarmelab c658335
test useList
erwanMarmelab 420cfad
ReferenceManyField -> tests + stories
erwanMarmelab 7401122
InfiniteList -> limit -> stories
erwanMarmelab 1e41bc3
List -> tests + stories
erwanMarmelab c18a232
Improve documentation sentences
erwanMarmelab a4c7a82
Improve jsDoc of selectionModifiers
erwanMarmelab 03d9afc
remove the duplicated `resource` from the query
erwanMarmelab f1b4091
add the missing frenc translation + reorder alphabetically the messages
erwanMarmelab 6f8e99b
rename message `too_many_elements` into `select_all_limit_reached`
erwanMarmelab 4e86cd8
Remove the `Warning` from the `select_all_limit_reached` message
erwanMarmelab 755571e
Remove the `Warning` from the `select_all_limit_reached` message in t…
erwanMarmelab b8f8413
remove useless `console.error`
erwanMarmelab f1d4000
create a translation for the error message + add a type to the notif …
erwanMarmelab 400d85f
rename `onSelectAllProps` into `onSelectAllParams`
erwanMarmelab bf47b5e
remove `selectionModifiers` from props to import it with a hook
erwanMarmelab 8916730
apply the deletion of the `selectionMofifiers` prop
erwanMarmelab b56f600
apply the PREFIX to the CSS in JS instead of HTML attribute
erwanMarmelab 7e7a05c
add a transated message dedicated for the select all button + fix Tra…
erwanMarmelab 05dcd17
rename `onSelectAll` into `handleSelectAll` in `useSelectAll` (not in…
erwanMarmelab 570170b
fix ts error
erwanMarmelab 11b0422
use `useEvent` instead of `useCallback`
erwanMarmelab 3da72ef
revert useless style changes
erwanMarmelab f02863b
group type imports
erwanMarmelab 2f315dd
make data mare plausible
erwanMarmelab 592824f
fix typo in `ListWithCheckboxes` title
erwanMarmelab 14c3aa3
pass `{children}` as child instead of as prop
erwanMarmelab 9dc0e64
stop using `act` in tests
erwanMarmelab 4b53460
rename `spiedChildren` into `callback`
erwanMarmelab 3e8272a
do write twice the spied func -> just spy it
erwanMarmelab b9142ae
pass children as child instead of prop
erwanMarmelab 17b4b30
improve test names
erwanMarmelab 0c25426
improve story label
erwanMarmelab 8a647e5
isolate type imports
erwanMarmelab 7f119de
adapt test with the new button label
erwanMarmelab 605f303
moove the `SelectAllButton`
erwanMarmelab 3563517
test the new `bulkActionsToolbar` Datagrid's prop
erwanMarmelab 0f0b22e
Adapt SelectAllButton doc to the new place
erwanMarmelab 4cfc3a2
Update Datagrid doc
erwanMarmelab 92893c4
update screenshot
erwanMarmelab b2ed592
fix typo
erwanMarmelab aae3600
useSelectAll -> test + stories
erwanMarmelab 7cf12a8
improve jsDoc
erwanMarmelab 3f3cbfe
improve `SelectAllButton` introduction's doc
erwanMarmelab 361153e
update the selection button name
erwanMarmelab 68adcf9
rename stories
erwanMarmelab 0231d03
fix ts errors + use story in tests
erwanMarmelab c8d447b
isolate tests into stories
erwanMarmelab ea989da
simplify tests (afterEach of Select All tests)
erwanMarmelab 56f48a5
don't pass children to the tests -> `useReferenceArrayFieldController`
erwanMarmelab cb70247
don't pass children to the tests -> `useReferenceManyFieldController`
erwanMarmelab db74e83
don't pass children to the tests -> `useInfiniteListController`
erwanMarmelab 8787f5b
don't pass children to the tests -> `useList`
erwanMarmelab 122dae6
simplify tests
erwanMarmelab 2abf955
don't pass children to the tests -> `useListController`
erwanMarmelab 54c8e6e
clean file
erwanMarmelab ec85bf9
clean file
erwanMarmelab fbb290c
display SelectAllButton if all data are selected
erwanMarmelab 4f4feff
adapt tests `SelectAllButton` + add a test on the new display condition
erwanMarmelab e5fdcb7
adapt tests `Datagrid`
erwanMarmelab 2d9822d
simplify stories
erwanMarmelab 1bd2dcb
adapt tests `List`
erwanMarmelab f5144e8
adapt tests `ReferenceManyField`
erwanMarmelab b300053
adapt tests `ReferenceArrayField`
erwanMarmelab 65ad280
Merge branch 'next' into feat/next/select_all
erwanMarmelab 614f4d1
improve buttons color
erwanMarmelab 9df60b1
Adapt ExpandAllButton's test with the new story
erwanMarmelab 969fd83
fix linter warning
erwanMarmelab 832e4ba
add a usage section
erwanMarmelab 3309535
remove the `bulkActionsToolbar` prop and create `selectAllButton`'s prop
erwanMarmelab 75f21ef
improve jsDoc example
erwanMarmelab 0a2399a
wrap tests in some `describe`
erwanMarmelab c5d2722
rename `handleSelectAll` into `handleClick`
erwanMarmelab 781ab5a
fix typo
erwanMarmelab 0bbb005
Rename `List` into `ListView`
erwanMarmelab ed4713a
rename story files
erwanMarmelab 315b9a9
add `target` and `id` to the queryKey
erwanMarmelab 6aac661
test the right spot for useSelectAll
erwanMarmelab d8c0992
use http_error instead of simple_error
erwanMarmelab b27fe7c
make test more logic
erwanMarmelab 2f3ed8a
rename tests
erwanMarmelab 002f485
fix tests
erwanMarmelab 420ab1d
update the bulkActionsToolbar implementation
erwanMarmelab 68fe92c
adapt stories with the last implem to fix stories
erwanMarmelab 2ebbcad
Misc adjustments
fzaninotto b4c0f8d
Capitalize type name
fzaninotto 31b3bd5
Fix TS compilation error
fzaninotto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fzaninotto marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You'd better use the data provider directly in the callback, or using react-query's useMutation. useGetList is really designed for queries triggered on mount.