@strapi/review-workflows 5.0.0-rc.2 → 5.0.0-rc.20
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-D3DDQmMI.js → Layout-AREWDuuq.js} +7 -8
- package/dist/_chunks/Layout-AREWDuuq.js.map +1 -0
- package/dist/_chunks/{Layout-Da8jupiA.mjs → Layout-D5aa9iUm.mjs} +7 -8
- package/dist/_chunks/Layout-D5aa9iUm.mjs.map +1 -0
- package/dist/_chunks/{_id-CnRDP3Xx.js → _id-C7pCAzXV.js} +10 -36
- package/dist/_chunks/_id-C7pCAzXV.js.map +1 -0
- package/dist/_chunks/{_id-xSrgPSJs.mjs → _id-DDNHKV_W.mjs} +10 -36
- package/dist/_chunks/_id-DDNHKV_W.mjs.map +1 -0
- package/dist/_chunks/{index-4kp4AkBB.js → index-Bv3cQ3c-.js} +4 -4
- package/dist/_chunks/index-Bv3cQ3c-.js.map +1 -0
- package/dist/_chunks/{index-DhPxWpsW.js → index-CIBLMG85.js} +55 -47
- package/dist/_chunks/index-CIBLMG85.js.map +1 -0
- package/dist/_chunks/{index-jfO5GxtW.mjs → index-CeaoNBIP.mjs} +4 -4
- package/dist/_chunks/index-CeaoNBIP.mjs.map +1 -0
- package/dist/_chunks/{index-DDsJlZQw.mjs → index-Cx5QECZI.mjs} +56 -48
- package/dist/_chunks/index-Cx5QECZI.mjs.map +1 -0
- package/dist/_chunks/{router-DOEULOpS.mjs → router-BEoNwQZ1.mjs} +3 -3
- package/dist/_chunks/{router-DOEULOpS.mjs.map → router-BEoNwQZ1.mjs.map} +1 -1
- package/dist/_chunks/{router-DSXpeew4.js → router-gRPIa2_c.js} +3 -3
- package/dist/_chunks/{router-DSXpeew4.js.map → router-gRPIa2_c.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/services/admin.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/content-manager.d.ts +4 -4
- package/dist/admin/src/services/settings.d.ts +1733 -7
- package/dist/server/index.js +14 -54
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +14 -54
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/index.d.ts +0 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/stages.d.ts.map +1 -1
- package/dist/server/src/controllers/workflows.d.ts +0 -7
- package/dist/server/src/controllers/workflows.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +1 -2
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/routes/review-workflows.d.ts.map +1 -1
- package/dist/server/src/services/document-service-middleware.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +1 -1
- package/dist/server/src/services/stages.d.ts +2 -7
- package/dist/server/src/services/stages.d.ts.map +1 -1
- package/dist/shared/contracts/review-workflows.d.ts +1 -14
- package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/_chunks/Layout-D3DDQmMI.js.map +0 -1
- package/dist/_chunks/Layout-Da8jupiA.mjs.map +0 -1
- package/dist/_chunks/_id-CnRDP3Xx.js.map +0 -1
- package/dist/_chunks/_id-xSrgPSJs.mjs.map +0 -1
- package/dist/_chunks/index-4kp4AkBB.js.map +0 -1
- package/dist/_chunks/index-DDsJlZQw.mjs.map +0 -1
- package/dist/_chunks/index-DhPxWpsW.js.map +0 -1
- package/dist/_chunks/index-jfO5GxtW.mjs.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -5,7 +5,7 @@ import { useIntl } from "react-intl";
|
|
|
5
5
|
import { useParams } from "react-router-dom";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { adminApi, useAPIErrorHandler, useNotification, useRBAC, useQueryParams, useAdminUsers } from "@strapi/admin/strapi-admin";
|
|
8
|
-
import { useSelector
|
|
8
|
+
import { useSelector } from "react-redux";
|
|
9
9
|
import { useLicenseLimits } from "@strapi/admin/strapi-admin/ee";
|
|
10
10
|
import { Cross } from "@strapi/icons";
|
|
11
11
|
import { styled } from "styled-components";
|
|
@@ -25,8 +25,9 @@ const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = "stagesPerWorkflow";
|
|
|
25
25
|
const STAGE_COLOR_DEFAULT = lightTheme.colors.primary600;
|
|
26
26
|
const useTypedSelector = useSelector;
|
|
27
27
|
const reviewWorkflowsApi = adminApi.enhanceEndpoints({
|
|
28
|
-
addTagTypes: ["ReviewWorkflow", "ReviewWorkflowStages"]
|
|
28
|
+
addTagTypes: ["ReviewWorkflow", "ReviewWorkflowStages", "Document", "ContentTypeSettings"]
|
|
29
29
|
});
|
|
30
|
+
const SINGLE_TYPES = "single-types";
|
|
30
31
|
const contentManagerApi = reviewWorkflowsApi.injectEndpoints({
|
|
31
32
|
endpoints: (builder) => ({
|
|
32
33
|
getStages: builder.query({
|
|
@@ -54,7 +55,17 @@ const contentManagerApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
54
55
|
params
|
|
55
56
|
}
|
|
56
57
|
}),
|
|
57
|
-
transformResponse: (res) => res.data
|
|
58
|
+
transformResponse: (res) => res.data,
|
|
59
|
+
invalidatesTags: (_result, _error, { slug, id, model }) => {
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
type: "Document",
|
|
63
|
+
id: slug !== SINGLE_TYPES ? `${model}_${id}` : model
|
|
64
|
+
},
|
|
65
|
+
{ type: "Document", id: `${model}_LIST` },
|
|
66
|
+
"ReviewWorkflowStages"
|
|
67
|
+
];
|
|
68
|
+
}
|
|
58
69
|
}),
|
|
59
70
|
updateAssignee: builder.mutation({
|
|
60
71
|
query: ({ model, slug, id, params, ...data }) => ({
|
|
@@ -65,7 +76,16 @@ const contentManagerApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
65
76
|
params
|
|
66
77
|
}
|
|
67
78
|
}),
|
|
68
|
-
transformResponse: (res) => res.data
|
|
79
|
+
transformResponse: (res) => res.data,
|
|
80
|
+
invalidatesTags: (_result, _error, { slug, id, model }) => {
|
|
81
|
+
return [
|
|
82
|
+
{
|
|
83
|
+
type: "Document",
|
|
84
|
+
id: slug !== SINGLE_TYPES ? `${model}_${id}` : model
|
|
85
|
+
},
|
|
86
|
+
{ type: "Document", id: `${model}_LIST` }
|
|
87
|
+
];
|
|
88
|
+
}
|
|
69
89
|
}),
|
|
70
90
|
getContentTypes: builder.query({
|
|
71
91
|
query: () => ({
|
|
@@ -136,7 +156,6 @@ const AssigneeSelect = () => {
|
|
|
136
156
|
id,
|
|
137
157
|
slug: model = ""
|
|
138
158
|
} = useParams();
|
|
139
|
-
const dispatch = useDispatch();
|
|
140
159
|
const permissions = useTypedSelector((state) => state.admin_app.permissions);
|
|
141
160
|
const { formatMessage } = useIntl();
|
|
142
161
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
|
@@ -180,15 +199,6 @@ const AssigneeSelect = () => {
|
|
|
180
199
|
}
|
|
181
200
|
});
|
|
182
201
|
if ("data" in res) {
|
|
183
|
-
dispatch({
|
|
184
|
-
type: "contentManagerApi/invalidateTags",
|
|
185
|
-
payload: [
|
|
186
|
-
{
|
|
187
|
-
type: "Document",
|
|
188
|
-
id: `${model}_${id}`
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
});
|
|
192
202
|
toggleNotification({
|
|
193
203
|
type: "success",
|
|
194
204
|
message: formatMessage({
|
|
@@ -356,7 +366,6 @@ const StageSelect = () => {
|
|
|
356
366
|
slug: model = "",
|
|
357
367
|
id = ""
|
|
358
368
|
} = useParams();
|
|
359
|
-
const dispatch = useDispatch();
|
|
360
369
|
const { formatMessage } = useIntl();
|
|
361
370
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
|
362
371
|
const { toggleNotification } = useNotification();
|
|
@@ -405,15 +414,6 @@ const StageSelect = () => {
|
|
|
405
414
|
data: { id: stageId }
|
|
406
415
|
});
|
|
407
416
|
if ("data" in res) {
|
|
408
|
-
dispatch({
|
|
409
|
-
type: "contentManagerApi/invalidateTags",
|
|
410
|
-
payload: [
|
|
411
|
-
{
|
|
412
|
-
type: "Document",
|
|
413
|
-
id: `${model}_${id}`
|
|
414
|
-
}
|
|
415
|
-
]
|
|
416
|
-
});
|
|
417
417
|
toggleNotification({
|
|
418
418
|
type: "success",
|
|
419
419
|
message: formatMessage({
|
|
@@ -571,36 +571,25 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
571
571
|
endpoints: (builder) => ({
|
|
572
572
|
getWorkflows: builder.query({
|
|
573
573
|
query: (args) => {
|
|
574
|
-
const { id, ...params } = args ?? {};
|
|
575
574
|
return {
|
|
576
|
-
url:
|
|
575
|
+
url: "/review-workflows/workflows",
|
|
577
576
|
method: "GET",
|
|
578
577
|
config: {
|
|
579
|
-
params
|
|
578
|
+
params: args ?? {}
|
|
580
579
|
}
|
|
581
580
|
};
|
|
582
581
|
},
|
|
583
582
|
transformResponse: (res) => {
|
|
584
|
-
let workflows = [];
|
|
585
|
-
if (Array.isArray(res.data)) {
|
|
586
|
-
workflows = res.data;
|
|
587
|
-
} else {
|
|
588
|
-
workflows = [res.data];
|
|
589
|
-
}
|
|
590
583
|
return {
|
|
591
|
-
workflows,
|
|
584
|
+
workflows: res.data,
|
|
592
585
|
meta: "meta" in res ? res.meta : void 0
|
|
593
586
|
};
|
|
594
587
|
},
|
|
595
|
-
providesTags: (res
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
...res?.workflows.map(({ id }) => ({ type: "ReviewWorkflow", id })) ?? [],
|
|
601
|
-
{ type: "ReviewWorkflow", id: "LIST" }
|
|
602
|
-
];
|
|
603
|
-
}
|
|
588
|
+
providesTags: (res) => {
|
|
589
|
+
return [
|
|
590
|
+
...res?.workflows.map(({ id }) => ({ type: "ReviewWorkflow", id })) ?? [],
|
|
591
|
+
{ type: "ReviewWorkflow", id: "LIST" }
|
|
592
|
+
];
|
|
604
593
|
}
|
|
605
594
|
}),
|
|
606
595
|
createWorkflow: builder.mutation({
|
|
@@ -610,7 +599,18 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
610
599
|
data
|
|
611
600
|
}),
|
|
612
601
|
transformResponse: (res) => res.data,
|
|
613
|
-
invalidatesTags
|
|
602
|
+
invalidatesTags(res) {
|
|
603
|
+
return [
|
|
604
|
+
{ type: "ReviewWorkflow", id: "LIST" },
|
|
605
|
+
"ReviewWorkflowStages",
|
|
606
|
+
{ type: "Document", id: `ALL_LIST` },
|
|
607
|
+
{ type: "ContentTypeSettings", id: "LIST" },
|
|
608
|
+
...res?.contentTypes.map((uid) => ({
|
|
609
|
+
type: "Document",
|
|
610
|
+
id: `${uid}_ALL_ITEMS`
|
|
611
|
+
})) ?? []
|
|
612
|
+
];
|
|
613
|
+
}
|
|
614
614
|
}),
|
|
615
615
|
updateWorkflow: builder.mutation({
|
|
616
616
|
query: ({ id, ...data }) => ({
|
|
@@ -621,7 +621,13 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
621
621
|
transformResponse: (res) => res.data,
|
|
622
622
|
invalidatesTags: (res, _err, arg) => [
|
|
623
623
|
{ type: "ReviewWorkflow", id: arg.id },
|
|
624
|
-
"ReviewWorkflowStages"
|
|
624
|
+
"ReviewWorkflowStages",
|
|
625
|
+
{ type: "Document", id: "ALL_LIST" },
|
|
626
|
+
{ type: "ContentTypeSettings", id: "LIST" },
|
|
627
|
+
...res?.contentTypes.map((uid) => ({
|
|
628
|
+
type: "Document",
|
|
629
|
+
id: `${uid}_ALL_ITEMS`
|
|
630
|
+
})) ?? []
|
|
625
631
|
]
|
|
626
632
|
}),
|
|
627
633
|
deleteWorkflow: builder.mutation({
|
|
@@ -632,7 +638,9 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
632
638
|
transformResponse: (res) => res.data,
|
|
633
639
|
invalidatesTags: (res, _err, arg) => [
|
|
634
640
|
{ type: "ReviewWorkflow", id: arg.id },
|
|
635
|
-
"ReviewWorkflowStages"
|
|
641
|
+
"ReviewWorkflowStages",
|
|
642
|
+
{ type: "Document", id: `ALL_LIST` },
|
|
643
|
+
{ type: "ContentTypeSettings", id: "LIST" }
|
|
636
644
|
]
|
|
637
645
|
})
|
|
638
646
|
}),
|
|
@@ -742,7 +750,7 @@ const admin = {
|
|
|
742
750
|
},
|
|
743
751
|
permissions: [],
|
|
744
752
|
async Component() {
|
|
745
|
-
const { Router } = await import("./router-
|
|
753
|
+
const { Router } = await import("./router-BEoNwQZ1.mjs");
|
|
746
754
|
return { default: Router };
|
|
747
755
|
}
|
|
748
756
|
});
|
|
@@ -798,4 +806,4 @@ export {
|
|
|
798
806
|
reviewWorkflowsApi as r,
|
|
799
807
|
useGetContentTypesQuery as u
|
|
800
808
|
};
|
|
801
|
-
//# sourceMappingURL=index-
|
|
809
|
+
//# sourceMappingURL=index-Cx5QECZI.mjs.map
|