@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
@@ -13,8 +13,8 @@ const Wrapper = styled.div`
13
13
  top: 0;
14
14
  left: 0;
15
15
  height: 100vh;
16
- width: ${props => props.theme.main.sizes.leftMenu.width};
17
- background: ${props => props.theme.main.colors.strapi['blue-darker']};
16
+ width: ${(props) => props.theme.main.sizes.leftMenu.width};
17
+ background: ${(props) => props.theme.main.colors.strapi['blue-darker']};
18
18
 
19
19
  /* scrollbar overrides */
20
20
  * {
@@ -28,15 +28,15 @@ const Wrapper = styled.div`
28
28
  }
29
29
 
30
30
  ::-webkit-scrollbar-thumb {
31
- background-color: ${props => props.theme.main.colors.leftMenu['title-color']};
31
+ background-color: ${(props) => props.theme.main.colors.leftMenu['title-color']};
32
32
  }
33
33
 
34
34
  ::-webkit-scrollbar-thumb:hover {
35
- background-color: ${props => props.theme.main.colors.leftMenu['link-color']};
35
+ background-color: ${(props) => props.theme.main.colors.leftMenu['link-color']};
36
36
  }
37
37
 
38
38
  /* firefox */
39
- scrollbar-color: ${props => props.theme.main.colors.leftMenu['title-color']} transparent;
39
+ scrollbar-color: ${(props) => props.theme.main.colors.leftMenu['title-color']} transparent;
40
40
  }
