mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 17:29:14 +00:00
Bug/collection type sort asc (#8706)
* fixed leftmenu sorting bug in content-types-builder Signed-off-by: akhilmhdh <akhilmhdh@gmail.com> * changed js toLowerCase to lodash toLower Signed-off-by: akhilmhdh <akhilmhdh@gmail.com> Co-authored-by: cyril lopez <cyril.lpz@gmail.com>
This commit is contained in:
parent
bbff091b88
commit
96db1488bc
@ -1,6 +1,6 @@
|
|||||||
import React, { isValidElement, useState } from 'react';
|
import React, { isValidElement, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { get, isEmpty, isObject } from 'lodash';
|
import { get, isEmpty, isObject, toLower } from 'lodash';
|
||||||
import { useGlobalContext } from '../../contexts/GlobalContext';
|
import { useGlobalContext } from '../../contexts/GlobalContext';
|
||||||
import matchSorter from 'match-sorter';
|
import matchSorter from 'match-sorter';
|
||||||
import LeftMenuLink from '../LeftMenuLink';
|
import LeftMenuLink from '../LeftMenuLink';
|
||||||
@ -54,12 +54,13 @@ function LeftMenuList({ customLink, links, title, searchable }) {
|
|||||||
return links.map(link => {
|
return links.map(link => {
|
||||||
return {
|
return {
|
||||||
...link,
|
...link,
|
||||||
links: matchSorter(link.links, search, { keys: ['title'] }),
|
links: matchSorter(link.links, toLower(search), {
|
||||||
|
keys: [item => toLower(item.title)],
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
return matchSorter(links, toLower(search), { keys: [item => toLower(item.title)] });
|
||||||
return matchSorter(links, search, { keys: ['title'] });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderCompo = (link, i) => {
|
const renderCompo = (link, i) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user