@webiny/api-apw 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f
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/ApwChangeRequestNotification.d.ts +1 -1
- package/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.d.ts +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.d.ts +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.d.ts +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.d.ts +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.d.ts +1 -1
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.d.ts +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.d.ts +2 -2
- package/crud/createContentReviewMethods.js +57 -32
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.d.ts +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.d.ts +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.d.ts +2 -2
- package/crud/utils.js +8 -8
- package/crud/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +7 -6
- package/index.js.map +1 -1
- package/package.json +32 -50
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +1 -1
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.d.ts +2 -2
- package/plugins/cms/apwEntryPlugins.js +19 -7
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.d.ts +4 -4
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.d.ts +2 -2
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.d.ts +2 -2
- package/plugins/cms/linkWorkflowToEntry.js +17 -16
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.d.ts +2 -2
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.d.ts +3 -3
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +5 -4
- package/plugins/cms/utils.js +19 -13
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +3 -3
- package/plugins/context.js +5 -14
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.d.ts +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -13
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.d.ts +1 -1
- package/plugins/graphql/comment.gql.js +41 -36
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.d.ts +1 -1
- package/plugins/graphql/contentReview.gql.js +26 -17
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.d.ts +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -13
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +10 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +1 -1
- package/plugins/graphql/workflow.gql.js +15 -13
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.d.ts +1 -1
- package/plugins/graphql.js +4 -2
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.d.ts +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.d.ts +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.d.ts +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.d.ts +3 -3
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +8 -11
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +8 -11
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +9 -12
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.d.ts +2 -2
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/getAppUrl.d.ts +2 -0
- package/plugins/hooks/notifications/getAppUrl.js +19 -0
- package/plugins/hooks/notifications/getAppUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.d.ts +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.d.ts +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.d.ts +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.d.ts +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.d.ts +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.d.ts +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/utils.d.ts +7 -6
- package/plugins/utils.js +12 -8
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.d.ts +1 -1
- package/scheduler/createScheduleActionMethods.js +105 -66
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +2 -2
- package/scheduler/handlers/executeAction/index.js +30 -9
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +3 -2
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.d.ts +2 -2
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +2 -2
- package/scheduler/handlers/scheduleAction/index.js +20 -15
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +3 -3
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +19 -14
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -3
- package/scheduler/handlers/utils.js +20 -13
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.d.ts +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +20 -36
- package/scheduler/types.js +11 -17
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.d.ts +2 -2
- package/storageOperations/changeRequestStorageOperations.js +44 -23
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.d.ts +3 -3
- package/storageOperations/commentStorageOperations.js +17 -24
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -3
- package/storageOperations/contentReviewStorageOperations.js +20 -25
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +3 -9
- package/storageOperations/index.js +11 -16
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +10 -11
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +10 -11
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +16 -15
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.d.ts +1 -1
- package/storageOperations/models/index.js +11 -31
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +11 -12
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.d.ts +2 -2
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +2 -3
- package/storageOperations/models/workflow.model.js +22 -23
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +3 -3
- package/storageOperations/reviewerStorageOperations.js +24 -34
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.d.ts +2 -2
- package/storageOperations/types.js +3 -1
- package/storageOperations/types.js.map +1 -1
- package/storageOperations/workflowStorageOperations.d.ts +2 -2
- package/storageOperations/workflowStorageOperations.js +25 -28
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +49 -64
- package/types.js +121 -29
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.d.ts +2 -2
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +3 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.d.ts +2 -2
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +30 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.d.ts +0 -2
- package/plugins/hooks/notifications/appUrl.js +0 -18
- package/plugins/hooks/notifications/appUrl.js.map +0 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +0 -9
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +0 -36
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +0 -1
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +0 -3
- package/plugins/pageBuilder/apwContentPagePlugins.js +0 -26
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +0 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +0 -3
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +0 -20
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +0 -1
- package/plugins/pageBuilder/index.d.ts +0 -11
- package/plugins/pageBuilder/index.js +0 -42
- package/plugins/pageBuilder/index.js.map +0 -1
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +0 -8
- package/plugins/pageBuilder/linkContentReviewToPage.js +0 -89
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +0 -1
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +0 -8
- package/plugins/pageBuilder/linkWorkflowToPage.js +0 -164
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +0 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +0 -31
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/commentNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +0 -31
- package/plugins/pageBuilder/notifications/commentNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +0 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +0 -31
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +0 -1
- package/plugins/pageBuilder/notifications/contentUrl.d.ts +0 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +0 -47
- package/plugins/pageBuilder/notifications/contentUrl.js.map +0 -1
- package/plugins/pageBuilder/triggerContentReview.d.ts +0 -8
- package/plugins/pageBuilder/triggerContentReview.js +0 -39
- package/plugins/pageBuilder/triggerContentReview.js.map +0 -1
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +0 -10
- package/plugins/pageBuilder/updateContentReviewStatus.js +0 -67
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +0 -1
- package/plugins/pageBuilder/utils.d.ts +0 -22
- package/plugins/pageBuilder/utils.js +0 -150
- package/plugins/pageBuilder/utils.js.map +0 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -8
- package/storageOperations/models/contentModelPluginFactory.js +0 -19
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -1,164 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.linkWorkflowToPage = void 0;
|
8
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
9
|
-
var _set = _interopRequireDefault(require("lodash/set"));
|
10
|
-
var _types = require("../../types");
|
11
|
-
var _utils = require("./utils");
|
12
|
-
const linkWorkflowToPage = params => {
|
13
|
-
const {
|
14
|
-
apw,
|
15
|
-
pageBuilder
|
16
|
-
} = params;
|
17
|
-
pageBuilder.onPageBeforeCreate.subscribe(async ({
|
18
|
-
page
|
19
|
-
}) => {
|
20
|
-
await (0, _utils.assignWorkflowToPage)({
|
21
|
-
listWorkflow: apw.workflow.list,
|
22
|
-
page
|
23
|
-
});
|
24
|
-
});
|
25
|
-
pageBuilder.onPageBeforeCreateFrom.subscribe(async params => {
|
26
|
-
const {
|
27
|
-
page,
|
28
|
-
original
|
29
|
-
} = params;
|
30
|
-
/**
|
31
|
-
* If the previous revision(original) already had the "contentReviewId",
|
32
|
-
* we need to unlink it so that new "contentReview" can be request for the new revision.
|
33
|
-
*/
|
34
|
-
const previousContentReviewId = (0, _get.default)(original, "settings.apw.contentReviewId");
|
35
|
-
if (previousContentReviewId) {
|
36
|
-
page.settings.apw.contentReviewId = null;
|
37
|
-
}
|
38
|
-
|
39
|
-
/**
|
40
|
-
* If the previous revision(original) already had the "workflowId",
|
41
|
-
* we don't need to do anything we'll just let it be copied over.
|
42
|
-
*/
|
43
|
-
const previousWorkflowId = (0, _get.default)(original, "settings.apw.workflowId");
|
44
|
-
if (previousWorkflowId) {
|
45
|
-
return;
|
46
|
-
}
|
47
|
-
/**
|
48
|
-
* Lookup and assign "workflowId".
|
49
|
-
*/
|
50
|
-
await (0, _utils.assignWorkflowToPage)({
|
51
|
-
listWorkflow: apw.workflow.list,
|
52
|
-
page
|
53
|
-
});
|
54
|
-
});
|
55
|
-
pageBuilder.onPageBeforeUpdate.subscribe(async params => {
|
56
|
-
const {
|
57
|
-
page,
|
58
|
-
original
|
59
|
-
} = params;
|
60
|
-
const prevApwWorkflowId = (0, _get.default)(original, "settings.apw");
|
61
|
-
const currentApwWorkflowId = (0, _get.default)(page, "settings.apw");
|
62
|
-
/**
|
63
|
-
* Make sure the apw property doesn't get lost between updates.
|
64
|
-
* It can happen because we run modal validation in "onBeforePageUpdate" event,
|
65
|
-
* which doesn't have the "apw" property.
|
66
|
-
*/
|
67
|
-
if (prevApwWorkflowId && !currentApwWorkflowId) {
|
68
|
-
page.settings.apw = original.settings.apw;
|
69
|
-
}
|
70
|
-
/*
|
71
|
-
* If there is a linked "contentReview" for this page and the page "title" has changed.
|
72
|
-
* Let's update the "title" field in "contentReview".
|
73
|
-
*/
|
74
|
-
const linkedContentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
75
|
-
const prevTitle = (0, _get.default)(original, "title");
|
76
|
-
const newTitle = (0, _get.default)(page, "title");
|
77
|
-
if (linkedContentReviewId && prevTitle !== newTitle) {
|
78
|
-
await apw.contentReview.update(linkedContentReviewId, {
|
79
|
-
title: newTitle
|
80
|
-
});
|
81
|
-
}
|
82
|
-
});
|
83
|
-
/**
|
84
|
-
* Link created workflow to associated pages.
|
85
|
-
*/
|
86
|
-
apw.workflow.onWorkflowAfterCreate.subscribe(async ({
|
87
|
-
workflow
|
88
|
-
}) => {
|
89
|
-
const {
|
90
|
-
scope
|
91
|
-
} = workflow;
|
92
|
-
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
93
|
-
return;
|
94
|
-
}
|
95
|
-
/**
|
96
|
-
* If the workflow has pages in it's scope, we'll link that workflow for each of those pages.
|
97
|
-
*/
|
98
|
-
if ((0, _utils.hasPages)(workflow) === false) {
|
99
|
-
return;
|
100
|
-
}
|
101
|
-
const pages = (0, _get.default)(scope, "data.pages");
|
102
|
-
for (const pid of pages) {
|
103
|
-
await (0, _utils.updatePageSettings)({
|
104
|
-
getPage: pageBuilder.getPage,
|
105
|
-
updatePage: pageBuilder.updatePage,
|
106
|
-
uniquePageId: pid,
|
107
|
-
getNewSettings: settings => {
|
108
|
-
return (0, _set.default)(settings, "apw.workflowId", workflow.id);
|
109
|
-
}
|
110
|
-
});
|
111
|
-
}
|
112
|
-
});
|
113
|
-
/**
|
114
|
-
* Link updated workflow to associated pages.
|
115
|
-
*/
|
116
|
-
apw.workflow.onWorkflowAfterUpdate.subscribe(async ({
|
117
|
-
workflow,
|
118
|
-
original
|
119
|
-
}) => {
|
120
|
-
const {
|
121
|
-
scope
|
122
|
-
} = workflow;
|
123
|
-
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
124
|
-
return;
|
125
|
-
}
|
126
|
-
const {
|
127
|
-
scope: prevScope
|
128
|
-
} = original;
|
129
|
-
/**
|
130
|
-
* If the workflow has pages in it's scope and there is a change in that page list,
|
131
|
-
* we'll update the workflow link for corresponding pages.
|
132
|
-
*/
|
133
|
-
if ((0, _utils.hasPages)(workflow) === false || (0, _utils.shouldUpdatePages)(scope, prevScope) === false) {
|
134
|
-
return;
|
135
|
-
}
|
136
|
-
const previousPages = (0, _get.default)(prevScope, "data.pages", []);
|
137
|
-
const currentPages = (0, _get.default)(scope, "data.pages", []);
|
138
|
-
const {
|
139
|
-
removedPages,
|
140
|
-
addedPages
|
141
|
-
} = (0, _utils.getPagesDiff)(currentPages, previousPages);
|
142
|
-
for (const pid of addedPages) {
|
143
|
-
await (0, _utils.updatePageSettings)({
|
144
|
-
getPage: pageBuilder.getPage,
|
145
|
-
updatePage: pageBuilder.updatePage,
|
146
|
-
uniquePageId: pid,
|
147
|
-
getNewSettings: settings => {
|
148
|
-
return (0, _set.default)(settings, "apw.workflowId", workflow.id);
|
149
|
-
}
|
150
|
-
});
|
151
|
-
}
|
152
|
-
for (const pid of removedPages) {
|
153
|
-
await (0, _utils.updatePageSettings)({
|
154
|
-
getPage: pageBuilder.getPage,
|
155
|
-
updatePage: pageBuilder.updatePage,
|
156
|
-
uniquePageId: pid,
|
157
|
-
getNewSettings: settings => {
|
158
|
-
return (0, _set.default)(settings, "apw.workflowId", null);
|
159
|
-
}
|
160
|
-
});
|
161
|
-
}
|
162
|
-
});
|
163
|
-
};
|
164
|
-
exports.linkWorkflowToPage = linkWorkflowToPage;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["linkWorkflowToPage","params","apw","pageBuilder","onPageBeforeCreate","subscribe","page","assignWorkflowToPage","listWorkflow","workflow","list","onPageBeforeCreateFrom","original","previousContentReviewId","get","settings","contentReviewId","previousWorkflowId","onPageBeforeUpdate","prevApwWorkflowId","currentApwWorkflowId","linkedContentReviewId","prevTitle","newTitle","contentReview","update","title","onWorkflowAfterCreate","scope","app","ApwWorkflowApplications","PB","hasPages","pages","pid","updatePageSettings","getPage","updatePage","uniquePageId","getNewSettings","set","id","onWorkflowAfterUpdate","prevScope","shouldUpdatePages","previousPages","currentPages","removedPages","addedPages","getPagesDiff"],"sources":["linkWorkflowToPage.ts"],"sourcesContent":["import get from \"lodash/get\";\nimport set from \"lodash/set\";\nimport {\n ApwWorkflowApplications,\n ApwOnPageBeforeCreateTopicParams,\n ApwOnPageBeforeCreateFromTopicParams,\n ApwOnPageBeforeUpdateTopicParams,\n AdvancedPublishingWorkflow\n} from \"~/types\";\nimport {\n getPagesDiff,\n hasPages,\n updatePageSettings,\n shouldUpdatePages,\n assignWorkflowToPage\n} from \"./utils\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\n\ninterface LinkWorkflowToPageParams {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n}\n\nexport const linkWorkflowToPage = (params: LinkWorkflowToPageParams) => {\n const { apw, pageBuilder } = params;\n\n pageBuilder.onPageBeforeCreate.subscribe<ApwOnPageBeforeCreateTopicParams>(async ({ page }) => {\n await assignWorkflowToPage({ listWorkflow: apw.workflow.list, page });\n });\n pageBuilder.onPageBeforeCreateFrom.subscribe<ApwOnPageBeforeCreateFromTopicParams>(\n async params => {\n const { page, original } = params;\n /**\n * If the previous revision(original) already had the \"contentReviewId\",\n * we need to unlink it so that new \"contentReview\" can be request for the new revision.\n */\n const previousContentReviewId = get(original, \"settings.apw.contentReviewId\");\n if (previousContentReviewId) {\n page.settings.apw.contentReviewId = null;\n }\n\n /**\n * If the previous revision(original) already had the \"workflowId\",\n * we don't need to do anything we'll just let it be copied over.\n */\n const previousWorkflowId = get(original, \"settings.apw.workflowId\");\n if (previousWorkflowId) {\n return;\n }\n /**\n * Lookup and assign \"workflowId\".\n */\n await assignWorkflowToPage({ listWorkflow: apw.workflow.list, page });\n }\n );\n pageBuilder.onPageBeforeUpdate.subscribe<ApwOnPageBeforeUpdateTopicParams>(async params => {\n const { page, original } = params;\n const prevApwWorkflowId = get(original, \"settings.apw\");\n const currentApwWorkflowId = get(page, \"settings.apw\");\n /**\n * Make sure the apw property doesn't get lost between updates.\n * It can happen because we run modal validation in \"onBeforePageUpdate\" event,\n * which doesn't have the \"apw\" property.\n */\n if (prevApwWorkflowId && !currentApwWorkflowId) {\n page.settings.apw = original.settings.apw;\n }\n /*\n * If there is a linked \"contentReview\" for this page and the page \"title\" has changed.\n * Let's update the \"title\" field in \"contentReview\".\n */\n const linkedContentReviewId = get(page, \"settings.apw.contentReviewId\");\n const prevTitle = get(original, \"title\");\n const newTitle = get(page, \"title\");\n\n if (linkedContentReviewId && prevTitle !== newTitle) {\n await apw.contentReview.update(linkedContentReviewId, { title: newTitle });\n }\n });\n /**\n * Link created workflow to associated pages.\n */\n apw.workflow.onWorkflowAfterCreate.subscribe(async ({ workflow }) => {\n const { scope } = workflow;\n if (workflow.app !== ApwWorkflowApplications.PB) {\n return;\n }\n /**\n * If the workflow has pages in it's scope, we'll link that workflow for each of those pages.\n */\n if (hasPages(workflow) === false) {\n return;\n }\n const pages = get(scope, \"data.pages\") as unknown as string[];\n\n for (const pid of pages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", workflow.id);\n }\n });\n }\n });\n /**\n * Link updated workflow to associated pages.\n */\n apw.workflow.onWorkflowAfterUpdate.subscribe(async ({ workflow, original }) => {\n const { scope } = workflow;\n if (workflow.app !== ApwWorkflowApplications.PB) {\n return;\n }\n const { scope: prevScope } = original;\n /**\n * If the workflow has pages in it's scope and there is a change in that page list,\n * we'll update the workflow link for corresponding pages.\n */\n if (hasPages(workflow) === false || shouldUpdatePages(scope, prevScope) === false) {\n return;\n }\n\n const previousPages = get(prevScope, \"data.pages\", []);\n const currentPages = get(scope, \"data.pages\", []);\n\n const { removedPages, addedPages } = getPagesDiff(currentPages, previousPages);\n for (const pid of addedPages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", workflow.id);\n }\n });\n }\n for (const pid of removedPages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", null);\n }\n });\n }\n });\n};\n"],"mappings":"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"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const createChangeRequestNotification: () => import("../../../ApwChangeRequestNotification").ApwChangeRequestNotification;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.createChangeRequestNotification = void 0;
|
7
|
-
var _types = require("../../../types");
|
8
|
-
var _ApwChangeRequestNotification = require("../../../ApwChangeRequestNotification");
|
9
|
-
const createChangeRequestNotification = () => {
|
10
|
-
const plugin = (0, _ApwChangeRequestNotification.createApwChangeRequestNotification)(_types.ApwContentTypes.PAGE, params => {
|
11
|
-
const {
|
12
|
-
changeRequestUrl,
|
13
|
-
contentUrl
|
14
|
-
} = params;
|
15
|
-
return {
|
16
|
-
text: `
|
17
|
-
Hi,<br /><br />
|
18
|
-
|
19
|
-
You have received a <a href="${changeRequestUrl}">change request</a>, for <a href="${contentUrl}">this</a> page.<br /><br />
|
20
|
-
|
21
|
-
Here are the full URLs:<br /><br />
|
22
|
-
|
23
|
-
Change Request: ${changeRequestUrl}<br />
|
24
|
-
Page: ${contentUrl}
|
25
|
-
`
|
26
|
-
};
|
27
|
-
});
|
28
|
-
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
29
|
-
return plugin;
|
30
|
-
};
|
31
|
-
exports.createChangeRequestNotification = createChangeRequestNotification;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestNotification","plugin","createApwChangeRequestNotification","ApwContentTypes","PAGE","params","changeRequestUrl","contentUrl","text","name","type"],"sources":["changeRequestNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwChangeRequestNotification } from \"~/ApwChangeRequestNotification\";\n\nexport const createChangeRequestNotification = () => {\n const plugin = createApwChangeRequestNotification(ApwContentTypes.PAGE, params => {\n const { changeRequestUrl, contentUrl } = params;\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${changeRequestUrl}\">change request</a>, for <a href=\"${contentUrl}\">this</a> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Change Request: ${changeRequestUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,MAAMA,+BAA+B,GAAG,MAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAkC,EAACC,sBAAe,CAACC,IAAI,EAAEC,MAAM,IAAI;IAC9E,MAAM;MAAEC,gBAAgB;MAAEC;IAAW,CAAC,GAAGF,MAAM;IAC/C,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,wBAAwBC,UAAW;AACnC;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,IAAK,UAAS;EAE9D,OAAOH,MAAM;AACjB,CAAC;AAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const createCommentNotification: () => import("../../../ApwCommentNotification").ApwCommentNotification;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.createCommentNotification = void 0;
|
7
|
-
var _ApwCommentNotification = require("../../../ApwCommentNotification");
|
8
|
-
var _types = require("../../../types");
|
9
|
-
const createCommentNotification = () => {
|
10
|
-
const plugin = (0, _ApwCommentNotification.createApwCommentNotification)(_types.ApwContentTypes.PAGE, params => {
|
11
|
-
const {
|
12
|
-
commentUrl,
|
13
|
-
contentUrl
|
14
|
-
} = params;
|
15
|
-
return {
|
16
|
-
text: `
|
17
|
-
Hi,<br /><br />
|
18
|
-
|
19
|
-
You have received a <a href="${commentUrl}">comment</a>, on a change request, for <a href="${contentUrl}">this</a> page.<br /><br />
|
20
|
-
|
21
|
-
Here are the full URLs:<br /><br />
|
22
|
-
|
23
|
-
Comment: ${commentUrl}<br />
|
24
|
-
Page: ${contentUrl}
|
25
|
-
`
|
26
|
-
};
|
27
|
-
});
|
28
|
-
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
29
|
-
return plugin;
|
30
|
-
};
|
31
|
-
exports.createCommentNotification = createCommentNotification;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createCommentNotification","plugin","createApwCommentNotification","ApwContentTypes","PAGE","params","commentUrl","contentUrl","text","name","type"],"sources":["commentNotification.ts"],"sourcesContent":["import { createApwCommentNotification } from \"~/ApwCommentNotification\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport const createCommentNotification = () => {\n const plugin = createApwCommentNotification(ApwContentTypes.PAGE, params => {\n const { commentUrl, contentUrl } = params;\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${commentUrl}\">comment</a>, on a change request, for <a href=\"${contentUrl}\">this</a> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Comment: ${commentUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,MAAMA,yBAAyB,GAAG,MAAM;EAC3C,MAAMC,MAAM,GAAG,IAAAC,oDAA4B,EAACC,sBAAe,CAACC,IAAI,EAAEC,MAAM,IAAI;IACxE,MAAM;MAAEC,UAAU;MAAEC;IAAW,CAAC,GAAGF,MAAM;IACzC,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,UAAW,oDAAmDC,UAAW;AACxH;AACA;AACA;AACA,2BAA2BD,UAAW;AACtC,wBAAwBC,UAAW;AACnC;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,IAAK,UAAS;EAE9D,OAAOH,MAAM;AACjB,CAAC;AAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const createContentReviewNotification: () => import("../../../ApwContentReviewNotification").ApwContentReviewNotification;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.createContentReviewNotification = void 0;
|
7
|
-
var _types = require("../../../types");
|
8
|
-
var _ApwContentReviewNotification = require("../../../ApwContentReviewNotification");
|
9
|
-
const createContentReviewNotification = () => {
|
10
|
-
const plugin = (0, _ApwContentReviewNotification.createApwContentReviewNotification)(_types.ApwContentTypes.PAGE, params => {
|
11
|
-
const {
|
12
|
-
contentReviewUrl,
|
13
|
-
contentUrl
|
14
|
-
} = params;
|
15
|
-
return {
|
16
|
-
text: `
|
17
|
-
Hi,<br /><br />
|
18
|
-
|
19
|
-
You have received a <a href="${contentReviewUrl}">content review</a>, for <a href="${contentUrl}">this</a> page.<br /><br />
|
20
|
-
|
21
|
-
Here are the full URLs:<br /><br />
|
22
|
-
|
23
|
-
Content Review: ${contentReviewUrl}<br />
|
24
|
-
Page: ${contentUrl}
|
25
|
-
`
|
26
|
-
};
|
27
|
-
});
|
28
|
-
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
29
|
-
return plugin;
|
30
|
-
};
|
31
|
-
exports.createContentReviewNotification = createContentReviewNotification;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createContentReviewNotification","plugin","createApwContentReviewNotification","ApwContentTypes","PAGE","params","contentReviewUrl","contentUrl","text","name","type"],"sources":["contentReviewNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwContentReviewNotification } from \"~/ApwContentReviewNotification\";\n\nexport const createContentReviewNotification = () => {\n const plugin = createApwContentReviewNotification(ApwContentTypes.PAGE, params => {\n const { contentReviewUrl, contentUrl } = params;\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${contentReviewUrl}\">content review</a>, for <a href=\"${contentUrl}\">this</a> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Content Review: ${contentReviewUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,MAAMA,+BAA+B,GAAG,MAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAkC,EAACC,sBAAe,CAACC,IAAI,EAAEC,MAAM,IAAI;IAC9E,MAAM;MAAEC,gBAAgB;MAAEC;IAAW,CAAC,GAAGF,MAAM;IAC/C,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,wBAAwBC,UAAW;AACnC;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,IAAK,UAAS;EAE9D,OAAOH,MAAM;AACjB,CAAC;AAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const createContentUrlPlugin: () => import("../../../ApwContentUrlPlugin").ApwContentUrlPlugin;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.createContentUrlPlugin = void 0;
|
7
|
-
var _ApwContentUrlPlugin = require("../../../ApwContentUrlPlugin");
|
8
|
-
var _types = require("../../../types");
|
9
|
-
/**
|
10
|
-
* In this file we create a plugin which in turn creates a content entry url when requested by the code which sends notifications.
|
11
|
-
* Due to multiple content types for the APW, everything needs to be pluginable.
|
12
|
-
*/
|
13
|
-
|
14
|
-
const createPageUrl = params => {
|
15
|
-
/**
|
16
|
-
* All variables must exist for URL to be created.
|
17
|
-
* We go through all vars and throw a log if it does not exist.
|
18
|
-
*/
|
19
|
-
for (const key in params) {
|
20
|
-
if (!!key) {
|
21
|
-
continue;
|
22
|
-
}
|
23
|
-
console.log(`Missing variable "${key}", which we use to create a page URL.`);
|
24
|
-
return null;
|
25
|
-
}
|
26
|
-
const {
|
27
|
-
baseUrl,
|
28
|
-
id
|
29
|
-
} = params;
|
30
|
-
return `${baseUrl}/page-builder/pages?id=${id}`;
|
31
|
-
};
|
32
|
-
const createContentUrlPlugin = () => {
|
33
|
-
return (0, _ApwContentUrlPlugin.createApwContentUrlPlugin)(_types.ApwContentTypes.PAGE, params => {
|
34
|
-
const {
|
35
|
-
baseUrl,
|
36
|
-
contentReview
|
37
|
-
} = params;
|
38
|
-
const {
|
39
|
-
id
|
40
|
-
} = contentReview.content;
|
41
|
-
return createPageUrl({
|
42
|
-
baseUrl,
|
43
|
-
id
|
44
|
-
});
|
45
|
-
});
|
46
|
-
};
|
47
|
-
exports.createContentUrlPlugin = createContentUrlPlugin;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["createPageUrl","params","key","console","log","baseUrl","id","createContentUrlPlugin","createApwContentUrlPlugin","ApwContentTypes","PAGE","contentReview","content"],"sources":["contentUrl.ts"],"sourcesContent":["/**\n * In this file we create a plugin which in turn creates a content entry url when requested by the code which sends notifications.\n * Due to multiple content types for the APW, everything needs to be pluginable.\n */\nimport { createApwContentUrlPlugin } from \"~/ApwContentUrlPlugin\";\nimport { ApwContentTypes } from \"~/types\";\n\ninterface CreatePageUrlParams {\n baseUrl?: string;\n id: string;\n}\nconst createPageUrl = (params: CreatePageUrlParams): string | null => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a page URL.`);\n return null;\n }\n const { baseUrl, id } = params;\n return `${baseUrl}/page-builder/pages?id=${id}`;\n};\n\nexport const createContentUrlPlugin = () => {\n return createApwContentUrlPlugin(ApwContentTypes.PAGE, params => {\n const { baseUrl, contentReview } = params;\n const { id } = contentReview.content;\n return createPageUrl({\n baseUrl,\n id\n });\n });\n};\n"],"mappings":";;;;;;AAIA;AACA;AALA;AACA;AACA;AACA;;AAQA,MAAMA,aAAa,GAAIC,MAA2B,IAAoB;EAClE;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAE,qBAAoBF,GAAI,uCAAsC,CAAC;IAC5E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC;EAAG,CAAC,GAAGL,MAAM;EAC9B,OAAQ,GAAEI,OAAQ,0BAAyBC,EAAG,EAAC;AACnD,CAAC;AAEM,MAAMC,sBAAsB,GAAG,MAAM;EACxC,OAAO,IAAAC,8CAAyB,EAACC,sBAAe,CAACC,IAAI,EAAET,MAAM,IAAI;IAC7D,MAAM;MAAEI,OAAO;MAAEM;IAAc,CAAC,GAAGV,MAAM;IACzC,MAAM;MAAEK;IAAG,CAAC,GAAGK,aAAa,CAACC,OAAO;IACpC,OAAOZ,aAAa,CAAC;MACjBK,OAAO;MACPC;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { AdvancedPublishingWorkflow } from "../../types";
|
2
|
-
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
-
interface TriggerContentReviewParams {
|
4
|
-
apw: AdvancedPublishingWorkflow;
|
5
|
-
pageBuilder: PageBuilderContextObject;
|
6
|
-
}
|
7
|
-
export declare const triggerContentReview: (params: TriggerContentReviewParams) => void;
|
8
|
-
export {};
|
@@ -1,39 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.triggerContentReview = void 0;
|
8
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
9
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
10
|
-
var _types = require("../../types");
|
11
|
-
const triggerContentReview = params => {
|
12
|
-
const {
|
13
|
-
pageBuilder,
|
14
|
-
apw
|
15
|
-
} = params;
|
16
|
-
pageBuilder.onPageBeforePublish.subscribe(async ({
|
17
|
-
page
|
18
|
-
}) => {
|
19
|
-
const contentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
20
|
-
if (contentReviewId) {
|
21
|
-
const contentReview = await apw.contentReview.get(contentReviewId);
|
22
|
-
if (contentReview.reviewStatus === _types.ApwContentReviewStatus.UNDER_REVIEW) {
|
23
|
-
throw new _error.default(`A peer review for this content has been already requested.`, "REVIEW_ALREADY_EXIST", {
|
24
|
-
contentReviewId,
|
25
|
-
page
|
26
|
-
});
|
27
|
-
}
|
28
|
-
return;
|
29
|
-
}
|
30
|
-
const workflowId = (0, _get.default)(page, "settings.apw.workflowId");
|
31
|
-
if (workflowId) {
|
32
|
-
throw new _error.default("This content requires peer review approval before it can be published.", "REVIEW_REQUIRED", {
|
33
|
-
workflowId,
|
34
|
-
page
|
35
|
-
});
|
36
|
-
}
|
37
|
-
});
|
38
|
-
};
|
39
|
-
exports.triggerContentReview = triggerContentReview;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["triggerContentReview","params","pageBuilder","apw","onPageBeforePublish","subscribe","page","contentReviewId","get","contentReview","reviewStatus","ApwContentReviewStatus","UNDER_REVIEW","Error","workflowId"],"sources":["triggerContentReview.ts"],"sourcesContent":["import get from \"lodash/get\";\nimport Error from \"@webiny/error\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentReviewStatus,\n ApwOnPageBeforePublishTopicParams\n} from \"~/types\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\n\ninterface TriggerContentReviewParams {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n}\n\nexport const triggerContentReview = (params: TriggerContentReviewParams) => {\n const { pageBuilder, apw } = params;\n\n pageBuilder.onPageBeforePublish.subscribe<ApwOnPageBeforePublishTopicParams>(\n async ({ page }) => {\n const contentReviewId = get(page, \"settings.apw.contentReviewId\");\n if (contentReviewId) {\n const contentReview = await apw.contentReview.get(contentReviewId);\n\n if (contentReview.reviewStatus === ApwContentReviewStatus.UNDER_REVIEW) {\n throw new Error(\n `A peer review for this content has been already requested.`,\n \"REVIEW_ALREADY_EXIST\",\n {\n contentReviewId,\n page\n }\n );\n }\n return;\n }\n\n const workflowId = get(page, \"settings.apw.workflowId\");\n\n if (workflowId) {\n throw new Error(\n \"This content requires peer review approval before it can be published.\",\n \"REVIEW_REQUIRED\",\n {\n workflowId,\n page\n }\n );\n }\n }\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAYO,MAAMA,oBAAoB,GAAIC,MAAkC,IAAK;EACxE,MAAM;IAAEC,WAAW;IAAEC;EAAI,CAAC,GAAGF,MAAM;EAEnCC,WAAW,CAACE,mBAAmB,CAACC,SAAS,CACrC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAChB,MAAMC,eAAe,GAAG,IAAAC,YAAG,EAACF,IAAI,EAAE,8BAA8B,CAAC;IACjE,IAAIC,eAAe,EAAE;MACjB,MAAME,aAAa,GAAG,MAAMN,GAAG,CAACM,aAAa,CAACD,GAAG,CAACD,eAAe,CAAC;MAElE,IAAIE,aAAa,CAACC,YAAY,KAAKC,6BAAsB,CAACC,YAAY,EAAE;QACpE,MAAM,IAAIC,cAAK,CACV,4DAA2D,EAC5D,sBAAsB,EACtB;UACIN,eAAe;UACfD;QACJ,CAAC,CACJ;MACL;MACA;IACJ;IAEA,MAAMQ,UAAU,GAAG,IAAAN,YAAG,EAACF,IAAI,EAAE,yBAAyB,CAAC;IAEvD,IAAIQ,UAAU,EAAE;MACZ,MAAM,IAAID,cAAK,CACX,wEAAwE,EACxE,iBAAiB,EACjB;QACIC,UAAU;QACVR;MACJ,CAAC,CACJ;IACL;EACJ,CAAC,CACJ;AACL,CAAC;AAAC"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { AdvancedPublishingWorkflow } from "../../types";
|
2
|
-
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
-
import { Security } from "@webiny/api-security/types";
|
4
|
-
interface UpdateContentReviewStatusParams {
|
5
|
-
apw: AdvancedPublishingWorkflow;
|
6
|
-
pageBuilder: PageBuilderContextObject;
|
7
|
-
security: Security;
|
8
|
-
}
|
9
|
-
export declare const updateContentReviewStatus: (params: UpdateContentReviewStatusParams) => void;
|
10
|
-
export {};
|
@@ -1,67 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.updateContentReviewStatus = void 0;
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
10
|
-
var _types = require("../../types");
|
11
|
-
var _utils = require("../../crud/utils");
|
12
|
-
const updateContentReviewStatus = params => {
|
13
|
-
const {
|
14
|
-
apw,
|
15
|
-
pageBuilder,
|
16
|
-
security
|
17
|
-
} = params;
|
18
|
-
pageBuilder.onPageAfterPublish.subscribe(async ({
|
19
|
-
page
|
20
|
-
}) => {
|
21
|
-
const contentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
22
|
-
/**
|
23
|
-
* Bail out if there is no "content review" linked.
|
24
|
-
*/
|
25
|
-
if (!contentReviewId) {
|
26
|
-
return;
|
27
|
-
}
|
28
|
-
const contentReview = await apw.contentReview.get(contentReviewId);
|
29
|
-
const identity = security.getIdentity();
|
30
|
-
/**
|
31
|
-
* If content review is "readyToBePublished set its status as "published" after page publish.
|
32
|
-
*/
|
33
|
-
if (contentReview.reviewStatus === _types.ApwContentReviewStatus.READY_TO_BE_PUBLISHED) {
|
34
|
-
await apw.contentReview.update(contentReviewId, {
|
35
|
-
reviewStatus: _types.ApwContentReviewStatus.PUBLISHED,
|
36
|
-
content: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, contentReview.content), _utils.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META), {}, {
|
37
|
-
publishedBy: identity.id
|
38
|
-
})
|
39
|
-
});
|
40
|
-
}
|
41
|
-
});
|
42
|
-
pageBuilder.onPageAfterUnpublish.subscribe(async ({
|
43
|
-
page
|
44
|
-
}) => {
|
45
|
-
const contentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
46
|
-
/**
|
47
|
-
* Bail out if there is no "content review" linked.
|
48
|
-
*/
|
49
|
-
if (!contentReviewId) {
|
50
|
-
return;
|
51
|
-
}
|
52
|
-
const contentReview = await apw.contentReview.get(contentReviewId);
|
53
|
-
/**
|
54
|
-
* If content review is "published set its status as "readyToBePublished" after page unpublish.
|
55
|
-
*/
|
56
|
-
|
57
|
-
if (contentReview.reviewStatus === _types.ApwContentReviewStatus.PUBLISHED) {
|
58
|
-
await apw.contentReview.update(contentReviewId, {
|
59
|
-
reviewStatus: _types.ApwContentReviewStatus.READY_TO_BE_PUBLISHED,
|
60
|
-
content: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, contentReview.content), _utils.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META), {}, {
|
61
|
-
publishedBy: null
|
62
|
-
})
|
63
|
-
});
|
64
|
-
}
|
65
|
-
});
|
66
|
-
};
|
67
|
-
exports.updateContentReviewStatus = updateContentReviewStatus;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["updateContentReviewStatus","params","apw","pageBuilder","security","onPageAfterPublish","subscribe","page","contentReviewId","get","contentReview","identity","getIdentity","reviewStatus","ApwContentReviewStatus","READY_TO_BE_PUBLISHED","update","PUBLISHED","content","INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META","publishedBy","id","onPageAfterUnpublish"],"sources":["updateContentReviewStatus.ts"],"sourcesContent":["import get from \"lodash/get\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentReviewStatus,\n ApwOnPageBeforePublishTopicParams\n} from \"~/types\";\nimport { INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META } from \"~/crud/utils\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\nimport { Security } from \"@webiny/api-security/types\";\n\ninterface UpdateContentReviewStatusParams {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n security: Security;\n}\n\nexport const updateContentReviewStatus = (params: UpdateContentReviewStatusParams) => {\n const { apw, pageBuilder, security } = params;\n\n pageBuilder.onPageAfterPublish.subscribe<ApwOnPageBeforePublishTopicParams>(\n async ({ page }) => {\n const contentReviewId = get(page, \"settings.apw.contentReviewId\");\n /**\n * Bail out if there is no \"content review\" linked.\n */\n if (!contentReviewId) {\n return;\n }\n\n const contentReview = await apw.contentReview.get(contentReviewId);\n const identity = security.getIdentity();\n /**\n * If content review is \"readyToBePublished set its status as \"published\" after page publish.\n */\n if (contentReview.reviewStatus === ApwContentReviewStatus.READY_TO_BE_PUBLISHED) {\n await apw.contentReview.update(contentReviewId, {\n reviewStatus: ApwContentReviewStatus.PUBLISHED,\n content: {\n ...contentReview.content,\n ...INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META,\n publishedBy: identity.id\n }\n });\n }\n }\n );\n pageBuilder.onPageAfterUnpublish.subscribe<ApwOnPageBeforePublishTopicParams>(\n async ({ page }) => {\n const contentReviewId = get(page, \"settings.apw.contentReviewId\");\n /**\n * Bail out if there is no \"content review\" linked.\n */\n if (!contentReviewId) {\n return;\n }\n\n const contentReview = await apw.contentReview.get(contentReviewId);\n /**\n * If content review is \"published set its status as \"readyToBePublished\" after page unpublish.\n */\n\n if (contentReview.reviewStatus === ApwContentReviewStatus.PUBLISHED) {\n await apw.contentReview.update(contentReviewId, {\n reviewStatus: ApwContentReviewStatus.READY_TO_BE_PUBLISHED,\n content: {\n ...contentReview.content,\n ...INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META,\n publishedBy: null\n }\n });\n }\n }\n );\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AAKA;AAUO,MAAMA,yBAAyB,GAAIC,MAAuC,IAAK;EAClF,MAAM;IAAEC,GAAG;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGH,MAAM;EAE7CE,WAAW,CAACE,kBAAkB,CAACC,SAAS,CACpC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAChB,MAAMC,eAAe,GAAG,IAAAC,YAAG,EAACF,IAAI,EAAE,8BAA8B,CAAC;IACjE;AACZ;AACA;IACY,IAAI,CAACC,eAAe,EAAE;MAClB;IACJ;IAEA,MAAME,aAAa,GAAG,MAAMR,GAAG,CAACQ,aAAa,CAACD,GAAG,CAACD,eAAe,CAAC;IAClE,MAAMG,QAAQ,GAAGP,QAAQ,CAACQ,WAAW,EAAE;IACvC;AACZ;AACA;IACY,IAAIF,aAAa,CAACG,YAAY,KAAKC,6BAAsB,CAACC,qBAAqB,EAAE;MAC7E,MAAMb,GAAG,CAACQ,aAAa,CAACM,MAAM,CAACR,eAAe,EAAE;QAC5CK,YAAY,EAAEC,6BAAsB,CAACG,SAAS;QAC9CC,OAAO,0FACAR,aAAa,CAACQ,OAAO,GACrBC,mDAA4C;UAC/CC,WAAW,EAAET,QAAQ,CAACU;QAAE;MAEhC,CAAC,CAAC;IACN;EACJ,CAAC,CACJ;EACDlB,WAAW,CAACmB,oBAAoB,CAAChB,SAAS,CACtC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAChB,MAAMC,eAAe,GAAG,IAAAC,YAAG,EAACF,IAAI,EAAE,8BAA8B,CAAC;IACjE;AACZ;AACA;IACY,IAAI,CAACC,eAAe,EAAE;MAClB;IACJ;IAEA,MAAME,aAAa,GAAG,MAAMR,GAAG,CAACQ,aAAa,CAACD,GAAG,CAACD,eAAe,CAAC;IAClE;AACZ;AACA;;IAEY,IAAIE,aAAa,CAACG,YAAY,KAAKC,6BAAsB,CAACG,SAAS,EAAE;MACjE,MAAMf,GAAG,CAACQ,aAAa,CAACM,MAAM,CAACR,eAAe,EAAE;QAC5CK,YAAY,EAAEC,6BAAsB,CAACC,qBAAqB;QAC1DG,OAAO,0FACAR,aAAa,CAACQ,OAAO,GACrBC,mDAA4C;UAC/CC,WAAW,EAAE;QAAI;MAEzB,CAAC,CAAC;IACN;EACJ,CAAC,CACJ;AACL,CAAC;AAAC"}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { ApwWorkflow, ApwWorkflowCrud, ApwWorkflowScope, PageWithWorkflow } from "../../types";
|
2
|
-
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
-
interface AssignWorkflowToPageParams {
|
4
|
-
listWorkflow: ApwWorkflowCrud["list"];
|
5
|
-
page: PageWithWorkflow;
|
6
|
-
}
|
7
|
-
export declare const assignWorkflowToPage: ({ listWorkflow, page }: AssignWorkflowToPageParams) => Promise<void>;
|
8
|
-
export declare const hasPages: (workflow: ApwWorkflow) => Boolean;
|
9
|
-
export declare const shouldUpdatePages: (scope: ApwWorkflowScope, prevScope: ApwWorkflowScope) => Boolean;
|
10
|
-
interface GetUpdatePageOpsResult {
|
11
|
-
addedPages: string[];
|
12
|
-
removedPages: string[];
|
13
|
-
}
|
14
|
-
export declare const getPagesDiff: (currentPages: string[], prevPages: string[]) => GetUpdatePageOpsResult;
|
15
|
-
interface UpdatePageSettingsParams {
|
16
|
-
getPage: PageBuilderContextObject["getPage"];
|
17
|
-
updatePage: PageBuilderContextObject["updatePage"];
|
18
|
-
uniquePageId: string;
|
19
|
-
getNewSettings: (settings: PageWithWorkflow["settings"]) => PageWithWorkflow["settings"];
|
20
|
-
}
|
21
|
-
export declare const updatePageSettings: ({ getPage, updatePage, uniquePageId, getNewSettings }: UpdatePageSettingsParams) => Promise<void>;
|
22
|
-
export {};
|