mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +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 PropTypes from 'prop-types';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { Typography } from '@strapi/design-system';
|
||||
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
@ -90,6 +91,12 @@ const DynamicTable = ({
|
||||
sortable: false,
|
||||
},
|
||||
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} />;
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user