@mattisvensson/strapi-plugin-webatlas 0.11.0 → 0.11.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/README.md +14 -8
- package/dist/admin/{FullLoader-CrPED_dY.mjs → FullLoader-Btjb2W2p.mjs} +4 -2
- package/dist/admin/{FullLoader-Cmsf8xS6.js → FullLoader-Da2n70bJ.js} +4 -2
- package/dist/admin/{SettingTitle-BjE_2u6R.js → SettingTitle-B0quw3f8.js} +5 -3
- package/dist/admin/{SettingTitle-B1IaU3qs.mjs → SettingTitle-HMfQOJnK.mjs} +5 -3
- package/dist/admin/de-B5pRvs13.mjs +0 -1
- package/dist/admin/de-CqU1FU8C.js +0 -1
- package/dist/admin/en-BE-zzIv8.mjs +0 -1
- package/dist/admin/en-C7I90FwV.js +0 -1
- package/dist/admin/{index-Cf9j0bn2.mjs → index-9_HhKDUC.mjs} +31 -59
- package/dist/admin/{index-DCYCtKrj.mjs → index-B79ELMEC.mjs} +220 -215
- package/dist/admin/{index-JLpXBQVL.js → index-BEVoxEAm.js} +31 -59
- package/dist/admin/index-Bmg-ERct.mjs +243 -0
- package/dist/admin/{index-AVI3QJ0R.js → index-C8YjuuOx.js} +496 -354
- package/dist/admin/{index-Yq-QR8t0.js → index-Cx_mktdk.js} +220 -215
- package/dist/admin/{index-BbnlyBrZ.mjs → index-Cz_k_jjp.mjs} +41 -31
- package/dist/admin/{index-D8bG0YFB.js → index-D2hB1vTw.js} +41 -31
- package/dist/admin/index-YdWxpvOH.js +243 -0
- package/dist/admin/{index-BIEUXWe7.mjs → index-oEJT_mvw.mjs} +496 -354
- package/dist/admin/index.js +1 -2
- package/dist/admin/index.mjs +1 -2
- package/dist/admin/src/index.d.ts +12 -0
- package/dist/server/index.js +174 -145
- package/dist/server/index.mjs +174 -145
- package/dist/server/src/index.d.ts +305 -0
- package/package.json +108 -108
- package/dist/admin/FullLoader-Cmsf8xS6.js.map +0 -1
- package/dist/admin/FullLoader-CrPED_dY.mjs.map +0 -1
- package/dist/admin/SettingTitle-B1IaU3qs.mjs.map +0 -1
- package/dist/admin/SettingTitle-BjE_2u6R.js.map +0 -1
- package/dist/admin/de-B5pRvs13.mjs.map +0 -1
- package/dist/admin/de-CqU1FU8C.js.map +0 -1
- package/dist/admin/en-BE-zzIv8.mjs.map +0 -1
- package/dist/admin/en-C7I90FwV.js.map +0 -1
- package/dist/admin/index-AVI3QJ0R.js.map +0 -1
- package/dist/admin/index-B90eSO4a.js +0 -219
- package/dist/admin/index-B90eSO4a.js.map +0 -1
- package/dist/admin/index-BIEUXWe7.mjs.map +0 -1
- package/dist/admin/index-BbnlyBrZ.mjs.map +0 -1
- package/dist/admin/index-Cf9j0bn2.mjs.map +0 -1
- package/dist/admin/index-D8bG0YFB.js.map +0 -1
- package/dist/admin/index-DCYCtKrj.mjs.map +0 -1
- package/dist/admin/index-JLpXBQVL.js.map +0 -1
- package/dist/admin/index-Y_PYIiRA.mjs +0 -219
- package/dist/admin/index-Y_PYIiRA.mjs.map +0 -1
- package/dist/admin/index-Yq-QR8t0.js.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/index.mjs.map +0 -1
|
@@ -2,11 +2,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useReducer, useState, useRef, useEffect } from "react";
|
|
3
3
|
import { Field } from "@strapi/design-system";
|
|
4
4
|
import { useNotification, Page } from "@strapi/strapi/admin";
|
|
5
|
-
import { c as usePluginConfig, g as getTranslation, p as pluginPermissions } from "./index-
|
|
5
|
+
import { c as usePluginConfig, g as getTranslation, p as pluginPermissions } from "./index-B79ELMEC.mjs";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
import "@strapi/icons/symbols";
|
|
8
|
-
import { F as FullLoader } from "./FullLoader-
|
|
9
|
-
import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-
|
|
8
|
+
import { F as FullLoader } from "./FullLoader-Btjb2W2p.mjs";
|
|
9
|
+
import { P as PageWrapper, C as ContentBox, S as SettingTitle } from "./SettingTitle-HMfQOJnK.mjs";
|
|
10
10
|
function reducer(newConfig, action) {
|
|
11
11
|
switch (action.type) {
|
|
12
12
|
case "SET_MAX_DEPTH":
|
|
@@ -31,8 +31,7 @@ const Settings = () => {
|
|
|
31
31
|
const initialConfig = useRef(fetchedConfig);
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
initialConfig.current = fetchedConfig;
|
|
34
|
-
if (fetchedConfig)
|
|
35
|
-
dispatch({ type: "SET_CONFIG", payload: fetchedConfig });
|
|
34
|
+
if (fetchedConfig) dispatch({ type: "SET_CONFIG", payload: fetchedConfig });
|
|
36
35
|
}, [fetchedConfig]);
|
|
37
36
|
useEffect(() => {
|
|
38
37
|
if (fetchError) {
|
|
@@ -95,35 +94,46 @@ const Settings = () => {
|
|
|
95
94
|
defaultMessage: "Configure navigation settings"
|
|
96
95
|
}),
|
|
97
96
|
disabledCondition: JSON.stringify(config) === JSON.stringify(initialConfig.current),
|
|
98
|
-
children: /* @__PURE__ */ jsx(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
97
|
+
children: /* @__PURE__ */ jsx(
|
|
98
|
+
ContentBox,
|
|
99
|
+
{
|
|
100
|
+
title: formatMessage({
|
|
101
|
+
id: getTranslation("settings.page.navigation.navigation"),
|
|
102
|
+
defaultMessage: "Navigation"
|
|
103
|
+
}),
|
|
104
|
+
children: /* @__PURE__ */ jsxs(Field.Root, { name: "maxNavDepth", children: [
|
|
105
|
+
/* @__PURE__ */ jsx(Field.Label, { children: /* @__PURE__ */ jsx(SettingTitle, { children: formatMessage({
|
|
106
|
+
id: getTranslation("settings.page.navigation.maxNavDepth.label"),
|
|
107
|
+
defaultMessage: "Max depth of navigation tree"
|
|
108
|
+
}) }) }),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
Field.Input,
|
|
111
|
+
{
|
|
112
|
+
id: "maxNavDepth",
|
|
113
|
+
type: "number",
|
|
114
|
+
min: 0,
|
|
115
|
+
step: 1,
|
|
116
|
+
value: config?.navigation?.maxDepth !== void 0 ? config.navigation.maxDepth + 1 : "",
|
|
117
|
+
onChange: (e) => dispatch({
|
|
118
|
+
type: "SET_MAX_DEPTH",
|
|
119
|
+
payload: Number(e.target.value) - 1
|
|
120
|
+
}),
|
|
121
|
+
onBlur: (e) => {
|
|
122
|
+
if (e.target.value === "") return;
|
|
123
|
+
dispatch({
|
|
124
|
+
type: "SET_MAX_DEPTH",
|
|
125
|
+
payload: Number(e.target.value) - 1
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
)
|
|
123
134
|
}
|
|
124
135
|
) });
|
|
125
136
|
};
|
|
126
137
|
export {
|
|
127
138
|
Settings as default
|
|
128
139
|
};
|
|
129
|
-
//# sourceMappingURL=index-BbnlyBrZ.mjs.map
|
|
@@ -4,11 +4,11 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-Cx_mktdk.js");
|
|
8
8
|
const reactIntl = require("react-intl");
|
|
9
9
|
require("@strapi/icons/symbols");
|
|
10
|
-
const FullLoader = require("./FullLoader-
|
|
11
|
-
const SettingTitle = require("./SettingTitle-
|
|
10
|
+
const FullLoader = require("./FullLoader-Da2n70bJ.js");
|
|
11
|
+
const SettingTitle = require("./SettingTitle-B0quw3f8.js");
|
|
12
12
|
function reducer(newConfig, action) {
|
|
13
13
|
switch (action.type) {
|
|
14
14
|
case "SET_MAX_DEPTH":
|
|
@@ -33,8 +33,7 @@ const Settings = () => {
|
|
|
33
33
|
const initialConfig = React.useRef(fetchedConfig);
|
|
34
34
|
React.useEffect(() => {
|
|
35
35
|
initialConfig.current = fetchedConfig;
|
|
36
|
-
if (fetchedConfig)
|
|
37
|
-
dispatch({ type: "SET_CONFIG", payload: fetchedConfig });
|
|
36
|
+
if (fetchedConfig) dispatch({ type: "SET_CONFIG", payload: fetchedConfig });
|
|
38
37
|
}, [fetchedConfig]);
|
|
39
38
|
React.useEffect(() => {
|
|
40
39
|
if (fetchError) {
|
|
@@ -97,33 +96,44 @@ const Settings = () => {
|
|
|
97
96
|
defaultMessage: "Configure navigation settings"
|
|
98
97
|
}),
|
|
99
98
|
disabledCondition: JSON.stringify(config) === JSON.stringify(initialConfig.current),
|
|
100
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
99
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
100
|
+
SettingTitle.ContentBox,
|
|
101
|
+
{
|
|
102
|
+
title: formatMessage({
|
|
103
|
+
id: index.getTranslation("settings.page.navigation.navigation"),
|
|
104
|
+
defaultMessage: "Navigation"
|
|
105
|
+
}),
|
|
106
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "maxNavDepth", children: [
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: /* @__PURE__ */ jsxRuntime.jsx(SettingTitle.SettingTitle, { children: formatMessage({
|
|
108
|
+
id: index.getTranslation("settings.page.navigation.maxNavDepth.label"),
|
|
109
|
+
defaultMessage: "Max depth of navigation tree"
|
|
110
|
+
}) }) }),
|
|
111
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
designSystem.Field.Input,
|
|
113
|
+
{
|
|
114
|
+
id: "maxNavDepth",
|
|
115
|
+
type: "number",
|
|
116
|
+
min: 0,
|
|
117
|
+
step: 1,
|
|
118
|
+
value: config?.navigation?.maxDepth !== void 0 ? config.navigation.maxDepth + 1 : "",
|
|
119
|
+
onChange: (e) => dispatch({
|
|
120
|
+
type: "SET_MAX_DEPTH",
|
|
121
|
+
payload: Number(e.target.value) - 1
|
|
122
|
+
}),
|
|
123
|
+
onBlur: (e) => {
|
|
124
|
+
if (e.target.value === "") return;
|
|
125
|
+
dispatch({
|
|
126
|
+
type: "SET_MAX_DEPTH",
|
|
127
|
+
payload: Number(e.target.value) - 1
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
133
|
+
] })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
125
136
|
}
|
|
126
137
|
) });
|
|
127
138
|
};
|
|
128
139
|
exports.default = Settings;
|
|
129
|
-
//# sourceMappingURL=index-D8bG0YFB.js.map
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const designSystem = require("@strapi/design-system");
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
const index = require("./index-Cx_mktdk.js");
|
|
8
|
+
const reactIntl = require("react-intl");
|
|
9
|
+
require("@strapi/icons/symbols");
|
|
10
|
+
const FullLoader = require("./FullLoader-Da2n70bJ.js");
|
|
11
|
+
const SettingTitle = require("./SettingTitle-B0quw3f8.js");
|
|
12
|
+
const icons = require("@strapi/icons");
|
|
13
|
+
function ContentTypeAccordion({
|
|
14
|
+
contentType,
|
|
15
|
+
contentTypeSettings,
|
|
16
|
+
dispatch
|
|
17
|
+
}) {
|
|
18
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
19
|
+
if (!contentType) return null;
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { borderColor: !contentTypeSettings.default ? "danger500" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: contentType.uid, children: [
|
|
21
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Trigger, { children: contentType?.info.displayName }) }),
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
23
|
+
designSystem.Field.Root,
|
|
24
|
+
{
|
|
25
|
+
name: "selectedContentTypes",
|
|
26
|
+
hint: formatMessage({
|
|
27
|
+
id: index.getTranslation("settings.page.generate.hint"),
|
|
28
|
+
defaultMessage: 'The selected field from the content type will be used to generate the path. Use a field that is unique and descriptive, such as a "title" or "name".'
|
|
29
|
+
}),
|
|
30
|
+
error: !contentTypeSettings.default && formatMessage({
|
|
31
|
+
id: index.getTranslation("settings.page.generate.error"),
|
|
32
|
+
defaultMessage: "Please select a default field"
|
|
33
|
+
}),
|
|
34
|
+
required: true,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
37
|
+
id: index.getTranslation("settings.page.generate"),
|
|
38
|
+
defaultMessage: "Generate paths from"
|
|
39
|
+
}) }),
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41
|
+
designSystem.SingleSelect,
|
|
42
|
+
{
|
|
43
|
+
name: `defaultField-${contentType.uid}`,
|
|
44
|
+
onClear: () => dispatch({
|
|
45
|
+
type: "SET_DEFAULT_FIELD",
|
|
46
|
+
payload: { ctUid: contentType.uid, field: "" }
|
|
47
|
+
}),
|
|
48
|
+
value: contentTypeSettings?.default || "",
|
|
49
|
+
onChange: (value) => dispatch({
|
|
50
|
+
type: "SET_DEFAULT_FIELD",
|
|
51
|
+
payload: { ctUid: contentType.uid, field: String(value) }
|
|
52
|
+
}),
|
|
53
|
+
children: Object.entries(contentType.attributes).map(([key], index2) => {
|
|
54
|
+
if (key === "id" || key === "documentId" || key === "createdAt" || key === "updatedAt" || key === "createdBy" || key === "updatedBy" || key === "webatlas" || // The following fields are not longer used in the new implementation, but we keep them hidden just in case
|
|
55
|
+
key === "webatlas_path" || key === "webatlas_override" || key === "webatlas_parent")
|
|
56
|
+
return null;
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: key, children: key }, index2);
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
) }) })
|
|
65
|
+
] }, contentType.uid) }, contentType.uid);
|
|
66
|
+
}
|
|
67
|
+
function reducer(newConfig, action) {
|
|
68
|
+
let updatedContentTypes;
|
|
69
|
+
switch (action.type) {
|
|
70
|
+
case "SET_DEFAULT_FIELD":
|
|
71
|
+
if (!newConfig) return null;
|
|
72
|
+
updatedContentTypes = newConfig?.selectedContentTypes.map(
|
|
73
|
+
(ct) => ct.uid === action.payload.ctUid ? { ...ct, default: action.payload.field } : ct
|
|
74
|
+
);
|
|
75
|
+
return { ...newConfig, selectedContentTypes: updatedContentTypes || [] };
|
|
76
|
+
case "SET_CONFIG":
|
|
77
|
+
return action.payload;
|
|
78
|
+
default:
|
|
79
|
+
throw new Error();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const Settings = () => {
|
|
83
|
+
const { config: fetchedConfig, setConfig, loading, fetchError } = index.usePluginConfig();
|
|
84
|
+
const [config, dispatch] = React.useReducer(reducer, fetchedConfig);
|
|
85
|
+
const { contentTypes: allContentTypesData } = index.useAllContentTypes();
|
|
86
|
+
const allContentTypes = allContentTypesData?.filter(
|
|
87
|
+
(ct) => ct.pluginOptions?.webatlas?.enabled === true
|
|
88
|
+
);
|
|
89
|
+
const { toggleNotification } = admin.useNotification();
|
|
90
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
91
|
+
const [isSaving, setIsSaving] = React.useState(false);
|
|
92
|
+
const initialConfig = React.useRef(fetchedConfig);
|
|
93
|
+
React.useEffect(() => {
|
|
94
|
+
initialConfig.current = fetchedConfig;
|
|
95
|
+
if (fetchedConfig) dispatch({ type: "SET_CONFIG", payload: fetchedConfig });
|
|
96
|
+
}, [fetchedConfig]);
|
|
97
|
+
React.useEffect(() => {
|
|
98
|
+
if (fetchError) {
|
|
99
|
+
toggleNotification({
|
|
100
|
+
type: "danger",
|
|
101
|
+
message: formatMessage({
|
|
102
|
+
id: index.getTranslation("notification.error"),
|
|
103
|
+
defaultMessage: "An error occurred"
|
|
104
|
+
}) + ": " + fetchError
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}, [fetchError, toggleNotification, formatMessage]);
|
|
108
|
+
async function save() {
|
|
109
|
+
if (!config || config.selectedContentTypes.find((cta) => !cta.default) !== void 0)
|
|
110
|
+
return;
|
|
111
|
+
setIsSaving(true);
|
|
112
|
+
try {
|
|
113
|
+
await setConfig({ selectedContentTypes: config.selectedContentTypes });
|
|
114
|
+
initialConfig.current = config;
|
|
115
|
+
toggleNotification({
|
|
116
|
+
type: "success",
|
|
117
|
+
message: formatMessage({
|
|
118
|
+
id: index.getTranslation("notification.settings.saved"),
|
|
119
|
+
defaultMessage: "Settings saved successfully"
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
setIsSaving(false);
|
|
123
|
+
} catch (err) {
|
|
124
|
+
setIsSaving(false);
|
|
125
|
+
toggleNotification({
|
|
126
|
+
type: "danger",
|
|
127
|
+
message: formatMessage({
|
|
128
|
+
id: index.getTranslation("notification.error"),
|
|
129
|
+
defaultMessage: "An error occurred"
|
|
130
|
+
}) + ": " + err
|
|
131
|
+
});
|
|
132
|
+
strapi.log.error(err);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (loading) {
|
|
136
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
137
|
+
SettingTitle.PageWrapper,
|
|
138
|
+
{
|
|
139
|
+
isSaving,
|
|
140
|
+
subtitle: formatMessage({
|
|
141
|
+
id: index.getTranslation("loading"),
|
|
142
|
+
defaultMessage: "Loading..."
|
|
143
|
+
}),
|
|
144
|
+
disabledCondition: true,
|
|
145
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(FullLoader.FullLoader, { height: 200 })
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: index.pluginPermissions["settings.general"], children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
150
|
+
SettingTitle.PageWrapper,
|
|
151
|
+
{
|
|
152
|
+
save,
|
|
153
|
+
isSaving,
|
|
154
|
+
subtitle: formatMessage({
|
|
155
|
+
id: index.getTranslation("settings.page.general.subtitle"),
|
|
156
|
+
defaultMessage: "Configure general settings"
|
|
157
|
+
}),
|
|
158
|
+
disabledCondition: JSON.stringify(config) === JSON.stringify(initialConfig.current),
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
161
|
+
SettingTitle.ContentBox,
|
|
162
|
+
{
|
|
163
|
+
title: formatMessage({
|
|
164
|
+
id: index.getTranslation("settings.page.general.contentTypes"),
|
|
165
|
+
defaultMessage: "Content Types"
|
|
166
|
+
}),
|
|
167
|
+
children: config?.selectedContentTypes && config.selectedContentTypes.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "selectedContentTypesAccordion", children: [
|
|
168
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: /* @__PURE__ */ jsxRuntime.jsx(SettingTitle.SettingTitle, { children: formatMessage({
|
|
169
|
+
id: index.getTranslation("settings.page.contentTypeSettings"),
|
|
170
|
+
defaultMessage: "Content Type settings"
|
|
171
|
+
}) }) }),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: config.selectedContentTypes?.map((contentTypeSettings) => {
|
|
173
|
+
const ct = allContentTypes?.find(
|
|
174
|
+
(item) => item.uid === contentTypeSettings.uid
|
|
175
|
+
);
|
|
176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
177
|
+
ContentTypeAccordion,
|
|
178
|
+
{
|
|
179
|
+
contentType: ct,
|
|
180
|
+
contentTypeSettings,
|
|
181
|
+
dispatch
|
|
182
|
+
},
|
|
183
|
+
contentTypeSettings.uid
|
|
184
|
+
);
|
|
185
|
+
}) })
|
|
186
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { children: [
|
|
187
|
+
formatMessage({
|
|
188
|
+
id: index.getTranslation("settings.page.general.noContentTypesEnabled"),
|
|
189
|
+
defaultMessage: "No content types are enabled for Webatlas. Please enable at least one content type to use this plugin."
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
192
|
+
designSystem.Link,
|
|
193
|
+
{
|
|
194
|
+
href: "https://github.com/mattisvensson/strapi-plugin-webatlas?tab=readme-ov-file#-configuration",
|
|
195
|
+
isExternal: true,
|
|
196
|
+
style: { marginLeft: 4 },
|
|
197
|
+
children: formatMessage({
|
|
198
|
+
id: index.getTranslation("settings.page.general.noContentTypesEnabled.moreInfo"),
|
|
199
|
+
defaultMessage: "More info"
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] })
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
207
|
+
SettingTitle.ContentBox,
|
|
208
|
+
{
|
|
209
|
+
title: formatMessage({
|
|
210
|
+
id: index.getTranslation("settings.page.general.details"),
|
|
211
|
+
defaultMessage: "Details"
|
|
212
|
+
}),
|
|
213
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "selectedContentTypesAccordion", children: [
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: /* @__PURE__ */ jsxRuntime.jsxs(SettingTitle.SettingTitle, { children: [
|
|
215
|
+
index.PLUGIN_NAME,
|
|
216
|
+
" ",
|
|
217
|
+
formatMessage({
|
|
218
|
+
id: index.getTranslation("version"),
|
|
219
|
+
defaultMessage: "Version"
|
|
220
|
+
})
|
|
221
|
+
] }) }),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { children: [
|
|
223
|
+
"v",
|
|
224
|
+
index.PLUGIN_VERSION,
|
|
225
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
226
|
+
designSystem.Link,
|
|
227
|
+
{
|
|
228
|
+
href: `https://github.com/mattisvensson/strapi-plugin-webatlas/releases/tag/v${index.PLUGIN_VERSION}`,
|
|
229
|
+
target: "_blank",
|
|
230
|
+
rel: "noopener noreferrer",
|
|
231
|
+
style: { marginLeft: 4 },
|
|
232
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {})
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
] })
|
|
236
|
+
] })
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
) });
|
|
242
|
+
};
|
|
243
|
+
exports.default = Settings;
|