mirror of
https://github.com/strapi/strapi.git
synced 2025-09-08 08:08:18 +00:00
Fix react-intl in table head
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
2496f2559b
commit
566de24d88
@ -54,7 +54,10 @@ const FieldPicker = ({ layout }) => {
|
|||||||
{allAllowedHeaders.map(header => {
|
{allAllowedHeaders.map(header => {
|
||||||
return (
|
return (
|
||||||
<Option key={header.name} value={header.name}>
|
<Option key={header.name} value={header.name}>
|
||||||
{formatMessage(header.intlLabel)}
|
{formatMessage({
|
||||||
|
id: header.intlLabel.id || header.name,
|
||||||
|
defaultMessage: header.intlLabel.defaultMessage || header.name,
|
||||||
|
})}
|
||||||
</Option>
|
</Option>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
@ -52,7 +52,7 @@ const TableHead = ({
|
|||||||
{ id: 'components.TableHeader.sort', defaultMessage: 'Sort on {label}' },
|
{ id: 'components.TableHeader.sort', defaultMessage: 'Sort on {label}' },
|
||||||
{ label }
|
{ label }
|
||||||
);
|
);
|
||||||
const intlLabel = formatMessage({ id: label, defaultMessage: label });
|
const intlLabel = formatMessage({ id: label || name, defaultMessage: label || name });
|
||||||
|
|
||||||
const handleClickSort = (shouldAllowClick = true) => {
|
const handleClickSort = (shouldAllowClick = true) => {
|
||||||
if (isSortable && shouldAllowClick) {
|
if (isSortable && shouldAllowClick) {
|
||||||
|
@ -45,7 +45,7 @@ const AttributeTag = ({ attribute, filter, onClick, operator, value }) => {
|
|||||||
return (
|
return (
|
||||||
<Box padding={1} onClick={handleClick}>
|
<Box padding={1} onClick={handleClick}>
|
||||||
<Tag icon={<Close />}>
|
<Tag icon={<Close />}>
|
||||||
{attribute.metadatas.label}
|
{attribute.metadatas.label || attribute.name}
|
||||||
{formatMessage({
|
{formatMessage({
|
||||||
id: `components.FilterOptions.FILTER_TYPES.${operator}`,
|
id: `components.FilterOptions.FILTER_TYPES.${operator}`,
|
||||||
defaultMessage: operator,
|
defaultMessage: operator,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user