@strapi/review-workflows 5.46.0 → 5.46.1
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.
- package/dist/admin/index.js +6 -0
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +7 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/components/AssigneeFilter.js +83 -0
- package/dist/admin/routes/content-manager/model/components/AssigneeFilter.js.map +1 -0
- package/dist/admin/routes/content-manager/model/components/AssigneeFilter.mjs +62 -0
- package/dist/admin/routes/content-manager/model/components/AssigneeFilter.mjs.map +1 -0
- package/dist/admin/routes/content-manager/model/components/StageFilter.js +70 -0
- package/dist/admin/routes/content-manager/model/components/StageFilter.js.map +1 -0
- package/dist/admin/routes/content-manager/model/components/StageFilter.mjs +68 -0
- package/dist/admin/routes/content-manager/model/components/StageFilter.mjs.map +1 -0
- package/dist/admin/routes/content-manager/model/constants.js +63 -9
- package/dist/admin/routes/content-manager/model/constants.js.map +1 -1
- package/dist/admin/routes/content-manager/model/constants.mjs +63 -10
- package/dist/admin/routes/content-manager/model/constants.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.js +5 -5
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.mjs +5 -5
- package/dist/admin/routes/content-manager/model/id/components/AssigneeSelect.mjs.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.js +45 -18
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.js.map +1 -1
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.mjs +45 -18
- package/dist/admin/routes/content-manager/model/id/components/StageSelect.mjs.map +1 -1
- package/dist/admin/routes/settings/components/Stages.js +1 -1
- package/dist/admin/routes/settings/components/Stages.js.map +1 -1
- package/dist/admin/routes/settings/components/Stages.mjs +1 -1
- package/dist/admin/routes/settings/components/Stages.mjs.map +1 -1
- package/dist/admin/routes/settings/id.js +4 -4
- package/dist/admin/routes/settings/id.js.map +1 -1
- package/dist/admin/routes/settings/id.mjs +4 -4
- package/dist/admin/routes/settings/id.mjs.map +1 -1
- package/dist/admin/routes/settings/index.js +2 -2
- package/dist/admin/routes/settings/index.js.map +1 -1
- package/dist/admin/routes/settings/index.mjs +2 -2
- package/dist/admin/routes/settings/index.mjs.map +1 -1
- package/dist/admin/src/utils/cm-hooks.d.ts +42 -2
- package/dist/admin/translations/cs.json.js +2 -1
- package/dist/admin/translations/cs.json.js.map +1 -1
- package/dist/admin/translations/cs.json.mjs +2 -1
- package/dist/admin/translations/cs.json.mjs.map +1 -1
- package/dist/admin/translations/de.json.js +8 -0
- package/dist/admin/translations/de.json.js.map +1 -0
- package/dist/admin/translations/de.json.mjs +6 -0
- package/dist/admin/translations/de.json.mjs.map +1 -0
- package/dist/admin/translations/en.json.js +20 -1
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +20 -1
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/es.json.js +2 -1
- package/dist/admin/translations/es.json.js.map +1 -1
- package/dist/admin/translations/es.json.mjs +2 -1
- package/dist/admin/translations/es.json.mjs.map +1 -1
- package/dist/admin/translations/fr.json.js +8 -0
- package/dist/admin/translations/fr.json.js.map +1 -0
- package/dist/admin/translations/fr.json.mjs +6 -0
- package/dist/admin/translations/fr.json.mjs.map +1 -0
- package/dist/admin/translations/nl.json.js +2 -1
- package/dist/admin/translations/nl.json.js.map +1 -1
- package/dist/admin/translations/nl.json.mjs +2 -1
- package/dist/admin/translations/nl.json.mjs.map +1 -1
- package/dist/admin/translations/pl.json.js +8 -0
- package/dist/admin/translations/pl.json.js.map +1 -0
- package/dist/admin/translations/pl.json.mjs +6 -0
- package/dist/admin/translations/pl.json.mjs.map +1 -0
- package/dist/admin/translations/ru.json.js +8 -0
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/translations/ru.json.mjs +6 -0
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/translations/uk.json.js +2 -1
- package/dist/admin/translations/uk.json.js.map +1 -1
- package/dist/admin/translations/uk.json.mjs +2 -1
- package/dist/admin/translations/uk.json.mjs.map +1 -1
- package/dist/admin/translations/zh-Hans.json.js +8 -0
- package/dist/admin/translations/zh-Hans.json.js.map +1 -0
- package/dist/admin/translations/zh-Hans.json.mjs +6 -0
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
- package/dist/admin/utils/cm-hooks.js +16 -0
- package/dist/admin/utils/cm-hooks.js.map +1 -1
- package/dist/admin/utils/cm-hooks.mjs +17 -2
- package/dist/admin/utils/cm-hooks.mjs.map +1 -1
- package/dist/server/controllers/stages.js +24 -14
- package/dist/server/controllers/stages.js.map +1 -1
- package/dist/server/controllers/stages.mjs +24 -14
- package/dist/server/controllers/stages.mjs.map +1 -1
- package/dist/server/src/controllers/stages.d.ts.map +1 -1
- package/dist/shared/contracts/review-workflows.d.ts +2 -0
- package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,7 +9,8 @@ var es = {
|
|
|
9
9
|
"settings.not-available": "Flujos de revisión sólo está disponible como parte de la Edición Enterprise. Actualiza para crear y gestionar flujos.",
|
|
10
10
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Etapa necesaria para la publicación",
|
|
11
11
|
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Cualquier etapa",
|
|
12
|
-
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Impide que se publiquen las entradas si no están en la fase requerida."
|
|
12
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Impide que se publiquen las entradas si no están en la fase requerida.",
|
|
13
|
+
"stage.label": "Fase de revisión"
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
module.exports = es;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,8 @@ var es = {
|
|
|
7
7
|
"settings.not-available": "Flujos de revisión sólo está disponible como parte de la Edición Enterprise. Actualiza para crear y gestionar flujos.",
|
|
8
8
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Etapa necesaria para la publicación",
|
|
9
9
|
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Cualquier etapa",
|
|
10
|
-
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Impide que se publiquen las entradas si no están en la fase requerida."
|
|
10
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Impide que se publiquen las entradas si no están en la fase requerida.",
|
|
11
|
+
"stage.label": "Fase de revisión"
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export { es as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -15,7 +15,8 @@ var nl = {
|
|
|
15
15
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Vereiste fase voor publicatie",
|
|
16
16
|
"settings.stage.name.label": "Fasenaam",
|
|
17
17
|
"widget.assigned.no-data": "Geen items",
|
|
18
|
-
"widget.assigned.title": "Aan mij toegewezen"
|
|
18
|
+
"widget.assigned.title": "Aan mij toegewezen",
|
|
19
|
+
"stage.label": "Beoordelingsfase"
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
module.exports = nl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -13,7 +13,8 @@ var nl = {
|
|
|
13
13
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Vereiste fase voor publicatie",
|
|
14
14
|
"settings.stage.name.label": "Fasenaam",
|
|
15
15
|
"widget.assigned.no-data": "Geen items",
|
|
16
|
-
"widget.assigned.title": "Aan mij toegewezen"
|
|
16
|
+
"widget.assigned.title": "Aan mij toegewezen",
|
|
17
|
+
"stage.label": "Beoordelingsfase"
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export { nl as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -9,7 +9,8 @@ var uk = {
|
|
|
9
9
|
"settings.not-available": "Робочі процеси перегляду доступні лише в рамках Enterprise Edition. Оновіть план, щоб створювати та керувати робочими процесами.",
|
|
10
10
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Необхідний етап для публікації",
|
|
11
11
|
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Будь-який етап",
|
|
12
|
-
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Запобігає публікації записів, якщо вони не знаходяться на необхідному етапі."
|
|
12
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Запобігає публікації записів, якщо вони не знаходяться на необхідному етапі.",
|
|
13
|
+
"stage.label": "Етап перегляду"
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
module.exports = uk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uk.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uk.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -7,7 +7,8 @@ var uk = {
|
|
|
7
7
|
"settings.not-available": "Робочі процеси перегляду доступні лише в рамках Enterprise Edition. Оновіть план, щоб створювати та керувати робочими процесами.",
|
|
8
8
|
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Необхідний етап для публікації",
|
|
9
9
|
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Будь-який етап",
|
|
10
|
-
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Запобігає публікації записів, якщо вони не знаходяться на необхідному етапі."
|
|
10
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Запобігає публікації записів, якщо вони не знаходяться на необхідному етапі.",
|
|
11
|
+
"stage.label": "Етап перегляду"
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export { uk as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uk.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uk.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-Hans.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh-Hans.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -18,6 +18,22 @@ const addColumnToTableHook = ({ displayedHeaders, layout })=>{
|
|
|
18
18
|
layout
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
+
const addFilterToListViewHook = ({ displayedFilters, layout })=>{
|
|
22
|
+
if (!layout?.options?.reviewWorkflows) {
|
|
23
|
+
return {
|
|
24
|
+
displayedFilters,
|
|
25
|
+
layout
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
displayedFilters: [
|
|
30
|
+
...displayedFilters,
|
|
31
|
+
...constants.REVIEW_WORKFLOW_FILTERS
|
|
32
|
+
],
|
|
33
|
+
layout
|
|
34
|
+
};
|
|
35
|
+
};
|
|
21
36
|
|
|
22
37
|
exports.addColumnToTableHook = addColumnToTableHook;
|
|
38
|
+
exports.addFilterToListViewHook = addFilterToListViewHook;
|
|
23
39
|
//# sourceMappingURL=cm-hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cm-hooks.js","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"cm-hooks.js","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import {\n REVIEW_WORKFLOW_COLUMNS,\n REVIEW_WORKFLOW_FILTERS,\n} from '../routes/content-manager/model/constants';\n\nimport type {\n InjectableListViewFilter,\n ListFieldLayout,\n ListLayout,\n} from '@strapi/content-manager/strapi-admin';\n\n/* -------------------------------------------------------------------------------------------------\n * addColumnToTableHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddColumnToTableHookArgs {\n layout: ListLayout;\n displayedHeaders: ListFieldLayout[];\n}\n\nconst addColumnToTableHook = ({ displayedHeaders, layout }: AddColumnToTableHookArgs) => {\n const { options } = layout;\n\n if (!options.reviewWorkflows) {\n return { displayedHeaders, layout };\n }\n\n return {\n displayedHeaders: [...displayedHeaders, ...REVIEW_WORKFLOW_COLUMNS],\n layout,\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * addFilterToListViewHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddFilterToListViewHookArgs {\n displayedFilters: InjectableListViewFilter[];\n layout: ListLayout;\n}\n\nconst addFilterToListViewHook = ({ displayedFilters, layout }: AddFilterToListViewHookArgs) => {\n if (!layout?.options?.reviewWorkflows) {\n return { displayedFilters, layout };\n }\n\n return {\n displayedFilters: [...displayedFilters, ...REVIEW_WORKFLOW_FILTERS],\n layout,\n };\n};\n\nexport { addColumnToTableHook, addFilterToListViewHook };\n"],"names":["addColumnToTableHook","displayedHeaders","layout","options","reviewWorkflows","REVIEW_WORKFLOW_COLUMNS","addFilterToListViewHook","displayedFilters","REVIEW_WORKFLOW_FILTERS"],"mappings":";;;;AAmBA,MAAMA,uBAAuB,CAAC,EAAEC,gBAAgB,EAAEC,MAAM,EAA4B,GAAA;IAClF,MAAM,EAAEC,OAAO,EAAE,GAAGD,MAAAA;IAEpB,IAAI,CAACC,OAAAA,CAAQC,eAAe,EAAE;QAC5B,OAAO;AAAEH,YAAAA,gBAAAA;AAAkBC,YAAAA;AAAO,SAAA;AACpC,IAAA;IAEA,OAAO;QACLD,gBAAAA,EAAkB;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBI,YAAAA,GAAAA;AAAwB,SAAA;AACnEH,QAAAA;AACF,KAAA;AACF;AAUA,MAAMI,0BAA0B,CAAC,EAAEC,gBAAgB,EAAEL,MAAM,EAA+B,GAAA;IACxF,IAAI,CAACA,MAAAA,EAAQC,OAAAA,EAASC,eAAAA,EAAiB;QACrC,OAAO;AAAEG,YAAAA,gBAAAA;AAAkBL,YAAAA;AAAO,SAAA;AACpC,IAAA;IAEA,OAAO;QACLK,gBAAAA,EAAkB;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBC,YAAAA,GAAAA;AAAwB,SAAA;AACnEN,QAAAA;AACF,KAAA;AACF;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { REVIEW_WORKFLOW_COLUMNS } from '../routes/content-manager/model/constants.mjs';
|
|
1
|
+
import { REVIEW_WORKFLOW_COLUMNS, REVIEW_WORKFLOW_FILTERS } from '../routes/content-manager/model/constants.mjs';
|
|
2
2
|
|
|
3
3
|
const addColumnToTableHook = ({ displayedHeaders, layout })=>{
|
|
4
4
|
const { options } = layout;
|
|
@@ -16,6 +16,21 @@ const addColumnToTableHook = ({ displayedHeaders, layout })=>{
|
|
|
16
16
|
layout
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
const addFilterToListViewHook = ({ displayedFilters, layout })=>{
|
|
20
|
+
if (!layout?.options?.reviewWorkflows) {
|
|
21
|
+
return {
|
|
22
|
+
displayedFilters,
|
|
23
|
+
layout
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
displayedFilters: [
|
|
28
|
+
...displayedFilters,
|
|
29
|
+
...REVIEW_WORKFLOW_FILTERS
|
|
30
|
+
],
|
|
31
|
+
layout
|
|
32
|
+
};
|
|
33
|
+
};
|
|
19
34
|
|
|
20
|
-
export { addColumnToTableHook };
|
|
35
|
+
export { addColumnToTableHook, addFilterToListViewHook };
|
|
21
36
|
//# sourceMappingURL=cm-hooks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cm-hooks.mjs","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"cm-hooks.mjs","sources":["../../../admin/src/utils/cm-hooks.ts"],"sourcesContent":["import {\n REVIEW_WORKFLOW_COLUMNS,\n REVIEW_WORKFLOW_FILTERS,\n} from '../routes/content-manager/model/constants';\n\nimport type {\n InjectableListViewFilter,\n ListFieldLayout,\n ListLayout,\n} from '@strapi/content-manager/strapi-admin';\n\n/* -------------------------------------------------------------------------------------------------\n * addColumnToTableHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddColumnToTableHookArgs {\n layout: ListLayout;\n displayedHeaders: ListFieldLayout[];\n}\n\nconst addColumnToTableHook = ({ displayedHeaders, layout }: AddColumnToTableHookArgs) => {\n const { options } = layout;\n\n if (!options.reviewWorkflows) {\n return { displayedHeaders, layout };\n }\n\n return {\n displayedHeaders: [...displayedHeaders, ...REVIEW_WORKFLOW_COLUMNS],\n layout,\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * addFilterToListViewHook\n * -----------------------------------------------------------------------------------------------*/\ninterface AddFilterToListViewHookArgs {\n displayedFilters: InjectableListViewFilter[];\n layout: ListLayout;\n}\n\nconst addFilterToListViewHook = ({ displayedFilters, layout }: AddFilterToListViewHookArgs) => {\n if (!layout?.options?.reviewWorkflows) {\n return { displayedFilters, layout };\n }\n\n return {\n displayedFilters: [...displayedFilters, ...REVIEW_WORKFLOW_FILTERS],\n layout,\n };\n};\n\nexport { addColumnToTableHook, addFilterToListViewHook };\n"],"names":["addColumnToTableHook","displayedHeaders","layout","options","reviewWorkflows","REVIEW_WORKFLOW_COLUMNS","addFilterToListViewHook","displayedFilters","REVIEW_WORKFLOW_FILTERS"],"mappings":";;AAmBA,MAAMA,uBAAuB,CAAC,EAAEC,gBAAgB,EAAEC,MAAM,EAA4B,GAAA;IAClF,MAAM,EAAEC,OAAO,EAAE,GAAGD,MAAAA;IAEpB,IAAI,CAACC,OAAAA,CAAQC,eAAe,EAAE;QAC5B,OAAO;AAAEH,YAAAA,gBAAAA;AAAkBC,YAAAA;AAAO,SAAA;AACpC,IAAA;IAEA,OAAO;QACLD,gBAAAA,EAAkB;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBI,YAAAA,GAAAA;AAAwB,SAAA;AACnEH,QAAAA;AACF,KAAA;AACF;AAUA,MAAMI,0BAA0B,CAAC,EAAEC,gBAAgB,EAAEL,MAAM,EAA+B,GAAA;IACxF,IAAI,CAACA,MAAAA,EAAQC,OAAAA,EAASC,eAAAA,EAAiB;QACrC,OAAO;AAAEG,YAAAA,gBAAAA;AAAkBL,YAAAA;AAAO,SAAA;AACpC,IAAA;IAEA,OAAO;QACLK,gBAAAA,EAAkB;AAAIA,YAAAA,GAAAA,gBAAAA;AAAqBC,YAAAA,GAAAA;AAAwB,SAAA;AACnEN,QAAAA;AACF,KAAA;AACF;;;;"}
|
|
@@ -129,19 +129,14 @@ var stages = {
|
|
|
129
129
|
}
|
|
130
130
|
// Load entity
|
|
131
131
|
const locale = await reviewWorkflows.validateLocale(query?.locale) ?? undefined;
|
|
132
|
-
const entity = await
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
ctx.throw(404, 'Entity not found');
|
|
141
|
-
}
|
|
142
|
-
const entityStageId = entity[workflows.ENTITY_STAGE_ATTRIBUTE]?.id;
|
|
143
|
-
const canTransition = stagePermissions.can(workflows.STAGE_TRANSITION_UID, entityStageId);
|
|
144
|
-
const [workflowCount, workflowResult] = await Promise.all([
|
|
132
|
+
const [entity, workflowCount, workflowResult] = await Promise.all([
|
|
133
|
+
strapi.documents(modelUID).findOne({
|
|
134
|
+
documentId,
|
|
135
|
+
locale,
|
|
136
|
+
populate: [
|
|
137
|
+
workflows.ENTITY_STAGE_ATTRIBUTE
|
|
138
|
+
]
|
|
139
|
+
}),
|
|
145
140
|
workflowService.count(),
|
|
146
141
|
workflowService.getAssignedWorkflow(modelUID, {
|
|
147
142
|
populate: {
|
|
@@ -158,10 +153,25 @@ var stages = {
|
|
|
158
153
|
})
|
|
159
154
|
]);
|
|
160
155
|
const workflowStages = workflowResult ? workflowResult.stages : [];
|
|
156
|
+
const entityStageId = entity?.[workflows.ENTITY_STAGE_ATTRIBUTE]?.id;
|
|
157
|
+
const canTransition = stagePermissions.can(workflows.STAGE_TRANSITION_UID, entityStageId);
|
|
161
158
|
const meta = {
|
|
162
159
|
stageCount: workflowStages.length,
|
|
163
|
-
workflowCount
|
|
160
|
+
workflowCount,
|
|
161
|
+
canTransition
|
|
164
162
|
};
|
|
163
|
+
// The entity may not exist yet for the requested locale (e.g. switching to a
|
|
164
|
+
// locale that has not been saved).
|
|
165
|
+
if (!entity) {
|
|
166
|
+
if (!workflowResult) {
|
|
167
|
+
ctx.throw(404, 'Entity not found');
|
|
168
|
+
}
|
|
169
|
+
ctx.body = {
|
|
170
|
+
data: [],
|
|
171
|
+
meta
|
|
172
|
+
};
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
165
175
|
if (!canTransition) {
|
|
166
176
|
ctx.body = {
|
|
167
177
|
data: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages.js","sources":["../../../server/src/controllers/stages.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { async, validate } from '@strapi/utils';\nimport { getService } from '../utils';\nimport { validateUpdateStageOnEntity, validateLocale } from '../validation/review-workflows';\nimport {\n STAGE_MODEL_UID,\n ENTITY_STAGE_ATTRIBUTE,\n STAGE_TRANSITION_UID,\n} from '../constants/workflows';\n\n/**\n *\n * @param { Core.Strapi } strapi - Strapi instance\n * @param userAbility\n * @return { (Stage) => SanitizedStage }\n */\nfunction sanitizeStage({ strapi }: { strapi: Core.Strapi }, userAbility: unknown) {\n const permissionChecker = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility, model: STAGE_MODEL_UID });\n\n return (entity: unknown) => permissionChecker.sanitizeOutput(entity);\n}\n\nexport default {\n /**\n * List all stages\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async find(ctx: Context) {\n const { workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stages = await stagesService.find({\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await async.map(stages, sanitizer),\n };\n },\n /**\n * Get one stage\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async findById(ctx: Context) {\n const { id, workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stage = await stagesService.findById(id, {\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await sanitizer(stage),\n };\n },\n\n /**\n * Updates an entity's stage.\n * @async\n * @param {Object} ctx - The Koa context object.\n * @param {Object} ctx.params - An object containing the parameters from the request URL.\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity to update.\n * @param {Object} ctx.request.body.data - Optional data object containing the new stage ID for the entity.\n * @param {string} ctx.request.body.data.id - The ID of the new stage for the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n * @throws {ValidationError} If the `data` object in the request body fails to pass validation.\n * @returns {Promise<void>} A promise that resolves when the entity's stage has been updated.\n */\n async updateEntity(ctx: Context) {\n const stagesService = getService('stages');\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { body, query = {} } = ctx.request;\n\n const { sanitizeOutput } = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID });\n\n // Load entity\n const locale = await validateLocale(query?.locale);\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n // @ts-expect-error - locale should be also null in the doc service types\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n // Validate if entity stage can be updated\n const canTransition = stagePermissions.can(\n STAGE_TRANSITION_UID,\n entity[ENTITY_STAGE_ATTRIBUTE]?.id\n );\n\n if (!canTransition) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const { id: stageId } = await validateUpdateStageOnEntity(\n { id: Number(body?.data?.id) },\n 'You should pass an id to the body of the put request.'\n );\n\n const workflow = await workflowService.assertContentTypeBelongsToWorkflow(modelUID);\n workflowService.assertStageBelongsToWorkflow(stageId, workflow);\n\n const canTransitionTo = await stagePermissions.canTransitionToStage(stageId);\n if (!canTransitionTo) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const updatedEntity = await stagesService.updateEntity(entity, modelUID, stageId);\n\n ctx.body = { data: await sanitizeOutput(updatedEntity) };\n },\n\n /**\n * List all the stages that are available for a user to transition an entity to.\n * Stages are filtered by both \"from\" permission on the current stage AND \"to\" permission on each target stage.\n * @async\n * @param {*} ctx\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n */\n async listAvailableStages(ctx: Context) {\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { query = {} } = ctx.request;\n\n if (\n strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID })\n .cannot.read()\n ) {\n return ctx.forbidden();\n }\n\n // Load entity\n const locale = (await validateLocale(query?.locale)) ?? undefined;\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n const entityStageId = entity[ENTITY_STAGE_ATTRIBUTE]?.id;\n const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);\n\n const [workflowCount, workflowResult] = await Promise.all([\n workflowService.count(),\n workflowService.getAssignedWorkflow(modelUID, {\n populate: { stages: { populate: { permissions: { populate: ['role'] } } } },\n }),\n ]);\n\n const workflowStages = workflowResult ? workflowResult.stages : [];\n\n const meta = {\n stageCount: workflowStages.length,\n workflowCount,\n };\n\n if (!canTransition) {\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n const otherStages = workflowStages.filter(\n (stage: { id: number; permissions?: unknown[] }) => stage.id !== entityStageId\n );\n\n const data = otherStages.filter((stage: { id: number; permissions?: unknown[] }) =>\n stagePermissions.canTransitionToStageWithPermissions(stage)\n );\n\n ctx.body = {\n data,\n meta,\n };\n },\n};\n"],"names":["sanitizeStage","strapi","userAbility","permissionChecker","plugin","service","create","model","STAGE_MODEL_UID","entity","sanitizeOutput","find","ctx","workflow_id","workflowId","params","populate","query","stagesService","getService","sanitizer","state","stages","body","data","async","map","findById","id","stage","updateEntity","stagePermissions","workflowService","model_uid","modelUID","documentId","request","locale","validateLocale","documents","findOne","ENTITY_STAGE_ATTRIBUTE","throw","canTransition","can","STAGE_TRANSITION_UID","stageId","validateUpdateStageOnEntity","Number","workflow","assertContentTypeBelongsToWorkflow","assertStageBelongsToWorkflow","canTransitionTo","canTransitionToStage","updatedEntity","listAvailableStages","cannot","read","forbidden","undefined","entityStageId","workflowCount","workflowResult","Promise","all","count","getAssignedWorkflow","permissions","workflowStages","meta","stageCount","length","otherStages","filter","canTransitionToStageWithPermissions"],"mappings":";;;;;;;AAYA;;;;;AAKC,IACD,SAASA,aAAAA,CAAc,EAAEC,QAAAA,OAAM,EAA2B,EAAEC,WAAoB,EAAA;IAC9E,MAAMC,iBAAAA,GAAoBF,QACvBG,MAAM,CAAC,mBACPC,OAAO,CAAC,oBAAA,CAAA,CACRC,MAAM,CAAC;AAAEJ,QAAAA,WAAAA;QAAaK,KAAAA,EAAOC;AAAgB,KAAA,CAAA;AAEhD,IAAA,OAAO,CAACC,MAAAA,GAAoBN,iBAAAA,CAAkBO,c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AE;AAElE,QAAA,MAAM+C,IAAAA,GAAO;AACXC,YAAAA,UAAAA,EAAYF,eAAeG,MAAM;AACjCV,YAAAA;AACF,SAAA;AAEA,QAAA,IAAI,CAAClB,aAAAA,EAAe;AAClB/B,YAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,gBAAAA,IAAAA,EAAM,EAAE;AACR6C,gBAAAA;AACF,aAAA;AAEA,YAAA;AACF,QAAA;QAEA,MAAMG,WAAAA,GAAcJ,eAAeK,MAAM,CACvC,CAAC5C,KAAAA,GAAmDA,KAAAA,CAAMD,EAAE,KAAKgC,aAAAA,CAAAA;QAGnE,MAAMpC,IAAAA,GAAOgD,YAAYC,MAAM,CAAC,CAAC5C,KAAAA,GAC/BE,gBAAAA,CAAiB2C,mCAAmC,CAAC7C,KAAAA,CAAAA,CAAAA;AAGvDjB,QAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,YAAAA,IAAAA;AACA6C,YAAAA;AACF,SAAA;AACF,IAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"stages.js","sources":["../../../server/src/controllers/stages.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { async, validate } from '@strapi/utils';\nimport { getService } from '../utils';\nimport { validateUpdateStageOnEntity, validateLocale } from '../validation/review-workflows';\nimport {\n STAGE_MODEL_UID,\n ENTITY_STAGE_ATTRIBUTE,\n STAGE_TRANSITION_UID,\n} from '../constants/workflows';\n\n/**\n *\n * @param { Core.Strapi } strapi - Strapi instance\n * @param userAbility\n * @return { (Stage) => SanitizedStage }\n */\nfunction sanitizeStage({ strapi }: { strapi: Core.Strapi }, userAbility: unknown) {\n const permissionChecker = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility, model: STAGE_MODEL_UID });\n\n return (entity: unknown) => permissionChecker.sanitizeOutput(entity);\n}\n\nexport default {\n /**\n * List all stages\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async find(ctx: Context) {\n const { workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stages = await stagesService.find({\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await async.map(stages, sanitizer),\n };\n },\n /**\n * Get one stage\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async findById(ctx: Context) {\n const { id, workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stage = await stagesService.findById(id, {\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await sanitizer(stage),\n };\n },\n\n /**\n * Updates an entity's stage.\n * @async\n * @param {Object} ctx - The Koa context object.\n * @param {Object} ctx.params - An object containing the parameters from the request URL.\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity to update.\n * @param {Object} ctx.request.body.data - Optional data object containing the new stage ID for the entity.\n * @param {string} ctx.request.body.data.id - The ID of the new stage for the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n * @throws {ValidationError} If the `data` object in the request body fails to pass validation.\n * @returns {Promise<void>} A promise that resolves when the entity's stage has been updated.\n */\n async updateEntity(ctx: Context) {\n const stagesService = getService('stages');\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { body, query = {} } = ctx.request;\n\n const { sanitizeOutput } = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID });\n\n // Load entity\n const locale = await validateLocale(query?.locale);\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n // @ts-expect-error - locale should be also null in the doc service types\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n // Validate if entity stage can be updated\n const canTransition = stagePermissions.can(\n STAGE_TRANSITION_UID,\n entity[ENTITY_STAGE_ATTRIBUTE]?.id\n );\n\n if (!canTransition) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const { id: stageId } = await validateUpdateStageOnEntity(\n { id: Number(body?.data?.id) },\n 'You should pass an id to the body of the put request.'\n );\n\n const workflow = await workflowService.assertContentTypeBelongsToWorkflow(modelUID);\n workflowService.assertStageBelongsToWorkflow(stageId, workflow);\n\n const canTransitionTo = await stagePermissions.canTransitionToStage(stageId);\n if (!canTransitionTo) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const updatedEntity = await stagesService.updateEntity(entity, modelUID, stageId);\n\n ctx.body = { data: await sanitizeOutput(updatedEntity) };\n },\n\n /**\n * List all the stages that are available for a user to transition an entity to.\n * Stages are filtered by both \"from\" permission on the current stage AND \"to\" permission on each target stage.\n * @async\n * @param {*} ctx\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n */\n async listAvailableStages(ctx: Context) {\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { query = {} } = ctx.request;\n\n if (\n strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID })\n .cannot.read()\n ) {\n return ctx.forbidden();\n }\n\n // Load entity\n const locale = (await validateLocale(query?.locale)) ?? undefined;\n const [entity, workflowCount, workflowResult] = await Promise.all([\n strapi.documents(modelUID).findOne({\n documentId,\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n }),\n workflowService.count(),\n workflowService.getAssignedWorkflow(modelUID, {\n populate: { stages: { populate: { permissions: { populate: ['role'] } } } },\n }),\n ]);\n\n const workflowStages = workflowResult ? workflowResult.stages : [];\n const entityStageId = entity?.[ENTITY_STAGE_ATTRIBUTE]?.id;\n const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);\n\n const meta = {\n stageCount: workflowStages.length,\n workflowCount,\n canTransition,\n };\n\n // The entity may not exist yet for the requested locale (e.g. switching to a\n // locale that has not been saved).\n if (!entity) {\n if (!workflowResult) {\n ctx.throw(404, 'Entity not found');\n }\n\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n if (!canTransition) {\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n const otherStages = workflowStages.filter(\n (stage: { id: number; permissions?: unknown[] }) => stage.id !== entityStageId\n );\n\n const data = otherStages.filter((stage: { id: number; permissions?: unknown[] }) =>\n stagePermissions.canTransitionToStageWithPermissions(stage)\n );\n\n ctx.body = {\n data,\n meta,\n };\n },\n};\n"],"names":["sanitizeStage","strapi","userAbility","permissionChecker","plugin","service","create","model","STAGE_MODEL_UID","entity","sanitizeOutput","find","ctx","workflow_id","workflowId","params","populate","query","stagesService","getService","sanitizer","state","stages","body","data","async","map","findById","id","stage","updateEntity","stagePermissions","workflowService","model_uid","modelUID","documentId","request","locale","validateLocale","documents","findOne","ENTITY_STAGE_ATTRIBUTE","throw","canTransition","can","STAGE_TRANSITION_UID","stageId","validateUpdateStageOnEntity","Number","workflow","assertContentTypeBelongsToWorkflow","assertStageBelongsToWorkflow","canTransitionTo","canTransitionToStage","updatedEntity","listAvailableStages","cannot","read","forbidden","undefined","workflowCount","workflowResult","Promise","all","count","getAssignedWorkflow","permissions","workflowStages","entityStageId","meta","stageCount","length","otherStages","filter","canTransitionToStageWithPermissions"],"mappings":";;;;;;;AAYA;;;;;AAKC,IACD,SAASA,aAAAA,CAAc,EAAEC,QAAAA,OAAM,EAA2B,EAAEC,WAAoB,EAAA;IAC9E,MAAMC,iBAAAA,GAAoBF,QACvBG,MAAM,CAAC,mBACPC,OAAO,CAAC,oBAAA,CAAA,CACRC,MAAM,CAAC;AAAEJ,QAAAA,WAAAA;QAAaK,KAAAA,EAAOC;AAAgB,KAAA,CAAA;AAEhD,IAAA,OAAO,CAACC,MAAAA,GAAoBN,iBA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AAAA;AACF,SAAA;;;AAIA,QAAA,IAAI,CAAClC,MAAAA,EAAQ;AACX,YAAA,IAAI,CAACoD,cAAAA,EAAgB;gBACnBjD,GAAAA,CAAI8B,KAAK,CAAC,GAAA,EAAK,kBAAA,CAAA;AACjB,YAAA;AAEA9B,YAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,gBAAAA,IAAAA,EAAM,EAAE;AACR6C,gBAAAA;AACF,aAAA;AAEA,YAAA;AACF,QAAA;AAEA,QAAA,IAAI,CAAC1B,aAAAA,EAAe;AAClB/B,YAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,gBAAAA,IAAAA,EAAM,EAAE;AACR6C,gBAAAA;AACF,aAAA;AAEA,YAAA;AACF,QAAA;QAEA,MAAMG,WAAAA,GAAcL,eAAeM,MAAM,CACvC,CAAC5C,KAAAA,GAAmDA,KAAAA,CAAMD,EAAE,KAAKwC,aAAAA,CAAAA;QAGnE,MAAM5C,IAAAA,GAAOgD,YAAYC,MAAM,CAAC,CAAC5C,KAAAA,GAC/BE,gBAAAA,CAAiB2C,mCAAmC,CAAC7C,KAAAA,CAAAA,CAAAA;AAGvDjB,QAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,YAAAA,IAAAA;AACA6C,YAAAA;AACF,SAAA;AACF,IAAA;AACF,CAAA;;;;"}
|
|
@@ -127,19 +127,14 @@ var stages = {
|
|
|
127
127
|
}
|
|
128
128
|
// Load entity
|
|
129
129
|
const locale = await validateLocale(query?.locale) ?? undefined;
|
|
130
|
-
const entity = await
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
ctx.throw(404, 'Entity not found');
|
|
139
|
-
}
|
|
140
|
-
const entityStageId = entity[ENTITY_STAGE_ATTRIBUTE]?.id;
|
|
141
|
-
const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);
|
|
142
|
-
const [workflowCount, workflowResult] = await Promise.all([
|
|
130
|
+
const [entity, workflowCount, workflowResult] = await Promise.all([
|
|
131
|
+
strapi.documents(modelUID).findOne({
|
|
132
|
+
documentId,
|
|
133
|
+
locale,
|
|
134
|
+
populate: [
|
|
135
|
+
ENTITY_STAGE_ATTRIBUTE
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
143
138
|
workflowService.count(),
|
|
144
139
|
workflowService.getAssignedWorkflow(modelUID, {
|
|
145
140
|
populate: {
|
|
@@ -156,10 +151,25 @@ var stages = {
|
|
|
156
151
|
})
|
|
157
152
|
]);
|
|
158
153
|
const workflowStages = workflowResult ? workflowResult.stages : [];
|
|
154
|
+
const entityStageId = entity?.[ENTITY_STAGE_ATTRIBUTE]?.id;
|
|
155
|
+
const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);
|
|
159
156
|
const meta = {
|
|
160
157
|
stageCount: workflowStages.length,
|
|
161
|
-
workflowCount
|
|
158
|
+
workflowCount,
|
|
159
|
+
canTransition
|
|
162
160
|
};
|
|
161
|
+
// The entity may not exist yet for the requested locale (e.g. switching to a
|
|
162
|
+
// locale that has not been saved).
|
|
163
|
+
if (!entity) {
|
|
164
|
+
if (!workflowResult) {
|
|
165
|
+
ctx.throw(404, 'Entity not found');
|
|
166
|
+
}
|
|
167
|
+
ctx.body = {
|
|
168
|
+
data: [],
|
|
169
|
+
meta
|
|
170
|
+
};
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
163
173
|
if (!canTransition) {
|
|
164
174
|
ctx.body = {
|
|
165
175
|
data: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stages.mjs","sources":["../../../server/src/controllers/stages.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { async, validate } from '@strapi/utils';\nimport { getService } from '../utils';\nimport { validateUpdateStageOnEntity, validateLocale } from '../validation/review-workflows';\nimport {\n STAGE_MODEL_UID,\n ENTITY_STAGE_ATTRIBUTE,\n STAGE_TRANSITION_UID,\n} from '../constants/workflows';\n\n/**\n *\n * @param { Core.Strapi } strapi - Strapi instance\n * @param userAbility\n * @return { (Stage) => SanitizedStage }\n */\nfunction sanitizeStage({ strapi }: { strapi: Core.Strapi }, userAbility: unknown) {\n const permissionChecker = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility, model: STAGE_MODEL_UID });\n\n return (entity: unknown) => permissionChecker.sanitizeOutput(entity);\n}\n\nexport default {\n /**\n * List all stages\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async find(ctx: Context) {\n const { workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stages = await stagesService.find({\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await async.map(stages, sanitizer),\n };\n },\n /**\n * Get one stage\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async findById(ctx: Context) {\n const { id, workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stage = await stagesService.findById(id, {\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await sanitizer(stage),\n };\n },\n\n /**\n * Updates an entity's stage.\n * @async\n * @param {Object} ctx - The Koa context object.\n * @param {Object} ctx.params - An object containing the parameters from the request URL.\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity to update.\n * @param {Object} ctx.request.body.data - Optional data object containing the new stage ID for the entity.\n * @param {string} ctx.request.body.data.id - The ID of the new stage for the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n * @throws {ValidationError} If the `data` object in the request body fails to pass validation.\n * @returns {Promise<void>} A promise that resolves when the entity's stage has been updated.\n */\n async updateEntity(ctx: Context) {\n const stagesService = getService('stages');\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { body, query = {} } = ctx.request;\n\n const { sanitizeOutput } = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID });\n\n // Load entity\n const locale = await validateLocale(query?.locale);\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n // @ts-expect-error - locale should be also null in the doc service types\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n // Validate if entity stage can be updated\n const canTransition = stagePermissions.can(\n STAGE_TRANSITION_UID,\n entity[ENTITY_STAGE_ATTRIBUTE]?.id\n );\n\n if (!canTransition) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const { id: stageId } = await validateUpdateStageOnEntity(\n { id: Number(body?.data?.id) },\n 'You should pass an id to the body of the put request.'\n );\n\n const workflow = await workflowService.assertContentTypeBelongsToWorkflow(modelUID);\n workflowService.assertStageBelongsToWorkflow(stageId, workflow);\n\n const canTransitionTo = await stagePermissions.canTransitionToStage(stageId);\n if (!canTransitionTo) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const updatedEntity = await stagesService.updateEntity(entity, modelUID, stageId);\n\n ctx.body = { data: await sanitizeOutput(updatedEntity) };\n },\n\n /**\n * List all the stages that are available for a user to transition an entity to.\n * Stages are filtered by both \"from\" permission on the current stage AND \"to\" permission on each target stage.\n * @async\n * @param {*} ctx\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n */\n async listAvailableStages(ctx: Context) {\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { query = {} } = ctx.request;\n\n if (\n strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID })\n .cannot.read()\n ) {\n return ctx.forbidden();\n }\n\n // Load entity\n const locale = (await validateLocale(query?.locale)) ?? undefined;\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n const entityStageId = entity[ENTITY_STAGE_ATTRIBUTE]?.id;\n const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);\n\n const [workflowCount, workflowResult] = await Promise.all([\n workflowService.count(),\n workflowService.getAssignedWorkflow(modelUID, {\n populate: { stages: { populate: { permissions: { populate: ['role'] } } } },\n }),\n ]);\n\n const workflowStages = workflowResult ? workflowResult.stages : [];\n\n const meta = {\n stageCount: workflowStages.length,\n workflowCount,\n };\n\n if (!canTransition) {\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n const otherStages = workflowStages.filter(\n (stage: { id: number; permissions?: unknown[] }) => stage.id !== entityStageId\n );\n\n const data = otherStages.filter((stage: { id: number; permissions?: unknown[] }) =>\n stagePermissions.canTransitionToStageWithPermissions(stage)\n );\n\n ctx.body = {\n data,\n meta,\n };\n },\n};\n"],"names":["sanitizeStage","strapi","userAbility","permissionChecker","plugin","service","create","model","STAGE_MODEL_UID","entity","sanitizeOutput","find","ctx","workflow_id","workflowId","params","populate","query","stagesService","getService","sanitizer","state","stages","body","data","async","map","findById","id","stage","updateEntity","stagePermissions","workflowService","model_uid","modelUID","documentId","request","locale","validateLocale","documents","findOne","ENTITY_STAGE_ATTRIBUTE","throw","canTransition","can","STAGE_TRANSITION_UID","stageId","validateUpdateStageOnEntity","Number","workflow","assertContentTypeBelongsToWorkflow","assertStageBelongsToWorkflow","canTransitionTo","canTransitionToStage","updatedEntity","listAvailableStages","cannot","read","forbidden","undefined","entityStageId","workflowCount","workflowResult","Promise","all","count","getAssignedWorkflow","permissions","workflowStages","meta","stageCount","length","otherStages","filter","canTransitionToStageWithPermissions"],"mappings":";;;;;AAYA;;;;;AAKC,IACD,SAASA,aAAAA,CAAc,EAAEC,QAAAA,OAAM,EA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EM,MAAAA,EAAQ;wBAAEN,QAAAA,EAAU;4BAAEmD,WAAAA,EAAa;gCAAEnD,QAAAA,EAAU;AAAC,oCAAA;AAAO;AAAC;AAAE;AAAE;AAAE;AAC5E,aAAA;AACD,SAAA,CAAA;AAED,QAAA,MAAMoD,cAAAA,GAAiBN,cAAAA,GAAiBA,cAAAA,CAAexC,MAAM,GAAG,EAAE;AAElE,QAAA,MAAM+C,IAAAA,GAAO;AACXC,YAAAA,UAAAA,EAAYF,eAAeG,MAAM;AACjCV,YAAAA;AACF,SAAA;AAEA,QAAA,IAAI,CAAClB,aAAAA,EAAe;AAClB/B,YAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,gBAAAA,IAAAA,EAAM,EAAE;AACR6C,gBAAAA;AACF,aAAA;AAEA,YAAA;AACF,QAAA;QAEA,MAAMG,WAAAA,GAAcJ,eAAeK,MAAM,CACvC,CAAC5C,KAAAA,GAAmDA,KAAAA,CAAMD,EAAE,KAAKgC,aAAAA,CAAAA;QAGnE,MAAMpC,IAAAA,GAAOgD,YAAYC,MAAM,CAAC,CAAC5C,KAAAA,GAC/BE,gBAAAA,CAAiB2C,mCAAmC,CAAC7C,KAAAA,CAAAA,CAAAA;AAGvDjB,QAAAA,GAAAA,CAAIW,IAAI,GAAG;AACTC,YAAAA,IAAAA;AACA6C,YAAAA;AACF,SAAA;AACF,IAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"stages.mjs","sources":["../../../server/src/controllers/stages.ts"],"sourcesContent":["import type { Context } from 'koa';\nimport type { Core } from '@strapi/types';\n\nimport { async, validate } from '@strapi/utils';\nimport { getService } from '../utils';\nimport { validateUpdateStageOnEntity, validateLocale } from '../validation/review-workflows';\nimport {\n STAGE_MODEL_UID,\n ENTITY_STAGE_ATTRIBUTE,\n STAGE_TRANSITION_UID,\n} from '../constants/workflows';\n\n/**\n *\n * @param { Core.Strapi } strapi - Strapi instance\n * @param userAbility\n * @return { (Stage) => SanitizedStage }\n */\nfunction sanitizeStage({ strapi }: { strapi: Core.Strapi }, userAbility: unknown) {\n const permissionChecker = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility, model: STAGE_MODEL_UID });\n\n return (entity: unknown) => permissionChecker.sanitizeOutput(entity);\n}\n\nexport default {\n /**\n * List all stages\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async find(ctx: Context) {\n const { workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stages = await stagesService.find({\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await async.map(stages, sanitizer),\n };\n },\n /**\n * Get one stage\n * @param {import('koa').BaseContext} ctx - koa context\n */\n async findById(ctx: Context) {\n const { id, workflow_id: workflowId } = ctx.params;\n const { populate } = ctx.query;\n const stagesService = getService('stages');\n const sanitizer = sanitizeStage({ strapi }, ctx.state.userAbility);\n\n const stage = await stagesService.findById(id, {\n workflowId,\n populate,\n });\n\n ctx.body = {\n data: await sanitizer(stage),\n };\n },\n\n /**\n * Updates an entity's stage.\n * @async\n * @param {Object} ctx - The Koa context object.\n * @param {Object} ctx.params - An object containing the parameters from the request URL.\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity to update.\n * @param {Object} ctx.request.body.data - Optional data object containing the new stage ID for the entity.\n * @param {string} ctx.request.body.data.id - The ID of the new stage for the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n * @throws {ValidationError} If the `data` object in the request body fails to pass validation.\n * @returns {Promise<void>} A promise that resolves when the entity's stage has been updated.\n */\n async updateEntity(ctx: Context) {\n const stagesService = getService('stages');\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { body, query = {} } = ctx.request;\n\n const { sanitizeOutput } = strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID });\n\n // Load entity\n const locale = await validateLocale(query?.locale);\n const entity = await strapi.documents(modelUID).findOne({\n documentId,\n // @ts-expect-error - locale should be also null in the doc service types\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n });\n\n if (!entity) {\n ctx.throw(404, 'Entity not found');\n }\n\n // Validate if entity stage can be updated\n const canTransition = stagePermissions.can(\n STAGE_TRANSITION_UID,\n entity[ENTITY_STAGE_ATTRIBUTE]?.id\n );\n\n if (!canTransition) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const { id: stageId } = await validateUpdateStageOnEntity(\n { id: Number(body?.data?.id) },\n 'You should pass an id to the body of the put request.'\n );\n\n const workflow = await workflowService.assertContentTypeBelongsToWorkflow(modelUID);\n workflowService.assertStageBelongsToWorkflow(stageId, workflow);\n\n const canTransitionTo = await stagePermissions.canTransitionToStage(stageId);\n if (!canTransitionTo) {\n ctx.throw(403, 'Forbidden stage transition');\n }\n\n const updatedEntity = await stagesService.updateEntity(entity, modelUID, stageId);\n\n ctx.body = { data: await sanitizeOutput(updatedEntity) };\n },\n\n /**\n * List all the stages that are available for a user to transition an entity to.\n * Stages are filtered by both \"from\" permission on the current stage AND \"to\" permission on each target stage.\n * @async\n * @param {*} ctx\n * @param {string} ctx.params.model_uid - The model UID of the entity.\n * @param {string} ctx.params.id - The ID of the entity.\n * @throws {ApplicationError} If review workflows is not activated on the specified model UID.\n */\n async listAvailableStages(ctx: Context) {\n const stagePermissions = getService('stage-permissions');\n const workflowService = getService('workflows');\n\n const { model_uid: modelUID, id: documentId } = ctx.params;\n const { query = {} } = ctx.request;\n\n if (\n strapi\n .plugin('content-manager')\n .service('permission-checker')\n .create({ userAbility: ctx.state.userAbility, model: modelUID })\n .cannot.read()\n ) {\n return ctx.forbidden();\n }\n\n // Load entity\n const locale = (await validateLocale(query?.locale)) ?? undefined;\n const [entity, workflowCount, workflowResult] = await Promise.all([\n strapi.documents(modelUID).findOne({\n documentId,\n locale,\n populate: [ENTITY_STAGE_ATTRIBUTE],\n }),\n workflowService.count(),\n workflowService.getAssignedWorkflow(modelUID, {\n populate: { stages: { populate: { permissions: { populate: ['role'] } } } },\n }),\n ]);\n\n const workflowStages = workflowResult ? workflowResult.stages : [];\n const entityStageId = entity?.[ENTITY_STAGE_ATTRIBUTE]?.id;\n const canTransition = stagePermissions.can(STAGE_TRANSITION_UID, entityStageId);\n\n const meta = {\n stageCount: workflowStages.length,\n workflowCount,\n canTransition,\n };\n\n // The entity may not exist yet for the requested locale (e.g. switching to a\n // locale that has not been saved).\n if (!entity) {\n if (!workflowResult) {\n ctx.throw(404, 'Entity not found');\n }\n\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n if (!canTransition) {\n ctx.body = {\n data: [],\n meta,\n };\n\n return;\n }\n\n const otherStages = workflowStages.filter(\n (stage: { id: number; permissions?: unknown[] }) => stage.id !== entityStageId\n );\n\n const data = otherStages.filter((stage: { id: number; permissions?: unknown[] }) =>\n stagePermissions.canTransitionToStageWithPermissions(stage)\n );\n\n ctx.body = {\n data,\n meta,\n };\n },\n};\n"],"names":["sanitizeStage","strapi","userAbility","permissionChecker","plugin","service","create","model","STAGE_MODEL_UID","entity","sanitizeOutput","find","ctx","workflow_id","workflowId","params","populate","query","stagesService","getService","sanitizer","state","stages","body","data","async","map","findById","id","stage","updateEntity","stagePermissions","workflowService","model_uid","modelUID","documentId","request","locale","validateLocale","documents","findOne","ENTITY_STAGE_ATTRIBUTE","throw","canTransition","can","STAGE_TRANSITION_UID","stageId","validateUpdateStageOnEntity","Number","workflow","assertContentTypeBelongsToWorkflow","assertStageBelongsToWorkflow","canTransitionTo","canTransitionToStage","updatedEntity","listAvailableStages","cannot","read","forbidden","undefined","workflowCount","workflowResult","Promise","all","count","getAssignedWorkflow","permissions","workflowStages","entityStageId","meta","stageCount","length","otherStages","filter","canTransitionToStageWithPermissions"],"mappings":";;;;;AAYA;;;;;AAKC,IACD,SAASA,aAAAA,CAAc,EAAEC,QAAAA,OAAM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cACa,OAAO;IAevB;;;OAGG;kBACiB,OAAO;IAgB3B;;;;;;;;;;;;OAYG;sBACqB,OAAO;IAsD/B;;;;;;;;OAQG;6BAC4B,OAAO;;AApHxC,
|
|
1
|
+
{"version":3,"file":"stages.d.ts","sourceRoot":"","sources":["../../../../server/src/controllers/stages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;;IA4BjC;;;OAGG;cACa,OAAO;IAevB;;;OAGG;kBACiB,OAAO;IAgB3B;;;;;;;;;;;;OAYG;sBACqB,OAAO;IAsD/B;;;;;;;;OAQG;6BAC4B,OAAO;;AApHxC,wBAkME"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflows.d.ts","sourceRoot":"","sources":["../../../shared/contracts/review-workflows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAEvD;;GAEG;AACH,kBAAU,cAAc,CAAC;IACvB,UAAiB,OAAO;QACtB,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;aACzB,CAAC;SACH,CAAC;QACF,KAAK,EAAE,EAAE,CAAC;KACX;IAED,UAAiB,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;KAClB;IAED,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;KACjC;CACF;AAED,UAAU,eACR,SAAQ,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,KAAM,SAAQ,MAAM;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,kBAAU,SAAS,CAAC;IAClB,UAAiB,OAAO;QACtB,IAAI,EAAE,EAAE,CAAC;QACT,KAAK,EAAE,EAAE,CAAC;KACX;IAED,UAAiB,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;KAClB;IAED,UAAiB,QAAQ;QACvB,IAAI,EAAE,KAAK,EAAE,CAAC;QACd,IAAI,CAAC,EAAE;YAAE,aAAa,EAAE,MAAM,CAAA;SAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"review-workflows.d.ts","sourceRoot":"","sources":["../../../shared/contracts/review-workflows.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAEvD;;GAEG;AACH,kBAAU,cAAc,CAAC;IACvB,UAAiB,OAAO;QACtB,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;aACzB,CAAC;SACH,CAAC;QACF,KAAK,EAAE,EAAE,CAAC;KACX;IAED,UAAiB,MAAM;Q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,UAAiB,QAAQ;QACvB,IAAI,EAAE,QAAQ,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;KACjC;CACF;AAED,kBAAU,MAAM,CAAC;IACf,UAAiB,OAAO;QACtB,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG;gBAGvD,0BAA0B,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;aACnD,CAAC;SACH,CAAC;QACF,KAAK,EAAE,EAAE,CAAC;KACX;IAED,UAAiB,QAAQ;QACvB,IAAI,EAAE,QAAQ,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;KACjC;CACF;AAED,kBAAU,MAAM,CAAC;IACf,UAAiB,OAAO;QACtB,IAAI,EAAE,EAAE,CAAC;QACT,KAAK,EAAE,EAAE,CAAC;KACX;IAED,UAAiB,MAAM;QACrB,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;KAClB;IAED,UAAiB,QAAQ;QACvB,IAAI,EAAE,QAAQ,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC;KACjC;CACF;AAED,YAAY,EACV,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,GAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/review-workflows",
|
|
3
|
-
"version": "5.46.
|
|
3
|
+
"version": "5.46.1",
|
|
4
4
|
"description": "Review workflows for your content",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@reduxjs/toolkit": "1.9.7",
|
|
65
65
|
"@strapi/design-system": "2.2.0",
|
|
66
66
|
"@strapi/icons": "2.2.0",
|
|
67
|
-
"@strapi/utils": "5.46.
|
|
67
|
+
"@strapi/utils": "5.46.1",
|
|
68
68
|
"fractional-indexing": "3.2.0",
|
|
69
69
|
"react-dnd": "16.0.1",
|
|
70
70
|
"react-dnd-html5-backend": "16.0.1",
|
|
@@ -74,15 +74,15 @@
|
|
|
74
74
|
"yup": "0.32.9"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@strapi/admin": "5.46.
|
|
78
|
-
"@strapi/content-manager": "5.46.
|
|
79
|
-
"@strapi/types": "5.46.
|
|
77
|
+
"@strapi/admin": "5.46.1",
|
|
78
|
+
"@strapi/content-manager": "5.46.1",
|
|
79
|
+
"@strapi/types": "5.46.1",
|
|
80
80
|
"@testing-library/react": "16.3.0",
|
|
81
81
|
"msw": "2.13.4",
|
|
82
82
|
"react": "18.3.1",
|
|
83
83
|
"react-dom": "18.3.1",
|
|
84
84
|
"react-router-dom": "6.30.3",
|
|
85
|
-
"styled-components": "6.1
|
|
85
|
+
"styled-components": "6.4.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@strapi/admin": "^5.0.0",
|