41
41
  `;
42
42
 
@@ -45,7 +45,7 @@ const initialState = {
45
45
  };
46
46
 
47
47
  const reducer = (state = initialState, action) =>
48
- produce(state, draftState => {
48
+ produce(state, (draftState) => {
49
49
  switch (action.type) {
50
50
  case SET_CT_OR_ST_LINKS: {
51
51
  const { authorizedCtLinks, authorizedStLinks } = action.data;
@@ -1,3 +1,3 @@
1
- const selectMenuLinks = state => state.get('menu');
1
+ const selectMenuLinks = (state) => state.get('menu');
2
2
 
3
3
  export default selectMenuLinks;
@@ -3,8 +3,8 @@ import { stringify } from 'qs';
3
3
 
4
4
  const generateLinks = (links, type, configurations = []) => {
5
5
  return links
6
- .filter(link => link.isDisplayed)
7
- .map(link => {
6
+ .filter((link) => link.isDisplayed)
7
+ .map((link) => {
8
8
  const collectionTypesPermissions = [
9
9
  { action: 'plugins::content-manager.explorer.create', subject: link.uid },
10
10
  { action: 'plugins::content-manager.explorer.read', subject: link.uid },
@@ -2,13 +2,14 @@ import { request } from 'strapi-helper-plugin';
2
2
  import generateModelsLinks from './generateModelsLinks';
3
3
  import checkPermissions from './checkPermissions';
4
4
 
5
- const getCtOrStLinks = async userPermissions => {
5
+ const getCtOrStLinks = async (userPermissions) => {
6
6
  const requestURL = '/content-manager/content-types';
7
7
 
8
8
  try {
9
- const {
10
- data: contentTypeConfigurations,
11
- } = await request('/content-manager/content-types-settings', { method: 'GET' });
9
+ const { data: contentTypeConfigurations } = await request(
10
+ '/content-manager/content-types-settings',
11
+ { method: 'GET' }
12
+ );
12
13
 
13
14
  const { data } = await request(requestURL, { method: 'GET' });
14
15
  const { collectionTypesSectionLinks, singleTypesSectionLinks } = generateModelsLinks(
@@ -18,7 +18,7 @@ const getGeneralLinks = async (
18
18
 
19
19
  const settingsLinkPermissions = getSettingsMenuLinksPermissions(settingsMenu);
20
20
  const settingsLinkIndex = authorizedGeneralSectionLinks.findIndex(
21
- obj => obj.destination === SETTINGS_BASE_URL
21
+ (obj) => obj.destination === SETTINGS_BASE_URL
22
22
  );
23
23
 
24
24
  if (settingsLinkIndex === -1) {
@@ -1,6 +1,6 @@
1
1
  import { get, isEmpty } from 'lodash';
2
2
 
3
- const getSettingsMenuLinksPermissions = menu =>
3
+ const getSettingsMenuLinksPermissions = (menu) =>
4
4
  menu.reduce((acc, current) => {
5
5
  const links = get(current, 'links', []);
6
6
 
@@ -2,14 +2,14 @@ import get from 'lodash/get';
2
2
  import omit from 'lodash/omit';
3
3
  import sortLinks from '../../../utils/sortLinks';
4
4
 
5
- const toPluginLinks = plugins => {
5
+ const toPluginLinks = (plugins) => {
6
6
  const pluginsLinks = Object.values(plugins).reduce((acc, current) => {
7
7
  const pluginsSectionLinks = get(current, 'menu.pluginsSectionLinks', []);
8
8
 
9
9
  return [...acc, ...pluginsSectionLinks];
10
10
  }, []);
11
11
 
12
- const sortedLinks = sortLinks(pluginsLinks).map(link => {
12
+ const sortedLinks = sortLinks(pluginsLinks).map((link) => {
13
13
  return { ...omit(link, 'name') };
14
14
  });
15
15
 
@@ -20,7 +20,7 @@ export class LocaleToggle extends React.Component {
20
20
  // eslint-disable-line
21
21
  state = { isOpen: false };
22
22
 
23
- toggle = () => this.setState(prevState => ({ isOpen: !prevState.isOpen }));
23
+ toggle = () => this.setState((prevState) => ({ isOpen: !prevState.isOpen }));
24
24
 
25
25
  render() {
26
26
  const {
@@ -37,7 +37,7 @@ export class LocaleToggle extends React.Component {
37
37
  </DropdownToggle>
38
38
 
39
39
  <DropdownMenu className={style}>
40
- {languages.map(language => (
40
+ {languages.map((language) => (
41
41
  <DropdownItem
42
42
  key={language}
43
43
  onClick={() => this.props.changeLocale(language)}
@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
3
3
  /**
4
4
  * Direct selector to the localeToggle state domain
5
5
  */
6
- const selectLocaleToggle = () => state => state.get('localeToggle');
6
+ const selectLocaleToggle = () => (state) => state.get('localeToggle');
7
7
 
8
8
  /**
9
9
  * Other specific selectors
@@ -14,12 +14,9 @@ const selectLocaleToggle = () => state => state.get('localeToggle');
14
14
  */
15
15
 
16
16
  const makeSelectLocaleToggle = () =>
17
- createSelector(
18
- selectLocaleToggle(),
19
- substate => {
20
- return substate ? substate.toJS() : substate;
21
- }
22
- );
17
+ createSelector(selectLocaleToggle(), (substate) => {
18
+ return substate ? substate.toJS() : substate;
19
+ });
23
20
 
24
21
  export default makeSelectLocaleToggle;
25
22
  export { selectLocaleToggle };
@@ -43,7 +43,7 @@ class PluginCard extends React.Component {
43
43
  this.setState({ boostrapCol });
44
44
  };
45
45
 
46
- handleDownloadPlugin = e => {
46
+ handleDownloadPlugin = (e) => {
47
47
  const {
48
48
  autoReload,
49
49
  currentEnvironment,
@@ -98,7 +98,7 @@ class PluginCard extends React.Component {
98
98
  <img src={this.props.plugin.logo} alt="icon" />
99
99
  </div>
100
100
  <div
101
- onClick={e => {
101
+ onClick={(e) => {
102
102
  window.open(
103
103
  `https://github.com/strapi/strapi/tree/master/packages/strapi-plugin-${this.props.plugin.id}`,
104
104
  '_blank'
