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

[RFR] Fix ReferenceArrayInput ignores default filter on search #2583

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 10 additions & 10 deletions examples/simple/src/posts/PostEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ const EditActions = ({
resource,
...rest
}) => (
<CardActions className={className} {...rest}>
<CloneButton
className="button-clone"
basePath={basePath}
record={data}
/>
{hasShow && <ShowButton basePath={basePath} record={data} />}
</CardActions>
);
<CardActions className={className} {...rest}>
<CloneButton
className="button-clone"
basePath={basePath}
record={data}
/>
{hasShow && <ShowButton basePath={basePath} record={data} />}
</CardActions>
);

const PostEdit = props => (
<Edit title={<PostTitle />} actions={<EditActions />} {...props}>
Expand Down Expand Up @@ -83,7 +83,7 @@ const PostEdit = props => (
/>
</FormTab>
<FormTab label="post.form.miscellaneous">
<ReferenceArrayInput reference="tags" source="tags">
<ReferenceArrayInput reference="tags" source="tags" filter={{ published: true }}>
<AutocompleteArrayInput />
</ReferenceArrayInput>
<ArrayInput source="backlinks">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,15 @@ export class ReferenceArrayInputController extends Component {
source,
resource,
referenceSource,
filter: defaultFilter,
} = props;
const { pagination, sort, filter } = this.params;
crudGetMatching(
reference,
referenceSource(resource, source),
pagination,
sort,
filter
{ ...filter, ...defaultFilter }
);
};

Expand Down