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

Add ability to create independent store configurations for different lists of same resource #8042

Closed
wants to merge 61 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
364785a
Delete contexts don't send mutation meta
antoinefricker Jul 29, 2022
ae7aa5e
Fix access error
antoinefricker Jul 29, 2022
94a5678
Add meta support for bulk delete buttons
antoinefricker Jul 29, 2022
603ccdc
Update doc
antoinefricker Jul 29, 2022
e55f8de
Comment from PR
antoinefricker Aug 1, 2022
ea98f3c
Fix ArrayInput Adding Previously Removed Item
Aug 3, 2022
c487662
Apply review
Aug 3, 2022
e9bfa4c
Apply review
djhi Aug 4, 2022
83ff11a
Feat: Add filter redirection for pending reviews
arimet Aug 4, 2022
54a483d
Merge pull request #8036 from marmelab/fix-dashboard-redirection
fzaninotto Aug 4, 2022
5bd24ce
Add unit tests
antoinefricker Aug 4, 2022
35a81b9
Unit test corrections
antoinefricker Aug 4, 2022
e36ef26
Merge pull request #8029 from marmelab/fix-array-input-adding-previou…
fzaninotto Aug 4, 2022
4f2e996
Merge pull request #8023 from marmelab/8016-dataprovider-delete-meta
fzaninotto Aug 4, 2022
0847d2b
[Demo] Fix poster category selector shows id instead of name
fzaninotto Aug 4, 2022
ce98e65
[TypeScript] Fix MenuItemLink prop type isn't exported
fzaninotto Aug 4, 2022
0ae5f1f
Merge pull request #8040 from marmelab/fix-MenuItemLink-type
fzaninotto Aug 5, 2022
847e35a
Prepare changelog for v4.2.6
fzaninotto Aug 5, 2022
9592083
v4.2.6
fzaninotto Aug 5, 2022
f956e85
Fix yarn.lock
fzaninotto Aug 5, 2022
9454956
Add `customStoreKey` property
antoinefricker Aug 5, 2022
d379cba
Add feature documentation
antoinefricker Aug 5, 2022
a65472a
[Doc] Improve ImageField, NumberField and SelectField docs
fzaninotto Aug 8, 2022
243e9bc
Document how to sanitize form values
antoinefricker Aug 8, 2022
a286228
Merge pull request #8048 from marmelab/trello753
fzaninotto Aug 8, 2022
db57dd6
Unit tests
antoinefricker Aug 9, 2022
3dd0ac7
replace cloneElement by RecordContext
thibault-barrat Aug 9, 2022
4302137
Merge pull request #8052 from marmelab/7877-fileinput-cloneelement
fzaninotto Aug 9, 2022
ffe8878
add documentation for Vite integration
thibault-barrat Aug 9, 2022
1f6d7a9
add JsonSchemaForm doc
thibault-barrat Aug 9, 2022
c712aa3
Fix: useIsFormInvalid
arimet Aug 9, 2022
1ae6721
remove 'install dependencies' step
thibault-barrat Aug 9, 2022
d45f3b0
Merge pull request #8054 from marmelab/doc-vite
fzaninotto Aug 9, 2022
b384e30
Fix: Update useReferenceInputController test
arimet Aug 9, 2022
e86fedf
Merge pull request #8055 from marmelab/edit-notification
antoinefricker Aug 9, 2022
5dcef17
add form screenshot
thibault-barrat Aug 9, 2022
ddbab79
Merge pull request #8056 from marmelab/doc-json-schema-form
fzaninotto Aug 9, 2022
e467f4a
Fix: useAugmentedForm
arimet Aug 9, 2022
df2c757
Fix: Update eslint errors
arimet Aug 9, 2022
073a8c4
Fix useStore internal state reset when key changes
slax57 Aug 9, 2022
efbdeaf
Fix FormDataConsumer inside SimpleFormIterator adds empty value
fzaninotto Aug 10, 2022
03f081c
Fix: Update JSDoc
arimet Aug 10, 2022
43e7c4c
Merge pull request #8057 from marmelab/useNotifyIsValid
slax57 Aug 10, 2022
f55af51
Add unit test
fzaninotto Aug 10, 2022
f16e6c2
Merge pull request #8045 from marmelab/field-doc-improvement
fzaninotto Aug 10, 2022
d4f4719
Fix infinite re-render
slax57 Aug 10, 2022
6fc2039
Merge pull request #8058 from marmelab/fix-useStore-internal-state-reset
fzaninotto Aug 10, 2022
959b735
Merge pull request #8061 from marmelab/fix-simpleformiterator-formdat…
slax57 Aug 10, 2022
253c8c3
Merge branch 'master' into next
fzaninotto Aug 11, 2022
dd9d095
Add `customStoreKey` property
antoinefricker Aug 5, 2022
d3a29c4
Add feature documentation
antoinefricker Aug 5, 2022
fd26494
Unit tests
antoinefricker Aug 9, 2022
6b997c8
Unit test corrections
antoinefricker Aug 9, 2022
f031fd8
First correction from review
antoinefricker Aug 9, 2022
72800f8
Fix UT
antoinefricker Aug 11, 2022
ee9697b
Update useListController.md
antoinefricker Aug 12, 2022
9518bc3
Add feature documentation
antoinefricker Aug 5, 2022
62e8975
Unit tests
antoinefricker Aug 9, 2022
4169083
Merge branch 'rao8038-custom-list-storekey' of github.com:marmelab/re…
antoinefricker Aug 12, 2022
ec5f3fb
Add feature documentation
antoinefricker Aug 5, 2022
0c277f3
Merge branch 'rao8038-custom-list-storekey' of github.com:marmelab/re…
antoinefricker Aug 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ describe('useReferenceInputController', () => {
);

await waitFor(() => {
expect(children).toBeCalledTimes(4);
expect(children).toBeCalledTimes(3);
});
expect(children).toHaveBeenCalledWith(
expect.objectContaining({
8 changes: 3 additions & 5 deletions packages/ra-core/src/form/useIsFormInvalid.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import { useFormState, Control } from 'react-hook-form';
*/
export const useIsFormInvalid = (control?: Control) => {
const [isInvalid, setIsInvalid] = useState(false);
const { isValid, submitCount, errors } = useFormState(
const { submitCount, errors } = useFormState(
control ? { control } : undefined
);
const submitCountRef = useRef(submitCount);
@@ -22,15 +22,13 @@ export const useIsFormInvalid = (control?: Control) => {
if (submitCount > submitCountRef.current) {
submitCountRef.current = submitCount;

// For some reason, the validation state might not be sync yet on first submit
// so we need to check if there are actually some errors even though the isValid is false
if (Object.keys(errors).length > 0 && !isValid) {
if (Object.keys(errors).length > 0) {
setIsInvalid(true);
} else {
setIsInvalid(false);
}
}
}, [errors, isValid, submitCount]);
}, [errors, submitCount]);

return isInvalid;
};