mirror of
https://github.com/strapi/strapi.git
synced 2025-12-05 03:21:22 +00:00
update: localization attribute filter
This commit is contained in:
parent
b1ce10f7f8
commit
0c37e31344
@ -1,9 +1,11 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useIntl } from 'react-intl';
|
||||
import useAllowedAttributes from './hooks/useAllowedAttributes';
|
||||
import Filters from './Filters';
|
||||
|
||||
const AttributeFilter = ({ contentType, slug, metadatas }) => {
|
||||
const { formatMessage } = useIntl();
|
||||
const allowedAttributes = useAllowedAttributes(contentType, slug);
|
||||
const displayedFilters = allowedAttributes.map(name => {
|
||||
const attribute = contentType.attributes[name];
|
||||
@ -18,7 +20,7 @@ const AttributeFilter = ({ contentType, slug, metadatas }) => {
|
||||
|
||||
return {
|
||||
name,
|
||||
metadatas: { label },
|
||||
metadatas: { label: formatMessage({ id: label }) },
|
||||
fieldSchema: { type, options, mainField },
|
||||
trackedEvent,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user