@@ -109,7 +109,7 @@ class PluginCard extends React.Component {
109
109
  </div>
110
110
  </div>
111
111
  <div className="cardDescription">{descriptions.long}</div>
112
- <div className="cardFooter" onClick={e => e.stopPropagation()}>
112
+ <div className="cardFooter" onClick={(e) => e.stopPropagation()}>
113
113
  <div className="cardFooterButton">
114
114
  <CheckPermissions permissions={adminPermissions.marketplace.install}>
115
115
  <Button
@@ -23,7 +23,7 @@ const MarketPlacePage = () => {
23
23
  return <LoadingIndicatorPage />;
24
24
  }
25
25
 
26
- const handleDownloadPlugin = async pluginId => {
26
+ const handleDownloadPlugin = async (pluginId) => {
27
27
  emitEvent('willInstallPlugin', { plugin: pluginId });
28
28
 
29
29
  // Force the Overlayblocker to be displayed
@@ -80,7 +80,7 @@ const MarketPlacePage = () => {
80
80
  />
81
81
  <MarketplaceBanner />
82
82
  <div className="row" style={{ paddingTop: '4.1rem' }}>
83
- {data.map(plugin => {
83
+ {data.map((plugin) => {
84
84
  return (
85
85
  <PluginCard
86
86
  autoReload={autoReload}
@@ -27,19 +27,11 @@ const types = {
27
27
  const Notification = ({ notification }) => {
28
28
  const { formatMessage } = useIntl();
29
29
  const dispatch = useDispatch();
30
- const {
31
- title,
32
- message,
33
- link,
34
- type,
35
- id,
36
- onClose,
37
- timeout,
38
- blockTransition,
39
- centered,
40
- } = notification;
30
+ const { title, message, link, type, id, onClose, timeout, blockTransition, centered } =
31
+ notification;
41
32
 
42
- const formattedMessage = msg => (typeof msg === 'string' ? msg : formatMessage(msg, msg.values));
33
+ const formattedMessage = (msg) =>
34
+ typeof msg === 'string' ? msg : formatMessage(msg, msg.values);
43
35
 
44
36
  const handleClose = useCallback(() => {
45
37
  if (onClose) {
@@ -7,7 +7,7 @@ const NotificationWrapper = styled.div`
7
7
  border-bottom-right-radius: ${({ theme }) => theme.main.sizes.borderRadius};
8
8
  margin-bottom: ${({ theme }) => theme.main.sizes.paddings.sm};
9
9
  box-shadow: 0 2px 4px 0 ${({ theme }) => theme.main.colors.darkGrey};
10
- background-color: ${props => props.theme.main.colors.white};
10
+ background-color: ${(props) => props.theme.main.colors.white};
11
11
  border-left: 2px solid ${({ theme, color }) => theme.main.colors[color]};
12
12
  overflow: hidden;
13
13
  z-index: 10;
@@ -12,11 +12,11 @@ import Notification from './Notification';
12
12
  import NotificationsWrapper from './Wrapper';
13
13
 
14
14
  const NotificationsContainer = () => {
15
- const notifications = useSelector(state => state.get('newNotification').notifications);
15
+ const notifications = useSelector((state) => state.get('newNotification').notifications);
16
16
 
17
17
  return (
18
18
  <NotificationsWrapper>
19
- {notifications.map(notification => (
19
+ {notifications.map((notification) => (
20
20
  <CSSTransition
21
21
  key={notification.id}
22
22
  classNames="notification"
@@ -9,7 +9,7 @@ const initialState = {
9
9
 
10
10
  const notificationReducer = (state = initialState, action) =>
11
11
  // eslint-disable-next-line consistent-return
12
- produce(state, draftState => {
12
+ produce(state, (draftState) => {
13
13
  switch (action.type) {
14
14
  case SHOW_NEW_NOTIFICATION: {
15
15
  draftState.notifications.push({
@@ -32,7 +32,7 @@ const notificationReducer = (state = initialState, action) =>
32
32
  break;
33
33
  }
34
34
  case HIDE_NEW_NOTIFICATION: {
35
- const indexToRemove = state.notifications.findIndex(notif => notif.id === action.id);
35
+ const indexToRemove = state.notifications.findIndex((notif) => notif.id === action.id);
36
36
 
37
37
  if (indexToRemove !== -1) {
38
38
  draftState.notifications.splice(indexToRemove, 1);
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import { NotFound } from 'strapi-helper-plugin';
15
15
 
16
- const NotFoundPage = props => <NotFound {...props} />;
16
+ const NotFoundPage = (props) => <NotFound {...props} />;
17
17
 
18
18
  NotFoundPage.propTypes = {
19
19
  history: PropTypes.shape({
@@ -15,7 +15,7 @@ export function showNotification(message, status) {
15
15
  nextNotificationId++; // eslint-disable-line no-plusplus
16
16
 
17
17
  // Start timeout to hide the notification
18
- (id => {
18
+ ((id) => {
19
19
  setTimeout(() => {
20
20
  dispatch(hideNotification(id));
21
21
  }, 2500);
@@ -35,7 +35,7 @@ const mapStateToProps = createStructuredSelector({
35
35
 
36
36
  function mapDispatchToProps(dispatch) {
37
37
  return {
38
- onHideNotification: id => {
38
+ onHideNotification: (id) => {
39
39
  dispatch(hideNotification(id));
40
40
  },
41
41
  dispatch,
@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
3
3
  /**
4
4
  * Direct selector to the notificationProvider state domain
5
5
  */
6
- const selectNotificationProviderDomain = () => state => state.get('notification');
6
+ const selectNotificationProviderDomain = () => (state) => state.get('notification');
7
7
 
8
8
  /**
9
9
  * Other specific selectors
@@ -14,12 +14,12 @@ const selectNotificationProviderDomain = () => state => state.get('notification'
14
14
  */
15
15
 
16
16
  const selectNotificationProvider = () =>
17
- createSelector(selectNotificationProviderDomain(), notificationProviderState =>
17
+ createSelector(selectNotificationProviderDomain(), (notificationProviderState) =>
18
18
  notificationProviderState.toJS()
19
19
  );
20
20
 
21
21
  const selectNotifications = () =>
22
- createSelector(selectNotificationProviderDomain(), notificationProviderState =>
22
+ createSelector(selectNotificationProviderDomain(), (notificationProviderState) =>
23
23
  notificationProviderState.get('notifications')
24
24
  );
25
25
 
@@ -21,12 +21,12 @@ function StaticLinks() {
21
21
  icon: 'file',
22
22
  label: formatMessage({ id: 'app.static.links.cheatsheet' }),
23
23
  destination: 'https://strapi-showcase.s3-us-west-2.amazonaws.com/CheatSheet.pdf',
24
- }
24
+ },
25
25
  ];
26
26
 
27
27
  return (
28
28
  <ul className="list">
29
- {staticLinks.map(link => {
29
+ {staticLinks.map((link) => {
30
30
  const { icon, label, destination } = link;
31
31
 
32
32
  return (
@@ -45,7 +45,7 @@ class OnboardingVideo extends React.Component {
45
45
  }
46
46
  };
47
47
 
48
- handleCurrentTimeChange = curr => {
48
+ handleCurrentTimeChange = (curr) => {
49
49
  this.props.getVideoCurrentTime(this.props.id, curr, this.props.video.duration);
50
50
  };
51
51
 
@@ -56,7 +56,7 @@ const OnboardingVideos = () => {
56
56
  dispatch({ type: 'SET_IS_OPEN' });
57
57
  emitEvent(eventName);
58
58
  };
59
- const handleClickOpenVideo = videoIndexToOpen => {
59
+ const handleClickOpenVideo = (videoIndexToOpen) => {
60
60
  dispatch({
61
61
  type: 'TOGGLE_VIDEO_MODAL',
62
62
  videoIndexToOpen,
@@ -88,7 +88,7 @@ const OnboardingVideos = () => {
88
88
  <FormattedMessage id="app.components.Onboarding.title" />
89
89
  </p>
90
90
  <p>
91
- {Math.floor((videos.filter(v => v.end).length * 100) / videos.length)}
91
+ {Math.floor((videos.filter((v) => v.end).length * 100) / videos.length)}
92
92
  <FormattedMessage id="app.components.Onboarding.label.completed" />
93
93
  </p>
94
94
  </div>
@@ -1,4 +1,4 @@
1
- const init = initialState => {
1
+ const init = (initialState) => {
2
2
  return initialState;
3
3
  };
4
4
 
@@ -14,30 +14,30 @@ const reducer = (state, action) => {
14
14
  .update('isLoading', () => false)
15
15
  .update('videos', () => fromJS(action.videos));
16
16
  case 'SET_IS_OPEN':
17
- return state.update('isOpen', v => !v);
17
+ return state.update('isOpen', (v) => !v);
18
18
  case 'SET_VIDEO_DURATION':
19
19
  return state.updateIn(['videos', action.videoIndex, 'duration'], () => {
20
20
  return parseFloat(action.duration, 10);
21
21
  });
22
22
  case 'TOGGLE_VIDEO_MODAL':
23
- return state.update('videos', list => {
23
+ return state.update('videos', (list) => {
24
24
  return list.map((item, index) => {
25
25
  if (index === action.videoIndexToOpen) {
26
- return item.update('isOpen', v => !v);
26
+ return item.update('isOpen', (v) => !v);
27
27
  }
28
28
 
29
29
  return item.set('isOpen', false);
30
30
  });
31
31
  });
32
32
  case 'UPDATE_VIDEO_STARTED_TIME_AND_PLAYED_INFOS': {
33
- const updatedState = state.updateIn(['videos', action.videoIndex], video => {
33
+ const updatedState = state.updateIn(['videos', action.videoIndex], (video) => {
34
34
  const elapsedTime = parseFloat(action.elapsedTime, 10);
35
35
  const videoDuration = parseFloat(video.get('duration', 10));
36
36
  const percentElapsedTime = (elapsedTime * 100) / videoDuration;
37
37
 
38
38
  return video
39
39
  .update('startTime', () => elapsedTime)
40
- .update('end', oldValue => {
40
+ .update('end', (oldValue) => {
41
41
  if (oldValue === true) {
42
42
  return true;
43
43
  }
@@ -46,7 +46,7 @@ const reducer = (state, action) => {
46
46
  });
47
47
  });
48
48
 
49
- const videos = updatedState.get('videos').map(video => video.set('isOpen', false));
49
+ const videos = updatedState.get('videos').map((video) => video.set('isOpen', false));
50
50
 
51
51
  // Update the local storage
52
52
  localStorage.setItem('videos', JSON.stringify(videos.toJS()));
@@ -1,10 +1,10 @@
1
- const formatVideosArray = array => {
1
+ const formatVideosArray = (array) => {
2
2
  const alreadyFetchedVideos = JSON.parse(localStorage.getItem('videos')) || [];
3
3
  const didWatchVideos = alreadyFetchedVideos.length === array.length;
4
4
  let videos;
5
5
 
6
6
  if (!didWatchVideos) {
7
- videos = array.map(video => {
7
+ videos = array.map((video) => {
8
8
  return {
9
9
  ...video,
10
10
  duration: null,
@@ -9,7 +9,7 @@ import {
9
9
  } from './actions';
10
10
 
11
11
  const PermissionsManager = ({ children }) => {
12
- const { isLoading, userPermissions } = useSelector(state => state.get('permissionsManager'));
12
+ const { isLoading, userPermissions } = useSelector((state) => state.get('permissionsManager'));
13
13
 
14
14
  const dispatch = useDispatch();
15
15
  const fetchUserPermissions = async (resetState = false) => {
@@ -23,7 +23,7 @@ const initialState = {
23
23
 
24
24
  const reducer = (state = initialState, action) =>
25
25
  // eslint-disable-next-line consistent-return
26
- produce(state, draftState => {
26
+ produce(state, (draftState) => {
27
27
  switch (action.type) {
28
28
  case GET_USER_PERMISSIONS: {
29
29
  draftState.isLoading = true;
@@ -41,7 +41,7 @@ const reducer = (state = initialState, action) =>
41
41
  draftState.isLoading = false;
42
42
  draftState.userPermissions = action.data;
43
43
  draftState.collectionTypesRelatedPermissions = action.data
44
- .filter(perm => perm.subject)
44
+ .filter((perm) => perm.subject)
45
45
  .reduce((acc, current) => {
46
46
  const { subject, action } = current;
47
47
 
@@ -17,7 +17,7 @@ import { auth } from 'strapi-helper-plugin';
17
17
  const PrivateRoute = ({ component: Component, path, ...rest }) => (
18
18
  <Route
19
19
  path={path}
20
- render={props =>
20
+ render={(props) =>
21
21
  auth.getToken() !== null ? (
22
22
  <Component {...rest} {...props} />
23
23
  ) : (
@@ -19,7 +19,7 @@ const ProfilePage = () => {
19
19
  const changeLanguage = useChangeLanguage();
20
20
  const { formatMessage } = useIntl();
21
21
 
22
- const onSubmitSuccessCb = data => {
22
+ const onSubmitSuccessCb = (data) => {
23
23
  changeLanguage(data.preferedLanguage);
24
24
  auth.setUserInfo(data);
25
25
  };
@@ -66,7 +66,7 @@ const ProfilePage = () => {
66
66
  isLoading={isLoading}
67
67
  title={formatMessage({ id: 'Settings.profile.form.section.profile.title' })}
68
68
  >
69
- {Object.keys(form).map(key => (
69
+ {Object.keys(form).map((key) => (
70
70
  <SizedInput
71
71
  {...form[key]}
72
72
  key={key}
@@ -135,9 +135,9 @@ const ProfilePage = () => {
135
135
  <Select
136
136
  aria-labelledby="interface-language"
137
137
  selectedValue={get(modifiedData, 'preferedLanguage')}
138
- onChange={nextLocaleCode => setField('preferedLanguage', nextLocaleCode)}
138
+ onChange={(nextLocaleCode) => setField('preferedLanguage', nextLocaleCode)}
139
139
  >
140
- {languages.map(language => {
140
+ {languages.map((language) => {
141
141
  const langName = languageNativeNames[language];
142
142
 
143
143
  return (
@@ -61,7 +61,7 @@ const EditPage = () => {
61
61
  ];
62
62
  /* eslint-enable indent */
63
63
 
64
- const handleEditRoleSubmit = async data => {
64
+ const handleEditRoleSubmit = async (data) => {
65
65
  try {
66
66
  strapi.lockAppWithOverlay();
67
67
  setIsSubmiting(true);
@@ -38,20 +38,20 @@ const RoleListPage = () => {
38
38
  }, []);
39
39
 
40
40
  const handleGoTo = useCallback(
41
- id => {
41
+ (id) => {
42
42
  push(`${settingsBaseURL}/roles/${id}`);
43
43
  },
44
44
  // eslint-disable-next-line react-hooks/exhaustive-deps
45
45
  [settingsBaseURL]
46
46
  );
47
47
 
48
- const handleToggle = useCallback(e => {
48
+ const handleToggle = useCallback((e) => {
49
49
  e.preventDefault();
50
50
  e.stopPropagation();
51
- setIsOpen(prev => !prev);
51
+ setIsOpen((prev) => !prev);
52
52
  }, []);
53
53
 
54
- const handleToggleModalForCreatingRole = useCallback(e => {
54
+ const handleToggleModalForCreatingRole = useCallback((e) => {
55
55
  e.preventDefault();
56
56
  e.stopPropagation();
57
57
  emitEvent('didShowRBACUpgradeModal');
@@ -105,7 +105,7 @@ const RoleListPage = () => {
105
105
  )}
106
106
  items={results}
107
107
  isLoading={isLoading}
108
- customRowComponent={role => (
108
+ customRowComponent={(role) => (
109
109
  <RoleRow
110
110
  onClick={() => handleGoTo(role.id)}
111
111
  canUpdate={canUpdate}
@@ -7,7 +7,7 @@ const LeftMenuIcon = styled(({ ...props }) => <FontAwesomeIcon {...props} icon="
7
7
  top: calc(50% - 0.25rem);
8
8
  left: 1.5rem;
9
9
  font-size: 0.5rem;
10
- color: ${props => props.theme.main.colors.leftMenu['link-color']};
10
+ color: ${(props) => props.theme.main.colors.leftMenu['link-color']};
11
11
  `;
12
12
 
13
13
  export default LeftMenuIcon;
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
2
 
3
3
  const MenuWrapper = styled.div`
4
- background-color: ${props => props.theme.main.colors.mediumGrey};
4
+ background-color: ${(props) => props.theme.main.colors.mediumGrey};
5
5
  min-height: 100%;
6
6
  height: calc(100vh - ${({ theme }) => theme.main.sizes.header.height});
7
7
  `;
@@ -72,8 +72,8 @@ function SettingsPage() {
72
72
  // Only display accessible sections
73
73
  const filteredMenu = useMemo(() => getSectionsToDisplay(menu), [menu]);
74
74
 
75
- const toggleHeaderSearch = label =>
76
- setShowHeaderSearchState(prev => {
75
+ const toggleHeaderSearch = (label) =>
76
+ setShowHeaderSearchState((prev) => {
77
77
  if (prev.show) {
78
78
  return {
79
79
  show: false,
@@ -107,7 +107,7 @@ function SettingsPage() {
107
107
  <MenuWrapper>
108
108
  <ApplicationDetailLink />
109
109
  <StyledLeftMenu>
110
- {filteredMenu.map(item => {
110
+ {filteredMenu.map((item) => {
111
111
  return <LeftMenuList {...item} key={item.id} />;
112
112
  })}
113
113
  </StyledLeftMenu>
@@ -1,9 +1,9 @@
1
1
  import { get } from 'lodash';
2
2
  import createRoute from './createRoute';
3
3
 
4
- const retrieveRoutes = links => links.filter(link => typeof link.Component === 'function');
4
+ const retrieveRoutes = (links) => links.filter((link) => typeof link.Component === 'function');
5
5
 
6
- const createPluginsLinksRoutes = menu => {
6
+ const createPluginsLinksRoutes = (menu) => {
7
7
  return menu.reduce((acc, current) => {
8
8
  // The global links are handled by another util
9
9
  if (current.id === 'global') {
@@ -11,7 +11,7 @@ const createPluginsLinksRoutes = menu => {
11
11
  }
12
12
 
13
13
  const filteredLinks = retrieveRoutes(get(current, 'links', []));
14
- const routes = filteredLinks.map(link => {
14
+ const routes = filteredLinks.map((link) => {
15
15
  return createRoute(link.Component, link.to, link.exact);
16
16
  });
17
17
 
@@ -1,11 +1,11 @@
1
1
  import { flatMap } from 'lodash';
2
2
 
3
- const generateArrayOfLinks = array => flatMap(array, 'links');
3
+ const generateArrayOfLinks = (array) => flatMap(array, 'links');
4
4
 
5
- const findFirstAllowedEndpoint = menuArray => {
5
+ const findFirstAllowedEndpoint = (menuArray) => {
6
6
  const arrayOfLinks = generateArrayOfLinks(menuArray);
7
7
 
8
- const link = arrayOfLinks.find(link => link.isDisplayed === true);
8
+ const link = arrayOfLinks.find((link) => link.isDisplayed === true);
9
9
 
10
10
  return link ? link.to : null;
11
11
  };
@@ -1,5 +1,5 @@
1
- const getSectionsToDisplay = menu => {
2
- return menu.filter(section => !section.links.every(link => link.isDisplayed === false));
1
+ const getSectionsToDisplay = (menu) => {
2
+ return menu.filter((section) => !section.links.every((link) => link.isDisplayed === false));
3
3
  };
4
4
 
5
5
  export default getSectionsToDisplay;