Merge pull request #17131 from strapi/fix/review-worflow-column

This commit is contained in:
markkaylor 2023-06-29 12:10:40 +02:00 committed by GitHub
commit 1b09113fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,7 @@ import {
} from '@strapi/helper-plugin';
import { ArrowLeft, Cog, Plus } from '@strapi/icons';
import axios from 'axios';
import getReviewWorkflowsColumn from 'ee_else_ce/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn';
import isEqual from 'lodash/isEqual';
import PropTypes from 'prop-types';
import { stringify } from 'qs';
@ -391,6 +392,17 @@ function ListView({
return formattedHeaders;
}
// this should not exist. Ideally we would use registerHook() similar to what has been done
// in the i18n plugin. In order to do that review-workflows should have been a plugin. In
// a future iteration we need to find a better pattern.
// In CE this will return null - in EE a column definition including the custom formatting component.
const reviewWorkflowColumn = getReviewWorkflowsColumn(layout);
if (reviewWorkflowColumn) {
formattedHeaders.push(reviewWorkflowColumn);
}
return [
...formattedHeaders,
{