[BUG] pagination, the query is undefined
Environment
Please provide as many details as you can:
- Hosting type
- [] Form.io
- [x] Local deployment
- Version:
- Formio.js version: 2.0.0-beta.3
- Frontend framework: react
- Browser: firefox
- Browser version:
Steps to Reproduce
- Form grid shows the filtered forms based on getForms query
- click a specific page number
- the forms are filtered based on the number but not and on query
Expected behavior
It should filter the forms based on query and page
Observed behavior
Filters only on page
Example
If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.
For code or form JSON, please enclose in a code block:
render() {
const { forms, onAction, getForms, errors, auth, queryFromState } = this.props;
if (forms.isActive) {
return <Loading />;
}
return (
<div>
<Errors errors={errors} />
{auth.is.administrator ? <h3>Administrator</h3> : null}
{auth.is.authenticated ? <h3>Authenticated</h3> : null}
<FormGrid
forms={forms}
operations={operations(auth.is.administrator)}
onAction={onAction}
getForms={getForms}
/>
{/* <Link className="btn btn-primary" to="/form/create"><i className="fa fa-plus"></i> Create Form</Link> */}
</div>
);
}
};
const mapDispatchToProps = dispatch => {
return {
getForms: (page, query) => {
dispatch(indexForms('forms', page, query));
},
};
};
Can you try running the latest version of react and see if you are still seeing this issue? The latest version of react is 4.3.0.
I have upgraded formio-react to 4.3.0, formiojs to ^4.9.10, still the same. Query param in getForms is undefined. It looks like it needs to pass the query param. Right now I think it gets only the page from onSelect event in Pagination component
Could you please provide a JSFiddle of this issue occurring?
It is the first time I am using jsfiddle, I do not know if this is what you are expecting, I can sent screenshots of the app if you like. https://jsfiddle.net/sgjk4ra5/
An extra property could be added in FormsGrid, for example query, and then we could have an extra function like onSort, let's call it onPage =(page) => {}, onPage={this.onPage}. There we could call getForms with the query param too. Just a thought
I am closing the issue as it was created too long ago and there are no new comments here. I hope it was resolved. If not, please reopen it. Thanks!