@strapi/review-workflows 0.0.0-next.3c5bc3f35387771b185349533729e99e6e59c525 → 0.0.0-next.3fdd03038d558a8190aa7e17574020c5f65395e6
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/_chunks/{Layout-D7wwT4c7.js → Layout-8i0EXRRs.js} +2 -2
- package/dist/_chunks/{Layout-D7wwT4c7.js.map → Layout-8i0EXRRs.js.map} +1 -1
- package/dist/_chunks/{Layout-CJZ4iUxI.mjs → Layout-C9m07iTY.mjs} +2 -2
- package/dist/_chunks/{Layout-CJZ4iUxI.mjs.map → Layout-C9m07iTY.mjs.map} +1 -1
- package/dist/_chunks/{_id-DgUOk637.js → id-CmtaTf1x.js} +3 -3
- package/dist/_chunks/id-CmtaTf1x.js.map +1 -0
- package/dist/_chunks/{_id-DA44l-QM.mjs → id-DV0Ndeav.mjs} +3 -3
- package/dist/_chunks/id-DV0Ndeav.mjs.map +1 -0
- package/dist/_chunks/{index-DL9odlOl.js → index-B8WmHbCU.js} +3 -3
- package/dist/_chunks/{index-DL9odlOl.js.map → index-B8WmHbCU.js.map} +1 -1
- package/dist/_chunks/{index-mQar1hfK.js → index-BCUO98DV.js} +2 -5
- package/dist/_chunks/{index-mQar1hfK.js.map → index-BCUO98DV.js.map} +1 -1
- package/dist/_chunks/{index-CnyO97Gi.mjs → index-CA5Axcoc.mjs} +3 -3
- package/dist/_chunks/{index-CnyO97Gi.mjs.map → index-CA5Axcoc.mjs.map} +1 -1
- package/dist/_chunks/{index-C33Q2-Fc.mjs → index-CqYVkW3E.mjs} +2 -5
- package/dist/_chunks/{index-C33Q2-Fc.mjs.map → index-CqYVkW3E.mjs.map} +1 -1
- package/dist/_chunks/{router-B1YtLp6u.js → router-BOXlNnrU.js} +3 -3
- package/dist/_chunks/router-BOXlNnrU.js.map +1 -0
- package/dist/_chunks/{router-BFv8U71z.mjs → router-Jdt6SbIA.mjs} +3 -3
- package/dist/_chunks/router-Jdt6SbIA.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +41 -7
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +41 -7
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/stages.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/_chunks/_id-DA44l-QM.mjs.map +0 -1
- package/dist/_chunks/_id-DgUOk637.js.map +0 -1
- package/dist/_chunks/router-B1YtLp6u.js.map +0 -1
- package/dist/_chunks/router-BFv8U71z.mjs.map +0 -1
- /package/dist/admin/src/routes/settings/{:id.d.ts → id.d.ts} +0 -0
package/dist/server/index.mjs
CHANGED
|
@@ -6561,8 +6561,40 @@ function extendReviewWorkflowContentTypes({ strapi: strapi2 }) {
|
|
|
6561
6561
|
});
|
|
6562
6562
|
}
|
|
6563
6563
|
}
|
|
6564
|
+
function persistRWOnDowngrade({ strapi: strapi2 }) {
|
|
6565
|
+
const { removePersistedTablesWithSuffix, persistTables } = getAdminService("persist-tables");
|
|
6566
|
+
return async ({ contentTypes: contentTypes2 }) => {
|
|
6567
|
+
const getStageTableToPersist = (contentTypeUID) => {
|
|
6568
|
+
const { attributes, tableName } = strapi2.db.metadata.get(contentTypeUID);
|
|
6569
|
+
const joinTableName = attributes[ENTITY_STAGE_ATTRIBUTE].joinTable.name;
|
|
6570
|
+
return {
|
|
6571
|
+
name: joinTableName,
|
|
6572
|
+
dependsOn: [{ name: tableName }]
|
|
6573
|
+
};
|
|
6574
|
+
};
|
|
6575
|
+
const getAssigneeTableToPersist = (contentTypeUID) => {
|
|
6576
|
+
const { attributes, tableName } = strapi2.db.metadata.get(contentTypeUID);
|
|
6577
|
+
const joinTableName = attributes[ENTITY_ASSIGNEE_ATTRIBUTE].joinTable.name;
|
|
6578
|
+
return {
|
|
6579
|
+
name: joinTableName,
|
|
6580
|
+
dependsOn: [{ name: tableName }]
|
|
6581
|
+
};
|
|
6582
|
+
};
|
|
6583
|
+
const enabledRWContentTypes = fp.pipe([
|
|
6584
|
+
getVisibleContentTypesUID,
|
|
6585
|
+
fp.filter((uid) => hasStageAttribute(contentTypes2[uid]))
|
|
6586
|
+
])(contentTypes2);
|
|
6587
|
+
const stageJoinTablesToPersist = enabledRWContentTypes.map(getStageTableToPersist);
|
|
6588
|
+
await removePersistedTablesWithSuffix("_strapi_stage_lnk");
|
|
6589
|
+
await persistTables(stageJoinTablesToPersist);
|
|
6590
|
+
const assigneeJoinTablesToPersist = enabledRWContentTypes.map(getAssigneeTableToPersist);
|
|
6591
|
+
await removePersistedTablesWithSuffix("_strapi_assignee_lnk");
|
|
6592
|
+
await persistTables(assigneeJoinTablesToPersist);
|
|
6593
|
+
};
|
|
6594
|
+
}
|
|
6564
6595
|
const register = async ({ strapi: strapi2 }) => {
|
|
6565
6596
|
strapi2.hook("strapi::content-types.beforeSync").register(migrateStageAttribute);
|
|
6597
|
+
strapi2.hook("strapi::content-types.afterSync").register(persistRWOnDowngrade({ strapi: strapi2 }));
|
|
6566
6598
|
strapi2.hook("strapi::content-types.afterSync").register(migrateReviewWorkflowStagesColor).register(migrateReviewWorkflowStagesRoles).register(migrateReviewWorkflowName).register(migrateWorkflowsContentTypes).register(migrateDeletedCTInWorkflows);
|
|
6567
6599
|
reviewWorkflowsMiddlewares.contentTypeMiddleware(strapi2);
|
|
6568
6600
|
extendReviewWorkflowContentTypes({ strapi: strapi2 });
|
|
@@ -7331,7 +7363,9 @@ const stages$1 = ({ strapi: strapi2 }) => {
|
|
|
7331
7363
|
const entity = await strapi2.documents(model).update({
|
|
7332
7364
|
documentId,
|
|
7333
7365
|
locale,
|
|
7334
|
-
|
|
7366
|
+
// Stage doesn't have DP or i18n enabled, connecting it through the `id`
|
|
7367
|
+
// will be safer than relying on the `documentId` + `locale` + `status` transformation
|
|
7368
|
+
data: { [ENTITY_STAGE_ATTRIBUTE]: fp.pick(["id"], stage) },
|
|
7335
7369
|
populate: [ENTITY_STAGE_ATTRIBUTE]
|
|
7336
7370
|
});
|
|
7337
7371
|
metrics.sendDidChangeEntryStage();
|
|
@@ -7607,13 +7641,13 @@ const reviewWorkflowsMetrics = {
|
|
|
7607
7641
|
sendDidSendReviewWorkflowPropertiesOnceAWeek,
|
|
7608
7642
|
sendDidEditAssignee
|
|
7609
7643
|
};
|
|
7610
|
-
function _typeof(
|
|
7644
|
+
function _typeof(o) {
|
|
7611
7645
|
"@babel/helpers - typeof";
|
|
7612
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(
|
|
7613
|
-
return typeof
|
|
7614
|
-
} : function(
|
|
7615
|
-
return
|
|
7616
|
-
}, _typeof(
|
|
7646
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
7647
|
+
return typeof o2;
|
|
7648
|
+
} : function(o2) {
|
|
7649
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
7650
|
+
}, _typeof(o);
|
|
7617
7651
|
}
|
|
7618
7652
|
function toInteger(dirtyNumber) {
|
|
7619
7653
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|