Fix dropdown list label picker

This commit is contained in:
soupette 2019-07-31 16:03:59 +02:00
parent 0a3b692a87
commit 2a229141f1

View File

@ -2,7 +2,7 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-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 {
ButtonDropdown,
@ -130,7 +130,12 @@ function ListView({
const getAllLabels = () => {
return sortBy(
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 => ({
name: label,
value: getListLayout().includes(label),