@strapi/admin 4.5.3 → 4.5.4
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/components/AuthenticatedApp/index.js +13 -2
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +39 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +5 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/recursivelyFindPathsBasedOnCondition.js +8 -1
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +4 -0
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +4 -9
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -0
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +1 -1
- package/admin/src/content-manager/hooks/useLazyComponents/index.js +40 -15
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +5 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/constants.js +2 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +7 -0
- package/admin/src/core/utils/axiosInstance.js +4 -2
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useFetchClient/index.js +23 -0
- package/admin/src/pages/App/index.js +20 -13
- package/admin/src/pages/HomePage/SocialLinks.js +4 -4
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +23 -18
- package/admin/src/translations/tr.json +485 -5
- package/admin/src/utils/fetchClient.js +45 -0
- package/admin/src/utils/getFetchClient.js +10 -0
- package/admin/src/utils/index.js +1 -0
- package/admin/src/utils/uniqueAdminHash.js +22 -0
- package/build/{1233.80b05d66.chunk.js → 1233.802422fa.chunk.js} +61 -61
- package/build/4306.df40a798.chunk.js +98 -0
- package/build/4318.9283c350.chunk.js +30 -0
- package/build/5057.195a59ff.chunk.js +65 -0
- package/build/{4986.3820d11d.chunk.js → 8176.e929d326.chunk.js} +3 -3
- package/build/{8633.8da5488a.chunk.js → 8633.43ec9042.chunk.js} +1 -1
- package/build/8881.c693411a.chunk.js +245 -0
- package/build/9161.4a0ab137.chunk.js +2119 -0
- package/build/9279.6290c87a.chunk.js +117 -0
- package/build/Admin-authenticatedApp.0da578b8.chunk.js +80 -0
- package/build/{Admin_homePage.54e33c2d.chunk.js → Admin_homePage.8945f71a.chunk.js} +5 -5
- package/build/{Admin_marketplace.8219fda6.chunk.js → Admin_marketplace.ed754a4a.chunk.js} +1 -1
- package/build/{Admin_profilePage.e9fcce92.chunk.js → Admin_profilePage.60ab80bb.chunk.js} +1 -1
- package/build/{Admin_settingsPage.a1a5218b.chunk.js → Admin_settingsPage.6ef8acc9.chunk.js} +6 -6
- package/build/admin-app.a3277e72.chunk.js +112 -0
- package/build/admin-edit-roles-page.f407538c.chunk.js +1 -0
- package/build/admin-edit-users.5547b126.chunk.js +10 -0
- package/build/{admin-users.a0748674.chunk.js → admin-users.e64fb0f1.chunk.js} +1 -1
- package/build/content-manager.f9630c3b.chunk.js +1197 -0
- package/build/content-type-builder-translation-tr-json.949e22eb.chunk.js +1 -0
- package/build/content-type-builder.b132b5f4.chunk.js +145 -0
- package/build/email-settings-page.c6e62f6b.chunk.js +15 -0
- package/build/email-translation-tr-json.8aa034bb.chunk.js +1 -0
- package/build/i18n-translation-tr-json.34ca9d61.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/{main.f31112a5.js → main.71f24343.js} +371 -371
- package/build/runtime~main.1115f82b.js +2 -0
- package/build/sso-settings-page.feed2f45.chunk.js +1 -0
- package/build/tr-json.eac8bd79.chunk.js +1 -0
- package/build/upload-translation-tr-json.b173223a.chunk.js +1 -0
- package/build/upload.74540aab.chunk.js +64 -0
- package/build/users-advanced-settings-page.0c0b8230.chunk.js +13 -0
- package/build/users-email-settings-page.3126ff8c.chunk.js +28 -0
- package/build/users-permissions-translation-tr-json.9bebc250.chunk.js +1 -0
- package/build/users-providers-settings-page.b7b602e2.chunk.js +33 -0
- package/build/users-roles-settings-page.ce5b582d.chunk.js +30 -0
- package/build/{webhook-edit-page.14ad1e6e.chunk.js → webhook-edit-page.1215a6b7.chunk.js} +1 -1
- package/package.json +11 -11
- package/server/controllers/admin.js +2 -0
- package/server/routes/admin.js +1 -1
- package/server/services/metrics.js +5 -2
- package/utils/get-plugins-path.js +17 -3
- package/build/1920.74a262e7.chunk.js +0 -245
- package/build/2438.61291207.chunk.js +0 -2183
- package/build/2517.9b4940f3.chunk.js +0 -117
- package/build/4306.f03c2b46.chunk.js +0 -98
- package/build/4318.7931eee7.chunk.js +0 -30
- package/build/Admin-authenticatedApp.1e1d3bdd.chunk.js +0 -80
- package/build/admin-app.9cb0abc7.chunk.js +0 -112
- package/build/admin-edit-roles-page.23f15909.chunk.js +0 -1
- package/build/admin-edit-users.283b49ed.chunk.js +0 -10
- package/build/content-manager.01e04e11.chunk.js +0 -1200
- package/build/content-type-builder-translation-tr-json.2e52bc60.chunk.js +0 -1
- package/build/content-type-builder.848a9610.chunk.js +0 -145
- package/build/email-settings-page.d44a57cb.chunk.js +0 -15
- package/build/email-translation-tr-json.87f2feb3.chunk.js +0 -1
- package/build/runtime~main.f91e75cd.js +0 -2
- package/build/sso-settings-page.9f091262.chunk.js +0 -1
- package/build/tr-json.9c44ea0c.chunk.js +0 -1
- package/build/upload.a73936d9.chunk.js +0 -64
- package/build/users-advanced-settings-page.dc23bc56.chunk.js +0 -13
- package/build/users-email-settings-page.6541d372.chunk.js +0 -28
- package/build/users-permissions-translation-tr-json.cdc49a3c.chunk.js +0 -1
- package/build/users-providers-settings-page.e11a2f64.chunk.js +0 -33
- package/build/users-roles-settings-page.445e5e16.chunk.js +0 -30
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { auth } from '@strapi/helper-plugin';
|
|
3
|
+
|
|
4
|
+
export const reqInterceptor = async (config) => {
|
|
5
|
+
config.headers = {
|
|
6
|
+
Authorization: `Bearer ${auth.getToken()}`,
|
|
7
|
+
Accept: 'application/json',
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
return config;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const reqErrorInterceptor = (error) => {
|
|
15
|
+
return Promise.reject(error);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const resInterceptor = (response) => response;
|
|
19
|
+
|
|
20
|
+
export const resErrorInterceptor = (error) => {
|
|
21
|
+
// whatever you want to do with the error
|
|
22
|
+
if (error?.response?.status === 401) {
|
|
23
|
+
auth.clearAppStorage();
|
|
24
|
+
window.location.reload();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
throw error;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const addInterceptors = (instance) => {
|
|
31
|
+
instance.interceptors.request.use(reqInterceptor, reqErrorInterceptor);
|
|
32
|
+
|
|
33
|
+
instance.interceptors.response.use(resInterceptor, resErrorInterceptor);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const fetchClient = ({ baseURL }) => {
|
|
37
|
+
const instance = axios.create({
|
|
38
|
+
baseURL,
|
|
39
|
+
});
|
|
40
|
+
addInterceptors(instance);
|
|
41
|
+
|
|
42
|
+
return instance;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default fetchClient({ baseURL: process.env.STRAPI_ADMIN_BACKEND_URL });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import instance from './fetchClient';
|
|
2
|
+
|
|
3
|
+
export const getFetchClient = (defaultOptions = {}) => {
|
|
4
|
+
return {
|
|
5
|
+
get: (url, config) => instance.get(url, { ...defaultOptions, ...config }),
|
|
6
|
+
put: (url, data, config) => instance.put(url, data, { ...defaultOptions, ...config }),
|
|
7
|
+
post: (url, data, config) => instance.post(url, data, { ...defaultOptions, ...config }),
|
|
8
|
+
del: (url, config) => instance.delete(url, { ...defaultOptions, ...config }),
|
|
9
|
+
};
|
|
10
|
+
};
|
package/admin/src/utils/index.js
CHANGED
|
@@ -7,3 +7,4 @@ export { default as sortLinks } from './sortLinks';
|
|
|
7
7
|
export { default as getExistingActions } from './getExistingActions';
|
|
8
8
|
export { default as getRequestUrl } from './getRequestUrl';
|
|
9
9
|
export { default as getFullName } from './getFullName';
|
|
10
|
+
export { default as hashAdminUserEmail } from './uniqueAdminHash';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const utils = {
|
|
2
|
+
bufferToHex(buffer) {
|
|
3
|
+
return [...new Uint8Array(buffer)].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
4
|
+
},
|
|
5
|
+
async digestMessage(message) {
|
|
6
|
+
const msgUint8 = new TextEncoder().encode(message);
|
|
7
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
|
|
8
|
+
|
|
9
|
+
return this.bufferToHex(hashBuffer);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default async function hashAdminUserEmail(payload) {
|
|
14
|
+
if (!payload) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
return await utils.digestMessage(payload.email);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|