@akemona-org/strapi-admin 3.7.0 → 3.7.1

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.
Files changed (213) hide show
  1. package/admin/src/app.js +15 -15
  2. package/admin/src/components/Header/index.js +4 -4
  3. package/admin/src/components/LeftMenu/LeftMenuFooter/Wrapper.js +1 -1
  4. package/admin/src/components/LeftMenu/LeftMenuFooter/index.js +6 -1
  5. package/admin/src/components/LeftMenu/LeftMenuHeader/Wrapper.js +3 -3
  6. package/admin/src/components/LeftMenu/LeftMenuLink/A.js +7 -7
  7. package/admin/src/components/LeftMenu/LeftMenuLink/LeftMenuLinkContent.js +1 -1
  8. package/admin/src/components/LeftMenu/LeftMenuLinkHeader/Title.js +1 -1
  9. package/admin/src/components/LeftMenu/LeftMenuLinkHeader/index.js +2 -2
  10. package/admin/src/components/LeftMenu/LeftMenuLinkSection/index.js +1 -1
  11. package/admin/src/components/LeftMenu/LinksContainer/index.js +2 -2
  12. package/admin/src/components/Notifications/Notification/Li.js +15 -15
  13. package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/ClearIndicator.js +1 -1
  14. package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/index.js +7 -6
  15. package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/MenuList/utils/createCollapsesObject.js +1 -1
  16. package/admin/src/components/Roles/ConditionsModal/ConditionsSelect/SingleValue.js +1 -1
  17. package/admin/src/components/Roles/ConditionsModal/index.js +2 -2
  18. package/admin/src/components/Roles/ConditionsModal/utils/selectStyle.js +8 -8
  19. package/admin/src/components/Roles/ContentTypeCollapse/Collapse/index.js +4 -7
  20. package/admin/src/components/Roles/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +1 -1
  21. package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/index.js +1 -1
  22. package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +1 -1
  23. package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/Header/index.js +1 -1
  24. package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/SubActionRow/index.js +6 -10
  25. package/admin/src/components/Roles/ContentTypeCollapse/CollapsePropertyMatrix/utils/generateHeadersFromActions.js +1 -1
  26. package/admin/src/components/Roles/ContentTypeCollapse/utils/activeStyle.js +1 -1
  27. package/admin/src/components/Roles/ContentTypeCollapse/utils/getAvailableActions.js +1 -1
  28. package/admin/src/components/Roles/ContentTypeCollapses/index.js +1 -1
  29. package/admin/src/components/Roles/Curve/index.js +1 -1
  30. package/admin/src/components/Roles/GlobalActions/utils/findDisplayedActions.js +1 -1
  31. package/admin/src/components/Roles/GlobalActions/utils/getRowLabelCheckboxesState.js +2 -2
  32. package/admin/src/components/Roles/Permissions/index.js +5 -4
  33. package/admin/src/components/Roles/Permissions/reducer.js +4 -4
  34. package/admin/src/components/Roles/Permissions/utils/createDefaultCTFormFromLayout.js +1 -1
  35. package/admin/src/components/Roles/Permissions/utils/findMatchingPermissions.js +1 -1
  36. package/admin/src/components/Roles/Permissions/utils/formatContentTypesPermissionToAPI.js +2 -2
  37. package/admin/src/components/Roles/Permissions/utils/formatLayoutForSettingsAndPlugins.js +1 -1
  38. package/admin/src/components/Roles/Permissions/utils/formatPermissionsToAPI.js +1 -1
  39. package/admin/src/components/Roles/Permissions/utils/formatSettingsPermissionsToAPI.js +4 -4
  40. package/admin/src/components/Roles/Permissions/utils/updateConditionsToFalse.js +2 -2
  41. package/admin/src/components/Roles/PluginsAndSettings/Row/Wrapper.js +1 -1
  42. package/admin/src/components/Roles/PluginsAndSettings/SubCategory/index.js +4 -7
  43. package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/formatActions.js +2 -2
  44. package/admin/src/components/Roles/PluginsAndSettings/SubCategory/utils/getConditionsButtonState.js +2 -2
  45. package/admin/src/components/Roles/PluginsAndSettings/index.js +1 -1
  46. package/admin/src/components/Roles/RoleForm/NameInput.js +1 -1
  47. package/admin/src/components/Roles/RoleList/RoleDescription.js +1 -1
  48. package/admin/src/components/Roles/Tabs/index.js +1 -1
  49. package/admin/src/components/Roles/utils/createArrayOfValues.js +2 -2
  50. package/admin/src/components/Roles/utils/getCheckboxState.js +3 -3
  51. package/admin/src/components/Roles/utils/removeConditionKeyFromData.js +1 -1
  52. package/admin/src/components/Users/FilterPicker/Card/Input.js +1 -1
  53. package/admin/src/components/Users/FilterPicker/Card/index.js +2 -2
  54. package/admin/src/components/Users/FilterPicker/Card/init.js +1 -1
  55. package/admin/src/components/Users/FilterPicker/Card/reducer.js +1 -1
  56. package/admin/src/components/Users/FilterPicker/index.js +1 -1
  57. package/admin/src/components/Users/List/index.js +5 -5
  58. package/admin/src/components/Users/List/init.js +1 -1
  59. package/admin/src/components/Users/List/reducer.js +1 -1
  60. package/admin/src/components/Users/List/utils/checkIfAllEntriesAreSelected.js +1 -1
  61. package/admin/src/components/Users/List/utils/headers.js +2 -2
  62. package/admin/src/components/Users/List/utils/updateRows.js +1 -1
  63. package/admin/src/components/Users/ModalCreateBody/index.js +3 -3
  64. package/admin/src/components/Users/ModalCreateBody/init.js +1 -1
  65. package/admin/src/components/Users/ModalCreateBody/reducer.js +1 -1
  66. package/admin/src/components/Users/ModalCreateBody/utils/schema.js +2 -8
  67. package/admin/src/components/Users/RoleSettingsModalSection/index.js +1 -1
  68. package/admin/src/components/Users/SelectRoles/ClearIndicator.js +1 -1
  69. package/admin/src/components/Users/SelectRoles/MultiValueContainer.js +1 -1
  70. package/admin/src/components/Users/SelectRoles/index.js +3 -3
  71. package/admin/src/components/Users/SelectRoles/utils/styles.js +4 -4
  72. package/admin/src/components/Users/SortPicker/Button.js +1 -1
  73. package/admin/src/components/Users/SortPicker/List.js +1 -1
  74. package/admin/src/components/Users/SortPicker/ListWrapper.js +1 -1
  75. package/admin/src/components/Users/SortPicker/index.js +2 -2
  76. package/admin/src/components/Webhooks/EventInput/EventRow.js +2 -2
  77. package/admin/src/components/Webhooks/EventInput/index.js +5 -5
  78. package/admin/src/components/Webhooks/EventInput/utils/formatValue.js +1 -1
  79. package/admin/src/components/Webhooks/HeadersInput/index.js +6 -6
  80. package/admin/src/components/Webhooks/Inputs/index.js +2 -2
  81. package/admin/src/components/Webhooks/ListRow/index.js +3 -3
  82. package/admin/src/configureStore.js +1 -1
  83. package/admin/src/containers/Admin/Content.js +5 -5
  84. package/admin/src/containers/Admin/Logout/index.js +1 -1
  85. package/admin/src/containers/Admin/Wrapper.js +1 -1
  86. package/admin/src/containers/Admin/reducer.js +1 -1
  87. package/admin/src/containers/Admin/selectors.js +2 -2
  88. package/admin/src/containers/App/selectors.js +9 -8
  89. package/admin/src/containers/App/styles/website.css +5 -5
  90. package/admin/src/containers/ApplicationInfosPage/index.js +4 -4
  91. package/admin/src/containers/AuthPage/components/ForgotPassword/index.js +1 -1
  92. package/admin/src/containers/AuthPage/components/Login/BaseLogin.js +1 -1
  93. package/admin/src/containers/AuthPage/components/Login/index.js +2 -2
  94. package/admin/src/containers/AuthPage/components/Register/index.js +3 -3
  95. package/admin/src/containers/AuthPage/components/ResetPassword/index.js +1 -1
  96. package/admin/src/containers/AuthPage/init.js +1 -1
  97. package/admin/src/containers/AuthPage/reducer.js +1 -1
  98. package/admin/src/containers/AuthPage/utils/forms.js +2 -8
  99. package/admin/src/containers/HomePage/index.js +15 -16
  100. package/admin/src/containers/InstalledPluginsPage/Row.js +1 -1
  101. package/admin/src/containers/InstalledPluginsPage/index.js +1 -1
  102. package/admin/src/containers/InstalledPluginsPage/utils/generateRows.js +1 -1
  103. package/admin/src/containers/LanguageProvider/hooks/useChangeLanguage.js +1 -1
  104. package/admin/src/containers/LanguageProvider/index.js +1 -1
  105. package/admin/src/containers/LanguageProvider/selectors.js +3 -10
  106. package/admin/src/containers/LeftMenu/Wrapper.js +5 -5
  107. package/admin/src/containers/LeftMenu/reducer.js +1 -1
  108. package/admin/src/containers/LeftMenu/selectors.js +1 -1
  109. package/admin/src/containers/LeftMenu/utils/generateModelsLinks.js +2 -2
  110. package/admin/src/containers/LeftMenu/utils/getCtOrStLinks.js +5 -4
  111. package/admin/src/containers/LeftMenu/utils/getGeneralLinks.js +1 -1
  112. package/admin/src/containers/LeftMenu/utils/getSettingsMenuLinksPermissions.js +1 -1
  113. package/admin/src/containers/LeftMenu/utils/toPluginLinks.js +2 -2
  114. package/admin/src/containers/LocaleToggle/index.js +2 -2
  115. package/admin/src/containers/LocaleToggle/selectors.js +4 -7
  116. package/admin/src/containers/MarketplacePage/PluginCard/index.js +3 -3
  117. package/admin/src/containers/MarketplacePage/index.js +2 -2
  118. package/admin/src/containers/NewNotification/Notification/index.js +4 -12
  119. package/admin/src/containers/NewNotification/Notification/styledComponents.js +1 -1
  120. package/admin/src/containers/NewNotification/index.js +2 -2
  121. package/admin/src/containers/NewNotification/reducer.js +2 -2
  122. package/admin/src/containers/NotFoundPage/index.js +1 -1
  123. package/admin/src/containers/NotificationProvider/actions.js +1 -1
  124. package/admin/src/containers/NotificationProvider/index.js +1 -1
  125. package/admin/src/containers/NotificationProvider/selectors.js +3 -3
  126. package/admin/src/containers/Onboarding/StaticLinks/index.js +2 -2
  127. package/admin/src/containers/Onboarding/Video.js +1 -1
  128. package/admin/src/containers/Onboarding/index.js +2 -2
  129. package/admin/src/containers/Onboarding/init.js +1 -1
  130. package/admin/src/containers/Onboarding/reducer.js +6 -6
  131. package/admin/src/containers/Onboarding/utils/formatAndStoreVideoArray.js +2 -2
  132. package/admin/src/containers/PermissionsManager/index.js +1 -1
  133. package/admin/src/containers/PermissionsManager/reducer.js +2 -2
  134. package/admin/src/containers/PrivateRoute/index.js +1 -1
  135. package/admin/src/containers/ProfilePage/index.js +4 -4
  136. package/admin/src/containers/Roles/EditPage/index.js +1 -1
  137. package/admin/src/containers/Roles/ListPage/index.js +5 -5
  138. package/admin/src/containers/SettingsPage/components/ApplicationDetailLink/Icon.js +1 -1
  139. package/admin/src/containers/SettingsPage/components/MenuWrapper/index.js +1 -1
  140. package/admin/src/containers/SettingsPage/index.js +3 -3
  141. package/admin/src/containers/SettingsPage/utils/createPluginsLinksRoutes.js +3 -3
  142. package/admin/src/containers/SettingsPage/utils/findFirstAllowedEndpoint.js +3 -3
  143. package/admin/src/containers/SettingsPage/utils/getSectionsToDisplay.js +2 -2
  144. package/admin/src/containers/SettingsPage/utils/makeUniqueRoutes.js +2 -2
  145. package/admin/src/containers/Users/EditPage/index.js +2 -2
  146. package/admin/src/containers/Users/ListPage/Header.js +2 -2
  147. package/admin/src/containers/Users/ListPage/index.js +4 -4
  148. package/admin/src/containers/Users/ListPage/init.js +1 -1
  149. package/admin/src/containers/Users/ListPage/reducer.js +1 -1
  150. package/admin/src/containers/Users/ListPage/utils/getFilters.js +1 -1
  151. package/admin/src/containers/Webhooks/EditView/index.js +11 -17
  152. package/admin/src/containers/Webhooks/EditView/reducer.js +4 -4
  153. package/admin/src/containers/Webhooks/EditView/utils/formatData.js +2 -2
  154. package/admin/src/containers/Webhooks/EditView/utils/schema.js +1 -1
  155. package/admin/src/containers/Webhooks/ListView/index.js +5 -5
  156. package/admin/src/containers/Webhooks/ListView/reducer.js +5 -5
  157. package/admin/src/contexts/MarketPlace/index.js +2 -10
  158. package/admin/src/hooks/useFetchPermissionsLayout/index.js +1 -1
  159. package/admin/src/hooks/useFetchPermissionsLayout/reducer.js +1 -1
  160. package/admin/src/hooks/useFetchPluginsFromMarketPlace/index.js +1 -1
  161. package/admin/src/hooks/useFetchRole/index.js +4 -4
  162. package/admin/src/hooks/useFetchRole/reducer.js +1 -1
  163. package/admin/src/hooks/useModels/index.js +1 -1
  164. package/admin/src/hooks/useModels/reducer.js +3 -3
  165. package/admin/src/hooks/useRolesList/reducer.js +1 -1
  166. package/admin/src/hooks/useSettingsForm/index.js +2 -2
  167. package/admin/src/hooks/useSettingsForm/reducer.js +1 -1
  168. package/admin/src/hooks/useSettingsMenu/index.js +2 -2
  169. package/admin/src/hooks/useSettingsMenu/reducer.js +3 -3
  170. package/admin/src/hooks/useSettingsMenu/utils/formatLinks.js +3 -3
  171. package/admin/src/plugins.js +2 -2
  172. package/admin/src/public-path.js +1 -3
  173. package/admin/src/utils/ComponentApi.js +3 -3
  174. package/admin/src/utils/FieldApi.js +3 -3
  175. package/admin/src/utils/Plugin.js +1 -1
  176. package/admin/src/utils/Strapi.js +2 -2
  177. package/admin/src/utils/checkStore.js +1 -4
  178. package/admin/src/utils/getAttributesToDisplay.js +1 -1
  179. package/admin/src/utils/getExistingActions.js +2 -2
  180. package/admin/src/utils/getRequestUrl.js +1 -1
  181. package/admin/src/utils/injectReducer.js +26 -25
  182. package/admin/src/utils/injectSaga.js +28 -27
  183. package/admin/src/utils/reducerInjectors.js +1 -5
  184. package/admin/src/utils/retrieveGlobalLinks.js +1 -1
  185. package/admin/src/utils/retrievePluginsMenu.js +1 -1
  186. package/admin/src/utils/sagaInjectors.js +4 -7
  187. package/admin/src/utils/sortLinks.js +1 -1
  188. package/admin/src/validations/users/profile.js +1 -5
  189. package/admin/src/validations/users/roles.js +1 -4
  190. package/config/admin-conditions.js +3 -3
  191. package/config/migrations/permissions-fields-to-properties.js +4 -4
  192. package/controllers/admin.js +1 -1
  193. package/controllers/formatters/format-actions-by-sections.js +1 -1
  194. package/doc/customize-menu.md +3 -3
  195. package/domain/action/index.js +3 -3
  196. package/domain/condition/index.js +2 -2
  197. package/domain/permission/index.js +3 -3
  198. package/domain/user.js +2 -2
  199. package/index.js +12 -12
  200. package/middlewares/auth/index.js +1 -1
  201. package/package.json +4 -4
  202. package/services/action.js +1 -1
  203. package/services/condition.js +1 -1
  204. package/services/passport/local-strategy.js +2 -2
  205. package/services/passport.js +2 -4
  206. package/services/permission/engine.js +9 -9
  207. package/services/permission/queries.js +11 -12
  208. package/services/permission/sections-builder/utils.js +5 -5
  209. package/services/token.js +2 -2
  210. package/utils/index.js +1 -1
  211. package/validation/common-functions/check-fields-are-correctly-nested.js +3 -2
  212. package/validation/common-functions/check-fields-dont-have-duplicates.js +1 -1
  213. package/webpack.config.js +2 -2
