strapi-cache 1.8.2-rc.1 → 1.8.2-rc.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/dist/_chunks/{index-B_MAAg0W.js → index-Bdo3ZcJs.js} +4 -3
- package/dist/_chunks/{index-BwuX8jJl.mjs → index-BovuTRdq.mjs} +7 -4
- package/dist/_chunks/{index-CkLhx2ik.mjs → index-DLoQ9I8J.mjs} +5 -4
- package/dist/_chunks/{index-D_ssKKxu.js → index-EMYe2zF8.js} +6 -3
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/hooks/useCachePermissions.d.ts +1 -0
- package/dist/admin/src/permission.d.ts +4 -0
- package/dist/server/index.js +10 -1
- package/dist/server/index.mjs +10 -1
- package/package.json +1 -1
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const designSystem = require("@strapi/design-system");
|
|
5
5
|
const reactIntl = require("react-intl");
|
|
6
|
-
const
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
const index = require("./index-EMYe2zF8.js");
|
|
7
8
|
const react = require("react");
|
|
8
9
|
const SettingsPage = () => {
|
|
9
10
|
const { formatMessage } = reactIntl.useIntl();
|
|
10
11
|
const [keyToUse, setKeyToUse] = react.useState("");
|
|
11
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "20px" }, children: [
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsx(admin.Page.Protect, { permissions: index.pluginPermissions.viewSettings, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "20px" }, children: [
|
|
12
13
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", as: "h1", children: formatMessage({
|
|
13
14
|
id: "strapi-cache.name",
|
|
14
15
|
defaultMessage: "Strapi Cache Settings"
|
|
@@ -47,6 +48,6 @@ const SettingsPage = () => {
|
|
|
47
48
|
}
|
|
48
49
|
),
|
|
49
50
|
/* @__PURE__ */ jsxRuntime.jsx(index.PurgeModal, { buttonText: "Purge All", isPurgeAll: true, isSettingsPage: true })
|
|
50
|
-
] });
|
|
51
|
+
] }) });
|
|
51
52
|
};
|
|
52
53
|
exports.default = SettingsPage;
|
|
@@ -73,12 +73,14 @@ const useCacheConfig = (enabled = true) => {
|
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
const pluginPermissions = {
|
|
76
|
-
purge: [{ action: "plugin::strapi-cache.purge-cache", subject: null }]
|
|
76
|
+
purge: [{ action: "plugin::strapi-cache.purge-cache", subject: null }],
|
|
77
|
+
viewSettings: [{ action: "plugin::strapi-cache.view-settings", subject: null }]
|
|
77
78
|
};
|
|
78
79
|
const useCachePermissions = () => {
|
|
79
80
|
const { allowedActions } = useRBAC(pluginPermissions);
|
|
80
81
|
return {
|
|
81
82
|
canPurgeCache: allowedActions.canPurgeCache,
|
|
83
|
+
canViewSettings: allowedActions.canViewSettings,
|
|
82
84
|
allowedActions
|
|
83
85
|
};
|
|
84
86
|
};
|
|
@@ -371,8 +373,8 @@ const index = {
|
|
|
371
373
|
},
|
|
372
374
|
id: "settings",
|
|
373
375
|
to: `${PLUGIN_ID}/settings`,
|
|
374
|
-
Component: () => import("./index-
|
|
375
|
-
permissions:
|
|
376
|
+
Component: () => import("./index-DLoQ9I8J.mjs"),
|
|
377
|
+
permissions: pluginPermissions.viewSettings
|
|
376
378
|
}
|
|
377
379
|
]
|
|
378
380
|
);
|
|
@@ -392,5 +394,6 @@ const index = {
|
|
|
392
394
|
};
|
|
393
395
|
export {
|
|
394
396
|
PurgeModal as P,
|
|
395
|
-
index as i
|
|
397
|
+
index as i,
|
|
398
|
+
pluginPermissions as p
|
|
396
399
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Typography, TextInput } from "@strapi/design-system";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { Page } from "@strapi/strapi/admin";
|
|
5
|
+
import { p as pluginPermissions, P as PurgeModal } from "./index-BovuTRdq.mjs";
|
|
5
6
|
import { useState } from "react";
|
|
6
7
|
const SettingsPage = () => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
9
|
const [keyToUse, setKeyToUse] = useState("");
|
|
9
|
-
return /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
|
|
10
|
+
return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions.viewSettings, children: /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
|
|
10
11
|
/* @__PURE__ */ jsx(Typography, { variant: "alpha", as: "h1", children: formatMessage({
|
|
11
12
|
id: "strapi-cache.name",
|
|
12
13
|
defaultMessage: "Strapi Cache Settings"
|
|
@@ -45,7 +46,7 @@ const SettingsPage = () => {
|
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
48
|
/* @__PURE__ */ jsx(PurgeModal, { buttonText: "Purge All", isPurgeAll: true, isSettingsPage: true })
|
|
48
|
-
] });
|
|
49
|
+
] }) });
|
|
49
50
|
};
|
|
50
51
|
export {
|
|
51
52
|
SettingsPage as default
|
|
@@ -74,12 +74,14 @@ const useCacheConfig = (enabled = true) => {
|
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
76
|
const pluginPermissions = {
|
|
77
|
-
purge: [{ action: "plugin::strapi-cache.purge-cache", subject: null }]
|
|
77
|
+
purge: [{ action: "plugin::strapi-cache.purge-cache", subject: null }],
|
|
78
|
+
viewSettings: [{ action: "plugin::strapi-cache.view-settings", subject: null }]
|
|
78
79
|
};
|
|
79
80
|
const useCachePermissions = () => {
|
|
80
81
|
const { allowedActions } = admin.useRBAC(pluginPermissions);
|
|
81
82
|
return {
|
|
82
83
|
canPurgeCache: allowedActions.canPurgeCache,
|
|
84
|
+
canViewSettings: allowedActions.canViewSettings,
|
|
83
85
|
allowedActions
|
|
84
86
|
};
|
|
85
87
|
};
|
|
@@ -372,8 +374,8 @@ const index = {
|
|
|
372
374
|
},
|
|
373
375
|
id: "settings",
|
|
374
376
|
to: `${PLUGIN_ID}/settings`,
|
|
375
|
-
Component: () => Promise.resolve().then(() => require("./index-
|
|
376
|
-
permissions:
|
|
377
|
+
Component: () => Promise.resolve().then(() => require("./index-Bdo3ZcJs.js")),
|
|
378
|
+
permissions: pluginPermissions.viewSettings
|
|
377
379
|
}
|
|
378
380
|
]
|
|
379
381
|
);
|
|
@@ -393,3 +395,4 @@ const index = {
|
|
|
393
395
|
};
|
|
394
396
|
exports.PurgeModal = PurgeModal;
|
|
395
397
|
exports.index = index;
|
|
398
|
+
exports.pluginPermissions = pluginPermissions;
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -92,6 +92,12 @@ const actions = [
|
|
|
92
92
|
displayName: "Purge Cache",
|
|
93
93
|
uid: "purge-cache",
|
|
94
94
|
pluginName: "strapi-cache"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
section: "plugins",
|
|
98
|
+
displayName: "View settings",
|
|
99
|
+
uid: "view-settings",
|
|
100
|
+
pluginName: "strapi-cache"
|
|
95
101
|
}
|
|
96
102
|
];
|
|
97
103
|
const bootstrap = ({ strapi: strapi2 }) => {
|
|
@@ -708,7 +714,10 @@ const purgeRoute = [
|
|
|
708
714
|
{
|
|
709
715
|
name: "plugin::content-manager.hasPermissions",
|
|
710
716
|
config: {
|
|
711
|
-
actions: [
|
|
717
|
+
actions: [
|
|
718
|
+
"plugin::strapi-cache.purge-cache",
|
|
719
|
+
"plugin::strapi-cache.view-settings"
|
|
720
|
+
]
|
|
712
721
|
}
|
|
713
722
|
}
|
|
714
723
|
]
|
package/dist/server/index.mjs
CHANGED
|
@@ -88,6 +88,12 @@ const actions = [
|
|
|
88
88
|
displayName: "Purge Cache",
|
|
89
89
|
uid: "purge-cache",
|
|
90
90
|
pluginName: "strapi-cache"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
section: "plugins",
|
|
94
|
+
displayName: "View settings",
|
|
95
|
+
uid: "view-settings",
|
|
96
|
+
pluginName: "strapi-cache"
|
|
91
97
|
}
|
|
92
98
|
];
|
|
93
99
|
const bootstrap = ({ strapi: strapi2 }) => {
|
|
@@ -704,7 +710,10 @@ const purgeRoute = [
|
|
|
704
710
|
{
|
|
705
711
|
name: "plugin::content-manager.hasPermissions",
|
|
706
712
|
config: {
|
|
707
|
-
actions: [
|
|
713
|
+
actions: [
|
|
714
|
+
"plugin::strapi-cache.purge-cache",
|
|
715
|
+
"plugin::strapi-cache.view-settings"
|
|
716
|
+
]
|
|
708
717
|
}
|
|
709
718
|
}
|
|
710
719
|
]
|
package/package.json
CHANGED