mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 17:29:14 +00:00
feat: change includes to startsWith in CM & CTB
This commit is contained in:
parent
ef4f3b64fe
commit
802f880729
@ -27,7 +27,7 @@ const LeftMenu = () => {
|
|||||||
const modelLinksSelector = useMemo(makeSelectModelLinks, []);
|
const modelLinksSelector = useMemo(makeSelectModelLinks, []);
|
||||||
const { collectionTypeLinks, singleTypeLinks } = useSelector(modelLinksSelector, shallowEqual);
|
const { collectionTypeLinks, singleTypeLinks } = useSelector(modelLinksSelector, shallowEqual);
|
||||||
|
|
||||||
const { includes } = useFilter(locale, {
|
const { startsWith } = useFilter(locale, {
|
||||||
sensitivity: 'base',
|
sensitivity: 'base',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ const LeftMenu = () => {
|
|||||||
/**
|
/**
|
||||||
* Filter by the search value
|
* Filter by the search value
|
||||||
*/
|
*/
|
||||||
.filter((link) => includes(link.title, search))
|
.filter((link) => startsWith(link.title, search))
|
||||||
/**
|
/**
|
||||||
* Sort correctly using the language
|
* Sort correctly using the language
|
||||||
*/
|
*/
|
||||||
@ -80,7 +80,7 @@ const LeftMenu = () => {
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
})),
|
})),
|
||||||
[collectionTypeLinks, search, singleTypeLinks, includes, formatMessage, formatter]
|
[collectionTypeLinks, search, singleTypeLinks, startsWith, formatMessage, formatter]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
|
@ -25,7 +25,7 @@ const useContentTypeBuilderMenu = () => {
|
|||||||
const { onOpenModalCreateSchema, onOpenModalEditCategory } = useFormModalNavigation();
|
const { onOpenModalCreateSchema, onOpenModalEditCategory } = useFormModalNavigation();
|
||||||
const { locale } = useIntl();
|
const { locale } = useIntl();
|
||||||
|
|
||||||
const { includes } = useFilter(locale, {
|
const { startsWith } = useFilter(locale, {
|
||||||
sensitivity: 'base',
|
sensitivity: 'base',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ const useContentTypeBuilderMenu = () => {
|
|||||||
return {
|
return {
|
||||||
...section,
|
...section,
|
||||||
links: section.links
|
links: section.links
|
||||||
.filter((link) => includes(link.title, search))
|
.filter((link) => startsWith(link.title, search))
|
||||||
.sort((a, b) => formatter.compare(a.title, b.title)),
|
.sort((a, b) => formatter.compare(a.title, b.title)),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user