Skip to content

Commit

Permalink
Merge pull request #4000 from marmelab/fix-filter-resets-pagination
Browse files Browse the repository at this point in the history
[RFR] Fix setting filter resets pagination
  • Loading branch information
fzaninotto authored Nov 19, 2019
2 parents 2b8bbf8 + 779ccb1 commit bd2b57a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"ignore-styles": "~5.0.1",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-final-form": "^6.3.0",
"react-final-form": "^6.3.3",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
Expand All @@ -57,7 +57,7 @@
"final-form": "^4.18.5",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-final-form": "^6.3.0",
"react-final-form": "^6.3.3",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
Expand Down
9 changes: 1 addition & 8 deletions packages/ra-core/src/controller/useListParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,7 @@ const useListParams = ({
);

const changeParams = useCallback(action => {
const newQuery = getQuery({
location,
params,
filterDefaultValues,
sort,
perPage,
});
const newParams = queryReducer(newQuery, action);
const newParams = queryReducer(query, action);
history.push({
search: `?${stringify({
...newParams,
Expand Down
8 changes: 6 additions & 2 deletions packages/ra-core/src/form/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { Field, FieldProps } from 'react-final-form';
import { Field, FieldProps, FieldRenderProps } from 'react-final-form';
import { Validator, composeValidators } from './validate';

export const isRequired = validate => {
Expand All @@ -13,7 +13,11 @@ export const isRequired = validate => {
return false;
};

interface Props extends Omit<FieldProps<any, HTMLElement>, 'validate'> {
interface Props
extends Omit<
FieldProps<any, FieldRenderProps<any, HTMLElement>, HTMLElement>,
'validate'
> {
defaultValue?: any;
input?: any;
source: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-core/src/form/useInput.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
useField as useFinalFormField,
FieldProps as FinalFormFieldProps,
FieldProps,
FieldRenderProps,
FieldInputProps,
} from 'react-final-form';
Expand All @@ -10,7 +10,7 @@ import { useCallback, ChangeEvent } from 'react';

export interface InputProps<T = any>
extends Omit<
FinalFormFieldProps<any, HTMLElement>,
FieldProps<any, FieldRenderProps<any, HTMLElement>, HTMLElement>,
'validate' | 'children'
> {
source: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-ui-materialui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"ra-core": "^3.0.0-beta.6",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-final-form": "^6.3.0",
"react-final-form": "^6.3.3",
"react-final-form-arrays": "^3.1.1",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
Expand All @@ -58,7 +58,7 @@
"ra-core": "^3.0.0-beta.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-final-form": "^6.3.0",
"react-final-form": "^6.3.3",
"react-final-form-arrays": "^3.1.1",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ra-i18n-polyglot": "^3.0.0-beta.6",
"ra-language-english": "^3.0.0-beta.2",
"ra-ui-materialui": "^3.0.0-beta.6",
"react-final-form": "^6.3.0",
"react-final-form": "^6.3.3",
"react-final-form-arrays": "^3.1.1",
"react-redux": "^7.1.0",
"react-router": "^5.1.0",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12682,13 +12682,13 @@ react-final-form-arrays@^3.1.1:
dependencies:
"@babel/runtime" "^7.4.5"

react-final-form@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/react-final-form/-/react-final-form-6.3.0.tgz#b85ae123a3796b3e0c8f56033c8a5037f4497e76"
integrity sha512-jijhXR1fFGUBQwNOSqF4MK8XJO7Ynl1p8vcFsnQS0INSkGI52+4IagjUgtHj3w8EviIHPFK/Eflji6FELUl07w==
react-final-form@^6.3.3:
version "6.3.3"
resolved "https://registry.yarnpkg.com/react-final-form/-/react-final-form-6.3.3.tgz#8856a92278de2733f83e88c75d9ef347294a66a0"
integrity sha512-hFLwLpLasywky46SovNEGlym7+N+3RKge1/cg+/fVec/YY0l4g0ihgjRof6PbkiYe4qGjKbwbrvlgfZ9/Uf8vw==
dependencies:
"@babel/runtime" "^7.4.5"
ts-essentials "^2.0.8"
ts-essentials "^3.0.2"

react-is@^16.5.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0:
version "16.9.0"
Expand Down Expand Up @@ -14830,10 +14830,10 @@ tryer@^1.0.1:
resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==

ts-essentials@^2.0.8:
version "2.0.12"
resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745"
integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==
ts-essentials@^3.0.2:
version "3.0.4"
resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-3.0.4.tgz#e783fc31ddce38e19429d2e7171d1c42654f3715"
integrity sha512-lVxvv4CzJURUagjsE3D2PwMK3yVZw0eGXWSlvXVI/cY5vICt5yQ/Cx9Row5fKRcy/rXXz1wzmmVHQtjJoL+lvg==

ts-invariant@^0.4.0:
version "0.4.4"
Expand Down

0 comments on commit bd2b57a

Please sign in to comment.