@strapi/content-manager 5.39.0 → 5.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/admin/hooks/useDocument.js +21 -5
  2. package/dist/admin/hooks/useDocument.js.map +1 -1
  3. package/dist/admin/hooks/useDocument.mjs +22 -6
  4. package/dist/admin/hooks/useDocument.mjs.map +1 -1
  5. package/dist/admin/pages/EditView/components/DocumentActions.js +1 -0
  6. package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
  7. package/dist/admin/pages/EditView/components/DocumentActions.mjs +3 -2
  8. package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
  9. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs +4 -4
  10. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs.map +1 -1
  11. package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js +71 -44
  12. package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js.map +1 -1
  13. package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs +54 -46
  14. package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs.map +1 -1
  15. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +107 -88
  16. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
  17. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +109 -90
  18. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
  19. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js +91 -106
  20. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js.map +1 -1
  21. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs +94 -109
  22. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs.map +1 -1
  23. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js +43 -23
  24. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js.map +1 -1
  25. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs +45 -25
  26. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs.map +1 -1
  27. package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs +2 -2
  28. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +30 -19
  29. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
  30. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +34 -23
  31. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
  32. package/dist/admin/pages/EditView/components/FormInputs/UID.mjs +1 -1
  33. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs +1 -1
  34. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.mjs +1 -1
  35. package/dist/admin/pages/EditView/components/FormLayout.js +23 -3
  36. package/dist/admin/pages/EditView/components/FormLayout.js.map +1 -1
  37. package/dist/admin/pages/EditView/components/FormLayout.mjs +4 -3
  38. package/dist/admin/pages/EditView/components/FormLayout.mjs.map +1 -1
  39. package/dist/admin/pages/EditView/components/Header.js +59 -9
  40. package/dist/admin/pages/EditView/components/Header.js.map +1 -1
  41. package/dist/admin/pages/EditView/components/Header.mjs +63 -13
  42. package/dist/admin/pages/EditView/components/Header.mjs.map +1 -1
  43. package/dist/admin/pages/EditView/components/InputRenderer.js +19 -7
  44. package/dist/admin/pages/EditView/components/InputRenderer.js.map +1 -1
  45. package/dist/admin/pages/EditView/components/InputRenderer.mjs +20 -8
  46. package/dist/admin/pages/EditView/components/InputRenderer.mjs.map +1 -1
  47. package/dist/admin/pages/ListView/ListViewPage.js +47 -0
  48. package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
  49. package/dist/admin/pages/ListView/ListViewPage.mjs +50 -3
  50. package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
  51. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.js +15 -19
  52. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.js.map +1 -1
  53. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.mjs +15 -20
  54. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.mjs.map +1 -1
  55. package/dist/admin/src/pages/EditView/components/FormInputs/Component/NonRepeatable.d.ts +3 -2
  56. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Repeatable.d.ts +3 -2
  57. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +3 -3
  58. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +1 -1
  59. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +1 -1
  60. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +3 -0
  61. package/dist/admin/src/pages/ListView/components/Filters.d.ts +3 -0
  62. package/dist/admin/translations/en.json.js +3 -0
  63. package/dist/admin/translations/en.json.js.map +1 -1
  64. package/dist/admin/translations/en.json.mjs +3 -0
  65. package/dist/admin/translations/en.json.mjs.map +1 -1
  66. package/dist/server/controllers/collection-types.js +25 -28
  67. package/dist/server/controllers/collection-types.js.map +1 -1
  68. package/dist/server/controllers/collection-types.mjs +20 -23
  69. package/dist/server/controllers/collection-types.mjs.map +1 -1
  70. package/dist/server/controllers/single-types.js +2 -1
  71. package/dist/server/controllers/single-types.js.map +1 -1
  72. package/dist/server/controllers/single-types.mjs +2 -1
  73. package/dist/server/controllers/single-types.mjs.map +1 -1
  74. package/dist/server/services/document-manager.js +10 -9
  75. package/dist/server/services/document-manager.js.map +1 -1
  76. package/dist/server/services/document-manager.mjs +10 -9
  77. package/dist/server/services/document-manager.mjs.map +1 -1
  78. package/dist/server/services/document-metadata.js +84 -41
  79. package/dist/server/services/document-metadata.js.map +1 -1
  80. package/dist/server/services/document-metadata.mjs +85 -42
  81. package/dist/server/services/document-metadata.mjs.map +1 -1
  82. package/dist/server/services/populate-builder.js +11 -0
  83. package/dist/server/services/populate-builder.js.map +1 -1
  84. package/dist/server/services/populate-builder.mjs +12 -1
  85. package/dist/server/services/populate-builder.mjs.map +1 -1
  86. package/dist/server/services/utils/configuration/attributes.js +2 -1
  87. package/dist/server/services/utils/configuration/attributes.js.map +1 -1
  88. package/dist/server/services/utils/configuration/attributes.mjs +2 -1
  89. package/dist/server/services/utils/configuration/attributes.mjs.map +1 -1
  90. package/dist/server/services/utils/draft.js +8 -1
  91. package/dist/server/services/utils/draft.js.map +1 -1
  92. package/dist/server/services/utils/draft.mjs +8 -1
  93. package/dist/server/services/utils/draft.mjs.map +1 -1
  94. package/dist/server/services/utils/populate.js +73 -8
  95. package/dist/server/services/utils/populate.js.map +1 -1
  96. package/dist/server/services/utils/populate.mjs +73 -9
  97. package/dist/server/services/utils/populate.mjs.map +1 -1
  98. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  99. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  100. package/dist/server/src/controllers/utils/metadata.d.ts +2 -2
  101. package/dist/server/src/index.d.ts +18 -3
  102. package/dist/server/src/index.d.ts.map +1 -1
  103. package/dist/server/src/services/document-manager.d.ts +9 -3
  104. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  105. package/dist/server/src/services/document-metadata.d.ts +8 -0
  106. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  107. package/dist/server/src/services/index.d.ts +18 -3
  108. package/dist/server/src/services/index.d.ts.map +1 -1
  109. package/dist/server/src/services/populate-builder.d.ts +7 -0
  110. package/dist/server/src/services/populate-builder.d.ts.map +1 -1
  111. package/dist/server/src/services/utils/configuration/attributes.d.ts.map +1 -1
  112. package/dist/server/src/services/utils/draft.d.ts.map +1 -1
  113. package/dist/server/src/services/utils/populate.d.ts +21 -17
  114. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  115. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"PublishAction.mjs","sources":["../../../../../../admin/src/pages/ListView/components/BulkActions/PublishAction.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n FormErrors,\n getYupValidationErrors,\n Table,\n useQueryParams,\n useTable,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n Flex,\n IconButton,\n Loader,\n Modal,\n Tooltip,\n Typography,\n TypographyComponent,\n RawTable,\n Tr,\n Td,\n Tbody,\n} from '@strapi/design-system';\nimport { ArrowsCounterClockwise, CheckCircle, CrossCircle, Pencil } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { Link, useLocation } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport { ValidationError } from 'yup';\n\nimport { useDocumentRBAC } from '../../../../features/DocumentRBAC';\nimport { useContentTypeSchema } from '../../../../hooks/useContentTypeSchema';\nimport { useDocumentActions } from '../../../../hooks/useDocumentActions';\nimport { useDocLayout } from '../../../../hooks/useDocumentLayout';\nimport { contentManagerApi } from '../../../../services/api';\nimport {\n useGetAllDocumentsQuery,\n usePublishManyDocumentsMutation,\n} from '../../../../services/documents';\nimport { buildValidParams } from '../../../../utils/api';\nimport { getTranslation } from '../../../../utils/translations';\nimport { createYupSchema } from '../../../../utils/validation';\nimport { DocumentStatus } from '../../../EditView/components/DocumentStatus';\n\nimport { ConfirmDialogPublishAll, ConfirmDialogPublishAllProps } from './ConfirmBulkActionDialog';\n\nimport type { BulkActionComponent } from '../../../../content-manager';\nimport type { Document } from '../../../../hooks/useDocument';\n\nconst TypographyMaxWidth = styled<TypographyComponent>(Typography)`\n max-width: 300px;\n`;\n\nconst TableComponent = styled(RawTable)`\n width: 100%;\n table-layout: fixed;\n td:first-child {\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n }\n td:first-of-type {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * EntryValidationText\n * -----------------------------------------------------------------------------------------------*/\n\nconst formatErrorMessages = (errors: FormErrors, parentKey: string, formatMessage: any) => {\n const messages: string[] = [];\n\n Object.entries(errors).forEach(([key, value]) => {\n const currentKey = parentKey ? `${parentKey}.${key}` : key;\n\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n if ('id' in value && 'defaultMessage' in value) {\n messages.push(\n formatMessage(\n {\n id: `${value.id}.withField`,\n defaultMessage: value.defaultMessage,\n },\n { field: currentKey }\n )\n );\n } else {\n messages.push(\n ...formatErrorMessages(\n // @ts-expect-error TODO: check why value is not compatible with FormErrors\n value,\n currentKey,\n formatMessage\n )\n );\n }\n } else {\n messages.push(\n formatMessage(\n {\n id: `${value}.withField`,\n defaultMessage: value,\n },\n { field: currentKey }\n )\n );\n }\n });\n\n return messages;\n};\n\ninterface EntryValidationTextProps {\n validationErrors?: FormErrors;\n status: string;\n}\n\nconst EntryValidationText = ({ validationErrors, status }: EntryValidationTextProps) => {\n const { formatMessage } = useIntl();\n\n if (validationErrors) {\n const validationErrorsMessages = formatErrorMessages(validationErrors, '', formatMessage).join(\n ' '\n );\n\n return (\n <Flex gap={2}>\n <CrossCircle fill=\"danger600\" />\n <Tooltip label={validationErrorsMessages}>\n <TypographyMaxWidth textColor=\"danger600\" variant=\"omega\" fontWeight=\"bold\" ellipsis>\n {validationErrorsMessages}\n </TypographyMaxWidth>\n </Tooltip>\n </Flex>\n );\n }\n\n if (status === 'published') {\n return (\n <Flex gap={2}>\n <CheckCircle fill=\"success600\" />\n <Typography textColor=\"success600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'content-manager.bulk-publish.already-published',\n defaultMessage: 'Already Published',\n })}\n </Typography>\n </Flex>\n );\n }\n\n if (status === 'modified') {\n return (\n <Flex gap={2}>\n <ArrowsCounterClockwise fill=\"alternative600\" />\n <Typography textColor=\"alternative600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'content-manager.bulk-publish.modified',\n defaultMessage: 'Ready to publish changes',\n })}\n </Typography>\n </Flex>\n );\n }\n\n return (\n <Flex gap={2}>\n <CheckCircle fill=\"success600\" />\n <Typography textColor=\"success600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'app.utils.ready-to-publish',\n defaultMessage: 'Ready to publish',\n })}\n </Typography>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SelectedEntriesTableContent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SelectedEntriesTableContentProps {\n isPublishing?: boolean;\n rowsToDisplay?: TableRow[];\n entriesToPublish?: TableRow['documentId'][];\n validationErrors: Record<string, EntryValidationTextProps['validationErrors']>;\n}\n\nconst TABLE_HEADERS = [\n { name: 'id', label: 'id' },\n { name: 'name', label: 'name' },\n { name: 'status', label: 'status' },\n { name: 'publicationStatus', label: 'Publication status' },\n];\n\nconst SelectedEntriesTableContent = ({\n isPublishing,\n rowsToDisplay = [],\n entriesToPublish = [],\n validationErrors = {},\n}: SelectedEntriesTableContentProps) => {\n const { pathname } = useLocation();\n const { formatMessage } = useIntl();\n\n const {\n list: {\n settings: { mainField },\n },\n } = useDocLayout();\n\n const shouldDisplayMainField = mainField != null && mainField !== 'id';\n\n return (\n <Table.Content>\n <Table.Head>\n <Table.HeaderCheckboxCell />\n {TABLE_HEADERS.filter((head) => head.name !== 'name' || shouldDisplayMainField).map(\n (head) => (\n <Table.HeaderCell key={head.name} {...head} />\n )\n )}\n </Table.Head>\n <Table.Loading />\n <Table.Body>\n {rowsToDisplay.map((row) => (\n <Table.Row key={row.id}>\n <Table.CheckboxCell id={row.id} />\n <Table.Cell>\n <Typography>{row.id}</Typography>\n </Table.Cell>\n {shouldDisplayMainField && (\n <Table.Cell>\n <Typography>{row[mainField as keyof TableRow]}</Typography>\n </Table.Cell>\n )}\n <Table.Cell>\n <DocumentStatus status={row.status} maxWidth={'min-content'} />\n </Table.Cell>\n <Table.Cell>\n {isPublishing && entriesToPublish.includes(row.documentId) ? (\n <Flex gap={2}>\n <Typography>\n {formatMessage({\n id: 'content-manager.success.record.publishing',\n defaultMessage: 'Publishing...',\n })}\n </Typography>\n <Loader small />\n </Flex>\n ) : (\n <EntryValidationText\n validationErrors={validationErrors[row.documentId]}\n status={row.status}\n />\n )}\n </Table.Cell>\n <Table.Cell>\n <Flex>\n <IconButton\n tag={Link}\n to={{\n pathname: `${pathname}/${row.documentId}`,\n search: row.locale && `?plugins[i18n][locale]=${row.locale}`,\n }}\n state={{ from: pathname }}\n label={formatMessage({\n id: 'content-manager.bulk-publish.edit',\n defaultMessage: 'Edit',\n })}\n target=\"_blank\"\n marginLeft=\"auto\"\n variant=\"ghost\"\n >\n <Pencil width={'1.6rem'} height={'1.6rem'} />\n </IconButton>\n </Flex>\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Content>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublicationStatusSummary\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PublicationStatusSummaryProps {\n count: number;\n icon: React.ReactNode;\n message: string;\n textColor: string;\n}\n\nconst PublicationStatusSummary = ({\n count,\n icon,\n message,\n textColor,\n}: PublicationStatusSummaryProps) => {\n return (\n <Flex justifyContent=\"space-between\" flex={1} gap={3}>\n <Flex gap={2}>\n {icon}\n <Typography textColor={textColor} fontWeight=\"bold\">\n {message}\n </Typography>\n </Flex>\n <Typography fontWeight=\"bold\">{count}</Typography>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublicationStatusGrid\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PublicationStatusGridProps {\n entriesReadyToPublishCount: number;\n entriesModifiedCount: number;\n entriesPublishedCount: number;\n entriesWithErrorsCount: number;\n}\n\nconst PublicationStatusGrid = ({\n entriesReadyToPublishCount,\n entriesPublishedCount,\n entriesModifiedCount,\n entriesWithErrorsCount,\n}: PublicationStatusGridProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Box hasRadius borderColor=\"neutral150\">\n <TableComponent colCount={2} rowCount={2}>\n <Tbody>\n <Tr>\n <Td>\n <PublicationStatusSummary\n textColor=\"success600\"\n count={entriesReadyToPublishCount}\n icon={<CheckCircle fill=\"success600\" />}\n message={formatMessage({\n id: 'app.utils.ready-to-publish',\n defaultMessage: 'Ready to publish',\n })}\n />\n </Td>\n <Td>\n <PublicationStatusSummary\n textColor=\"success600\"\n count={entriesPublishedCount}\n icon={<CheckCircle fill=\"success600\" />}\n message={formatMessage({\n id: 'app.utils.already-published',\n defaultMessage: 'Already published',\n })}\n />\n </Td>\n </Tr>\n <Tr>\n <Td>\n <PublicationStatusSummary\n textColor=\"alternative600\"\n count={entriesModifiedCount}\n icon={<ArrowsCounterClockwise fill=\"alternative600\" />}\n message={formatMessage({\n id: 'content-manager.bulk-publish.modified',\n defaultMessage: 'Ready to publish changes',\n })}\n />\n </Td>\n <Td>\n <PublicationStatusSummary\n textColor=\"danger600\"\n count={entriesWithErrorsCount}\n icon={<CrossCircle fill=\"danger600\" />}\n message={formatMessage({\n id: 'content-manager.bulk-publish.waiting-for-action',\n defaultMessage: 'Waiting for action',\n })}\n />\n </Td>\n </Tr>\n </Tbody>\n </TableComponent>\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SelectedEntriesModalContent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface TableRow extends Document {}\n\ninterface SelectedEntriesModalContentProps {\n listViewSelectedEntries: TableRow[];\n toggleModal: ConfirmDialogPublishAllProps['onToggleDialog'];\n setListViewSelectedDocuments: (documents: TableRow[]) => void;\n model: string;\n}\n\nconst SelectedEntriesModalContent = ({\n listViewSelectedEntries,\n toggleModal,\n setListViewSelectedDocuments,\n model,\n}: SelectedEntriesModalContentProps) => {\n const { formatMessage } = useIntl();\n const { schema, components } = useContentTypeSchema(model);\n const documentIds = listViewSelectedEntries.map(({ documentId }) => documentId);\n\n // We want to keep the selected entries order same as the list view\n const [{ query }] = useQueryParams<{ sort?: string; plugins?: Record<string, any> }>();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n // Fetch the documents based on the selected entries and update the modal table\n const { data, isLoading, isFetching, refetch } = useGetAllDocumentsQuery(\n {\n model,\n params: {\n page: '1',\n pageSize: documentIds.length.toString(),\n sort: query.sort,\n filters: {\n documentId: {\n $in: documentIds,\n },\n },\n locale: query.plugins?.i18n?.locale,\n },\n },\n {\n selectFromResult: ({ data, ...restRes }) => ({ data: data?.results ?? [], ...restRes }),\n }\n );\n\n // Validate the entries based on the schema to show errors if any\n const { rows, validationErrors } = React.useMemo(() => {\n if (data.length > 0 && schema) {\n const validate = createYupSchema(\n schema.attributes,\n components,\n // Since this is the \"Publish\" action, the validation\n // schema must enforce the rules for published entities\n { status: 'published' }\n );\n const validationErrors: Record<TableRow['documentId'], FormErrors> = {};\n const rows = data.map((entry: Document) => {\n try {\n validate.validateSync(entry, { abortEarly: false });\n\n return entry;\n } catch (e) {\n if (e instanceof ValidationError) {\n validationErrors[entry.documentId] = getYupValidationErrors(e);\n }\n\n return entry;\n }\n });\n\n return { rows, validationErrors };\n }\n\n return {\n rows: [],\n validationErrors: {},\n };\n }, [components, data, schema]);\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n\n const { publishMany: bulkPublishAction, isLoading: isPublishing } = useDocumentActions();\n const [, { isLoading: isSubmittingForm }] = usePublishManyDocumentsMutation();\n\n const selectedRows = useTable('publishAction', (state) => state.selectedRows);\n\n // Filter selected entries from the updated modal table rows\n const selectedEntries = rows.filter((entry) =>\n selectedRows.some((selectedEntry) => selectedEntry.documentId === entry.documentId)\n );\n\n const entriesToPublish = selectedEntries\n .filter((entry) => !validationErrors[entry.documentId])\n .map((entry) => entry.documentId);\n\n const selectedEntriesWithErrorsCount = selectedEntries.filter(\n ({ documentId }) => validationErrors[documentId]\n ).length;\n const selectedEntriesPublishedCount = selectedEntries.filter(\n ({ status }) => status === 'published'\n ).length;\n const selectedEntriesModifiedCount = selectedEntries.filter(\n ({ status, documentId }) => status === 'modified' && !validationErrors[documentId]\n ).length;\n const selectedEntriesWithNoErrorsCount =\n selectedEntries.length - selectedEntriesWithErrorsCount - selectedEntriesPublishedCount;\n\n const toggleDialog = () => setIsDialogOpen((prev) => !prev);\n\n const handleConfirmBulkPublish = async () => {\n toggleDialog();\n\n const res = await bulkPublishAction({ model: model, documentIds: entriesToPublish, params });\n if (!('error' in res)) {\n const unpublishedEntries = rows.filter((row) => {\n return !entriesToPublish.includes(row.documentId);\n });\n // Keep selection of the entries in list view that were not published\n setListViewSelectedDocuments(unpublishedEntries);\n }\n };\n\n return (\n <>\n <Modal.Body>\n <PublicationStatusGrid\n entriesReadyToPublishCount={\n selectedEntriesWithNoErrorsCount - selectedEntriesModifiedCount\n }\n entriesPublishedCount={selectedEntriesPublishedCount}\n entriesModifiedCount={selectedEntriesModifiedCount}\n entriesWithErrorsCount={selectedEntriesWithErrorsCount}\n />\n <Box marginTop={7}>\n <SelectedEntriesTableContent\n isPublishing={isSubmittingForm}\n rowsToDisplay={rows}\n entriesToPublish={entriesToPublish}\n validationErrors={validationErrors}\n />\n </Box>\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={toggleModal} variant=\"tertiary\">\n {formatMessage({\n id: 'app.components.Button.cancel',\n defaultMessage: 'Cancel',\n })}\n </Button>\n <Flex gap={2}>\n <Button onClick={refetch} variant=\"tertiary\" loading={isFetching}>\n {formatMessage({ id: 'app.utils.refresh', defaultMessage: 'Refresh' })}\n </Button>\n <Button\n onClick={toggleDialog}\n disabled={\n selectedEntries.length === 0 ||\n selectedEntries.length === selectedEntriesWithErrorsCount ||\n selectedEntriesPublishedCount === selectedEntries.length ||\n isLoading\n }\n loading={isPublishing || isSubmittingForm}\n >\n {formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' })}\n </Button>\n </Flex>\n </Modal.Footer>\n <ConfirmDialogPublishAll\n isOpen={isDialogOpen}\n onToggleDialog={toggleDialog}\n isConfirmButtonLoading={isPublishing || isSubmittingForm}\n onConfirm={handleConfirmBulkPublish}\n />\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublishAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst PublishAction: BulkActionComponent = ({ documents, model }) => {\n const { formatMessage } = useIntl();\n // Publish button visibility\n const hasPublishPermission = useDocumentRBAC('unpublishAction', (state) => state.canPublish);\n const showPublishButton =\n hasPublishPermission && documents.some(({ status }) => status !== 'published');\n\n const setListViewSelectedDocuments = useTable('publishAction', (state) => state.selectRow);\n\n const refetchList = () => {\n contentManagerApi.util.invalidateTags([{ type: 'Document', id: `${model}_LIST` }]);\n };\n\n if (!showPublishButton) return null;\n\n return {\n actionType: 'publish',\n variant: 'tertiary',\n label: formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' }),\n dialog: {\n type: 'modal',\n title: formatMessage({\n id: getTranslation('containers.ListPage.selectedEntriesModal.title'),\n defaultMessage: 'Publish entries',\n }),\n content: ({ onClose }) => {\n return (\n <Table.Root rows={documents} defaultSelectedRows={documents} headers={TABLE_HEADERS}>\n <SelectedEntriesModalContent\n listViewSelectedEntries={documents}\n toggleModal={() => {\n onClose();\n refetchList();\n }}\n setListViewSelectedDocuments={setListViewSelectedDocuments}\n model={model}\n />\n </Table.Root>\n );\n },\n onClose: () => {\n refetchList();\n },\n },\n };\n};\n\nexport { PublishAction, SelectedEntriesModalContent };\n"],"names":["TypographyMaxWidth","styled","Typography","TableComponent","RawTable","theme","colors","neutral150","spaces","formatErrorMessages","errors","parentKey","formatMessage","messages","Object","entries","forEach","key","value","currentKey","Array","isArray","push","id","defaultMessage","field","EntryValidationText","validationErrors","status","useIntl","validationErrorsMessages","join","_jsxs","Flex","gap","_jsx","CrossCircle","fill","Tooltip","label","textColor","variant","fontWeight","ellipsis","CheckCircle","ArrowsCounterClockwise","TABLE_HEADERS","name","SelectedEntriesTableContent","isPublishing","rowsToDisplay","entriesToPublish","pathname","useLocation","list","settings","mainField","useDocLayout","shouldDisplayMainField","Table","Content","Head","HeaderCheckboxCell","filter","head","map","HeaderCell","Loading","Body","row","Row","CheckboxCell","Cell","DocumentStatus","maxWidth","includes","documentId","Loader","small","IconButton","tag","Link","to","search","locale","state","from","target","marginLeft","Pencil","width","height","PublicationStatusSummary","count","icon","message","justifyContent","flex","PublicationStatusGrid","entriesReadyToPublishCount","entriesPublishedCount","entriesModifiedCount","entriesWithErrorsCount","Box","hasRadius","borderColor","colCount","rowCount","Tbody","Tr","Td","SelectedEntriesModalContent","listViewSelectedEntries","toggleModal","setListViewSelectedDocuments","model","schema","components","useContentTypeSchema","documentIds","query","useQueryParams","params","React","useMemo","buildValidParams","data","isLoading","isFetching","refetch","useGetAllDocumentsQuery","page","pageSize","length","toString","sort","filters","$in","plugins","i18n","selectFromResult","restRes","results","rows","validate","createYupSchema","attributes","entry","validateSync","abortEarly","e","ValidationError","getYupValidationErrors","isDialogOpen","setIsDialogOpen","useState","publishMany","bulkPublishAction","useDocumentActions","isSubmittingForm","usePublishManyDocumentsMutation","selectedRows","useTable","selectedEntries","some","selectedEntry","selectedEntriesWithErrorsCount","selectedEntriesPublishedCount","selectedEntriesModifiedCount","selectedEntriesWithNoErrorsCount","toggleDialog","prev","handleConfirmBulkPublish","res","unpublishedEntries","_Fragment","Modal","marginTop","Footer","Button","onClick","loading","disabled","ConfirmDialogPublishAll","isOpen","onToggleDialog","isConfirmButtonLoading","onConfirm","PublishAction","documents","hasPublishPermission","useDocumentRBAC","canPublish","showPublishButton","selectRow","refetchList","contentManagerApi","util","invalidateTags","type","actionType","dialog","title","getTranslation","content","onClose","Root","defaultSelectedRows","headers"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiDA,MAAMA,kBAAAA,GAAqBC,MAAAA,CAA4BC,UAAAA,CAAW;;AAElE,CAAC;AAED,MAAMC,cAAAA,GAAiBF,MAAAA,CAAOG,QAAAA,CAAS;;;;4BAIX,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAAA,CAAMC,MAAM,CAACC,UAAU,CAAC;;;aAGxD,EAAE,CAAC,EAAEF,KAAK,EAAE,GAAKA,KAAAA,CAAMG,MAAM,CAAC,CAAA,CAAE,CAA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A,OAAAA,EAAAA;AACAV,4BAAAA,WAAAA,EAAAA;AACF,wBAAA,CAAA;wBACAjF,4BAAAA,EAA8BA,4BAAAA;wBAC9BC,KAAAA,EAAOA;;;AAIf,YAAA,CAAA;YACA0F,OAAAA,EAAS,IAAA;AACPV,gBAAAA,WAAAA,EAAAA;AACF,YAAA;AACF;AACF,KAAA;AACF;;;;"}
1
+ {"version":3,"file":"PublishAction.mjs","sources":["../../../../../../admin/src/pages/ListView/components/BulkActions/PublishAction.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n FormErrors,\n getYupValidationErrors,\n Table,\n useQueryParams,\n useTable,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n Flex,\n IconButton,\n Loader,\n Modal,\n Tooltip,\n Typography,\n TypographyComponent,\n RawTable,\n Tr,\n Td,\n Tbody,\n} from '@strapi/design-system';\nimport { ArrowsCounterClockwise, CheckCircle, CrossCircle, Pencil } from '@strapi/icons';\nimport { useIntl, type IntlShape } from 'react-intl';\nimport { Link, useLocation } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport { ValidationError } from 'yup';\n\nimport { useDocumentRBAC } from '../../../../features/DocumentRBAC';\nimport { useContentTypeSchema } from '../../../../hooks/useContentTypeSchema';\nimport { useDocumentActions } from '../../../../hooks/useDocumentActions';\nimport { useDocLayout } from '../../../../hooks/useDocumentLayout';\nimport { contentManagerApi } from '../../../../services/api';\nimport {\n useGetAllDocumentsQuery,\n usePublishManyDocumentsMutation,\n} from '../../../../services/documents';\nimport { buildValidParams } from '../../../../utils/api';\nimport { getTranslation } from '../../../../utils/translations';\nimport { createYupSchema } from '../../../../utils/validation';\nimport { DocumentStatus } from '../../../EditView/components/DocumentStatus';\n\nimport { ConfirmDialogPublishAll, ConfirmDialogPublishAllProps } from './ConfirmBulkActionDialog';\n\nimport type { BulkActionComponent } from '../../../../content-manager';\nimport type { Document } from '../../../../hooks/useDocument';\n\nconst TypographyMaxWidth = styled<TypographyComponent>(Typography)`\n max-width: 300px;\n`;\n\nconst TableComponent = styled(RawTable)`\n width: 100%;\n table-layout: fixed;\n td:first-child {\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n }\n td:first-of-type {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * EntryValidationText\n * -----------------------------------------------------------------------------------------------*/\n\nexport const formatErrorMessages = (\n errors: FormErrors,\n parentKey: string,\n formatMessage: IntlShape['formatMessage']\n) => {\n if (!errors) return [];\n\n const messages: string[] = [];\n\n Object.entries(errors).forEach(([key, value]) => {\n const currentKey = parentKey ? `${parentKey}.${key}` : key;\n\n if (!value) return;\n const isErrorMessageDescriptor =\n typeof value === 'object' && 'id' in value && 'defaultMessage' in value;\n if (isErrorMessageDescriptor || typeof value === 'string') {\n const id = isErrorMessageDescriptor ? value.id : value;\n const defaultMessage = isErrorMessageDescriptor\n ? (value.defaultMessage as string)\n : (value as string);\n messages.push(\n formatMessage(\n {\n id: `${id}.withField`,\n defaultMessage,\n },\n { field: currentKey }\n )\n );\n } else {\n messages.push(\n ...formatErrorMessages(value as unknown as FormErrors, currentKey, formatMessage)\n );\n }\n });\n\n return messages;\n};\n\ninterface EntryValidationTextProps {\n validationErrors?: FormErrors;\n status: string;\n}\n\nconst EntryValidationText = ({ validationErrors, status }: EntryValidationTextProps) => {\n const { formatMessage } = useIntl();\n\n if (validationErrors) {\n const validationErrorsMessages = formatErrorMessages(validationErrors, '', formatMessage).join(\n ' '\n );\n\n return (\n <Flex gap={2}>\n <CrossCircle fill=\"danger600\" />\n <Tooltip label={validationErrorsMessages}>\n <TypographyMaxWidth textColor=\"danger600\" variant=\"omega\" fontWeight=\"bold\" ellipsis>\n {validationErrorsMessages}\n </TypographyMaxWidth>\n </Tooltip>\n </Flex>\n );\n }\n\n if (status === 'published') {\n return (\n <Flex gap={2}>\n <CheckCircle fill=\"success600\" />\n <Typography textColor=\"success600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'content-manager.bulk-publish.already-published',\n defaultMessage: 'Already Published',\n })}\n </Typography>\n </Flex>\n );\n }\n\n if (status === 'modified') {\n return (\n <Flex gap={2}>\n <ArrowsCounterClockwise fill=\"alternative600\" />\n <Typography textColor=\"alternative600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'content-manager.bulk-publish.modified',\n defaultMessage: 'Ready to publish changes',\n })}\n </Typography>\n </Flex>\n );\n }\n\n return (\n <Flex gap={2}>\n <CheckCircle fill=\"success600\" />\n <Typography textColor=\"success600\" fontWeight=\"bold\">\n {formatMessage({\n id: 'app.utils.ready-to-publish',\n defaultMessage: 'Ready to publish',\n })}\n </Typography>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SelectedEntriesTableContent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SelectedEntriesTableContentProps {\n isPublishing?: boolean;\n rowsToDisplay?: TableRow[];\n entriesToPublish?: TableRow['documentId'][];\n validationErrors: Record<string, EntryValidationTextProps['validationErrors']>;\n}\n\nconst TABLE_HEADERS = [\n { name: 'documentId', label: 'documentId' },\n { name: 'name', label: 'name' },\n { name: 'status', label: 'status' },\n { name: 'publicationStatus', label: 'Publication status' },\n];\n\nconst SelectedEntriesTableContent = ({\n isPublishing,\n rowsToDisplay = [],\n entriesToPublish = [],\n validationErrors = {},\n}: SelectedEntriesTableContentProps) => {\n const { pathname } = useLocation();\n const { formatMessage } = useIntl();\n\n const {\n list: {\n settings: { mainField },\n },\n } = useDocLayout();\n\n const shouldDisplayMainField =\n mainField != null && mainField !== 'id' && mainField !== 'documentId';\n\n return (\n <Table.Content>\n <Table.Head>\n <Table.HeaderCheckboxCell />\n {TABLE_HEADERS.filter((head) => head.name !== 'name' || shouldDisplayMainField).map(\n (head) => (\n <Table.HeaderCell key={head.name} {...head} />\n )\n )}\n </Table.Head>\n <Table.Loading />\n <Table.Body>\n {rowsToDisplay.map((row) => (\n <Table.Row key={row.id}>\n <Table.CheckboxCell id={row.id} />\n <Table.Cell>\n <Typography>{row.documentId}</Typography>\n </Table.Cell>\n {shouldDisplayMainField && (\n <Table.Cell>\n <Typography>{row[mainField as keyof TableRow]}</Typography>\n </Table.Cell>\n )}\n <Table.Cell>\n <DocumentStatus status={row.status} maxWidth={'min-content'} />\n </Table.Cell>\n <Table.Cell>\n {isPublishing && entriesToPublish.includes(row.documentId) ? (\n <Flex gap={2}>\n <Typography>\n {formatMessage({\n id: 'content-manager.success.record.publishing',\n defaultMessage: 'Publishing...',\n })}\n </Typography>\n <Loader small />\n </Flex>\n ) : (\n <EntryValidationText\n validationErrors={validationErrors[row.documentId]}\n status={row.status}\n />\n )}\n </Table.Cell>\n <Table.Cell>\n <Flex>\n <IconButton\n tag={Link}\n to={{\n pathname: `${pathname}/${row.documentId}`,\n search: row.locale && `?plugins[i18n][locale]=${row.locale}`,\n }}\n state={{ from: pathname }}\n label={formatMessage({\n id: 'content-manager.bulk-publish.edit',\n defaultMessage: 'Edit',\n })}\n target=\"_blank\"\n marginLeft=\"auto\"\n variant=\"ghost\"\n >\n <Pencil width={'1.6rem'} height={'1.6rem'} />\n </IconButton>\n </Flex>\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Content>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublicationStatusSummary\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PublicationStatusSummaryProps {\n count: number;\n icon: React.ReactNode;\n message: string;\n textColor: string;\n}\n\nconst PublicationStatusSummary = ({\n count,\n icon,\n message,\n textColor,\n}: PublicationStatusSummaryProps) => {\n return (\n <Flex justifyContent=\"space-between\" flex={1} gap={3}>\n <Flex gap={2}>\n {icon}\n <Typography textColor={textColor} fontWeight=\"bold\">\n {message}\n </Typography>\n </Flex>\n <Typography fontWeight=\"bold\">{count}</Typography>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublicationStatusGrid\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PublicationStatusGridProps {\n entriesReadyToPublishCount: number;\n entriesModifiedCount: number;\n entriesPublishedCount: number;\n entriesWithErrorsCount: number;\n}\n\nconst PublicationStatusGrid = ({\n entriesReadyToPublishCount,\n entriesPublishedCount,\n entriesModifiedCount,\n entriesWithErrorsCount,\n}: PublicationStatusGridProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Box hasRadius borderColor=\"neutral150\">\n <TableComponent colCount={2} rowCount={2}>\n <Tbody>\n <Tr>\n <Td>\n <PublicationStatusSummary\n textColor=\"success600\"\n count={entriesReadyToPublishCount}\n icon={<CheckCircle fill=\"success600\" />}\n message={formatMessage({\n id: 'app.utils.ready-to-publish',\n defaultMessage: 'Ready to publish',\n })}\n />\n </Td>\n <Td>\n <PublicationStatusSummary\n textColor=\"success600\"\n count={entriesPublishedCount}\n icon={<CheckCircle fill=\"success600\" />}\n message={formatMessage({\n id: 'app.utils.already-published',\n defaultMessage: 'Already published',\n })}\n />\n </Td>\n </Tr>\n <Tr>\n <Td>\n <PublicationStatusSummary\n textColor=\"alternative600\"\n count={entriesModifiedCount}\n icon={<ArrowsCounterClockwise fill=\"alternative600\" />}\n message={formatMessage({\n id: 'content-manager.bulk-publish.modified',\n defaultMessage: 'Ready to publish changes',\n })}\n />\n </Td>\n <Td>\n <PublicationStatusSummary\n textColor=\"danger600\"\n count={entriesWithErrorsCount}\n icon={<CrossCircle fill=\"danger600\" />}\n message={formatMessage({\n id: 'content-manager.bulk-publish.waiting-for-action',\n defaultMessage: 'Waiting for action',\n })}\n />\n </Td>\n </Tr>\n </Tbody>\n </TableComponent>\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SelectedEntriesModalContent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface TableRow extends Document {}\n\ninterface SelectedEntriesModalContentProps {\n listViewSelectedEntries: TableRow[];\n toggleModal: ConfirmDialogPublishAllProps['onToggleDialog'];\n setListViewSelectedDocuments: (documents: TableRow[]) => void;\n model: string;\n}\n\nconst SelectedEntriesModalContent = ({\n listViewSelectedEntries,\n toggleModal,\n setListViewSelectedDocuments,\n model,\n}: SelectedEntriesModalContentProps) => {\n const { formatMessage } = useIntl();\n const { schema, components } = useContentTypeSchema(model);\n const documentIds = listViewSelectedEntries.map(({ documentId }) => documentId);\n\n // We want to keep the selected entries order same as the list view\n const [{ query }] = useQueryParams<{ sort?: string; plugins?: Record<string, any> }>();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n // Fetch the documents based on the selected entries and update the modal table\n const { data, isLoading, isFetching, refetch } = useGetAllDocumentsQuery(\n {\n model,\n params: {\n page: '1',\n pageSize: documentIds.length.toString(),\n sort: query.sort,\n filters: {\n documentId: {\n $in: documentIds,\n },\n },\n locale: query.plugins?.i18n?.locale,\n },\n },\n {\n selectFromResult: ({ data, ...restRes }) => ({ data: data?.results ?? [], ...restRes }),\n }\n );\n\n // Validate the entries based on the schema to show errors if any\n const { rows, validationErrors } = React.useMemo(() => {\n if (data.length > 0 && schema) {\n const validate = createYupSchema(\n schema.attributes,\n components,\n // Since this is the \"Publish\" action, the validation\n // schema must enforce the rules for published entities\n { status: 'published' }\n );\n const validationErrors: Record<TableRow['documentId'], FormErrors> = {};\n const rows = data.map((entry: Document) => {\n try {\n validate.validateSync(entry, { abortEarly: false });\n\n return entry;\n } catch (e) {\n if (e instanceof ValidationError) {\n validationErrors[entry.documentId] = getYupValidationErrors(e);\n }\n\n return entry;\n }\n });\n\n return { rows, validationErrors };\n }\n\n return {\n rows: [],\n validationErrors: {},\n };\n }, [components, data, schema]);\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n\n const { publishMany: bulkPublishAction, isLoading: isPublishing } = useDocumentActions();\n const [, { isLoading: isSubmittingForm }] = usePublishManyDocumentsMutation();\n\n const selectedRows = useTable('publishAction', (state) => state.selectedRows);\n\n // Filter selected entries from the updated modal table rows\n const selectedEntries = rows.filter((entry) =>\n selectedRows.some((selectedEntry) => selectedEntry.documentId === entry.documentId)\n );\n\n const entriesToPublish = selectedEntries\n .filter((entry) => !validationErrors[entry.documentId])\n .map((entry) => entry.documentId);\n\n const selectedEntriesWithErrorsCount = selectedEntries.filter(\n ({ documentId }) => validationErrors[documentId]\n ).length;\n const selectedEntriesPublishedCount = selectedEntries.filter(\n ({ status }) => status === 'published'\n ).length;\n const selectedEntriesModifiedCount = selectedEntries.filter(\n ({ status, documentId }) => status === 'modified' && !validationErrors[documentId]\n ).length;\n const selectedEntriesWithNoErrorsCount =\n selectedEntries.length - selectedEntriesWithErrorsCount - selectedEntriesPublishedCount;\n\n const toggleDialog = () => setIsDialogOpen((prev) => !prev);\n\n const handleConfirmBulkPublish = async () => {\n toggleDialog();\n\n const res = await bulkPublishAction({ model: model, documentIds: entriesToPublish, params });\n if (!('error' in res)) {\n const unpublishedEntries = rows.filter((row) => {\n return !entriesToPublish.includes(row.documentId);\n });\n // Keep selection of the entries in list view that were not published\n setListViewSelectedDocuments(unpublishedEntries);\n }\n };\n\n return (\n <>\n <Modal.Body>\n <PublicationStatusGrid\n entriesReadyToPublishCount={\n selectedEntriesWithNoErrorsCount - selectedEntriesModifiedCount\n }\n entriesPublishedCount={selectedEntriesPublishedCount}\n entriesModifiedCount={selectedEntriesModifiedCount}\n entriesWithErrorsCount={selectedEntriesWithErrorsCount}\n />\n <Box marginTop={7}>\n <SelectedEntriesTableContent\n isPublishing={isSubmittingForm}\n rowsToDisplay={rows}\n entriesToPublish={entriesToPublish}\n validationErrors={validationErrors}\n />\n </Box>\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={toggleModal} variant=\"tertiary\">\n {formatMessage({\n id: 'app.components.Button.cancel',\n defaultMessage: 'Cancel',\n })}\n </Button>\n <Flex gap={2}>\n <Button onClick={refetch} variant=\"tertiary\" loading={isFetching}>\n {formatMessage({ id: 'app.utils.refresh', defaultMessage: 'Refresh' })}\n </Button>\n <Button\n onClick={toggleDialog}\n disabled={\n selectedEntries.length === 0 ||\n selectedEntries.length === selectedEntriesWithErrorsCount ||\n selectedEntriesPublishedCount === selectedEntries.length ||\n isLoading\n }\n loading={isPublishing || isSubmittingForm}\n >\n {formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' })}\n </Button>\n </Flex>\n </Modal.Footer>\n <ConfirmDialogPublishAll\n isOpen={isDialogOpen}\n onToggleDialog={toggleDialog}\n isConfirmButtonLoading={isPublishing || isSubmittingForm}\n onConfirm={handleConfirmBulkPublish}\n />\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PublishAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst PublishAction: BulkActionComponent = ({ documents, model }) => {\n const { formatMessage } = useIntl();\n // Publish button visibility\n const hasPublishPermission = useDocumentRBAC('unpublishAction', (state) => state.canPublish);\n const showPublishButton =\n hasPublishPermission && documents.some(({ status }) => status !== 'published');\n\n const setListViewSelectedDocuments = useTable('publishAction', (state) => state.selectRow);\n\n const refetchList = () => {\n contentManagerApi.util.invalidateTags([{ type: 'Document', id: `${model}_LIST` }]);\n };\n\n if (!showPublishButton) return null;\n\n return {\n actionType: 'publish',\n variant: 'tertiary',\n label: formatMessage({ id: 'app.utils.publish', defaultMessage: 'Publish' }),\n dialog: {\n type: 'modal',\n title: formatMessage({\n id: getTranslation('containers.ListPage.selectedEntriesModal.title'),\n defaultMessage: 'Publish entries',\n }),\n content: ({ onClose }) => {\n return (\n <Table.Root rows={documents} defaultSelectedRows={documents} headers={TABLE_HEADERS}>\n <SelectedEntriesModalContent\n listViewSelectedEntries={documents}\n toggleModal={() => {\n onClose();\n refetchList();\n }}\n setListViewSelectedDocuments={setListViewSelectedDocuments}\n model={model}\n />\n </Table.Root>\n );\n },\n onClose: () => {\n refetchList();\n },\n },\n };\n};\n\nexport { PublishAction, SelectedEntriesModalContent };\n"],"names":["TypographyMaxWidth","styled","Typography","TableComponent","RawTable","theme","colors","neutral150","spaces","formatErrorMessages","errors","parentKey","formatMessage","messages","Object","entries","forEach","key","value","currentKey","isErrorMessageDescriptor","id","defaultMessage","push","field","EntryValidationText","validationErrors","status","useIntl","validationErrorsMessages","join","_jsxs","Flex","gap","_jsx","CrossCircle","fill","Tooltip","label","textColor","variant","fontWeight","ellipsis","CheckCircle","ArrowsCounterClockwise","TABLE_HEADERS","name","SelectedEntriesTableContent","isPublishing","rowsToDisplay","entriesToPublish","pathname","useLocation","list","settings","mainField","useDocLayout","shouldDisplayMainField","Table","Content","Head","HeaderCheckboxCell","filter","head","map","HeaderCell","Loading","Body","row","Row","CheckboxCell","Cell","documentId","DocumentStatus","maxWidth","includes","Loader","small","IconButton","tag","Link","to","search","locale","state","from","target","marginLeft","Pencil","width","height","PublicationStatusSummary","count","icon","message","justifyContent","flex","PublicationStatusGrid","entriesReadyToPublishCount","entriesPublishedCount","entriesModifiedCount","entriesWithErrorsCount","Box","hasRadius","borderColor","colCount","rowCount","Tbody","Tr","Td","SelectedEntriesModalContent","listViewSelectedEntries","toggleModal","setListViewSelectedDocuments","model","schema","components","useContentTypeSchema","documentIds","query","useQueryParams","params","React","useMemo","buildValidParams","data","isLoading","isFetching","refetch","useGetAllDocumentsQuery","page","pageSize","length","toString","sort","filters","$in","plugins","i18n","selectFromResult","restRes","results","rows","validate","createYupSchema","attributes","entry","validateSync","abortEarly","e","ValidationError","getYupValidationErrors","isDialogOpen","setIsDialogOpen","useState","publishMany","bulkPublishAction","useDocumentActions","isSubmittingForm","usePublishManyDocumentsMutation","selectedRows","useTable","selectedEntries","some","selectedEntry","selectedEntriesWithErrorsCount","selectedEntriesPublishedCount","selectedEntriesModifiedCount","selectedEntriesWithNoErrorsCount","toggleDialog","prev","handleConfirmBulkPublish","res","unpublishedEntries","_Fragment","Modal","marginTop","Footer","Button","onClick","loading","disabled","ConfirmDialogPublishAll","isOpen","onToggleDialog","isConfirmButtonLoading","onConfirm","PublishAction","documents","hasPublishPermission","useDocumentRBAC","canPublish","showPublishButton","selectRow","refetchList","contentManagerApi","util","invalidateTags","type","actionType","dialog","title","getTranslation","content","onClose","Root","defaultSelectedRows","headers"],"mappings":";;;;;;;;;;;;;;;;;;;;;A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qBACE1K,GAAA,CAACwB,MAAMmJ,IAAI,EAAA;oBAAC/D,IAAAA,EAAM8C,SAAAA;oBAAWkB,mBAAAA,EAAqBlB,SAAAA;oBAAWmB,OAAAA,EAASlK,aAAAA;AACpE,oBAAA,QAAA,gBAAAX,GAAA,CAAC4E,2BAAAA,EAAAA;wBACCC,uBAAAA,EAAyB6E,SAAAA;wBACzB5E,WAAAA,EAAa,IAAA;AACX4F,4BAAAA,OAAAA,EAAAA;AACAV,4BAAAA,WAAAA,EAAAA;AACF,wBAAA,CAAA;wBACAjF,4BAAAA,EAA8BA,4BAAAA;wBAC9BC,KAAAA,EAAOA;;;AAIf,YAAA,CAAA;YACA0F,OAAAA,EAAS,IAAA;AACPV,gBAAAA,WAAAA,EAAAA;AACF,YAAA;AACF;AACF,KAAA;AACF;;;;"}
@@ -1,5 +1,6 @@
1
+ import * as React from 'react';
1
2
  import type { ComponentInputProps } from './Input';
2
3
  type NonRepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;
3
- declare const NonRepeatableComponent: ({ attribute, name, children, layout, }: NonRepeatableComponentProps) => import("react/jsx-runtime").JSX.Element;
4
- export { NonRepeatableComponent };
4
+ declare const MemoizedNonRepeatableComponent: React.MemoExoticComponent<({ attribute, name, children, layout, }: NonRepeatableComponentProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export { MemoizedNonRepeatableComponent as NonRepeatableComponent };
5
6
  export type { NonRepeatableComponentProps };
@@ -1,5 +1,6 @@
1
+ import * as React from 'react';
1
2
  import type { ComponentInputProps } from './Input';
2
3
  type RepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;
3
- declare const RepeatableComponent: ({ attribute, disabled, name, mainField, children, layout, }: RepeatableComponentProps) => import("react/jsx-runtime").JSX.Element;
4
- export { RepeatableComponent };
4
+ declare const MemoizedRepeatableComponent: React.MemoExoticComponent<({ attribute, disabled, name, mainField, children, layout, }: RepeatableComponentProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export { MemoizedRepeatableComponent as RepeatableComponent };
5
6
  export type { RepeatableComponentProps };
@@ -8,11 +8,11 @@ interface DynamicComponentProps extends Pick<UseDragAndDropOptions, 'onGrabItem'
8
8
  index: number;
9
9
  name: string;
10
10
  onAddComponent: (componentUid: string, index: number) => void;
11
- onRemoveComponentClick: () => void;
11
+ onRemoveComponentClick: (index: number) => void;
12
12
  onMoveComponent: (dragIndex: number, hoverIndex: number) => void;
13
13
  totalLength: number;
14
14
  children?: (props: InputRendererProps) => React.ReactNode;
15
15
  }
16
- declare const DynamicComponent: ({ componentUid, disabled, index, name, onRemoveComponentClick, onMoveComponent, onGrabItem, onDropItem, onCancel, dynamicComponentsByCategory, onAddComponent, totalLength, children, }: DynamicComponentProps) => import("react/jsx-runtime").JSX.Element;
17
- export { DynamicComponent };
16
+ declare const MemoizedDynamicComponent: React.MemoExoticComponent<({ componentUid, disabled, index, name, onRemoveComponentClick, onMoveComponent, onGrabItem, onDropItem, onCancel, dynamicComponentsByCategory, onAddComponent, totalLength, children, }: DynamicComponentProps) => import("react/jsx-runtime").JSX.Element>;
17
+ export { MemoizedDynamicComponent as DynamicComponent };
18
18
  export type { DynamicComponentProps };
@@ -30,5 +30,5 @@ interface FormLayoutProps extends Pick<EditLayout, 'layout'> {
30
30
  hasBackground?: boolean;
31
31
  document: ReturnType<UseDocument>;
32
32
  }
33
- declare const FormLayout: ({ layout, document, hasBackground }: FormLayoutProps) => import("react/jsx-runtime").JSX.Element;
33
+ declare const FormLayout: React.MemoExoticComponent<({ layout, document, hasBackground }: FormLayoutProps) => import("react/jsx-runtime").JSX.Element>;
34
34
  export { FormLayout, FormLayoutProps };
@@ -4,7 +4,7 @@ import type { EditFieldLayout } from '../../../hooks/useDocumentLayout';
4
4
  import type { Schema } from '@strapi/types';
5
5
  import type { DistributiveOmit } from 'react-redux';
6
6
  type InputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {
7
- document: ReturnType<UseDocument>;
7
+ document?: ReturnType<UseDocument>;
8
8
  };
9
9
  declare const useFieldHint: (hint: React.ReactNode, attribute: Schema.Attribute.AnyAttribute) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | (string | import("react/jsx-runtime").JSX.Element | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal)[] | null | undefined;
10
10
  /**
@@ -1,6 +1,9 @@
1
+ import { FormErrors } from '@strapi/admin/strapi-admin';
2
+ import { type IntlShape } from 'react-intl';
1
3
  import { ConfirmDialogPublishAllProps } from './ConfirmBulkActionDialog';
2
4
  import type { BulkActionComponent } from '../../../../content-manager';
3
5
  import type { Document } from '../../../../hooks/useDocument';
6
+ export declare const formatErrorMessages: (errors: FormErrors, parentKey: string, formatMessage: IntlShape['formatMessage']) => string[];
4
7
  interface TableRow extends Document {
5
8
  }
6
9
  interface SelectedEntriesModalContentProps {
@@ -10,6 +10,9 @@ declare const listViewFilters: {
10
10
  Root: ({ disabled, schema, children }: FiltersProps) => import("react/jsx-runtime").JSX.Element;
11
11
  Trigger: React.ForwardRefExoticComponent<Filters.TriggerProps & React.RefAttributes<HTMLButtonElement>>;
12
12
  Popover: ({ zIndex }: {
13
+ /**
14
+ * If new attributes are added, this list needs to be updated.
15
+ */
13
16
  zIndex?: number | undefined;
14
17
  }) => import("react/jsx-runtime").JSX.Element | null;
