@strapi/review-workflows 5.0.0-rc.7 → 5.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/_chunks/{Layout-Cwbb9usb.js → Layout-AREWDuuq.js} +7 -8
  2. package/dist/_chunks/Layout-AREWDuuq.js.map +1 -0
  3. package/dist/_chunks/{Layout-BpMLb-Oo.mjs → Layout-D5aa9iUm.mjs} +7 -8
  4. package/dist/_chunks/Layout-D5aa9iUm.mjs.map +1 -0
  5. package/dist/_chunks/{_id-p9NnvlMP.js → _id-C7pCAzXV.js} +10 -36
  6. package/dist/_chunks/_id-C7pCAzXV.js.map +1 -0
  7. package/dist/_chunks/{_id-KpezMzxO.mjs → _id-DDNHKV_W.mjs} +10 -36
  8. package/dist/_chunks/_id-DDNHKV_W.mjs.map +1 -0
  9. package/dist/_chunks/{index-DqT_oXGP.js → index-Bv3cQ3c-.js} +4 -4
  10. package/dist/_chunks/index-Bv3cQ3c-.js.map +1 -0
  11. package/dist/_chunks/{index-BTr8zF-9.js → index-CIBLMG85.js} +30 -50
  12. package/dist/_chunks/index-CIBLMG85.js.map +1 -0
  13. package/dist/_chunks/{index-BxkGN0Yj.mjs → index-CeaoNBIP.mjs} +4 -4
  14. package/dist/_chunks/index-CeaoNBIP.mjs.map +1 -0
  15. package/dist/_chunks/{index-DtJI5ZoC.mjs → index-Cx5QECZI.mjs} +31 -51
  16. package/dist/_chunks/index-Cx5QECZI.mjs.map +1 -0
  17. package/dist/_chunks/{router-B8G2sh6V.mjs → router-BEoNwQZ1.mjs} +3 -3
  18. package/dist/_chunks/{router-B8G2sh6V.mjs.map → router-BEoNwQZ1.mjs.map} +1 -1
  19. package/dist/_chunks/{router-Bqj-105s.js → router-gRPIa2_c.js} +3 -3
  20. package/dist/_chunks/{router-Bqj-105s.js.map → router-gRPIa2_c.js.map} +1 -1
  21. package/dist/admin/index.js +1 -1
  22. package/dist/admin/index.mjs +1 -1
  23. package/dist/admin/src/services/settings.d.ts +1731 -5
  24. package/dist/server/index.js +0 -41
  25. package/dist/server/index.js.map +1 -1
  26. package/dist/server/index.mjs +0 -41
  27. package/dist/server/index.mjs.map +1 -1
  28. package/dist/server/src/controllers/index.d.ts +0 -1
  29. package/dist/server/src/controllers/index.d.ts.map +1 -1
  30. package/dist/server/src/controllers/workflows.d.ts +0 -7
  31. package/dist/server/src/controllers/workflows.d.ts.map +1 -1
  32. package/dist/server/src/index.d.ts +0 -1
  33. package/dist/server/src/index.d.ts.map +1 -1
  34. package/dist/server/src/routes/review-workflows.d.ts.map +1 -1
  35. package/dist/shared/contracts/review-workflows.d.ts +1 -14
  36. package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
  37. package/package.json +9 -9
  38. package/dist/_chunks/Layout-BpMLb-Oo.mjs.map +0 -1
  39. package/dist/_chunks/Layout-Cwbb9usb.js.map +0 -1
  40. package/dist/_chunks/_id-KpezMzxO.mjs.map +0 -1
  41. package/dist/_chunks/_id-p9NnvlMP.js.map +0 -1
  42. package/dist/_chunks/index-BTr8zF-9.js.map +0 -1
  43. package/dist/_chunks/index-BxkGN0Yj.mjs.map +0 -1
  44. package/dist/_chunks/index-DqT_oXGP.js.map +0 -1
  45. package/dist/_chunks/index-DtJI5ZoC.mjs.map +0 -1
@@ -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, useDispatch } from "react-redux";
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";
@@ -62,7 +62,8 @@ const contentManagerApi = reviewWorkflowsApi.injectEndpoints({
62
62
  type: "Document",
63
63
  id: slug !== SINGLE_TYPES ? `${model}_${id}` : model
64
64
  },
65
- { type: "Document", id: `${model}_LIST` }
65
+ { type: "Document", id: `${model}_LIST` },
66
+ "ReviewWorkflowStages"
66
67
  ];
67
68
  }
68
69
  }),
@@ -155,7 +156,6 @@ const AssigneeSelect = () => {
155
156
  id,
156
157
  slug: model = ""
157
158
  } = useParams();
158
- const dispatch = useDispatch();
159
159
  const permissions = useTypedSelector((state) => state.admin_app.permissions);