@@ -1,6 +1,6 @@
1
- const makeUniqueRoutes = routes =>
1
+ const makeUniqueRoutes = (routes) =>
2
2
  routes.filter((route, index, refArray) => {
3
- return refArray.findIndex(obj => obj.key === route.key) === index;
3
+ return refArray.findIndex((obj) => obj.key === route.key) === index;
4
4
  });
5
5
 
6
6
  export default makeUniqueRoutes;
@@ -22,7 +22,7 @@ const EditPage = ({ canUpdate }) => {
22
22
  params: { id },
23
23
  } = useRouteMatch(`${settingsBaseURL}/users/:id`);
24
24
 
25
- const cbSuccess = data => {
25
+ const cbSuccess = (data) => {
26
26
  const userInfos = auth.getUserInfo();
27
27
 
28
28
  // The user is updating themself
@@ -85,7 +85,7 @@ const EditPage = ({ canUpdate }) => {
85
85
  id: 'app.components.Users.ModalCreateBody.block-title.details',
86
86
  })}
87
87
  >
88
- {Object.keys(form).map(key => {
88
+ {Object.keys(form).map((key) => {
89
89
  return (
90
90
  <SizedInput
91
91
  {...form[key]}
@@ -31,7 +31,7 @@ const Header = ({
31
31
  label: formatMessage({ id: 'app.utils.delete' }),
32
32
  onClick: onClickDelete,
33
33
  type: 'button',
34
- Component: props => (canDelete ? <Button {...props} /> : null),
34
+ Component: (props) => (canDelete ? <Button {...props} /> : null),
35
35
  },
36
36
 
37
37
  {
@@ -40,7 +40,7 @@ const Header = ({
40
40
  label: formatMessage({ id: 'Settings.permissions.users.create' }),
41
41
  onClick: onClickAddUser,
42
42
  type: 'button',
43
- Component: props => (canCreate ? <Button {...props} /> : null),
43
+ Component: (props) => (canCreate ? <Button {...props} /> : null),
44
44
  },
45
45
  ],
46
46
  content: canRead
@@ -104,7 +104,7 @@ const ListPage = () => {
104
104
  // eslint-disable-next-line react-hooks/exhaustive-deps
105
105
  }, [canRead]);
106
106
 
107
- const handleChangeDataToDelete = ids => {
107
+ const handleChangeDataToDelete = (ids) => {
108
108
  dispatch({
109
109
  type: 'ON_CHANGE_DATA_TO_DELETE',
110
110
  dataToDelete: ids,
@@ -139,7 +139,7 @@ const ListPage = () => {
139
139
  push({ search: currentSearch.toString() });
140
140
  };
141
141
 
142
- const handleClickDelete = useCallback(id => {
142
+ const handleClickDelete = useCallback((id) => {
143
143
  handleToggleModal();
144
144
 
145
145
  dispatch({
@@ -201,9 +201,9 @@ const ListPage = () => {
201
201
  handleToggleModal();
202
202
  }, [dataToDelete]);
203
203
 
204
- const handleToggle = () => setIsModalOpened(prev => !prev);
204
+ const handleToggle = () => setIsModalOpened((prev) => !prev);
205
205
 
206
- const handleToggleModal = () => setIsWarningDeleteAllOpened(prev => !prev);
206
+ const handleToggleModal = () => setIsWarningDeleteAllOpened((prev) => !prev);
207
207
 
208
208
  const updateSearchParams = (name, value, shouldDeleteSearch = false) => {
209
209
  const currentSearch = new URLSearchParams(search);
@@ -1,3 +1,3 @@
1
- const init = initialState => initialState;
1
+ const init = (initialState) => initialState;
2
2
 
3
3
  export default init;
@@ -16,7 +16,7 @@ const initialState = {
16
16
  };
17
17
 
18
18
  const reducer = (state, action) =>
19
- produce(state, draftState => {
19
+ produce(state, (draftState) => {
20
20
  switch (action.type) {
21
21
  case 'GET_DATA': {
22
22
  return initialState;
@@ -1,4 +1,4 @@
1
- const getFilters = search => {
1
+ const getFilters = (search) => {
2
2
  const query = new URLSearchParams(search);
3
3
  const filters = [];
4
4
 
@@ -40,14 +40,8 @@ function EditView() {
40
40
  const { signal } = abortController;
41
41
  const isCreating = id === 'create';
42
42
 
43
- const {
44
- formErrors,
45
- modifiedData,
46
- initialData,
47
- isLoading,
48
- isTriggering,
49
- triggerResponse,
50
- } = reducerState.toJS();
43
+ const { formErrors, modifiedData, initialData, isLoading, isTriggering, triggerResponse } =
44
+ reducerState.toJS();
51
45
 
52
46
  useEffect(() => {
53
47
  isMounted.current = true;
@@ -96,7 +90,7 @@ function EditView() {
96
90
  const isTriggerActionDisabled = isCreating || (!isCreating && !areActionDisabled) || isTriggering;
97
91
 
98
92
  const formattedErrors = Object.keys(formErrors)
99
- .filter(key => key.includes('headers'))
93
+ .filter((key) => key.includes('headers'))
100
94
  .reduce((obj, key) => {
101
95
  obj[key] = formErrors[key];
102
96
 
@@ -216,7 +210,7 @@ function EditView() {
216
210
  }
217
211
  };
218
212
 
219
- const getErrorMessage = error => {
213
+ const getErrorMessage = (error) => {
220
214
  if (!error) {
221
215
  return null;
222
216
  }
@@ -284,7 +278,7 @@ function EditView() {
284
278
  }
285
279
  };
286
280
 
287
- const handleRemove = index => {
281
+ const handleRemove = (index) => {
288
282
  dispatch({
289
283
  type: 'ON_HEADER_REMOVE',
290
284
  index,
@@ -298,7 +292,7 @@ function EditView() {
298
292
  type: 'RESET_FORM',
299
293
  });
300
294
 
301
- const handleSubmit = e => {
295
+ const handleSubmit = (e) => {
302
296
  e.preventDefault();
303
297
  setSubmittedOnce(true);
304
298
  checkFormErrors(true);
@@ -318,7 +312,7 @@ function EditView() {
318
312
  setErrors(errors);
319
313
  };
320
314
 
321
- const resetHeadersError = keys => {
315
+ const resetHeadersError = (keys) => {
322
316
  const errors = formErrors;
323
317
 
324
318
  setErrors(omit(errors, [keys]));
@@ -327,7 +321,7 @@ function EditView() {
327
321
  const resetHeadersErrors = () => {
328
322
  const errors = formErrors;
329
323
  const newErrors = Object.keys(errors)
330
- .filter(key => !key.includes('headers'))
324
+ .filter((key) => !key.includes('headers'))
331
325
  .reduce((obj, key) => {
332
326
  obj[key] = formErrors[key];
333
327
 
@@ -337,7 +331,7 @@ function EditView() {
337
331
  setErrors(newErrors);
338
332
  };
339
333
 
340
- const setErrors = errors => {
334
+ const setErrors = (errors) => {
341
335
  dispatch({
342
336
  type: 'SET_ERRORS',
343
337
  errors,
@@ -384,7 +378,7 @@ function EditView() {
384
378
  };
385
379
 
386
380
  const shouldShowDPEvents = useMemo(
387
- () => collectionTypes.some(ct => ct.options.draftAndPublish === true),
381
+ () => collectionTypes.some((ct) => ct.options.draftAndPublish === true),
388
382
  [collectionTypes]
389
383
  );
390
384
 
@@ -410,7 +404,7 @@ function EditView() {
410
404
  <div className="form-wrapper">
411
405
  <div className="form-card">
412
406
  <div className="row">
413
- {Object.keys(form).map(key => {
407
+ {Object.keys(form).map((key) => {
414
408
  return (
415
409
  <div key={key} className={form[key].styleName}>
416
410
  <InputsIndex
@@ -22,13 +22,13 @@ const initialState = fromJS({
22
22
  const reducer = (state, action) => {
23
23
  switch (action.type) {
24
24
  case 'ADD_NEW_HEADER':
25
- return state.updateIn(['modifiedData', ...action.keys], arr => arr.push(fromJS(header)));
25
+ return state.updateIn(['modifiedData', ...action.keys], (arr) => arr.push(fromJS(header)));
26
26
  case 'GET_DATA_SUCCEEDED': {
27
27
  const headers = get(action, ['data', 'headers'], {});
28
28
  let formattedHeaders = [header];
29
29
 
30
30
  if (Object.keys(headers).length > 0) {
31
- formattedHeaders = Object.keys(headers).map(key => {
31
+ formattedHeaders = Object.keys(headers).map((key) => {
32
32
  return { key, value: headers[key] };
33
33
  });
34
34
  }
@@ -43,7 +43,7 @@ const reducer = (state, action) => {
43
43
  case 'ON_CHANGE':
44
44
  return state.updateIn(['modifiedData', ...action.keys], () => action.value);
45
45
  case 'ON_HEADER_REMOVE': {
46
- return state.updateIn(['modifiedData', 'headers'], headers => {
46
+ return state.updateIn(['modifiedData', 'headers'], (headers) => {
47
47
  if (headers.size === 1) {
48
48
  return fromJS([header]);
49
49
  }
@@ -58,7 +58,7 @@ const reducer = (state, action) => {
58
58
  case 'SET_ERRORS':
59
59
  return state.update('formErrors', () => fromJS(action.errors));
60
60
  case 'SET_IS_TRIGGERING':
61
- return state.update('isTriggering', isTriggering => !isTriggering);
61
+ return state.update('isTriggering', (isTriggering) => !isTriggering);
62
62
  case 'SUBMIT_SUCCEEDED':
63
63
  return state.update('initialData', () => state.get('modifiedData'));
64
64
  case 'TRIGGER_SUCCEEDED':
@@ -1,6 +1,6 @@
1
1
  import { set } from 'lodash';
2
2
 
3
- const cleanData = data => {
3
+ const cleanData = (data) => {
4
4
  const webhooks = data;
5
5
 
6
6
  set(webhooks, 'headers', unformatHeaders(data.headers));
@@ -8,7 +8,7 @@ const cleanData = data => {
8
8
  return webhooks;
9
9
  };
10
10
 
11
- const unformatHeaders = headers => {
11
+ const unformatHeaders = (headers) => {
12
12
  return headers.reduce((acc, current) => {
13
13
  const { key, value } = current;
14
14
 
@@ -11,7 +11,7 @@ const schema = yup.object().shape({
11
11
  .string(translatedErrors.string)
12
12
  .required(translatedErrors.required)
13
13
  .matches(URL_REGEX, translatedErrors.regex),
14
- headers: yup.lazy(array => {
14
+ headers: yup.lazy((array) => {
15
15
  let baseSchema = yup.array();
16
16
 
17
17
  if (array.length === 1) {
@@ -54,7 +54,7 @@ function ListView() {
54
54
  }
55
55
  }, [canRead]);
56
56
 
57
- const getWebhookIndex = id => webhooks.findIndex(webhook => webhook.id === id);
57
+ const getWebhookIndex = (id) => webhooks.findIndex((webhook) => webhook.id === id);
58
58
 
59
59
  // New button
60
60
  const addBtnLabel = formatMessage({
@@ -67,7 +67,7 @@ function ListView() {
67
67
  color: 'primary',
68
68
  type: 'button',
69
69
  icon: <Plus fill="#007eff" width="11px" height="11px" />,
70
- Component: props => {
70
+ Component: (props) => {
71
71
  if (canCreate) {
72
72
  return <Button {...props} />;
73
73
  }
@@ -213,7 +213,7 @@ function ListView() {
213
213
  setShowModal(false);
214
214
  };
215
215
 
216
- const handleDeleteClick = id => {
216
+ const handleDeleteClick = (id) => {
217
217
  setShowModal(true);
218
218
 
219
219
  dispatch({
@@ -264,7 +264,7 @@ function ListView() {
264
264
  }
265
265
  };
266
266
 
267
- const handleGoTo = to => {
267
+ const handleGoTo = (to) => {
268
268
  push(`${pathname}/${to}`);
269
269
  };
270
270
 
@@ -281,7 +281,7 @@ function ListView() {
281
281
  {rowsCount > 0 ? (
282
282
  <List
283
283
  {...listProps}
284
- customRowComponent={props => {
284
+ customRowComponent={(props) => {
285
285
  return (
286
286
  <ListRow
287
287
  {...props}
@@ -15,24 +15,24 @@ const reducer = (state, action) => {
15
15
  case 'SET_WEBHOOK_TO_DELETE':
16
16
  return state.update('webhookToDelete', () => action.id);
17
17
  case 'SET_WEBHOOKS_TO_DELETE':
18
- return state.update('webhooksToDelete', list => {
18
+ return state.update('webhooksToDelete', (list) => {
19
19
  if (action.value) {
20
20
  return list.push(action.id);
21
21
  }
22
22
 
23
- return list.filter(data => data !== action.id);
23
+ return list.filter((data) => data !== action.id);
24
24
  });
25
25
  case 'WEBHOOKS_DELETED':
26
26
  return state
27
- .update('webhooks', webhooks =>
28
- webhooks.filter(webhook => {
27
+ .update('webhooks', (webhooks) =>
28
+ webhooks.filter((webhook) => {
29
29
  return !state.get('webhooksToDelete').includes(webhook.get('id'));
30
30
  })
31
31
  )
32
32
  .update('webhooksToDelete', () => []);
33
33
  case 'WEBHOOK_DELETED':
34
34
  return state
35
- .update('webhooks', webhooks => webhooks.remove(action.index))
35
+ .update('webhooks', (webhooks) => webhooks.remove(action.index))
36
36
  .update('webhookToDelete', () => null);
37
37
  default:
38
38
  return state;
@@ -4,11 +4,7 @@ import PropTypes from 'prop-types';
4
4
  const MarketPlaceContext = createContext({});
5
5
 
6
6
  const MarketPlaceContextProvider = ({ children, ...rest }) => {
7
- return (
8
- <MarketPlaceContext.Provider value={rest}>
9
- {children}
10
- </MarketPlaceContext.Provider>
11
- );
7
+ return <MarketPlaceContext.Provider value={rest}>{children}</MarketPlaceContext.Provider>;
12
8
  };
13
9
 
14
10
  const useMarketPlaceContext = () => useContext(MarketPlaceContext);
@@ -18,8 +14,4 @@ MarketPlaceContextProvider.propTypes = {
18
14
  downloadPlugin: PropTypes.func.isRequired,
19
15
  };
20
16
 
21
- export {
22
- MarketPlaceContext,
23
- MarketPlaceContextProvider,
24
- useMarketPlaceContext,
25
- };
17
+ export { MarketPlaceContext, MarketPlaceContextProvider, useMarketPlaceContext };
@@ -3,7 +3,7 @@ import { request } from 'strapi-helper-plugin';
3
3
 
4
4
  import reducer, { initialState } from './reducer';
5
5
 
6
- const useFetchPermissionsLayout = id => {
6
+ const useFetchPermissionsLayout = (id) => {
7
7
  const [{ data, error, isLoading }, dispatch] = useReducer(reducer, initialState);
8
8
 
9
9
  useEffect(() => {
@@ -8,7 +8,7 @@ export const initialState = {
8
8
  };
9
9
 
10
10
  const reducer = (state, action) =>
11
- produce(state, draftState => {
11
+ produce(state, (draftState) => {
12
12
  switch (action.type) {
13
13
  case 'GET_DATA': {
14
14
  draftState.isLoading = true;
@@ -31,7 +31,7 @@ const useFetchPluginsFromMarketPlace = () => {
31
31
  // Silent
32
32
  } else {
33
33
  // handle error
34
- setState(prev => ({ ...prev, isLoading: false, error: true }));
34
+ setState((prev) => ({ ...prev, isLoading: false, error: true }));
35
35
  }
36
36
  }
37
37
  };
@@ -2,7 +2,7 @@ import { useCallback, useReducer, useEffect } from 'react';
2
2
  import { request } from 'strapi-helper-plugin';
3
3
  import reducer, { initialState } from './reducer';
4
4
 
5
- const useFetchRole = id => {
5
+ const useFetchRole = (id) => {
6
6
  const [state, dispatch] = useReducer(reducer, initialState);
7
7
 
8
8
  useEffect(() => {
@@ -19,10 +19,10 @@ const useFetchRole = id => {
19
19
  // eslint-disable-next-line react-hooks/exhaustive-deps
20
20
  }, [id]);
21
21
 
22
- const fetchRole = async roleId => {
22
+ const fetchRole = async (roleId) => {
23
23
  try {
24
24
  const [{ data: role }, { data: permissions }] = await Promise.all(
25
- [`roles/${roleId}`, `roles/${roleId}/permissions`].map(endPoint =>
25
+ [`roles/${roleId}`, `roles/${roleId}/permissions`].map((endPoint) =>
26
26
  request(`/admin/${endPoint}`, { method: 'GET' })
27
27
  )
28
28
  );
@@ -45,7 +45,7 @@ const useFetchRole = id => {
45
45
  }
46
46
  };
47
47
 
48
- const handleSubmitSucceeded = useCallback(data => {
48
+ const handleSubmitSucceeded = useCallback((data) => {
49
49
  dispatch({
50
50
  type: 'ON_SUBMIT_SUCCEEDED',
51
51
  ...data,
@@ -8,7 +8,7 @@ export const initialState = {
8
8
  };
9
9
 
10
10
  const reducer = (state, action) =>
11
- produce(state, draftState => {
11
+ produce(state, (draftState) => {
12
12
  switch (action.type) {
13
13
  case 'GET_DATA_SUCCEEDED': {
14
14
  draftState.role = action.role;
@@ -17,7 +17,7 @@ const useModels = () => {
17
17
 
18
18
  try {
19
19
  const [{ data: components }, { data: contentTypes }] = await Promise.all(
20
- ['components', 'content-types'].map(endPoint =>
20
+ ['components', 'content-types'].map((endPoint) =>
21
21
  request(`/content-manager/${endPoint}`, { method: 'GET' })
22
22
  )
23
23
  );
@@ -9,7 +9,7 @@ export const initialState = {
9
9
  };
10
10
 
11
11
  const reducer = (state, action) =>
12
- produce(state, draftState => {
12
+ produce(state, (draftState) => {
13
13
  switch (action.type) {
14
14
  case 'GET_MODELS': {
15
15
  draftState.collectionTypes = initialState.collectionTypes;
@@ -26,9 +26,9 @@ const reducer = (state, action) =>
26
26
  break;
27
27
  }
28
28
  case 'GET_MODELS_SUCCEDED': {
29
- const getContentTypeByKind = kind =>
29
+ const getContentTypeByKind = (kind) =>
30
30
  action.contentTypes.filter(
31
- contentType => contentType.isDisplayed && contentType.kind === kind
31
+ (contentType) => contentType.isDisplayed && contentType.kind === kind
32
32
  );
33
33
 
34
34
  draftState.isLoading = false;
@@ -7,7 +7,7 @@ export const initialState = {
7
7
  };
8
8
 
9
9
  const reducer = (state, action) =>
10
- produce(state, draftState => {
10
+ produce(state, (draftState) => {
11
11
  switch (action.type) {
12
12
  case 'GET_DATA': {
13
13
  draftState.isLoading = true;
@@ -59,7 +59,7 @@ const useSettingsForm = (endPoint, schema, cbSuccess, fieldsToPick) => {
59
59
  });
60
60
  };
61
61
 
62
- const handleSubmit = async e => {
62
+ const handleSubmit = async (e) => {
63
63
  e.preventDefault();
64
64
 
65
65
  const errors = await checkFormValidity(modifiedData, schema);
@@ -80,7 +80,7 @@ const useSettingsForm = (endPoint, schema, cbSuccess, fieldsToPick) => {
80
80
  const cleanedData = omit(modifiedData, ['confirmPassword', 'registrationToken']);
81
81
 
82
82
  if (cleanedData.roles) {
83
- cleanedData.roles = cleanedData.roles.map(role => role.id);
83
+ cleanedData.roles = cleanedData.roles.map((role) => role.id);
84
84
  }
85
85
 
86
86
  const { data } = await request(endPoint, {
@@ -13,7 +13,7 @@ const initialState = {
13
13
  };
14
14
 
15
15
  const reducer = (state, action) =>
16
- produce(state, draftState => {
16
+ produce(state, (draftState) => {
17
17
  switch (action.type) {
18
18
  case 'GET_DATA_SUCCEEDED': {
19
19
  draftState.isLoading = false;
@@ -20,9 +20,9 @@ const useSettingsMenu = (noCheck = false) => {
20
20
  return { hasPermission, path };
21
21
  };
22
22
 
23
- const generateArrayOfPromises = array => {
23
+ const generateArrayOfPromises = (array) => {
24
24
  return array.reduce((acc, current, sectionIndex) => {
25
- const generateArrayOfPromises = array =>
25
+ const generateArrayOfPromises = (array) =>
26
26
  array.map((link, index) =>
27
27
  checkPermissions(array[index].permissions, `${sectionIndex}.links.${index}`)
28
28
  );
@@ -8,10 +8,10 @@ const initialState = {
8
8
 
9
9
  const reducer = (state, action) =>
10
10
  // eslint-disable-next-line consistent-return
11
- produce(state, draftState => {
11
+ produce(state, (draftState) => {
12
12
  switch (action.type) {
13
13
  case 'CHECK_PERMISSIONS_SUCCEEDED': {
14
- action.data.forEach(checkedPermissions => {
14
+ action.data.forEach((checkedPermissions) => {
15
15
  if (checkedPermissions.hasPermission) {
16
16
  set(
17
17
  draftState,
@@ -24,7 +24,7 @@ const reducer = (state, action) =>
24
24
  // Remove the not needed links in each section
25
25
  draftState.menu.forEach((section, sectionIndex) => {
26
26
  draftState.menu[sectionIndex].links = section.links.filter(
27
- link => link.isDisplayed === true
27
+ (link) => link.isDisplayed === true
28
28
  );
29
29
  });
30
30
 
@@ -1,6 +1,6 @@
1
- const formatLinks = menu => {
2
- return menu.map(menuSection => {
3
- const formattedLinks = menuSection.links.map(link => ({
1
+ const formatLinks = (menu) => {
2
+ return menu.map((menuSection) => {
3
+ const formattedLinks = menuSection.links.map((link) => ({
4
4
  ...link,
5
5
  isDisplayed: false,
6
6
  }));
@@ -28,8 +28,8 @@ module.exports = {
28
28
  .default,
29
29
  'strapi-plugin-content-manager': require('../../../strapi-plugin-content-manager/admin/src')
30
30
  .default,
31
- 'strapi-plugin-content-type-builder': require('../../../strapi-plugin-content-type-builder/admin/src')
32
- .default,
31
+ 'strapi-plugin-content-type-builder':
32
+ require('../../../strapi-plugin-content-type-builder/admin/src').default,
33
33
  'strapi-plugin-email': require('../../../strapi-plugin-email/admin/src').default,
34
34
  'strapi-plugin-upload': require('../../../strapi-plugin-upload/admin/src').default,
35
35
  'strapi-plugin-graphql': require('../../../strapi-plugin-graphql/admin/src').default,
@@ -13,9 +13,7 @@ const remoteURL = (() => {
13
13
  return process.env.REMOTE_URL.replace(/\/$/, '');
14
14
  })();
15
15
  const backendURL =
16
- process.env.BACKEND_URL === '/'
17
- ? window.location.origin
18
- : process.env.BACKEND_URL;
16
+ process.env.BACKEND_URL === '/' ? window.location.origin : process.env.BACKEND_URL;
19
17
 
20
18
  // Retrieve development URL to avoid to re-build.
21
19
  const $body = document.getElementsByTagName('body')[0];
@@ -4,7 +4,7 @@ import invariant from 'invariant';
4
4
  class ComponentApi {
5
5
  components = {};
6
6
 
7
- getComponent = name => {
7
+ getComponent = (name) => {
8
8
  invariant(name, 'A name must be provided');
9
9
 
10
10
  return cloneDeep(this.components[name]) || null;
@@ -20,7 +20,7 @@ class ComponentApi {
20
20
  }, {});
21
21
  };
22
22
 
23
- registerComponent = component => {
23
+ registerComponent = (component) => {
24
24
  const { name, Component } = component;
25
25
 
26
26
  invariant(Component, 'A Component must be provided');
@@ -30,7 +30,7 @@ class ComponentApi {
30
30
  this.components[name] = { Component };
31
31
  };
32
32
 
33
- removeComponent = name => {
33
+ removeComponent = (name) => {
34
34
  invariant(name, 'A name must be provided in order to remove a field');
35
35
 
36
36
  delete this.components[name];
@@ -10,7 +10,7 @@ import invariant from 'invariant';
10
10
  class FieldApi {
11
11
  fields = {};
12
12
 
13
- getField = type => {
13
+ getField = (type) => {
14
14
  invariant(type, 'A type must be provided');
15
15
 
16
16
  return cloneDeep(this.fields[type]) || null;
@@ -26,7 +26,7 @@ class FieldApi {
26
26
  }, {});
27
27
  };
28
28
 
29
- registerField = field => {
29
+ registerField = (field) => {
30
30
  const { type, Component } = field;
31
31
 
32
32
  invariant(Component, 'A Component must be provided');
@@ -36,7 +36,7 @@ class FieldApi {
36
36
  this.fields[type] = { Component };
37
37
  };
38
38
 
39
- removeField = type => {
39
+ removeField = (type) => {
40
40
  invariant(type, 'A type must be provided in order to remove a field');
41
41
 
42
42
  delete this.fields[type];
@@ -47,4 +47,4 @@ class Plugin {
47
47
  }
48
48
  }
49
49
 
50
- export default pluginConf => new Plugin(pluginConf);
50
+ export default (pluginConf) => new Plugin(pluginConf);
@@ -12,11 +12,11 @@ class Strapi {
12
12
 
13
13
  plugins = {};
14
14
 
15
- getPlugin = pluginId => {
15
+ getPlugin = (pluginId) => {
16
16
  return this.plugins[pluginId];
17
17
  };
18
18
 
19
- registerPlugin = pluginConf => {
19
+ registerPlugin = (pluginConf) => {
20
20
  if (pluginConf.id) {
21
21
  this.plugins[pluginConf.id] = PluginHandler(pluginConf);
22
22
  }
@@ -17,8 +17,5 @@ export default function checkStore(store) {
17
17
  injectedSagas: isObject,
18
18
  };
19
19
 
20
- invariant(
21
- conformsTo(store, shape),
22
- '(app/utils...) injectors: Expected a valid redux store',
23
- );
20
+ invariant(conformsTo(store, shape), '(app/utils...) injectors: Expected a valid redux store');
24
21
  }