@localazy/strapi-plugin 1.4.0 → 1.7.0
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 +30 -0
- package/dist/_chunks/{FetchIdentity-BpFOT163.js → FetchIdentity-D89DgpbN.js} +24 -32
- package/dist/_chunks/{FetchIdentity-Cor4ooZv.mjs → FetchIdentity-DkHj24S5.mjs} +36 -44
- package/dist/_chunks/{LanguagesSelector-CC1ecWnc.js → LanguagesSelector-638KGQYw.js} +3 -2
- package/dist/_chunks/{LanguagesSelector-BbrMKwQY.mjs → LanguagesSelector-CR_7I2R1.mjs} +4 -3
- package/dist/_chunks/{LocalazyApp-D0JGRQeF.js → LocalazyApp-Benn8pkA.js} +75 -39
- package/dist/_chunks/{LocalazyApp-DpFR8p10.mjs → LocalazyApp-DM3zg5E4.mjs} +70 -34
- package/dist/_chunks/{LocalazyContentTransferSetup-Dael1Q4w.mjs → LocalazyContentTransferSetup-BA_rtSBM.mjs} +58 -22
- package/dist/_chunks/{LocalazyContentTransferSetup-Cr7D-BUi.js → LocalazyContentTransferSetup-CWchyGdD.js} +62 -26
- package/dist/_chunks/{LocalazyGlobalSettings-D3nG4zl7.js → LocalazyGlobalSettings-88jqQbD4.js} +56 -25
- package/dist/_chunks/{LocalazyGlobalSettings-DzBI5M-K.mjs → LocalazyGlobalSettings-BWF0s9tM.mjs} +56 -25
- package/dist/_chunks/{LocalazyPanel-W6j8N1WC.mjs → LocalazyPanel-4HRa1jNl.mjs} +12 -6
- package/dist/_chunks/{LocalazyPanel-KQPLxTDz.js → LocalazyPanel-D0w9JSIS.js} +14 -8
- package/dist/_chunks/{LocalazyStatusColumn-B7Q_U2Lu.js → LocalazyStatusColumn-BR3f8rKp.js} +10 -4
- package/dist/_chunks/{LocalazyStatusColumn-CrhsCjgp.mjs → LocalazyStatusColumn-D4-rZZUK.mjs} +10 -4
- package/dist/_chunks/{RequireLocalazyAuth-D3GeZPDh.js → RequireLocalazyAuth-C442750b.js} +30 -3
- package/dist/_chunks/{RequireLocalazyAuth-BwoGRfJq.mjs → RequireLocalazyAuth-DbNjEOq-.mjs} +32 -5
- package/dist/_chunks/{entry-exclusion-service-D7gaRHPE.mjs → entry-exclusion-service-Bd3mUDde.mjs} +1 -1
- package/dist/_chunks/{entry-exclusion-service-Bwruvyce.js → entry-exclusion-service-CAIcybXX.js} +1 -1
- package/dist/_chunks/{has-model-changed-Dp2Vkwjw.mjs → has-model-changed-BNs3d9q5.mjs} +4 -3
- package/dist/_chunks/{has-model-changed-5IV9WI_-.js → has-model-changed-BrDeyHFt.js} +4 -3
- package/dist/_chunks/{i18n-o24yXf-j.mjs → i18n-76ox2llT.mjs} +4 -1
- package/dist/_chunks/{i18n-C_5tJvr0.js → i18n-C5ucROBh.js} +4 -1
- package/dist/_chunks/{index-C9hN3KbD.mjs → index-C9Px4v-A.mjs} +34 -12
- package/dist/_chunks/{index-jAg6jjCu.js → index-DwFm1TyM.js} +33 -11
- package/dist/_chunks/{index-BjL9XpRh.mjs → index-shryj0jT.mjs} +16 -16
- package/dist/_chunks/{strapi-api-base-IG3Pe5Sg.js → strapi-api-base-BWZYbxxj.js} +1 -1
- package/dist/_chunks/{strapi-api-base-CAzGcwF6.mjs → strapi-api-base-lPo7wq6I.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/LocalazyStatusColumn.d.ts +1 -1
- package/dist/admin/src/constants/permissions.d.ts +29 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +1 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +1 -1
- package/dist/admin/src/modules/login/locale/en.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/WebhookSetup.d.ts +4 -1
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/index.js +422 -213
- package/dist/server/index.mjs +422 -213
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/constants/permissions.d.ts +38 -0
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +1 -0
- package/dist/server/src/core/index.d.ts +3 -1
- package/dist/server/src/index.d.ts +57 -8
- package/dist/server/src/routes/activity-logs-routes.d.ts +20 -3
- package/dist/server/src/routes/debug-bundle-routes.d.ts +6 -1
- package/dist/server/src/routes/entry-exclusion-routes.d.ts +20 -3
- package/dist/server/src/routes/index.d.ts +52 -6
- package/dist/server/src/routes/localazy-auth-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-project-routes.d.ts +20 -3
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-user-routes.d.ts +20 -3
- package/dist/server/src/routes/plugin-settings-routes.d.ts +20 -3
- package/dist/server/src/routes/strapi-routes.d.ts +20 -3
- package/dist/server/src/services/index.d.ts +3 -1
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +2 -1
- package/dist/server/src/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/src/utils/blocks-to-translatable.d.ts +34 -0
- package/dist/server/src/utils/model-utils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useNavigate, useLocation, NavLink, useParams, Routes, Route } from "react-router-dom";
|
|
3
|
-
import { o as ForwardRef$2H, p as ForwardRef$d, q as ForwardRef$3P, r as ForwardRef$4j,
|
|
3
|
+
import { o as ForwardRef$2H, p as ForwardRef$d, q as ForwardRef$3P, r as ForwardRef$4j, e as Button, s as TooltipImpl, B as Box, T as Typography, g as Link, t as SubNav, u as SubNavHeader, v as SubNavSections, w as SubNavSection, x as SubNavLink, y as ForwardRef$L, G as Grid, j as Divider, c as Flex, f as ForwardRef$3, A as Alert, D as Dialog, z as ForwardRef$4L, E as ForwardRef$4N, P as Pagination, H as PreviousLink, I as PageLink, J as Dots, N as NextLink, K as lodashExports, O as ForwardRef$j, i as ForwardRef$2x, F as Field, Q as DatePicker$1, R as Tabs, U as ForwardRef$57, l as DesignSystemProvider } from "./index-shryj0jT.mjs";
|
|
4
4
|
import React__default, { useState, useEffect, useCallback, useMemo, useRef } from "react";
|
|
5
|
-
import { u as useLocalazyIdentity,
|
|
6
|
-
import {
|
|
5
|
+
import { u as useLocalazyIdentity, a as PluginPageLoader, y as LocalazyUserService, z as emptyIdentity, P as PluginSettingsService, g as getDefaultTheme, H as HeadingFixGlobalStyle, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-DkHj24S5.mjs";
|
|
6
|
+
import { a as PLUGIN_ID, P as PERMISSIONS } from "./index-C9Px4v-A.mjs";
|
|
7
7
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
8
8
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import "./i18n-
|
|
13
|
-
import { h as hasModelChanged } from "./has-model-changed-
|
|
9
|
+
import { useRBAC, Layouts, useAuth, useNotification, Page } from "@strapi/strapi/admin";
|
|
10
|
+
import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-lPo7wq6I.mjs";
|
|
11
|
+
import { P as ProjectService, L as LanguagesSelector } from "./LanguagesSelector-CR_7I2R1.mjs";
|
|
12
|
+
import "./i18n-76ox2llT.mjs";
|
|
13
|
+
import { h as hasModelChanged } from "./has-model-changed-BNs3d9q5.mjs";
|
|
14
14
|
import { useTheme } from "styled-components";
|
|
15
15
|
var PLUGIN_ROUTES = /* @__PURE__ */ ((PLUGIN_ROUTES2) => {
|
|
16
16
|
PLUGIN_ROUTES2["ROOT"] = "";
|
|
@@ -98,10 +98,6 @@ const useHeaderSubtitle = () => {
|
|
|
98
98
|
const currentNavItem = navigation.find((navItem) => pluginSegment.includes(navItem.id));
|
|
99
99
|
return currentNavItem?.description || "";
|
|
100
100
|
};
|
|
101
|
-
function PluginPageLoader() {
|
|
102
|
-
const { t: t2 } = useTranslation();
|
|
103
|
-
return /* @__PURE__ */ jsx(Flex, { marginTop: 10, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(Loader, { children: t2("common.loading_content") }) });
|
|
104
|
-
}
|
|
105
101
|
var propTypes = { exports: {} };
|
|
106
102
|
var reactIs = { exports: {} };
|
|
107
103
|
var reactIs_production_min = {};
|
|
@@ -1258,6 +1254,8 @@ if (process.env.STRAPI_ADMIN_LOCALAZY_ENV === "development") {
|
|
|
1258
1254
|
}
|
|
1259
1255
|
const LoginButton = (props) => {
|
|
1260
1256
|
const { t: t2 } = useTranslation();
|
|
1257
|
+
const { allowedActions } = useRBAC(PERMISSIONS.SETTINGS_UPDATE);
|
|
1258
|
+
const canConnect = !!allowedActions.canUpdate;
|
|
1261
1259
|
const [isLoading, setIsLoading] = useState(false);
|
|
1262
1260
|
const login = async () => {
|
|
1263
1261
|
setIsLoading(true);
|
|
@@ -1278,7 +1276,8 @@ const LoginButton = (props) => {
|
|
|
1278
1276
|
setIsLoading(false);
|
|
1279
1277
|
props.onResultFetched(pollResult);
|
|
1280
1278
|
};
|
|
1281
|
-
|
|
1279
|
+
const button = /* @__PURE__ */ jsx(Button, { variant: "default", size: "L", loading: isLoading, onClick: login, disabled: !canConnect, children: t2("login.login_with_localazy") });
|
|
1280
|
+
return /* @__PURE__ */ jsx("div", { children: canConnect ? button : /* @__PURE__ */ jsx(TooltipImpl, { label: t2("login.requires_settings_update_permission"), children: /* @__PURE__ */ jsx("span", { children: button }) }) });
|
|
1282
1281
|
};
|
|
1283
1282
|
LoginButton.propTypes = {
|
|
1284
1283
|
onResultFetched: PropTypes.func.isRequired
|
|
@@ -1436,6 +1435,8 @@ const LogoutButton = (props) => {
|
|
|
1436
1435
|
const { t: t2 } = useTranslation();
|
|
1437
1436
|
const [isLoading, setIsLoading] = useState(false);
|
|
1438
1437
|
const { setIdentity } = useLocalazyIdentity();
|
|
1438
|
+
const { allowedActions } = useRBAC(PERMISSIONS.SETTINGS_UPDATE);
|
|
1439
|
+
const canDisconnect = !!allowedActions.canUpdate;
|
|
1439
1440
|
const logout = async () => {
|
|
1440
1441
|
setIsLoading(true);
|
|
1441
1442
|
void LocalazyUserService.deleteIdentity();
|
|
@@ -1443,7 +1444,8 @@ const LogoutButton = (props) => {
|
|
|
1443
1444
|
setIsLoading(false);
|
|
1444
1445
|
props.onResultFetched();
|
|
1445
1446
|
};
|
|
1446
|
-
|
|
1447
|
+
const button = /* @__PURE__ */ jsx(Button, { startIcon: /* @__PURE__ */ jsx(ForwardRef$L, {}), variant: "secondary", loading: isLoading, onClick: logout, disabled: !canDisconnect, children: t2("login.logout_from_localazy") });
|
|
1448
|
+
return /* @__PURE__ */ jsx("div", { children: canDisconnect ? button : /* @__PURE__ */ jsx(TooltipImpl, { label: t2("login.requires_settings_update_permission"), children: /* @__PURE__ */ jsx("span", { children: button }) }) });
|
|
1447
1449
|
};
|
|
1448
1450
|
const OverviewItem = (props) => {
|
|
1449
1451
|
return /* @__PURE__ */ jsxs(Grid.Root, { padding: 1, col: 6, s: 12, children: [
|
|
@@ -1474,7 +1476,7 @@ const Overview = ({ title, subtitle, isLoadingProp = false }) => {
|
|
|
1474
1476
|
setIsLoading(true);
|
|
1475
1477
|
const project = await ProjectService.getConnectedProject();
|
|
1476
1478
|
setConnectedProject(project);
|
|
1477
|
-
void PluginSettingsService.
|
|
1479
|
+
void PluginSettingsService.updatePluginSettingsUiPrefs({ defaultRoute: PLUGIN_ROUTES.OVERVIEW });
|
|
1478
1480
|
setIsLoading(false);
|
|
1479
1481
|
}
|
|
1480
1482
|
void initComponent();
|
|
@@ -5061,7 +5063,7 @@ const Upload = (props) => {
|
|
|
5061
5063
|
setLocalazySourceLanguage(sourceLanguage);
|
|
5062
5064
|
setModelChanged(modelChangedResult);
|
|
5063
5065
|
setLocalesIncompatible(!localesCompatibleResult);
|
|
5064
|
-
void PluginSettingsService.
|
|
5066
|
+
void PluginSettingsService.updatePluginSettingsUiPrefs({ defaultRoute: PLUGIN_ROUTES.UPLOAD });
|
|
5065
5067
|
setIsLoading(false);
|
|
5066
5068
|
}
|
|
5067
5069
|
void initComponent();
|
|
@@ -5194,16 +5196,9 @@ const Download = (props) => {
|
|
|
5194
5196
|
window.open(identity.project.url, "_blank");
|
|
5195
5197
|
};
|
|
5196
5198
|
const [projectLanguages, setProjectLanguages] = useState([]);
|
|
5197
|
-
const [
|
|
5199
|
+
const [uiLanguages, setUiLanguages] = useState([]);
|
|
5198
5200
|
const onDownloadLanguagesChange = (languages) => {
|
|
5199
|
-
|
|
5200
|
-
set(newFormModel, "download.uiLanguages", languages);
|
|
5201
|
-
setFormModel(newFormModel);
|
|
5202
|
-
try {
|
|
5203
|
-
void PluginSettingsService.updatePluginSettings(newFormModel);
|
|
5204
|
-
} catch (e2) {
|
|
5205
|
-
console.error(e2.message);
|
|
5206
|
-
}
|
|
5201
|
+
setUiLanguages(languages);
|
|
5207
5202
|
};
|
|
5208
5203
|
const onDownloadClick = async (fullSync = false) => {
|
|
5209
5204
|
setIsDownloading(true);
|
|
@@ -5212,7 +5207,7 @@ const Download = (props) => {
|
|
|
5212
5207
|
success: false,
|
|
5213
5208
|
report: []
|
|
5214
5209
|
});
|
|
5215
|
-
const result = await LocalazyDownloadService.download({ fullSync });
|
|
5210
|
+
const result = await LocalazyDownloadService.download({ fullSync, uiLanguages });
|
|
5216
5211
|
const { streamIdentifier } = result;
|
|
5217
5212
|
downloadAlertsService.setStreamIdentifier(streamIdentifier);
|
|
5218
5213
|
downloadAlertsService.onDownload((data) => {
|
|
@@ -5253,8 +5248,8 @@ const Download = (props) => {
|
|
|
5253
5248
|
setHasSyncCursor(syncCursor?.processedKeys !== void 0 && Object.keys(syncCursor.processedKeys).length > 0);
|
|
5254
5249
|
const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
|
|
5255
5250
|
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
5256
|
-
|
|
5257
|
-
void PluginSettingsService.
|
|
5251
|
+
setUiLanguages(Array.isArray(globalSettings?.download?.uiLanguages) ? globalSettings.download.uiLanguages : []);
|
|
5252
|
+
void PluginSettingsService.updatePluginSettingsUiPrefs({ defaultRoute: PLUGIN_ROUTES.DOWNLOAD });
|
|
5258
5253
|
setIsLoading(false);
|
|
5259
5254
|
}
|
|
5260
5255
|
void initComponent();
|
|
@@ -5312,7 +5307,7 @@ const Download = (props) => {
|
|
|
5312
5307
|
/* @__PURE__ */ jsx(Box, { paddingTop: 6, children: /* @__PURE__ */ jsx(
|
|
5313
5308
|
LanguagesSelector,
|
|
5314
5309
|
{
|
|
5315
|
-
preselectedLanguages:
|
|
5310
|
+
preselectedLanguages: uiLanguages,
|
|
5316
5311
|
projectLanguages,
|
|
5317
5312
|
onChange: (languages) => onDownloadLanguagesChange(languages),
|
|
5318
5313
|
label: t2("download.ui_languages"),
|
|
@@ -5689,6 +5684,9 @@ const useDebouncedSearch = () => {
|
|
|
5689
5684
|
const ActivityLogs = (props) => {
|
|
5690
5685
|
const { t: t2 } = useTranslation();
|
|
5691
5686
|
const navigate = useNavigate();
|
|
5687
|
+
const {
|
|
5688
|
+
allowedActions: { canTransfer }
|
|
5689
|
+
} = useRBAC(PERMISSIONS.TRANSFER);
|
|
5692
5690
|
const [isLoading, setIsLoading] = useState(true);
|
|
5693
5691
|
const [sessions, setSessions] = useState([]);
|
|
5694
5692
|
const [activeTab, setActiveTab] = useState("upload");
|
|
@@ -5702,7 +5700,7 @@ const ActivityLogs = (props) => {
|
|
|
5702
5700
|
const debouncedSaveSortPrefs = useCallback((prefs) => {
|
|
5703
5701
|
if (saveSortTimerRef.current) clearTimeout(saveSortTimerRef.current);
|
|
5704
5702
|
saveSortTimerRef.current = setTimeout(() => {
|
|
5705
|
-
void PluginSettingsService.
|
|
5703
|
+
void PluginSettingsService.updatePluginSettingsUiPrefs({ activityLogsSort: prefs });
|
|
5706
5704
|
}, 1e3);
|
|
5707
5705
|
}, []);
|
|
5708
5706
|
const onSortChange = (eventType, key, direction) => {
|
|
@@ -5758,7 +5756,7 @@ const ActivityLogs = (props) => {
|
|
|
5758
5756
|
void fetchSessions("upload");
|
|
5759
5757
|
};
|
|
5760
5758
|
void init();
|
|
5761
|
-
void PluginSettingsService.
|
|
5759
|
+
void PluginSettingsService.updatePluginSettingsUiPrefs({ defaultRoute: PLUGIN_ROUTES.ACTIVITY_LOGS });
|
|
5762
5760
|
}, []);
|
|
5763
5761
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5764
5762
|
/* @__PURE__ */ jsx(
|
|
@@ -5768,7 +5766,16 @@ const ActivityLogs = (props) => {
|
|
|
5768
5766
|
subtitle: props.subtitle,
|
|
5769
5767
|
primaryAction: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
5770
5768
|
/* @__PURE__ */ jsx(Button, { variant: "secondary", startIcon: /* @__PURE__ */ jsx(ForwardRef$3P, {}), onClick: onExportLogs, children: t2("activity_logs.export_logs") }),
|
|
5771
|
-
/* @__PURE__ */ jsx(
|
|
5769
|
+
/* @__PURE__ */ jsx(
|
|
5770
|
+
Button,
|
|
5771
|
+
{
|
|
5772
|
+
variant: "danger-light",
|
|
5773
|
+
startIcon: /* @__PURE__ */ jsx(ForwardRef$j, {}),
|
|
5774
|
+
disabled: !canTransfer,
|
|
5775
|
+
onClick: () => setShowClearConfirm(true),
|
|
5776
|
+
children: t2("activity_logs.clear_logs")
|
|
5777
|
+
}
|
|
5778
|
+
)
|
|
5772
5779
|
] })
|
|
5773
5780
|
}
|
|
5774
5781
|
),
|
|
@@ -6136,6 +6143,10 @@ const App = () => {
|
|
|
6136
6143
|
const { isLoggedIn, isFetchingIdentity } = useLocalazyIdentity();
|
|
6137
6144
|
const headerTitle = useHeaderTitle();
|
|
6138
6145
|
const headerSubtitle = useHeaderSubtitle();
|
|
6146
|
+
const {
|
|
6147
|
+
allowedActions: { canRead, canTransfer },
|
|
6148
|
+
isLoading: isLoadingPermissions
|
|
6149
|
+
} = useRBAC([...PERMISSIONS.READ, ...PERMISSIONS.TRANSFER]);
|
|
6139
6150
|
const normalizedPath = location2.pathname.replace(/\/+$/, "");
|
|
6140
6151
|
const pluginRoot = `/plugins/${PLUGIN_ID}`;
|
|
6141
6152
|
const isAtPluginRoot = normalizedPath === pluginRoot;
|
|
@@ -6157,6 +6168,19 @@ const App = () => {
|
|
|
6157
6168
|
};
|
|
6158
6169
|
void fetchData();
|
|
6159
6170
|
}, [isLoggedIn, isFetchingIdentity, normalizedPath]);
|
|
6171
|
+
if (isLoadingPermissions) {
|
|
6172
|
+
return /* @__PURE__ */ jsxs(DesignSystemProvider, { theme: getDefaultTheme(), children: [
|
|
6173
|
+
/* @__PURE__ */ jsx(HeadingFixGlobalStyle, {}),
|
|
6174
|
+
/* @__PURE__ */ jsx(Box, { background: "neutral100", children: /* @__PURE__ */ jsx(Layouts.Root, { children: /* @__PURE__ */ jsx(PluginPageLoader, {}) }) })
|
|
6175
|
+
] });
|
|
6176
|
+
}
|
|
6177
|
+
if (!canRead) {
|
|
6178
|
+
return /* @__PURE__ */ jsxs(DesignSystemProvider, { theme: getDefaultTheme(), children: [
|
|
6179
|
+
/* @__PURE__ */ jsx(HeadingFixGlobalStyle, {}),
|
|
6180
|
+
/* @__PURE__ */ jsx(Box, { background: "neutral100", children: /* @__PURE__ */ jsx(Layouts.Root, { children: /* @__PURE__ */ jsx(Page.NoPermissions, {}) }) })
|
|
6181
|
+
] });
|
|
6182
|
+
}
|
|
6183
|
+
const transferElement = (page) => canTransfer ? page : /* @__PURE__ */ jsx(Page.NoPermissions, {});
|
|
6160
6184
|
return /* @__PURE__ */ jsxs(DesignSystemProvider, { theme: getDefaultTheme(), children: [
|
|
6161
6185
|
/* @__PURE__ */ jsx(HeadingFixGlobalStyle, {}),
|
|
6162
6186
|
/* @__PURE__ */ jsx(PluginErrorBoundary, { children: /* @__PURE__ */ jsx(Box, { background: "neutral100", children: /* @__PURE__ */ jsxs(Layouts.Root, { sideNav: isLoggedIn && /* @__PURE__ */ jsx(SideNav, {}), children: [
|
|
@@ -6176,8 +6200,20 @@ const App = () => {
|
|
|
6176
6200
|
element: /* @__PURE__ */ jsx(Overview, { title: headerTitle, subtitle: headerSubtitle, isLoadingProp: false })
|
|
6177
6201
|
}
|
|
6178
6202
|
),
|
|
6179
|
-
/* @__PURE__ */ jsx(
|
|
6180
|
-
|
|
6203
|
+
/* @__PURE__ */ jsx(
|
|
6204
|
+
Route,
|
|
6205
|
+
{
|
|
6206
|
+
path: `upload`,
|
|
6207
|
+
element: transferElement(/* @__PURE__ */ jsx(Upload, { title: headerTitle, subtitle: headerSubtitle }))
|
|
6208
|
+
}
|
|
6209
|
+
),
|
|
6210
|
+
/* @__PURE__ */ jsx(
|
|
6211
|
+
Route,
|
|
6212
|
+
{
|
|
6213
|
+
path: `download`,
|
|
6214
|
+
element: transferElement(/* @__PURE__ */ jsx(Download, { title: headerTitle, subtitle: headerSubtitle }))
|
|
6215
|
+
}
|
|
6216
|
+
),
|
|
6181
6217
|
/* @__PURE__ */ jsx(Route, { path: `activity-logs`, element: /* @__PURE__ */ jsx(ActivityLogs, { title: headerTitle, subtitle: headerSubtitle }) }),
|
|
6182
6218
|
/* @__PURE__ */ jsx(
|
|
6183
6219
|
Route,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { C as CheckboxImpl, B as Box, m as Accordion, c as Flex, n as SwitchImpl, T as Typography, e as Button, d as ForwardRef$4z, A as Alert, j as Divider, l as DesignSystemProvider } from "./index-
|
|
2
|
+
import { C as CheckboxImpl, B as Box, m as Accordion, c as Flex, n as SwitchImpl, T as Typography, e as Button, d as ForwardRef$4z, A as Alert, j as Divider, l as DesignSystemProvider } from "./index-shryj0jT.mjs";
|
|
3
|
+
import { useRBAC, Layouts, Page } from "@strapi/strapi/admin";
|
|
3
4
|
import { forwardRef, useState, useEffect } from "react";
|
|
4
|
-
import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-Dp2Vkwjw.mjs";
|
|
5
|
+
import { s as set, i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-DbNjEOq-.mjs";
|
|
6
|
+
import { r as keys, v as isArrayLike, w as arrayEach, l as isArray, n as isObject, P as PluginSettingsService, c as cloneDeep, g as getDefaultTheme, H as HeadingFixGlobalStyle, a as PluginPageLoader, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-DkHj24S5.mjs";
|
|
7
|
+
import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-BNs3d9q5.mjs";
|
|
8
8
|
import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
|
|
9
9
|
import styled from "styled-components";
|
|
10
10
|
import { Trans } from "./index-BIbKC7-V.mjs";
|
|
11
|
-
import "./
|
|
11
|
+
import { P as PERMISSIONS } from "./index-C9Px4v-A.mjs";
|
|
12
|
+
import "./i18n-76ox2llT.mjs";
|
|
12
13
|
const getFilteredModelsSchemas = (models) => {
|
|
13
14
|
if (!models) {
|
|
14
15
|
return [];
|
|
@@ -763,12 +764,19 @@ const SvgX = (props, ref) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.
|
|
|
763
764
|
)
|
|
764
765
|
] }) });
|
|
765
766
|
forwardRef(SvgX);
|
|
766
|
-
const TreeItem = ({
|
|
767
|
+
const TreeItem = ({
|
|
768
|
+
label,
|
|
769
|
+
value,
|
|
770
|
+
children,
|
|
771
|
+
passedKey = "",
|
|
772
|
+
onTreeItemClick,
|
|
773
|
+
disabled = false
|
|
774
|
+
}) => {
|
|
767
775
|
const onChange = (key, currentValue) => {
|
|
768
776
|
onTreeItemClick(key, currentValue);
|
|
769
777
|
};
|
|
770
778
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
771
|
-
typeof value === "boolean" && /* @__PURE__ */ jsx(CheckboxImpl, { checked: value, onCheckedChange: () => onChange([passedKey], value), children: label || "-" }),
|
|
779
|
+
typeof value === "boolean" && /* @__PURE__ */ jsx(CheckboxImpl, { checked: value, disabled, onCheckedChange: () => onChange([passedKey], value), children: label || "-" }),
|
|
772
780
|
value === null && /* @__PURE__ */ jsx(CheckboxImpl, { checked: false, disabled: true, children: label || "-" }),
|
|
773
781
|
children && /* @__PURE__ */ jsx("div", { children }, passedKey)
|
|
774
782
|
] });
|
|
@@ -831,7 +839,7 @@ function flattenObject(obj, delimiter = ".") {
|
|
|
831
839
|
});
|
|
832
840
|
return nobj;
|
|
833
841
|
}
|
|
834
|
-
const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
842
|
+
const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false, disabled = false }) => {
|
|
835
843
|
const { t } = useTranslation();
|
|
836
844
|
const [, setIsExpanded] = useState(initiallyExpanded);
|
|
837
845
|
useEffect(() => {
|
|
@@ -884,7 +892,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
884
892
|
isSubbranchObject && /* @__PURE__ */ jsx(
|
|
885
893
|
CheckboxImpl,
|
|
886
894
|
{
|
|
887
|
-
disabled: hasAllNullValue,
|
|
895
|
+
disabled: disabled || hasAllNullValue,
|
|
888
896
|
checked: getCheckedState(hasTruthyValue, hasFalsyValue),
|
|
889
897
|
onCheckedChange: () => onTreeItemClick(flattenedKeys, hasTruthyValue),
|
|
890
898
|
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", children: [
|
|
@@ -893,11 +901,21 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
893
901
|
] })
|
|
894
902
|
}
|
|
895
903
|
),
|
|
896
|
-
/* @__PURE__ */ jsx(TreeItem, { onTreeItemClick, passedKey, children: createTree(key, value, passedKey) })
|
|
904
|
+
/* @__PURE__ */ jsx(TreeItem, { onTreeItemClick, passedKey, disabled, children: createTree(key, value, passedKey) })
|
|
897
905
|
] }, passedKey);
|
|
898
906
|
}) });
|
|
899
907
|
}
|
|
900
|
-
return /* @__PURE__ */ jsx(
|
|
908
|
+
return /* @__PURE__ */ jsx(
|
|
909
|
+
TreeItem,
|
|
910
|
+
{
|
|
911
|
+
onTreeItemClick,
|
|
912
|
+
passedKey: path,
|
|
913
|
+
label: name,
|
|
914
|
+
value: branch,
|
|
915
|
+
disabled
|
|
916
|
+
},
|
|
917
|
+
path
|
|
918
|
+
);
|
|
901
919
|
};
|
|
902
920
|
return /* @__PURE__ */ jsx(Box, { children: Object.entries(objects).map(([key, value]) => {
|
|
903
921
|
return value.__model__ !== void 0 && /* @__PURE__ */ jsx(Box, { borderColor: "neutral200", hasRadius: true, children: /* @__PURE__ */ jsx(Accordion.Root, { size: "S", children: /* @__PURE__ */ jsxs(Accordion.Item, { value: key, children: [
|
|
@@ -913,6 +931,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
913
931
|
label: `switch_tree_${key}`,
|
|
914
932
|
onCheckedChange: () => onTreeItemClick([`${key}.__model__`], value.__model__),
|
|
915
933
|
checked: !!value.__model__,
|
|
934
|
+
disabled,
|
|
916
935
|
style: { marginRight: "1rem" }
|
|
917
936
|
}
|
|
918
937
|
)
|
|
@@ -990,6 +1009,9 @@ function ContentTransferSetupEmpty() {
|
|
|
990
1009
|
}
|
|
991
1010
|
const ContentTransferSetup = () => {
|
|
992
1011
|
const { t } = useTranslation();
|
|
1012
|
+
const {
|
|
1013
|
+
allowedActions: { canUpdate: canUpdateSettings }
|
|
1014
|
+
} = useRBAC(PERMISSIONS.SETTINGS_UPDATE);
|
|
993
1015
|
const [isLoading, setIsLoading] = useState(true);
|
|
994
1016
|
const [showAlert, setShowAlert] = useState(false);
|
|
995
1017
|
const [showModalChangedAlert, setShowModalChangedAlert] = useState(false);
|
|
@@ -1087,12 +1109,12 @@ const ContentTransferSetup = () => {
|
|
|
1087
1109
|
title: t("plugin_settings.content_transfer_setup"),
|
|
1088
1110
|
subtitle: t("plugin_settings.content_transfer_setup_description"),
|
|
1089
1111
|
primaryAction: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
1090
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
1112
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !canUpdateSettings || !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
1091
1113
|
/* @__PURE__ */ jsx(
|
|
1092
1114
|
Button,
|
|
1093
1115
|
{
|
|
1094
1116
|
startIcon: /* @__PURE__ */ jsx(ForwardRef$4z, {}),
|
|
1095
|
-
disabled: !hasUnsavedChanges,
|
|
1117
|
+
disabled: !canUpdateSettings || !hasUnsavedChanges,
|
|
1096
1118
|
onClick: () => {
|
|
1097
1119
|
void saveContentTransferSetup(formModel);
|
|
1098
1120
|
},
|
|
@@ -1128,7 +1150,15 @@ const ContentTransferSetup = () => {
|
|
|
1128
1150
|
!formModel.length && // empty state
|
|
1129
1151
|
/* @__PURE__ */ jsx(ContentTransferSetupEmpty, {}),
|
|
1130
1152
|
formModel.map((tree, index) => {
|
|
1131
|
-
return /* @__PURE__ */ jsx(Box, { marginBottom: 3, children: /* @__PURE__ */ jsx(
|
|
1153
|
+
return /* @__PURE__ */ jsx(Box, { marginBottom: 3, children: /* @__PURE__ */ jsx(
|
|
1154
|
+
Tree,
|
|
1155
|
+
{
|
|
1156
|
+
onTreeItemClick,
|
|
1157
|
+
objects: tree,
|
|
1158
|
+
initiallyExpanded: index === 0,
|
|
1159
|
+
disabled: !canUpdateSettings
|
|
1160
|
+
}
|
|
1161
|
+
) }, `box_tree_${index}`);
|
|
1132
1162
|
}),
|
|
1133
1163
|
!!formModel.length && /* @__PURE__ */ jsxs(Box, { children: [
|
|
1134
1164
|
/* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Divider, {}) }),
|
|
@@ -1153,13 +1183,19 @@ const ContentTransferSetup = () => {
|
|
|
1153
1183
|
] })
|
|
1154
1184
|
] });
|
|
1155
1185
|
};
|
|
1156
|
-
const LocalazyContentTransferSetup = () =>
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1186
|
+
const LocalazyContentTransferSetup = () => {
|
|
1187
|
+
const {
|
|
1188
|
+
allowedActions: { canRead: canReadSettings },
|
|
1189
|
+
isLoading: isLoadingPermissions
|
|
1190
|
+
} = useRBAC(PERMISSIONS.SETTINGS_READ);
|
|
1191
|
+
return /* @__PURE__ */ jsxs(DesignSystemProvider, { theme: getDefaultTheme(), children: [
|
|
1192
|
+
/* @__PURE__ */ jsx(HeadingFixGlobalStyle, {}),
|
|
1193
|
+
isLoadingPermissions ? /* @__PURE__ */ jsx(PluginPageLoader, {}) : !canReadSettings ? /* @__PURE__ */ jsx(Page.NoPermissions, {}) : /* @__PURE__ */ jsxs(LocalazyIdentityProvider, { children: [
|
|
1194
|
+
/* @__PURE__ */ jsx(FetchIdentity, {}),
|
|
1195
|
+
/* @__PURE__ */ jsx(RequireLocalazyAuth, { children: /* @__PURE__ */ jsx(ContentTransferSetup, {}) })
|
|
1196
|
+
] })
|
|
1197
|
+
] });
|
|
1198
|
+
};
|
|
1163
1199
|
export {
|
|
1164
1200
|
LocalazyContentTransferSetup as default
|
|
1165
1201
|
};
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const index = require("./index-CTkxoioB.js");
|
|
5
|
-
const React = require("react");
|
|
6
|
-
const RequireLocalazyAuth = require("./RequireLocalazyAuth-D3GeZPDh.js");
|
|
7
|
-
const FetchIdentity = require("./FetchIdentity-BpFOT163.js");
|
|
8
5
|
const admin = require("@strapi/strapi/admin");
|
|
9
|
-
const
|
|
6
|
+
const React = require("react");
|
|
7
|
+
const RequireLocalazyAuth = require("./RequireLocalazyAuth-C442750b.js");
|
|
8
|
+
const FetchIdentity = require("./FetchIdentity-D89DgpbN.js");
|
|
9
|
+
const hasModelChanged = require("./has-model-changed-BrDeyHFt.js");
|
|
10
10
|
const useTranslation = require("./useTranslation-BdIl-aLe.js");
|
|
11
11
|
const styled = require("styled-components");
|
|
12
12
|
const index$1 = require("./index-1he9s_bs.js");
|
|
13
|
-
require("./
|
|
13
|
+
const index$2 = require("./index-DwFm1TyM.js");
|
|
14
|
+
require("./i18n-C5ucROBh.js");
|
|
14
15
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
16
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
16
17
|
const getFilteredModelsSchemas = (models) => {
|
|
@@ -42,16 +43,16 @@ const buildContentTransferSetupSchema = (localizableTree = [], storedSetupSchema
|
|
|
42
43
|
const localizableTreeValueToSet = hasModelChanged.get(oStoredSetupSchema, key);
|
|
43
44
|
const allModelsTreeValueToSet = hasModelChanged.findModelValueByKey(allModelsTree, key);
|
|
44
45
|
if (allModelsTreeValueToSet === null) {
|
|
45
|
-
|
|
46
|
+
RequireLocalazyAuth.set(destinationObject, key, null);
|
|
46
47
|
} else if (localizableTreeValueToSet !== null) {
|
|
47
|
-
|
|
48
|
+
RequireLocalazyAuth.set(destinationObject, key, localizableTreeValueToSet);
|
|
48
49
|
} else {
|
|
49
50
|
const newValueToSet = hasModelChanged.findModelValueByKey(allModelsTree, key);
|
|
50
|
-
|
|
51
|
+
RequireLocalazyAuth.set(destinationObject, key, newValueToSet);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
newKeys.forEach((key) => {
|
|
54
|
-
|
|
55
|
+
RequireLocalazyAuth.set(destinationObject, key, hasModelChanged.get(oLocalizableTree, key));
|
|
55
56
|
});
|
|
56
57
|
const destinationArray = [];
|
|
57
58
|
const sortedDestinationObjectKeys = Object.keys(destinationObject).sort((a, b) => {
|
|
@@ -767,12 +768,19 @@ const SvgX = (props, ref) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "htt
|
|
|
767
768
|
)
|
|
768
769
|
] }) });
|
|
769
770
|
React.forwardRef(SvgX);
|
|
770
|
-
const TreeItem = ({
|
|
771
|
+
const TreeItem = ({
|
|
772
|
+
label,
|
|
773
|
+
value,
|
|
774
|
+
children,
|
|
775
|
+
passedKey = "",
|
|
776
|
+
onTreeItemClick,
|
|
777
|
+
disabled = false
|
|
778
|
+
}) => {
|
|
771
779
|
const onChange = (key, currentValue) => {
|
|
772
780
|
onTreeItemClick(key, currentValue);
|
|
773
781
|
};
|
|
774
782
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
775
|
-
typeof value === "boolean" && /* @__PURE__ */ jsxRuntime.jsx(index.CheckboxImpl, { checked: value, onCheckedChange: () => onChange([passedKey], value), children: label || "-" }),
|
|
783
|
+
typeof value === "boolean" && /* @__PURE__ */ jsxRuntime.jsx(index.CheckboxImpl, { checked: value, disabled, onCheckedChange: () => onChange([passedKey], value), children: label || "-" }),
|
|
776
784
|
value === null && /* @__PURE__ */ jsxRuntime.jsx(index.CheckboxImpl, { checked: false, disabled: true, children: label || "-" }),
|
|
777
785
|
children && /* @__PURE__ */ jsxRuntime.jsx("div", { children }, passedKey)
|
|
778
786
|
] });
|
|
@@ -835,7 +843,7 @@ function flattenObject(obj, delimiter = ".") {
|
|
|
835
843
|
});
|
|
836
844
|
return nobj;
|
|
837
845
|
}
|
|
838
|
-
const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
846
|
+
const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false, disabled = false }) => {
|
|
839
847
|
const { t } = useTranslation.useTranslation();
|
|
840
848
|
const [, setIsExpanded] = React.useState(initiallyExpanded);
|
|
841
849
|
React.useEffect(() => {
|
|
@@ -888,7 +896,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
888
896
|
isSubbranchObject && /* @__PURE__ */ jsxRuntime.jsx(
|
|
889
897
|
index.CheckboxImpl,
|
|
890
898
|
{
|
|
891
|
-
disabled: hasAllNullValue,
|
|
899
|
+
disabled: disabled || hasAllNullValue,
|
|
892
900
|
checked: getCheckedState(hasTruthyValue, hasFalsyValue),
|
|
893
901
|
onCheckedChange: () => onTreeItemClick(flattenedKeys, hasTruthyValue),
|
|
894
902
|
children: /* @__PURE__ */ jsxRuntime.jsxs(index.Flex, { alignItems: "center", children: [
|
|
@@ -897,11 +905,21 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
897
905
|
] })
|
|
898
906
|
}
|
|
899
907
|
),
|
|
900
|
-
/* @__PURE__ */ jsxRuntime.jsx(TreeItem, { onTreeItemClick, passedKey, children: createTree(key, value, passedKey) })
|
|
908
|
+
/* @__PURE__ */ jsxRuntime.jsx(TreeItem, { onTreeItemClick, passedKey, disabled, children: createTree(key, value, passedKey) })
|
|
901
909
|
] }, passedKey);
|
|
902
910
|
}) });
|
|
903
911
|
}
|
|
904
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
912
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
913
|
+
TreeItem,
|
|
914
|
+
{
|
|
915
|
+
onTreeItemClick,
|
|
916
|
+
passedKey: path,
|
|
917
|
+
label: name,
|
|
918
|
+
value: branch,
|
|
919
|
+
disabled
|
|
920
|
+
},
|
|
921
|
+
path
|
|
922
|
+
);
|
|
905
923
|
};
|
|
906
924
|
return /* @__PURE__ */ jsxRuntime.jsx(index.Box, { children: Object.entries(objects).map(([key, value]) => {
|
|
907
925
|
return value.__model__ !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(index.Box, { borderColor: "neutral200", hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsx(index.Accordion.Root, { size: "S", children: /* @__PURE__ */ jsxRuntime.jsxs(index.Accordion.Item, { value: key, children: [
|
|
@@ -917,6 +935,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
|
|
|
917
935
|
label: `switch_tree_${key}`,
|
|
918
936
|
onCheckedChange: () => onTreeItemClick([`${key}.__model__`], value.__model__),
|
|
919
937
|
checked: !!value.__model__,
|
|
938
|
+
disabled,
|
|
920
939
|
style: { marginRight: "1rem" }
|
|
921
940
|
}
|
|
922
941
|
)
|
|
@@ -994,6 +1013,9 @@ function ContentTransferSetupEmpty() {
|
|
|
994
1013
|
}
|
|
995
1014
|
const ContentTransferSetup = () => {
|
|
996
1015
|
const { t } = useTranslation.useTranslation();
|
|
1016
|
+
const {
|
|
1017
|
+
allowedActions: { canUpdate: canUpdateSettings }
|
|
1018
|
+
} = admin.useRBAC(index$2.PERMISSIONS.SETTINGS_UPDATE);
|
|
997
1019
|
const [isLoading, setIsLoading] = React.useState(true);
|
|
998
1020
|
const [showAlert, setShowAlert] = React.useState(false);
|
|
999
1021
|
const [showModalChangedAlert, setShowModalChangedAlert] = React.useState(false);
|
|
@@ -1045,7 +1067,7 @@ const ContentTransferSetup = () => {
|
|
|
1045
1067
|
}
|
|
1046
1068
|
const isEditable = hasModelChanged.get(model, key) !== null;
|
|
1047
1069
|
if (isEditable) {
|
|
1048
|
-
|
|
1070
|
+
RequireLocalazyAuth.set(model, key, !currentValue);
|
|
1049
1071
|
}
|
|
1050
1072
|
});
|
|
1051
1073
|
newState.splice(arrayIndex, 1, model);
|
|
@@ -1091,12 +1113,12 @@ const ContentTransferSetup = () => {
|
|
|
1091
1113
|
title: t("plugin_settings.content_transfer_setup"),
|
|
1092
1114
|
subtitle: t("plugin_settings.content_transfer_setup_description"),
|
|
1093
1115
|
primaryAction: /* @__PURE__ */ jsxRuntime.jsxs(index.Flex, { gap: 2, children: [
|
|
1094
|
-
/* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
1116
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Button, { variant: "secondary", disabled: !canUpdateSettings || !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
1095
1117
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1096
1118
|
index.Button,
|
|
1097
1119
|
{
|
|
1098
1120
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(index.ForwardRef$4z, {}),
|
|
1099
|
-
disabled: !hasUnsavedChanges,
|
|
1121
|
+
disabled: !canUpdateSettings || !hasUnsavedChanges,
|
|
1100
1122
|
onClick: () => {
|
|
1101
1123
|
void saveContentTransferSetup(formModel);
|
|
1102
1124
|
},
|
|
@@ -1132,7 +1154,15 @@ const ContentTransferSetup = () => {
|
|
|
1132
1154
|
!formModel.length && // empty state
|
|
1133
1155
|
/* @__PURE__ */ jsxRuntime.jsx(ContentTransferSetupEmpty, {}),
|
|
1134
1156
|
formModel.map((tree, index$12) => {
|
|
1135
|
-
return /* @__PURE__ */ jsxRuntime.jsx(index.Box, { marginBottom: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1157
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Box, { marginBottom: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1158
|
+
Tree,
|
|
1159
|
+
{
|
|
1160
|
+
onTreeItemClick,
|
|
1161
|
+
objects: tree,
|
|
1162
|
+
initiallyExpanded: index$12 === 0,
|
|
1163
|
+
disabled: !canUpdateSettings
|
|
1164
|
+
}
|
|
1165
|
+
) }, `box_tree_${index$12}`);
|
|
1136
1166
|
}),
|
|
1137
1167
|
!!formModel.length && /* @__PURE__ */ jsxRuntime.jsxs(index.Box, { children: [
|
|
1138
1168
|
/* @__PURE__ */ jsxRuntime.jsx(index.Box, { paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(index.Divider, {}) }),
|
|
@@ -1157,11 +1187,17 @@ const ContentTransferSetup = () => {
|
|
|
1157
1187
|
] })
|
|
1158
1188
|
] });
|
|
1159
1189
|
};
|
|
1160
|
-
const LocalazyContentTransferSetup = () =>
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1190
|
+
const LocalazyContentTransferSetup = () => {
|
|
1191
|
+
const {
|
|
1192
|
+
allowedActions: { canRead: canReadSettings },
|
|
1193
|
+
isLoading: isLoadingPermissions
|
|
1194
|
+
} = admin.useRBAC(index$2.PERMISSIONS.SETTINGS_READ);
|
|
1195
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(index.DesignSystemProvider, { theme: FetchIdentity.getDefaultTheme(), children: [
|
|
1196
|
+
/* @__PURE__ */ jsxRuntime.jsx(FetchIdentity.HeadingFixGlobalStyle, {}),
|
|
1197
|
+
isLoadingPermissions ? /* @__PURE__ */ jsxRuntime.jsx(FetchIdentity.PluginPageLoader, {}) : !canReadSettings ? /* @__PURE__ */ jsxRuntime.jsx(admin.Page.NoPermissions, {}) : /* @__PURE__ */ jsxRuntime.jsxs(FetchIdentity.LocalazyIdentityProvider, { children: [
|
|
1198
|
+
/* @__PURE__ */ jsxRuntime.jsx(FetchIdentity.FetchIdentity, {}),
|
|
1199
|
+
/* @__PURE__ */ jsxRuntime.jsx(RequireLocalazyAuth.RequireLocalazyAuth, { children: /* @__PURE__ */ jsxRuntime.jsx(ContentTransferSetup, {}) })
|
|
1200
|
+
] })
|
|
1201
|
+
] });
|
|
1202
|
+
};
|
|
1167
1203
|
exports.default = LocalazyContentTransferSetup;
|