mirror of
https://github.com/strapi/strapi.git
synced 2025-11-19 03:29:47 +00:00
Fix dropdown list label picker
This commit is contained in:
parent
0a3b692a87
commit
2a229141f1
@ -2,7 +2,7 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { bindActionCreators, compose } from 'redux';
|
import { bindActionCreators, compose } from 'redux';
|
||||||
import { capitalize, get, isEmpty, sortBy } from 'lodash';
|
import { capitalize, get, sortBy } from 'lodash';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import {
|
import {
|
||||||
ButtonDropdown,
|
ButtonDropdown,
|
||||||
@ -130,7 +130,12 @@ function ListView({
|
|||||||
const getAllLabels = () => {
|
const getAllLabels = () => {
|
||||||
return sortBy(
|
return sortBy(
|
||||||
Object.keys(getMetaDatas())
|
Object.keys(getMetaDatas())
|
||||||
.filter(key => !isEmpty(getMetaDatas([key, 'list'])))
|
.filter(
|
||||||
|
key =>
|
||||||
|
!['json', 'group', 'relation', 'media', 'richtext'].includes(
|
||||||
|
get(layouts, [slug, 'schema', 'attributes', key, 'type'], '')
|
||||||
|
)
|
||||||
|
)
|
||||||
.map(label => ({
|
.map(label => ({
|
||||||
name: label,
|
name: label,
|
||||||
value: getListLayout().includes(label),
|
value: getListLayout().includes(label),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user