mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
CM: Display review stage in empty state instead of crashing the app
This commit is contained in:
parent
23abbc63d8
commit
fd75b0bb0f
@ -1,6 +1,7 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
import { Typography } from '@strapi/design-system';
|
||||||
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
|
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
@ -90,6 +91,12 @@ const DynamicTable = ({
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
},
|
},
|
||||||
cellFormatter({ strapi_reviewWorkflows_stage }) {
|
cellFormatter({ strapi_reviewWorkflows_stage }) {
|
||||||
|
// if entities are created e.g. through lifecycle methods
|
||||||
|
// they may not have a stage assigned
|
||||||
|
if (!strapi_reviewWorkflows_stage) {
|
||||||
|
return <Typography textColor="neutral800">-</Typography>;
|
||||||
|
}
|
||||||
|
|
||||||
return <ReviewWorkflowsStage name={strapi_reviewWorkflows_stage.name} />;
|
return <ReviewWorkflowsStage name={strapi_reviewWorkflows_stage.name} />;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user