160
160
  const { formatMessage } = useIntl();
161
161
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
@@ -199,15 +199,6 @@ const AssigneeSelect = () => {
199
199
  }
200
200
  });
201
201
  if ("data" in res) {
202
- dispatch({
203
- type: "contentManagerApi/invalidateTags",
204
- payload: [
205
- {
206
- type: "Document",
207
- id: `${model}_${id}`
208
- }
209
- ]
210
- });
211
202
  toggleNotification({
212
203
  type: "success",
213
204
  message: formatMessage({
@@ -375,7 +366,6 @@ const StageSelect = () => {
375
366
  slug: model = "",
376
367
  id = ""
377
368
  } = useParams();
378
- const dispatch = useDispatch();
379
369
  const { formatMessage } = useIntl();
380
370
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
381
371
  const { toggleNotification } = useNotification();
@@ -424,15 +414,6 @@ const StageSelect = () => {
424
414
  data: { id: stageId }
425
415
  });
426
416
  if ("data" in res) {
427
- dispatch({
428
- type: "contentManagerApi/invalidateTags",
429
- payload: [
430
- {
431
- type: "Document",
432
- id: `${model}_${id}`
433
- }
434
- ]
435
- });
436
417
  toggleNotification({
437
418
  type: "success",
438
419
  message: formatMessage({
@@ -590,36 +571,25 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
590
571
  endpoints: (builder) => ({
591
572
  getWorkflows: builder.query({
592
573
  query: (args) => {
593
- const { id, ...params } = args ?? {};
594
574
  return {
595
- url: `/review-workflows/workflows${id ? `/${id}` : ""}`,
575
+ url: "/review-workflows/workflows",
596
576
  method: "GET",
597
577
  config: {
598
- params
578
+ params: args ?? {}
599
579
  }
600
580
  };
601
581
  },
602
582
  transformResponse: (res) => {
603
- let workflows = [];
604
- if (Array.isArray(res.data)) {
605
- workflows = res.data;
606
- } else {
607
- workflows = [res.data];
608
- }
609
583
  return {
610
- workflows,
584
+ workflows: res.data,
611
585
  meta: "meta" in res ? res.meta : void 0
612
586
  };
613
587
  },
614
- providesTags: (res, _err, arg) => {
615
- if (typeof arg === "object" && "id" in arg && arg.id !== "") {
616
- return [{ type: "ReviewWorkflow", id: arg.id }];
617
- } else {
618
- return [
619
- ...res?.workflows.map(({ id }) => ({ type: "ReviewWorkflow", id })) ?? [],
620
- { type: "ReviewWorkflow", id: "LIST" }
621
- ];
622
- }
588
+ providesTags: (res) => {
589
+ return [
590
+ ...res?.workflows.map(({ id }) => ({ type: "ReviewWorkflow", id })) ?? [],
591
+ { type: "ReviewWorkflow", id: "LIST" }
592
+ ];
623
593
  }
624
594
  }),
625
595
  createWorkflow: builder.mutation({
@@ -629,12 +599,18 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
629
599
  data
630
600
  }),
631
601
  transformResponse: (res) => res.data,
632
- invalidatesTags: [
633
- { type: "ReviewWorkflow", id: "LIST" },
634
- "ReviewWorkflowStages",
635
- { type: "Document", id: `ALL_LIST` },
636
- { type: "ContentTypeSettings", id: "LIST" }
637
- ]
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
+ }
638
614
  }),
639
615
  updateWorkflow: builder.mutation({
640
616
  query: ({ id, ...data }) => ({
@@ -646,8 +622,12 @@ const settingsApi = reviewWorkflowsApi.injectEndpoints({
646
622
  invalidatesTags: (res, _err, arg) => [
647
623
  { type: "ReviewWorkflow", id: arg.id },
648
624
  "ReviewWorkflowStages",
649
- { type: "Document", id: `ALL_LIST` },
650
- { type: "ContentTypeSettings", id: "LIST" }
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
+ })) ?? []
651
631
  ]
652
632
  }),
653
633
  deleteWorkflow: builder.mutation({
@@ -770,7 +750,7 @@ const admin = {
770
750
  },
771
751
  permissions: [],
772
752
  async Component() {
773
- const { Router } = await import("./router-B8G2sh6V.mjs");
753
+ const { Router } = await import("./router-BEoNwQZ1.mjs");
774
754
  return { default: Router };
775
755
  }
776
756
  });
@@ -826,4 +806,4 @@ export {
826
806
  reviewWorkflowsApi as r,
827
807
  useGetContentTypesQuery as u
828
808
  };
829
- //# sourceMappingURL=index-DtJI5ZoC.mjs.map
809
+ //# sourceMappingURL=index-Cx5QECZI.mjs.map