15
18
  List: () => import("react/jsx-runtime").JSX.Element | null;
@@ -16,6 +16,8 @@ var en = {
16
16
  "actions.discard.dialog.body": "Are you sure you want to discard the changes? This action is irreversible.",
17
17
  "actions.edit.error": "An error occurred while trying to edit the document.",
18
18
  "actions.edit.label": "Edit",
19
+ "actions.copy-documentId.label": "Copy document ID",
20
+ "actions.copy-documentId.success": "Document ID copied to clipboard",
19
21
  "actions.unpublish.error": "An error occurred while trying to unpublish the document.",
20
22
  "actions.unpublish.dialog.body": "Are you sure you want to unpublish this?",
21
23
  "actions.unpublish.dialog.option.keep-draft": "Unpublish and keep last draft",
@@ -108,6 +110,7 @@ var en = {
108
110
  "containers.edit.information.last-draft.value": "{time}{isAnonymous, select, true {} other { by {author}}}",
109
111
  "containers.edit.information.document.label": "Created",
110
112
  "containers.edit.information.document.value": "{time}{isAnonymous, select, true {} other { by {author}}}",
113
+ "containers.edit.information.documentId.label": "Document ID",
111
114
  "containers.EditSettingsView.modal-form.edit-field": "Edit the field",
112
115
  "containers.EditView.add.new-entry": "Add an entry",
113
116
  "containers.EditView.notification.errors": "The form contains some errors",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,6 +12,8 @@ var en = {
12
12
  "actions.discard.dialog.body": "Are you sure you want to discard the changes? This action is irreversible.",
13
13
  "actions.edit.error": "An error occurred while trying to edit the document.",
14
14
  "actions.edit.label": "Edit",
15
+ "actions.copy-documentId.label": "Copy document ID",
16
+ "actions.copy-documentId.success": "Document ID copied to clipboard",
15
17
  "actions.unpublish.error": "An error occurred while trying to unpublish the document.",
16
18
  "actions.unpublish.dialog.body": "Are you sure you want to unpublish this?",
17
19
  "actions.unpublish.dialog.option.keep-draft": "Unpublish and keep last draft",
@@ -104,6 +106,7 @@ var en = {
104
106
  "containers.edit.information.last-draft.value": "{time}{isAnonymous, select, true {} other { by {author}}}",
105
107
  "containers.edit.information.document.label": "Created",
106
108
  "containers.edit.information.document.value": "{time}{isAnonymous, select, true {} other { by {author}}}",
109
+ "containers.edit.information.documentId.label": "Document ID",
107
110
  "containers.EditSettingsView.modal-form.edit-field": "Edit the field",
108
111
  "containers.EditView.add.new-entry": "Add an entry",
109
112
  "containers.EditView.notification.errors": "The form contains some errors",
@@ -1 +1 @@
1
- {"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,6 +8,7 @@ var clone = require('./utils/clone.js');
8
8
  var dimensions = require('./validation/dimensions.js');
9
9
  var metadata = require('./utils/metadata.js');
10
10
  var documentStatus = require('./utils/document-status.js');
11
+ var populate = require('../services/utils/populate.js');
11
12
 
12
13
  /**
13
14
  * Returns documentIds for (documentId, locale) that have both draft and published,
@@ -249,10 +250,10 @@ var collectionTypes = {
249
250
  return ctx.forbidden();
250
251
  }
251
252
  const permissionQuery = await permissionChecker.sanitizedQuery.read(query);
252
- const populate = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(1).countRelations({
253
+ const populate$1 = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(1).countRelations({
253
254
  toOne: false,
254
255
  toMany: true
255
- }).build();
256
+ }).withPopulateOverride(populate.getPopulateForLocalizations(model)).build();
256
257
  // "Modified" is a UI-only filter; not a real document status. Read and strip it
257
258
  // so we never pass it to validation or the document service.
258
259
  const publicationStatusFilter = query.publicationStatusFilter;
@@ -266,7 +267,7 @@ var collectionTypes = {
266
267
  ], permissionQuery);
267
268
  let findPageParams = {
268
269
  ...paramsForDocumentService,
269
- populate,
270
+ populate: populate$1,
270
271
  locale,
271
272
  status
272
273
  };
@@ -287,9 +288,8 @@ var collectionTypes = {
287
288
  };
288
289
  }
289
290
  const { results: documents, pagination } = await documentManager.findPage(findPageParams, model);
290
- // TODO: Skip this part if not necessary (if D&P disabled or columns not displayed in the view)
291
- const documentsAvailableStatus = await documentMetadata.getManyAvailableStatus(model, documents);
292
- const statusByDocumentId = documentStatus.indexByDocumentId(documentsAvailableStatus);
291
+ const hasDraftAndPublish = strapiUtils.contentTypes.hasDraftAndPublish(strapi.getModel(model));
292
+ const statusByDocumentId = hasDraftAndPublish ? documentStatus.indexByDocumentId(await documentMetadata.getManyAvailableStatus(model, documents)) : new Map();
293
293
  const setStatus = (document)=>{
294
294
  // Available status of document
295
295
  const availableStatuses = statusByDocumentId.get(document.documentId) || [];
@@ -315,10 +315,10 @@ var collectionTypes = {
315
315
  return ctx.forbidden();
316
316
  }
317
317
  const permissionQuery = await permissionChecker.sanitizedQuery.read(ctx.query);
318
- const populate = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().build();
318
+ const populate$1 = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().withPopulateOverride(populate.getPopulateForLocalizations(model)).build();
319
319
  const { locale, status } = await dimensions.getDocumentLocaleAndStatus(ctx.query, model);
320
320
  const version = await documentManager.findOne(id, model, {
321
- populate,
321
+ populate: populate$1,
322
322
  locale,
323
323
  status
324
324
  });
@@ -489,7 +489,7 @@ var collectionTypes = {
489
489
  const publishedDocument = await strapi.db.transaction(async ()=>{
490
490
  // Create or update document
491
491
  const permissionQuery = await permissionChecker.sanitizedQuery.publish(ctx.query);
492
- const populate = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().build();
492
+ const populate$1 = await index.getService('populate-builder')(model).populateFromQuery(permissionQuery).populateDeep(Infinity).countRelations().withPopulateOverride(populate.getPopulateForLocalizations(model)).build();
493
493
  let document;
494
494
  const { locale } = await dimensions.getDocumentLocaleAndStatus(body, model);
495
495
  /**
@@ -508,7 +508,7 @@ var collectionTypes = {
508
508
  throw new strapiUtils.errors.ForbiddenError();
509
509
  }
510
510
  document = await createDocument(ctx, {
511
- populate
511
+ populate: populate$1
512
512
  });
513
513
  }
514
514
  const isUpdate = !isCreate;
@@ -520,7 +520,7 @@ var collectionTypes = {
520
520
  }
521
521
  // check the document version
522
522
  document = await documentManager.findOne(id, model, {
523
- populate,
523
+ populate: populate$1,
524
524
  locale
525
525
  });
526
526
  if (!document) {
@@ -570,12 +570,11 @@ var collectionTypes = {
570
570
  const { locale } = await dimensions.getDocumentLocaleAndStatus(body, model, {
571
571
  allowMultipleLocales: true
572
572
  });
573
- const entityPromises = documentIds.map((documentId)=>documentManager.findLocales(documentId, model, {
574
- populate,
575
- locale,
576
- isPublished: false
577
- }));
578
- const entities = (await Promise.all(entityPromises)).flat();
573
+ const entities = await documentManager.findLocales(documentIds, model, {
574
+ populate,
575
+ locale,
576
+ isPublished: false
577
+ });
579
578
  for (const entity of entities){
580
579
  if (!entity) {
581
580
  return ctx.notFound();
@@ -606,11 +605,10 @@ var collectionTypes = {
606
605
  const { locale } = await dimensions.getDocumentLocaleAndStatus(body, model, {
607
606
  allowMultipleLocales: true
608
607
  });
609
- const entityPromises = documentIds.map((documentId)=>documentManager.findLocales(documentId, model, {
610
- locale,
611
- isPublished: true
612
- }));
613
- const entities = (await Promise.all(entityPromises)).flat();
608
+ const entities = await documentManager.findLocales(documentIds, model, {
609
+ locale,
610
+ isPublished: true
611
+ });
614
612
  for (const entity of entities){
615
613
  if (!entity) {
616
614
  return ctx.notFound();
@@ -784,13 +782,12 @@ var collectionTypes = {
784
782
  if (permissionChecker.cannot.read()) {
785
783
  return ctx.forbidden();
786
784
  }
787
- const documents = await documentManager.findMany({
788
- filters: {
785
+ const count = await strapi.db.query(model).count({
786
+ where: {
789
787
  documentId: ids
790
- },
791
- locale
792
- }, model);
793
- if (!documents) {
788
+ }
789
+ });
790
+ if (count === 0) {
794
791
  return ctx.notFound();
795
792
  }
796
793
  const number = await documentManager.countManyEntriesDraftRelations(ids, model, locale);