mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 02:16:03 +00:00
Fix: bulk publish modified entry status (#20399)
* fix: updated publication status for modified entry * fix: handled modified entry to unpublish bulk action along with bulk publish
This commit is contained in:
parent
c579e0b62b
commit
08850ba05e
@ -385,7 +385,7 @@ const UnpublishAction: BulkActionComponent = ({ documents, model }) => {
|
||||
const showUnpublishButton =
|
||||
hasDraftAndPublishEnabled &&
|
||||
hasPublishPermission &&
|
||||
documents.some((entry) => entry.status === 'published');
|
||||
documents.some((entry) => entry.status === 'published' || entry.status === 'modified');
|
||||
|
||||
if (!showUnpublishButton) return null;
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ import {
|
||||
Loader,
|
||||
TypographyComponent,
|
||||
} from '@strapi/design-system';
|
||||
import { Pencil, CrossCircle, CheckCircle } from '@strapi/icons';
|
||||
import { Pencil, CrossCircle, CheckCircle, ArrowsCounterClockwise } from '@strapi/icons';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { styled } from 'styled-components';
|
||||
@ -80,13 +80,10 @@ const formatErrorMessages = (errors: FormErrors, parentKey: string, formatMessag
|
||||
|
||||
interface EntryValidationTextProps {
|
||||
validationErrors?: FormErrors;
|
||||
isPublished?: boolean;
|
||||
status: string;
|
||||
}
|
||||
|
||||
const EntryValidationText = ({
|
||||
validationErrors,
|
||||
isPublished = false,
|
||||
}: EntryValidationTextProps) => {
|
||||
const EntryValidationText = ({ validationErrors, status }: EntryValidationTextProps) => {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
if (validationErrors) {
|
||||
@ -106,7 +103,7 @@ const EntryValidationText = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (isPublished) {
|
||||
if (status === 'published') {
|
||||
return (
|
||||
<Flex gap={2}>
|
||||
<CheckCircle fill="success600" />
|
||||
@ -120,6 +117,20 @@ const EntryValidationText = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (status === 'modified') {
|
||||
return (
|
||||
<Flex gap={2}>
|
||||
<ArrowsCounterClockwise fill="alternative600" />
|
||||
<Typography>
|
||||
{formatMessage({
|
||||
id: 'content-manager.bulk-publish.modified',
|
||||
defaultMessage: 'Ready to publish changes',
|
||||
})}
|
||||
</Typography>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex gap={2}>
|
||||
<CheckCircle fill="success600" />
|
||||
@ -208,7 +219,7 @@ const SelectedEntriesTableContent = ({
|
||||
) : (
|
||||
<EntryValidationText
|
||||
validationErrors={validationErrors[row.documentId]}
|
||||
isPublished={row.status === 'published'}
|
||||
status={row.status}
|
||||
/>
|
||||
)}
|
||||
</Table.Cell>
|
||||
|
||||
@ -63,6 +63,7 @@
|
||||
"components.SettingsViewWrapper.pluginHeader.description.list-settings": "Define the settings of the list view.",
|
||||
"components.SettingsViewWrapper.pluginHeader.title": "Configure the view — {name}",
|
||||
"bulk-publish.already-published": "Already Published",
|
||||
"bulk-publish.modified": "Ready to publish changes",
|
||||
"components.TableDelete.delete": "Delete all",
|
||||
"components.TableDelete.deleteSelected": "Delete selected",
|
||||
"components.TableDelete.label": "{number, plural, one {# entry} other {# entries}} selected",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user