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

chore: backport relations search fix #19070

Merged
merged 1 commit into from
Dec 15, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const RelationInput = ({

const handleMenuOpen = (isOpen) => {
if (isOpen) {
onSearch();
onSearch(textValue);
}
};

Expand Down Expand Up @@ -221,7 +221,7 @@ const RelationInput = ({
<ComboboxWrapper marginRight="auto" maxWidth={size <= 6 ? '100%' : '70%'} width="100%">
<Combobox
ref={fieldRef}
autocomplete="list"
autocomplete="none"
error={error}
name={name}
hint={description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ exports[`Content-Manager || RelationInput should render and match snapshot 1`] =
class="c10 c11"
>
<input
aria-autocomplete="list"
aria-autocomplete="none"
aria-controls="radix-:r4:"
aria-describedby="1-hint 1-error"
aria-disabled="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe('useRelation', () => {
});

expect(spy).toBeCalledWith('/', {
params: { _q: 'something', _filter: '$startsWithi', limit: 10, page: 1 },
params: { _q: 'something', _filter: '$containsi', limit: 10, page: 1 },
});
});

Expand All @@ -284,7 +284,7 @@ describe('useRelation', () => {
expect(spy).toBeCalledWith(expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: 5,
page: expect.any(Number),
},
Expand Down Expand Up @@ -316,15 +316,15 @@ describe('useRelation', () => {
expect(spy).toHaveBeenNthCalledWith(1, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 1,
},
});
expect(spy).toHaveBeenNthCalledWith(2, expect.any(String), {
params: {
_q: 'something',
_filter: '$startsWithi',
_filter: '$containsi',
limit: expect.any(Number),
page: 2,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const useRelation = (cacheKey, { relation, search }) => {
setSearchParams({
...options,
_q: term,
_filter: '$startsWithi',
_filter: '$containsi',
});
};

Expand Down
Loading