@strapi/plugin-users-permissions 5.0.0-alpha.0 → 5.0.0-alpha.2
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/admin/src/index.js +1 -2
- package/admin/src/pages/AdvancedSettings/index.jsx +4 -6
- package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +4 -5
- package/admin/src/pages/EmailTemplates/index.jsx +5 -7
- package/admin/src/pages/Providers/index.jsx +6 -18
- package/admin/src/pages/Roles/hooks/usePlugins.js +1 -2
- package/admin/src/pages/Roles/pages/CreatePage.jsx +1 -2
- package/admin/src/pages/Roles/pages/EditPage.jsx +7 -2
- package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +2 -3
- package/admin/src/pages/Roles/pages/ListPage/index.jsx +33 -6
- package/admin/src/utils/prefixPluginTranslations.js +13 -0
- package/dist/_chunks/{EditViewPage-xYzUSAwS-wpHlxdkC.js → EditViewPage-JFzIJClS-9jnyNYlZ.js} +181 -167
- package/dist/_chunks/{EditViewPage-xYzUSAwS-wpHlxdkC.js.map → EditViewPage-JFzIJClS-9jnyNYlZ.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-xYzUSAwS-5mOQ_-nB.mjs → EditViewPage-JFzIJClS-SluImrzz.mjs} +44 -32
- package/dist/_chunks/EditViewPage-JFzIJClS-SluImrzz.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-xOVa04T_-elahT0e9.js → ListViewPage-1VNVP9Rw-94jqnla4.js} +104 -105
- package/dist/_chunks/ListViewPage-1VNVP9Rw-94jqnla4.js.map +1 -0
- package/dist/_chunks/{ListViewPage-xOVa04T_-lbfb219V.mjs → ListViewPage-1VNVP9Rw-Ce-HkFp1.mjs} +9 -10
- package/dist/_chunks/ListViewPage-1VNVP9Rw-Ce-HkFp1.mjs.map +1 -0
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-IWfB3WVH.mjs → ReviewWorkflowsColumn-sPZxvFUd-Cd4JhTlj.mjs} +2 -2
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-IWfB3WVH.mjs.map → ReviewWorkflowsColumn-sPZxvFUd-Cd4JhTlj.mjs.map} +1 -1
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-m8hslkeI.js → ReviewWorkflowsColumn-sPZxvFUd-S2eFi9Dy.js} +5 -5
- package/dist/_chunks/{ReviewWorkflowsColumn-FDxVKdto-m8hslkeI.js.map → ReviewWorkflowsColumn-sPZxvFUd-S2eFi9Dy.js.map} +1 -1
- package/dist/_chunks/{constants-WjN6I3sL-7e3gpx4b.mjs → constants-0OGkpIzK-R5N7-OUr.mjs} +2 -2
- package/dist/_chunks/{constants-WjN6I3sL-7e3gpx4b.mjs.map → constants-0OGkpIzK-R5N7-OUr.mjs.map} +1 -1
- package/dist/_chunks/{constants-WjN6I3sL-cDZPE6ED.js → constants-0OGkpIzK-f_M9PDKN.js} +18 -18
- package/dist/_chunks/{constants-WjN6I3sL-cDZPE6ED.js.map → constants-0OGkpIzK-f_M9PDKN.js.map} +1 -1
- package/dist/_chunks/{index-VgvlwVA7.js → index-6X9XaLjS.js} +10 -11
- package/dist/_chunks/index-6X9XaLjS.js.map +1 -0
- package/dist/_chunks/{index-5ZvCaCyY-06DLg5eU.mjs → index-GIVuHJgC-_q6V7_2B.mjs} +2822 -2710
- package/dist/_chunks/index-GIVuHJgC-_q6V7_2B.mjs.map +1 -0
- package/dist/_chunks/{index-5ZvCaCyY-JgYo3Jws.js → index-GIVuHJgC-tj2acNbO.js} +2791 -2679
- package/dist/_chunks/index-GIVuHJgC-tj2acNbO.js.map +1 -0
- package/dist/_chunks/{index-TJUxOCtJ.js → index-Q5NQ4RI9.js} +20 -12
- package/dist/_chunks/index-Q5NQ4RI9.js.map +1 -0
- package/dist/_chunks/{index-MEUac_4V.js → index-RT4MW9Nr.js} +35 -37
- package/dist/_chunks/index-RT4MW9Nr.js.map +1 -0
- package/dist/_chunks/{index-A3oJlPcE.mjs → index-av_iGW-0.mjs} +31 -33
- package/dist/_chunks/index-av_iGW-0.mjs.map +1 -0
- package/dist/_chunks/{index-bRuKnVcH.js → index-heeE_h30.js} +8 -12
- package/dist/_chunks/index-heeE_h30.js.map +1 -0
- package/dist/_chunks/{index-53jX2hhF.mjs → index-iaIILeuQ.mjs} +19 -11
- package/dist/_chunks/index-iaIILeuQ.mjs.map +1 -0
- package/dist/_chunks/{index-vXywiVeM.mjs → index-pDvppjQG.mjs} +11 -12
- package/dist/_chunks/index-pDvppjQG.mjs.map +1 -0
- package/dist/_chunks/{index-mzJ2Vb5u.js → index-tFzYCM9l.js} +4 -5
- package/dist/_chunks/index-tFzYCM9l.js.map +1 -0
- package/dist/_chunks/{index-ee_14Ldw.mjs → index-vvcDunmb.mjs} +9 -13
- package/dist/_chunks/index-vvcDunmb.mjs.map +1 -0
- package/dist/_chunks/{index-N-GcFWtg.mjs → index-whB2wk2v.mjs} +6 -7
- package/dist/_chunks/index-whB2wk2v.mjs.map +1 -0
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-Z54sMEPM.mjs → useSyncRbac-JNQibLFa-D0RzXrU4.mjs} +2 -2
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-Z54sMEPM.mjs.map → useSyncRbac-JNQibLFa-D0RzXrU4.mjs.map} +1 -1
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-h8HqtZ6y.js → useSyncRbac-JNQibLFa-G2N9BPgu.js} +7 -7
- package/dist/_chunks/{useSyncRbac-Kt8Li0Yf-h8HqtZ6y.js.map → useSyncRbac-JNQibLFa-G2N9BPgu.js.map} +1 -1
- package/dist/admin/index.js +1 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +1 -2
- package/dist/admin/index.mjs.map +1 -1
- package/package.json +6 -6
- package/admin/src/pages/Roles/pages/ListPage/utils/api.js +0 -30
- package/dist/_chunks/EditViewPage-xYzUSAwS-5mOQ_-nB.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-xOVa04T_-elahT0e9.js.map +0 -1
- package/dist/_chunks/ListViewPage-xOVa04T_-lbfb219V.mjs.map +0 -1
- package/dist/_chunks/index-53jX2hhF.mjs.map +0 -1
- package/dist/_chunks/index-5ZvCaCyY-06DLg5eU.mjs.map +0 -1
- package/dist/_chunks/index-5ZvCaCyY-JgYo3Jws.js.map +0 -1
- package/dist/_chunks/index-A3oJlPcE.mjs.map +0 -1
- package/dist/_chunks/index-MEUac_4V.js.map +0 -1
- package/dist/_chunks/index-N-GcFWtg.mjs.map +0 -1
- package/dist/_chunks/index-TJUxOCtJ.js.map +0 -1
- package/dist/_chunks/index-VgvlwVA7.js.map +0 -1
- package/dist/_chunks/index-bRuKnVcH.js.map +0 -1
- package/dist/_chunks/index-ee_14Ldw.mjs.map +0 -1
- package/dist/_chunks/index-mzJ2Vb5u.js.map +0 -1
- package/dist/_chunks/index-vXywiVeM.mjs.map +0 -1
package/dist/_chunks/{ListViewPage-xOVa04T_-elahT0e9.js → ListViewPage-1VNVP9Rw-94jqnla4.js}
RENAMED
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
|
-
const helperPlugin = require("@strapi/helper-plugin");
|
|
7
6
|
const Icons = require("@strapi/icons");
|
|
8
7
|
const isEqual = require("lodash/isEqual");
|
|
9
|
-
const
|
|
8
|
+
const indexGIVuHJgC = require("./index-GIVuHJgC-tj2acNbO.js");
|
|
10
9
|
const Helmet = require("./Helmet-d9JljxUo.js");
|
|
11
10
|
const reactIntl = require("react-intl");
|
|
12
11
|
const reactRouterDom = require("react-router-dom");
|
|
13
12
|
const styled = require("styled-components");
|
|
14
|
-
const
|
|
13
|
+
const useSyncRbacJNQibLFa = require("./useSyncRbac-JNQibLFa-G2N9BPgu.js");
|
|
14
|
+
const helperPlugin = require("@strapi/helper-plugin");
|
|
15
15
|
const isEmpty = require("lodash/isEmpty");
|
|
16
16
|
const toString = require("lodash/toString");
|
|
17
17
|
const v2 = require("@strapi/design-system/v2");
|
|
@@ -41,8 +41,8 @@ const isEmpty__default = /* @__PURE__ */ _interopDefault(isEmpty);
|
|
|
41
41
|
const toString__default = /* @__PURE__ */ _interopDefault(toString);
|
|
42
42
|
function parseISO(argument, options) {
|
|
43
43
|
var _options$additionalDi;
|
|
44
|
-
|
|
45
|
-
var additionalDigits =
|
|
44
|
+
indexGIVuHJgC.requiredArgs(1, arguments);
|
|
45
|
+
var additionalDigits = indexGIVuHJgC.toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
46
46
|
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
47
47
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
48
48
|
}
|
|
@@ -171,7 +171,7 @@ function parseTime(timeString) {
|
|
|
171
171
|
if (!validateTime(hours, minutes, seconds)) {
|
|
172
172
|
return NaN;
|
|
173
173
|
}
|
|
174
|
-
return hours *
|
|
174
|
+
return hours * indexGIVuHJgC.millisecondsInHour + minutes * indexGIVuHJgC.millisecondsInMinute + seconds * 1e3;
|
|
175
175
|
}
|
|
176
176
|
function parseTimeUnit(value) {
|
|
177
177
|
return value && parseFloat(value.replace(",", ".")) || 0;
|
|
@@ -188,7 +188,7 @@ function parseTimezone(timezoneString) {
|
|
|
188
188
|
if (!validateTimezone(hours, minutes)) {
|
|
189
189
|
return NaN;
|
|
190
190
|
}
|
|
191
|
-
return sign * (hours *
|
|
191
|
+
return sign * (hours * indexGIVuHJgC.millisecondsInHour + minutes * indexGIVuHJgC.millisecondsInMinute);
|
|
192
192
|
}
|
|
193
193
|
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
194
194
|
var date = /* @__PURE__ */ new Date(0);
|
|
@@ -350,7 +350,7 @@ const STRING_PARSE_FILTERS = [
|
|
|
350
350
|
value: "$endsWithi"
|
|
351
351
|
}
|
|
352
352
|
];
|
|
353
|
-
const [FiltersProvider, useFilters] =
|
|
353
|
+
const [FiltersProvider, useFilters] = indexGIVuHJgC.createContext("Filters");
|
|
354
354
|
const Root = ({
|
|
355
355
|
children,
|
|
356
356
|
disabled = false,
|
|
@@ -361,7 +361,7 @@ const Root = ({
|
|
|
361
361
|
options = []
|
|
362
362
|
}) => {
|
|
363
363
|
const [triggerNode, setTriggerNode] = React__namespace.useState(null);
|
|
364
|
-
const [open = false, setOpen] =
|
|
364
|
+
const [open = false, setOpen] = indexGIVuHJgC.useControllableState({
|
|
365
365
|
prop: openProp,
|
|
366
366
|
defaultProp: defaultOpen,
|
|
367
367
|
onChange: onOpenChange
|
|
@@ -411,7 +411,7 @@ const Trigger = React__namespace.forwardRef(
|
|
|
411
411
|
}
|
|
412
412
|
);
|
|
413
413
|
const PopoverImpl = () => {
|
|
414
|
-
const [{ query }, setQuery] =
|
|
414
|
+
const [{ query }, setQuery] = indexGIVuHJgC.useQueryParams();
|
|
415
415
|
const { formatMessage } = reactIntl.useIntl();
|
|
416
416
|
const open = useFilters("Popover", ({ open: open2 }) => open2);
|
|
417
417
|
const options = useFilters("Popover", ({ options: options2 }) => options2);
|
|
@@ -455,7 +455,7 @@ const PopoverImpl = () => {
|
|
|
455
455
|
spacing: 4,
|
|
456
456
|
maxHeight: "unset",
|
|
457
457
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
458
|
-
|
|
458
|
+
indexGIVuHJgC.Form,
|
|
459
459
|
{
|
|
460
460
|
method: "POST",
|
|
461
461
|
initialValues: {
|
|
@@ -465,7 +465,7 @@ const PopoverImpl = () => {
|
|
|
465
465
|
onSubmit: handleSubmit,
|
|
466
466
|
children: ({ values: formValues, modified, isSubmitting }) => {
|
|
467
467
|
const filter = options.find((filter2) => filter2.name === formValues.name);
|
|
468
|
-
const Input = filter?.input ||
|
|
468
|
+
const Input = filter?.input || indexGIVuHJgC.InputRenderer;
|
|
469
469
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, style: { minWidth: 184 }, children: [
|
|
470
470
|
[
|
|
471
471
|
{
|
|
@@ -500,7 +500,7 @@ const PopoverImpl = () => {
|
|
|
500
500
|
}),
|
|
501
501
|
type: "enumeration"
|
|
502
502
|
}
|
|
503
|
-
].map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
503
|
+
].map((field) => /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.InputRenderer, { ...field }, field.name)),
|
|
504
504
|
filter && formValues.filter && formValues.filter !== "$null" && formValues.filter !== "$notNull" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
505
505
|
Input,
|
|
506
506
|
{
|
|
@@ -565,7 +565,7 @@ const getFilterList = (filter) => {
|
|
|
565
565
|
}
|
|
566
566
|
};
|
|
567
567
|
const List = () => {
|
|
568
|
-
const [{ query }, setQuery] =
|
|
568
|
+
const [{ query }, setQuery] = indexGIVuHJgC.useQueryParams();
|
|
569
569
|
const options = useFilters("List", ({ options: options2 }) => options2);
|
|
570
570
|
const handleClick = (data) => {
|
|
571
571
|
const nextFilters = (query?.filters?.$and ?? []).filter((filter) => {
|
|
@@ -714,14 +714,14 @@ const NOT_ALLOWED_FILTERS = [
|
|
|
714
714
|
"blocks"
|
|
715
715
|
];
|
|
716
716
|
const DEFAULT_ALLOWED_FILTERS = ["createdAt", "updatedAt"];
|
|
717
|
-
const USER_FILTER_ATTRIBUTES = [...
|
|
717
|
+
const USER_FILTER_ATTRIBUTES = [...indexGIVuHJgC.CREATOR_FIELDS, "strapi_assignee"];
|
|
718
718
|
const FiltersImpl = ({ disabled, schema }) => {
|
|
719
719
|
const { attributes, uid: model, options } = schema;
|
|
720
720
|
const { formatMessage, locale } = reactIntl.useIntl();
|
|
721
|
-
const { trackUsage } =
|
|
721
|
+
const { trackUsage } = indexGIVuHJgC.useTracking();
|
|
722
722
|
const { allPermissions } = helperPlugin.useRBACProvider();
|
|
723
|
-
const [{ query }] =
|
|
724
|
-
const { schemas } =
|
|
723
|
+
const [{ query }] = indexGIVuHJgC.useQueryParams();
|
|
724
|
+
const { schemas } = indexGIVuHJgC.useContentTypeSchema();
|
|
725
725
|
const canReadAdminUsers = React__namespace.useMemo(
|
|
726
726
|
() => helperPlugin.findMatchingPermissions(allPermissions, [
|
|
727
727
|
{
|
|
@@ -742,7 +742,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
742
742
|
}
|
|
743
743
|
return acc;
|
|
744
744
|
}, []);
|
|
745
|
-
const { data: userData, isLoading: isLoadingAdminUsers } =
|
|
745
|
+
const { data: userData, isLoading: isLoadingAdminUsers } = indexGIVuHJgC.useAdminUsers(
|
|
746
746
|
{ filters: { id: { $in: selectedUserIds } } },
|
|
747
747
|
{
|
|
748
748
|
// fetch the list of admin users only if the filter contains users and the
|
|
@@ -751,7 +751,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
751
751
|
}
|
|
752
752
|
);
|
|
753
753
|
const { users = [] } = userData ?? {};
|
|
754
|
-
const { metadata } =
|
|
754
|
+
const { metadata } = indexGIVuHJgC.useGetContentTypeConfigurationQuery(model, {
|
|
755
755
|
selectFromResult: ({ data }) => ({ metadata: data?.contentType.metadatas ?? {} })
|
|
756
756
|
});
|
|
757
757
|
const formatter = designSystem.useCollator(locale, {
|
|
@@ -775,7 +775,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
775
775
|
"id",
|
|
776
776
|
...allowedFields,
|
|
777
777
|
...DEFAULT_ALLOWED_FILTERS,
|
|
778
|
-
...canReadAdminUsers ?
|
|
778
|
+
...canReadAdminUsers ? indexGIVuHJgC.CREATOR_FIELDS : []
|
|
779
779
|
].map((name) => {
|
|
780
780
|
const attribute = attributes[name];
|
|
781
781
|
if (NOT_ALLOWED_FILTERS.includes(attribute.type)) {
|
|
@@ -785,7 +785,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
785
785
|
let filter = {
|
|
786
786
|
name,
|
|
787
787
|
label: label ?? "",
|
|
788
|
-
mainField:
|
|
788
|
+
mainField: indexGIVuHJgC.getMainField(attribute, mainFieldName, { schemas, components: {} }),
|
|
789
789
|
// @ts-expect-error – TODO: this is filtered out above in the `allowedFields` call but TS complains, is there a better way to solve this?
|
|
790
790
|
type: attribute.type
|
|
791
791
|
};
|
|
@@ -794,7 +794,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
794
794
|
...filter,
|
|
795
795
|
input: AdminUsersFilter,
|
|
796
796
|
options: users.map((user) => ({
|
|
797
|
-
label:
|
|
797
|
+
label: indexGIVuHJgC.getDisplayName(user, formatMessage),
|
|
798
798
|
value: user.id.toString()
|
|
799
799
|
})),
|
|
800
800
|
operators: [
|
|
@@ -831,9 +831,9 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
831
831
|
users,
|
|
832
832
|
formatMessage
|
|
833
833
|
]);
|
|
834
|
-
const reviewWorkflowFilter =
|
|
834
|
+
const reviewWorkflowFilter = indexGIVuHJgC.useEnterprise(
|
|
835
835
|
REVIEW_WORKFLOW_FILTER_CE,
|
|
836
|
-
async () => (await Promise.resolve().then(() => require("./constants-
|
|
836
|
+
async () => (await Promise.resolve().then(() => require("./constants-0OGkpIzK-f_M9PDKN.js"))).REVIEW_WORKFLOW_FILTERS,
|
|
837
837
|
{
|
|
838
838
|
combine(ceFilters, eeFilters) {
|
|
839
839
|
return [
|
|
@@ -855,7 +855,7 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
855
855
|
// TODO: strapi_assignee should not be in here and rather defined
|
|
856
856
|
// in the ee directory.
|
|
857
857
|
eeFilter.name === "strapi_assignee" ? users.map((user) => ({
|
|
858
|
-
label:
|
|
858
|
+
label: indexGIVuHJgC.getDisplayName(user, formatMessage),
|
|
859
859
|
value: user.id.toString()
|
|
860
860
|
})) : void 0
|
|
861
861
|
)
|
|
@@ -907,10 +907,10 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
|
907
907
|
const AdminUsersFilter = ({ name }) => {
|
|
908
908
|
const [page, setPage] = React__namespace.useState(1);
|
|
909
909
|
const { formatMessage } = reactIntl.useIntl();
|
|
910
|
-
const { data, isLoading } =
|
|
910
|
+
const { data, isLoading } = indexGIVuHJgC.useAdminUsers({
|
|
911
911
|
page
|
|
912
912
|
});
|
|
913
|
-
const field =
|
|
913
|
+
const field = indexGIVuHJgC.useField(name);
|
|
914
914
|
const handleOpenChange = (isOpen) => {
|
|
915
915
|
if (!isOpen) {
|
|
916
916
|
setPage(1);
|
|
@@ -930,7 +930,7 @@ const AdminUsersFilter = ({ name }) => {
|
|
|
930
930
|
loading: isLoading,
|
|
931
931
|
onLoadMore: () => setPage((prev) => prev + 1),
|
|
932
932
|
children: users.map((user) => {
|
|
933
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children:
|
|
933
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children: indexGIVuHJgC.getDisplayName(user, formatMessage) }, user.id);
|
|
934
934
|
})
|
|
935
935
|
}
|
|
936
936
|
);
|
|
@@ -1006,10 +1006,10 @@ const MenuTrigger$1 = styled__default.default(v2.Menu.Trigger)`
|
|
|
1006
1006
|
`;
|
|
1007
1007
|
const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
|
|
1008
1008
|
const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
|
|
1009
|
-
const fileURL =
|
|
1009
|
+
const fileURL = indexGIVuHJgC.prefixFileUrlWithBackendUrl(url);
|
|
1010
1010
|
if (mime.includes("image")) {
|
|
1011
1011
|
const thumbnail = formats?.thumbnail?.url;
|
|
1012
|
-
const mediaURL =
|
|
1012
|
+
const mediaURL = indexGIVuHJgC.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
|
|
1013
1013
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Avatar, { src: mediaURL, alt: alternativeText || name, preview: true });
|
|
1014
1014
|
}
|
|
1015
1015
|
const fileExtension = getFileExtension(ext);
|
|
@@ -1052,18 +1052,18 @@ const MediaMultiple = ({ content }) => {
|
|
|
1052
1052
|
}) });
|
|
1053
1053
|
};
|
|
1054
1054
|
const RelationSingle = ({ mainField, content }) => {
|
|
1055
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth$1, { textColor: "neutral800", ellipsis: true, children:
|
|
1055
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth$1, { textColor: "neutral800", ellipsis: true, children: indexGIVuHJgC.getRelationLabel(content, mainField) });
|
|
1056
1056
|
};
|
|
1057
1057
|
const TypographyMaxWidth$1 = styled__default.default(designSystem.Typography)`
|
|
1058
1058
|
max-width: 500px;
|
|
1059
1059
|
`;
|
|
1060
1060
|
const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
1061
|
-
const { model } =
|
|
1061
|
+
const { model } = indexGIVuHJgC.useDoc();
|
|
1062
1062
|
const { formatMessage } = reactIntl.useIntl();
|
|
1063
1063
|
const { notifyStatus } = designSystem.useNotifyAT();
|
|
1064
1064
|
const [isOpen, setIsOpen] = React__namespace.useState(false);
|
|
1065
1065
|
const [targetField] = name.split(".");
|
|
1066
|
-
const { data, isLoading } =
|
|
1066
|
+
const { data, isLoading } = indexGIVuHJgC.useGetRelationsQuery(
|
|
1067
1067
|
{
|
|
1068
1068
|
model,
|
|
1069
1069
|
id: rowId,
|
|
@@ -1078,7 +1078,7 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
|
1078
1078
|
if (data) {
|
|
1079
1079
|
notifyStatus(
|
|
1080
1080
|
formatMessage({
|
|
1081
|
-
id:
|
|
1081
|
+
id: indexGIVuHJgC.getTranslation("DynamicTable.relation-loaded"),
|
|
1082
1082
|
defaultMessage: "Relations have been loaded"
|
|
1083
1083
|
})
|
|
1084
1084
|
);
|
|
@@ -1097,17 +1097,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
|
1097
1097
|
] }) }),
|
|
1098
1098
|
/* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.Content, { children: [
|
|
1099
1099
|
isLoading && /* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
|
|
1100
|
-
id:
|
|
1100
|
+
id: indexGIVuHJgC.getTranslation("ListViewTable.relation-loading"),
|
|
1101
1101
|
defaultMessage: "Relations are loading"
|
|
1102
1102
|
}) }) }),
|
|
1103
1103
|
data?.results && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1104
|
-
data.results.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth$1, { ellipsis: true, children:
|
|
1104
|
+
data.results.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth$1, { ellipsis: true, children: indexGIVuHJgC.getRelationLabel(entry, mainField) }) }, entry.documentId)),
|
|
1105
1105
|
data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
1106
|
v2.Menu.Item,
|
|
1107
1107
|
{
|
|
1108
1108
|
"aria-disabled": true,
|
|
1109
1109
|
"aria-label": formatMessage({
|
|
1110
|
-
id:
|
|
1110
|
+
id: indexGIVuHJgC.getTranslation("ListViewTable.relation-more"),
|
|
1111
1111
|
defaultMessage: "This relation contains more entities than displayed"
|
|
1112
1112
|
}),
|
|
1113
1113
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: "…" })
|
|
@@ -1182,10 +1182,10 @@ const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].in
|
|
|
1182
1182
|
const ViewSettingsMenu = (props) => {
|
|
1183
1183
|
const [isVisible, setIsVisible] = React__namespace.useState(false);
|
|
1184
1184
|
const cogButtonRef = React__namespace.useRef(null);
|
|
1185
|
-
const permissions =
|
|
1185
|
+
const permissions = indexGIVuHJgC.useTypedSelector(
|
|
1186
1186
|
(state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
|
|
1187
1187
|
);
|
|
1188
|
-
const [{ query }] =
|
|
1188
|
+
const [{ query }] = indexGIVuHJgC.useQueryParams();
|
|
1189
1189
|
const { formatMessage } = reactIntl.useIntl();
|
|
1190
1190
|
const {
|
|
1191
1191
|
allowedActions: { canViewConfiguration }
|
|
@@ -1226,7 +1226,7 @@ const ViewSettingsMenu = (props) => {
|
|
|
1226
1226
|
as: reactRouterDom.NavLink,
|
|
1227
1227
|
to: {
|
|
1228
1228
|
pathname: "configurations/list",
|
|
1229
|
-
search: query.plugins ?
|
|
1229
|
+
search: query.plugins ? indexGIVuHJgC.lib.stringify({ plugins: query.plugins }, { encode: false }) : ""
|
|
1230
1230
|
},
|
|
1231
1231
|
children: formatMessage({
|
|
1232
1232
|
id: "app.links.configure-view",
|
|
@@ -1241,15 +1241,15 @@ const ViewSettingsMenu = (props) => {
|
|
|
1241
1241
|
] });
|
|
1242
1242
|
};
|
|
1243
1243
|
const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
|
|
1244
|
-
const { trackUsage } =
|
|
1244
|
+
const { trackUsage } = indexGIVuHJgC.useTracking();
|
|
1245
1245
|
const { formatMessage, locale } = reactIntl.useIntl();
|
|
1246
|
-
const { schema, model } =
|
|
1247
|
-
const { list } =
|
|
1246
|
+
const { schema, model } = indexGIVuHJgC.useDoc();
|
|
1247
|
+
const { list } = indexGIVuHJgC.useDocumentLayout(model);
|
|
1248
1248
|
const formatter = designSystem.useCollator(locale, {
|
|
1249
1249
|
sensitivity: "base"
|
|
1250
1250
|
});
|
|
1251
1251
|
const attributes = schema?.attributes ?? {};
|
|
1252
|
-
const columns = Object.keys(attributes).filter((name) =>
|
|
1252
|
+
const columns = Object.keys(attributes).filter((name) => indexGIVuHJgC.checkIfAttributeIsDisplayable(attributes[name])).map((name) => ({
|
|
1253
1253
|
name,
|
|
1254
1254
|
label: list.metadatas[name]?.label ?? ""
|
|
1255
1255
|
})).sort((a, b) => formatter.compare(a.label, b.label));
|
|
@@ -1305,21 +1305,20 @@ const ChackboxWrapper = styled__default.default(designSystem.Flex)`
|
|
|
1305
1305
|
background-color: ${(props) => props.theme.colors.primary100};
|
|
1306
1306
|
}
|
|
1307
1307
|
`;
|
|
1308
|
-
const { INJECT_COLUMN_IN_TABLE } =
|
|
1308
|
+
const { INJECT_COLUMN_IN_TABLE } = indexGIVuHJgC.HOOKS;
|
|
1309
1309
|
const REVIEW_WORKFLOW_COLUMNS_CE = null;
|
|
1310
1310
|
const REVIEW_WORKFLOW_COLUMNS_CELL_CE = {
|
|
1311
1311
|
ReviewWorkflowsStageEE: () => null,
|
|
1312
1312
|
ReviewWorkflowsAssigneeEE: () => null
|
|
1313
1313
|
};
|
|
1314
1314
|
const ListViewPage = () => {
|
|
1315
|
-
const { trackUsage } =
|
|
1315
|
+
const { trackUsage } = indexGIVuHJgC.useTracking();
|
|
1316
1316
|
const navigate = reactRouterDom.useNavigate();
|
|
1317
1317
|
const { formatMessage } = reactIntl.useIntl();
|
|
1318
|
-
const { toggleNotification } =
|
|
1319
|
-
|
|
1320
|
-
const {
|
|
1321
|
-
const {
|
|
1322
|
-
const { list } = index5ZvCaCyY.useDocumentLayout(model);
|
|
1318
|
+
const { toggleNotification } = indexGIVuHJgC.useNotification();
|
|
1319
|
+
const { _unstableFormatAPIError: formatAPIError } = indexGIVuHJgC.useAPIErrorHandler(indexGIVuHJgC.getTranslation);
|
|
1320
|
+
const { collectionType, model, schema } = indexGIVuHJgC.useDoc();
|
|
1321
|
+
const { list } = indexGIVuHJgC.useDocumentLayout(model);
|
|
1323
1322
|
const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
|
|
1324
1323
|
const listLayout = usePrev(list.layout);
|
|
1325
1324
|
React__namespace.useEffect(() => {
|
|
@@ -1329,16 +1328,16 @@ const ListViewPage = () => {
|
|
|
1329
1328
|
}, [list.layout, listLayout]);
|
|
1330
1329
|
const handleSetHeaders = (headers) => {
|
|
1331
1330
|
setDisplayedHeaders(
|
|
1332
|
-
|
|
1331
|
+
indexGIVuHJgC.convertListLayoutToFieldLayouts(headers, schema.attributes, list.metadatas)
|
|
1333
1332
|
);
|
|
1334
1333
|
};
|
|
1335
|
-
const [{ query }] =
|
|
1334
|
+
const [{ query }] = indexGIVuHJgC.useQueryParams({
|
|
1336
1335
|
page: "1",
|
|
1337
1336
|
pageSize: list.settings.pageSize.toString(),
|
|
1338
1337
|
sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
|
|
1339
1338
|
});
|
|
1340
|
-
const params = React__namespace.useMemo(() =>
|
|
1341
|
-
const { data, error, isLoading } =
|
|
1339
|
+
const params = React__namespace.useMemo(() => indexGIVuHJgC.buildValidParams(query), [query]);
|
|
1340
|
+
const { data, error, isLoading } = indexGIVuHJgC.useGetAllDocumentsQuery({
|
|
1342
1341
|
model,
|
|
1343
1342
|
params
|
|
1344
1343
|
});
|
|
@@ -1355,7 +1354,7 @@ const ListViewPage = () => {
|
|
|
1355
1354
|
if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {
|
|
1356
1355
|
navigate(
|
|
1357
1356
|
{
|
|
1358
|
-
search:
|
|
1357
|
+
search: indexGIVuHJgC.lib.stringify({
|
|
1359
1358
|
...query,
|
|
1360
1359
|
page: pagination.pageCount
|
|
1361
1360
|
})
|
|
@@ -1364,27 +1363,27 @@ const ListViewPage = () => {
|
|
|
1364
1363
|
);
|
|
1365
1364
|
}
|
|
1366
1365
|
}, [pagination, formatMessage, query, navigate]);
|
|
1367
|
-
const { canCreate } =
|
|
1366
|
+
const { canCreate } = indexGIVuHJgC.useDocumentRBAC("ListViewPage", ({ canCreate: canCreate2 }) => ({
|
|
1368
1367
|
canCreate: canCreate2
|
|
1369
1368
|
}));
|
|
1370
|
-
const reviewWorkflowColumns =
|
|
1369
|
+
const reviewWorkflowColumns = indexGIVuHJgC.useEnterprise(
|
|
1371
1370
|
REVIEW_WORKFLOW_COLUMNS_CE,
|
|
1372
|
-
async () => (await Promise.resolve().then(() => require("./constants-
|
|
1371
|
+
async () => (await Promise.resolve().then(() => require("./constants-0OGkpIzK-f_M9PDKN.js"))).REVIEW_WORKFLOW_COLUMNS_EE,
|
|
1373
1372
|
{
|
|
1374
1373
|
enabled: !!schema?.options?.reviewWorkflows
|
|
1375
1374
|
}
|
|
1376
1375
|
);
|
|
1377
|
-
const ReviewWorkflowsColumns =
|
|
1376
|
+
const ReviewWorkflowsColumns = indexGIVuHJgC.useEnterprise(
|
|
1378
1377
|
REVIEW_WORKFLOW_COLUMNS_CELL_CE,
|
|
1379
1378
|
async () => {
|
|
1380
|
-
const { ReviewWorkflowsStageEE, ReviewWorkflowsAssigneeEE } = await Promise.resolve().then(() => require("./ReviewWorkflowsColumn-
|
|
1379
|
+
const { ReviewWorkflowsStageEE, ReviewWorkflowsAssigneeEE } = await Promise.resolve().then(() => require("./ReviewWorkflowsColumn-sPZxvFUd-S2eFi9Dy.js"));
|
|
1381
1380
|
return { ReviewWorkflowsStageEE, ReviewWorkflowsAssigneeEE };
|
|
1382
1381
|
},
|
|
1383
1382
|
{
|
|
1384
1383
|
enabled: !!schema?.options?.reviewWorkflows
|
|
1385
1384
|
}
|
|
1386
1385
|
);
|
|
1387
|
-
const runHookWaterfall =
|
|
1386
|
+
const runHookWaterfall = indexGIVuHJgC.useStrapiApp("ListViewPage", ({ runHookWaterfall: runHookWaterfall2 }) => runHookWaterfall2);
|
|
1388
1387
|
const tableHeaders = React__namespace.useMemo(() => {
|
|
1389
1388
|
const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
|
|
1390
1389
|
displayedHeaders,
|
|
@@ -1404,7 +1403,7 @@ const ListViewPage = () => {
|
|
|
1404
1403
|
},
|
|
1405
1404
|
name: "status",
|
|
1406
1405
|
label: formatMessage({
|
|
1407
|
-
id:
|
|
1406
|
+
id: indexGIVuHJgC.getTranslation(`containers.list.table-headers.status`),
|
|
1408
1407
|
defaultMessage: "status"
|
|
1409
1408
|
}),
|
|
1410
1409
|
searchable: false,
|
|
@@ -1429,20 +1428,20 @@ const ListViewPage = () => {
|
|
|
1429
1428
|
schema?.options?.draftAndPublish
|
|
1430
1429
|
]);
|
|
1431
1430
|
if (isLoading) {
|
|
1432
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Page.Loading, {});
|
|
1433
1432
|
}
|
|
1434
1433
|
if (error) {
|
|
1435
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1434
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Page.Error, {});
|
|
1436
1435
|
}
|
|
1437
1436
|
const contentTypeTitle = schema?.info.displayName ?? "Untitled";
|
|
1438
1437
|
const handleRowClick = (id) => () => {
|
|
1439
1438
|
trackUsage("willEditEntryFromList");
|
|
1440
1439
|
navigate({
|
|
1441
1440
|
pathname: id.toString(),
|
|
1442
|
-
search:
|
|
1441
|
+
search: indexGIVuHJgC.lib.stringify({ plugins: query.plugins })
|
|
1443
1442
|
});
|
|
1444
1443
|
};
|
|
1445
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(indexGIVuHJgC.Page.Main, { children: [
|
|
1446
1445
|
/* @__PURE__ */ jsxRuntime.jsx(Helmet.HelmetExport, { title: `${contentTypeTitle} | Strapi` }),
|
|
1447
1446
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1448
1447
|
designSystem.HeaderLayout,
|
|
@@ -1450,20 +1449,20 @@ const ListViewPage = () => {
|
|
|
1450
1449
|
primaryAction: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, {}) : null,
|
|
1451
1450
|
subtitle: formatMessage(
|
|
1452
1451
|
{
|
|
1453
|
-
id:
|
|
1452
|
+
id: indexGIVuHJgC.getTranslation("pages.ListView.header-subtitle"),
|
|
1454
1453
|
defaultMessage: "{number, plural, =0 {# entries} one {# entry} other {# entries}} found"
|
|
1455
1454
|
},
|
|
1456
1455
|
{ number: pagination?.total }
|
|
1457
1456
|
),
|
|
1458
1457
|
title: contentTypeTitle,
|
|
1459
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1458
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.BackButton, {})
|
|
1460
1459
|
}
|
|
1461
1460
|
),
|
|
1462
1461
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1463
1462
|
designSystem.ActionLayout,
|
|
1464
1463
|
{
|
|
1465
1464
|
endActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1466
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1465
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.InjectionZone, { area: "contentManager.listView.actions" }),
|
|
1467
1466
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1468
1467
|
ViewSettingsMenu,
|
|
1469
1468
|
{
|
|
@@ -1475,7 +1474,7 @@ const ListViewPage = () => {
|
|
|
1475
1474
|
] }),
|
|
1476
1475
|
startActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1477
1476
|
list.settings.searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1478
|
-
|
|
1477
|
+
indexGIVuHJgC.SearchInput,
|
|
1479
1478
|
{
|
|
1480
1479
|
disabled: results.length === 0,
|
|
1481
1480
|
label: formatMessage(
|
|
@@ -1494,31 +1493,31 @@ const ListViewPage = () => {
|
|
|
1494
1493
|
}
|
|
1495
1494
|
),
|
|
1496
1495
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
1497
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1498
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1499
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1500
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1501
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1502
|
-
tableHeaders.map((header) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1496
|
+
/* @__PURE__ */ jsxRuntime.jsxs(indexGIVuHJgC.Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
|
|
1497
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.ActionBar, {}),
|
|
1498
|
+
/* @__PURE__ */ jsxRuntime.jsxs(indexGIVuHJgC.Table.Content, { children: [
|
|
1499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(indexGIVuHJgC.Table.Head, { children: [
|
|
1500
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.HeaderCheckboxCell, {}),
|
|
1501
|
+
tableHeaders.map((header) => /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.HeaderCell, { ...header }, header.name))
|
|
1503
1502
|
] }),
|
|
1504
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1505
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1506
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1503
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Loading, {}),
|
|
1504
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Empty, { action: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, { variant: "secondary" }) : null }),
|
|
1505
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Body, { children: results.map((row) => {
|
|
1507
1506
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1508
|
-
|
|
1507
|
+
indexGIVuHJgC.Table.Row,
|
|
1509
1508
|
{
|
|
1510
1509
|
cursor: "pointer",
|
|
1511
1510
|
onClick: handleRowClick(row.documentId),
|
|
1512
1511
|
children: [
|
|
1513
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1512
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.CheckboxCell, { id: row.id }),
|
|
1514
1513
|
tableHeaders.map(({ cellFormatter, ...header }) => {
|
|
1515
1514
|
if (header.name === "status") {
|
|
1516
1515
|
const { status } = row;
|
|
1517
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1516
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.DocumentStatus, { status, maxWidth: "min-content" }) }, header.name);
|
|
1518
1517
|
}
|
|
1519
1518
|
if (schema?.options?.reviewWorkflows) {
|
|
1520
1519
|
if (header.name === "strapi_stage") {
|
|
1521
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1520
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: row.strapi_stage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1522
1521
|
ReviewWorkflowsColumns.ReviewWorkflowsStageEE,
|
|
1523
1522
|
{
|
|
1524
1523
|
color: row.strapi_stage.color ?? designSystem.lightTheme.colors.primary600,
|
|
@@ -1527,7 +1526,7 @@ const ListViewPage = () => {
|
|
|
1527
1526
|
) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: "-" }) }, header.name);
|
|
1528
1527
|
}
|
|
1529
1528
|
if (header.name === "strapi_assignee") {
|
|
1530
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1529
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: row.strapi_assignee ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1531
1530
|
ReviewWorkflowsColumns.ReviewWorkflowsAssigneeEE,
|
|
1532
1531
|
{
|
|
1533
1532
|
user: row.strapi_assignee
|
|
@@ -1536,12 +1535,12 @@ const ListViewPage = () => {
|
|
|
1536
1535
|
}
|
|
1537
1536
|
}
|
|
1538
1537
|
if (["createdBy", "updatedBy"].includes(header.name.split(".")[0])) {
|
|
1539
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1538
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: row[header.name.split(".")[0]] ? indexGIVuHJgC.getDisplayName(row[header.name.split(".")[0]], formatMessage) : "-" }) }, header.name);
|
|
1540
1539
|
}
|
|
1541
1540
|
if (typeof cellFormatter === "function") {
|
|
1542
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1541
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: cellFormatter(row, header, { collectionType, model }) }, header.name);
|
|
1543
1542
|
}
|
|
1544
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1543
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1545
1544
|
CellContent,
|
|
1546
1545
|
{
|
|
1547
1546
|
content: row[header.name.split(".")[0]],
|
|
@@ -1550,7 +1549,7 @@ const ListViewPage = () => {
|
|
|
1550
1549
|
}
|
|
1551
1550
|
) }, header.name);
|
|
1552
1551
|
}),
|
|
1553
|
-
/* @__PURE__ */ jsxRuntime.jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1552
|
+
/* @__PURE__ */ jsxRuntime.jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.TableActions, { document: row }) })
|
|
1554
1553
|
]
|
|
1555
1554
|
},
|
|
1556
1555
|
row.id
|
|
@@ -1559,27 +1558,27 @@ const ListViewPage = () => {
|
|
|
1559
1558
|
] })
|
|
1560
1559
|
] }),
|
|
1561
1560
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1562
|
-
|
|
1561
|
+
indexGIVuHJgC.Pagination.Root,
|
|
1563
1562
|
{
|
|
1564
1563
|
...pagination,
|
|
1565
1564
|
onPageSizeChange: () => trackUsage("willChangeNumberOfEntriesPerPage"),
|
|
1566
1565
|
children: [
|
|
1567
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1568
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1566
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Pagination.PageSize, {}),
|
|
1567
|
+
/* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Pagination.Links, {})
|
|
1569
1568
|
]
|
|
1570
1569
|
}
|
|
1571
1570
|
)
|
|
1572
1571
|
] }) })
|
|
1573
1572
|
] });
|
|
1574
1573
|
};
|
|
1575
|
-
const ActionsCell = styled__default.default(
|
|
1574
|
+
const ActionsCell = styled__default.default(indexGIVuHJgC.Table.Cell)`
|
|
1576
1575
|
display: flex;
|
|
1577
1576
|
justify-content: flex-end;
|
|
1578
1577
|
`;
|
|
1579
1578
|
const CreateButton = ({ variant }) => {
|
|
1580
1579
|
const { formatMessage } = reactIntl.useIntl();
|
|
1581
|
-
const { trackUsage } =
|
|
1582
|
-
const [{ query }] =
|
|
1580
|
+
const { trackUsage } = indexGIVuHJgC.useTracking();
|
|
1581
|
+
const [{ query }] = indexGIVuHJgC.useQueryParams();
|
|
1583
1582
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1584
1583
|
designSystem.Button,
|
|
1585
1584
|
{
|
|
@@ -1592,27 +1591,27 @@ const CreateButton = ({ variant }) => {
|
|
|
1592
1591
|
style: { textDecoration: "none" },
|
|
1593
1592
|
to: {
|
|
1594
1593
|
pathname: "create",
|
|
1595
|
-
search:
|
|
1594
|
+
search: indexGIVuHJgC.lib.stringify({ plugins: query.plugins })
|
|
1596
1595
|
},
|
|
1597
1596
|
children: formatMessage({
|
|
1598
|
-
id:
|
|
1597
|
+
id: indexGIVuHJgC.getTranslation("HeaderLayout.button.label-add-entry"),
|
|
1599
1598
|
defaultMessage: "Create new entry"
|
|
1600
1599
|
})
|
|
1601
1600
|
}
|
|
1602
1601
|
);
|
|
1603
1602
|
};
|
|
1604
1603
|
const ProtectedListViewPage = () => {
|
|
1605
|
-
const { model } =
|
|
1606
|
-
const [{ query }] =
|
|
1607
|
-
const { permissions = [], isLoading, isError } =
|
|
1604
|
+
const { model } = indexGIVuHJgC.useDoc();
|
|
1605
|
+
const [{ query }] = indexGIVuHJgC.useQueryParams();
|
|
1606
|
+
const { permissions = [], isLoading, isError } = useSyncRbacJNQibLFa.useSyncRbac(model, query, "editView");
|
|
1608
1607
|
if (isLoading) {
|
|
1609
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1608
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Page.Loading, {});
|
|
1610
1609
|
}
|
|
1611
1610
|
if (isError) {
|
|
1612
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Page.Error, {});
|
|
1613
1612
|
}
|
|
1614
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1613
|
+
return /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsxRuntime.jsx(indexGIVuHJgC.DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsxRuntime.jsx(ListViewPage, {}) }) });
|
|
1615
1614
|
};
|
|
1616
1615
|
exports.ListViewPage = ListViewPage;
|
|
1617
1616
|
exports.ProtectedListViewPage = ProtectedListViewPage;
|
|
1618
|
-
//# sourceMappingURL=ListViewPage-
|
|
1617
|
+
//# sourceMappingURL=ListViewPage-1VNVP9Rw-94jqnla4.js.map
|