@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
package/admin/src/app.js CHANGED
@@ -60,8 +60,8 @@ const strapi = Strapi();
60
60
  const pluginsReducers = {};
61
61
  const pluginsToLoad = [];
62
62
 
63
- Object.keys(plugins).forEach(current => {
64
- const registerPlugin = plugin => {
63
+ Object.keys(plugins).forEach((current) => {
64
+ const registerPlugin = (plugin) => {
65
65
  strapi.registerPlugin(plugin);
66
66
 
67
67
  return plugin;
@@ -98,7 +98,7 @@ Object.keys(plugins).forEach(current => {
98
98
  // Retrieve all reducers
99
99
  const pluginReducers = plugin.reducers || {};
100
100
 
101
- Object.keys(pluginReducers).forEach(reducerName => {
101
+ Object.keys(pluginReducers).forEach((reducerName) => {
102
102
  pluginsReducers[reducerName] = pluginReducers[reducerName];
103
103
  });
104
104
 
@@ -116,7 +116,7 @@ const { dispatch } = store;
116
116
 
117
117
  // Load plugins, this will be removed in the v4, temporary fix until the plugin API
118
118
  // https://plugin-api-rfc.vercel.app/plugin-api/admin.html
119
- pluginsToLoad.forEach(plugin => {
119
+ pluginsToLoad.forEach((plugin) => {
120
120
  const bootPlugin = plugin.boot;
121
121
 
122
122
  if (bootPlugin) {
@@ -143,10 +143,10 @@ const displayNotification = (message, status) => {
143
143
  );
144
144
  dispatch(showNotification(message, status));
145
145
  };
146
- const displayNewNotification = config => {
146
+ const displayNewNotification = (config) => {
147
147
  dispatch(showNewNotification(config));
148
148
  };
149
- const lockApp = data => {
149
+ const lockApp = (data) => {
150
150
  dispatch(freezeApp(data));
151
151
  };
152
152
  const unlockApp = () => {
@@ -169,27 +169,27 @@ window.strapi = Object.assign(window.strapi || {}, {
169
169
  backendURL: BACKEND_URL === '/' ? window.location.origin : BACKEND_URL,
170
170
  notification: {
171
171
  // New notification api
172
- toggle: config => {
172
+ toggle: (config) => {
173
173
  displayNewNotification(config);
174
174
  },
175
- success: message => {
175
+ success: (message) => {
176
176
  displayNotification(message, 'success');
177
177
  },
178
- warning: message => {
178
+ warning: (message) => {
179
179
  displayNotification(message, 'warning');
180
180
  },
181
- error: message => {
181
+ error: (message) => {
182
182
  displayNotification(message, 'error');
183
183
  },
184
- info: message => {
184
+ info: (message) => {
185
185
  displayNotification(message, 'info');
186
186
  },
187
187
  },
188
- refresh: pluginId => ({
189
- translationMessages: translationMessagesUpdated => {
188
+ refresh: (pluginId) => ({
189
+ translationMessages: (translationMessagesUpdated) => {
190
190
  render(merge({}, translationMessages, translationMessagesUpdated));
191
191
  },
192
- leftMenuSections: leftMenuSectionsUpdated => {
192
+ leftMenuSections: (leftMenuSectionsUpdated) => {
193
193
  store.dispatch(updatePlugin(pluginId, 'leftMenuSections', leftMenuSectionsUpdated));
194
194
  },
195
195
  }),
@@ -210,7 +210,7 @@ window.strapi = Object.assign(window.strapi || {}, {
210
210
 
211
211
  const MOUNT_NODE = document.getElementById('app') || document.createElement('div');
212
212
 
213
- const render = messages => {
213
+ const render = (messages) => {
214
214
  ReactDOM.render(
215
215
  <Provider store={store}>
216
216
  <StrapiProvider strapi={strapi}>
@@ -9,16 +9,16 @@ import PropTypes from 'prop-types';
9
9
 
10
10
  const Header = styled.div`
11
11
  width: 100%;
12
- height: ${props => props.theme.main.sizes.header.height};
12
+ height: ${(props) => props.theme.main.sizes.header.height};
13
13
 
14
14
  position: fixed;
15
15
  z-index: 1040;
16
- left: ${props => props.theme.main.sizes.leftMenu.width};
16
+ left: ${(props) => props.theme.main.sizes.leftMenu.width};
17
17
 
18
18
  box-shadow: 0 1px 2px 0 rgba(40, 42, 49, 0.16);
19
- background-color: ${props => props.theme.main.colors.white};
19
+ background-color: ${(props) => props.theme.main.colors.white};
20
20
 
21
- line-height: ${props => props.theme.main.sizes.header.height};
21
+ line-height: ${(props) => props.theme.main.sizes.header.height};
22
22
  `;
23
23
 
24
24
  Header.defaultProps = {
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
  const Wrapper = styled.div`
5
5
  position: absolute;
6
6
  width: 100%;
7
- background: ${props => props.theme.main.colors.strapi['blue-darker']};
7
+ background: ${(props) => props.theme.main.colors.strapi['blue-darker']};
8
8
  bottom: 0;
9
9
  .poweredBy {
10
10
  width: 100%;
@@ -16,7 +16,12 @@ function LeftMenuFooter({ version }) {
16
16
  return (
17
17
  <Wrapper>
18
18
  <div className="poweredBy">
19
- <A key="website" href="https://strapi.akemona.com" target="_blank" rel="noopener noreferrer">
19
+ <A
20
+ key="website"
21
+ href="https://strapi.akemona.com"
22
+ target="_blank"
23
+ rel="noopener noreferrer"
24
+ >
20
25
  Strapi
21
26
  </A>
22
27
  &nbsp;
@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
4
4
  import Logo from '../../../assets/images/logo-strapi.png';
5
5
 
6
6
  const Wrapper = styled.div`
7
- background-color: ${props => props.theme.main.colors.leftMenu['background-header-link']};
7
+ background-color: ${(props) => props.theme.main.colors.leftMenu['background-header-link']};
8
8
  padding-left: 2rem;
9
- height: ${props => props.theme.main.sizes.leftMenu.height};
9
+ height: ${(props) => props.theme.main.sizes.leftMenu.height};
10
10
 
11
11
  .leftMenuHeaderLink {
12
12
  &:hover {
@@ -17,7 +17,7 @@ const Wrapper = styled.div`
17
17
  .projectName {
18
18
  display: block;
19
19
  width: 100%;
20
- height: ${props => props.theme.main.sizes.leftMenu.height};
20
+ height: ${(props) => props.theme.main.sizes.leftMenu.height};
21
21
  font-size: 2rem;
22
22
  letter-spacing: 0.2rem;
23
23
  color: $white;
@@ -10,29 +10,29 @@ const A = styled.a`
10
10
  line-height: 1.8rem;
11
11
  border-left: 0.3rem solid transparent;
12
12
  cursor: pointer;
13
- color: ${props => props.theme.main.colors.leftMenu['link-color']};
13
+ color: ${(props) => props.theme.main.colors.leftMenu['link-color']};
14
14
  text-decoration: none;
15
15
  -webkit-font-smoothing: antialiased;
16
16
 
17
17
  &:hover {
18
- color: ${props => props.theme.main.colors.white};
19
- background: ${props => props.theme.main.colors.leftMenu['link-hover']};
20
- border-left: 0.3rem solid ${props => props.theme.main.colors.strapi.blue};
18
+ color: ${(props) => props.theme.main.colors.white};
19
+ background: ${(props) => props.theme.main.colors.leftMenu['link-hover']};
20
+ border-left: 0.3rem solid ${(props) => props.theme.main.colors.strapi.blue};
21
21
  text-decoration: none;
22
22
  }
23
23
 
24
24
  &:focus {
25
- color: ${props => props.theme.main.colors.white};
25
+ color: ${(props) => props.theme.main.colors.white};
26
26
  text-decoration: none;
27
27
  }
28
28
 
29
29
  &:visited {
30
- color: ${props => props.theme.main.colors.leftMenu['link-color']};
30
+ color: ${(props) => props.theme.main.colors.leftMenu['link-color']};
31
31
  }
32
32
 
33
33
  &.linkActive {
34
34
  color: white !important;
35
- border-left: 0.3rem solid ${props => props.theme.main.colors.strapi.blue};
35
+ border-left: 0.3rem solid ${(props) => props.theme.main.colors.strapi.blue};
36
36
  }
37
37
  `;
38
38
 
@@ -47,7 +47,7 @@ const LeftMenuLinkContent = ({
47
47
  label: `${label.id || label}`,
48
48
  }}
49
49
  >
50
- {message => <LinkLabel>{message}</LinkLabel>}
50
+ {(message) => <LinkLabel>{message}</LinkLabel>}
51
51
  </FormattedMessage>
52
52
  ) : (
53
53
  <LinkLabel>{labelId}</LinkLabel>
@@ -7,7 +7,7 @@ const Title = styled.div`
7
7
  padding-right: 1.6rem;
8
8
  padding-top: 1rem;
9
9
  margin-bottom: 0.9rem;
10
- color: ${props => props.theme.main.colors.leftMenu['title-color']};
10
+ color: ${(props) => props.theme.main.colors.leftMenu['title-color']};
11
11
  text-transform: uppercase;
12
12
  font-size: 1.1rem;
13
13
  letter-spacing: 0.1rem;
@@ -23,7 +23,7 @@ const LeftMenuLinkHeader = ({ section, searchable, setSearch, search }) => {
23
23
  }, [ref, showSearch]);
24
24
 
25
25
  const toggleSearch = () => {
26
- setShowSearch(prev => !prev);
26
+ setShowSearch((prev) => !prev);
27
27
  };
28
28
 
29
29
  const handleChange = ({ target: { value } }) => {
@@ -52,7 +52,7 @@ const LeftMenuLinkHeader = ({ section, searchable, setSearch, search }) => {
52
52
  <FontAwesomeIcon style={{ fontSize: 12 }} icon="search" />
53
53
  </div>
54
54
  <FormattedMessage id="components.Search.placeholder">
55
- {message => (
55
+ {(message) => (
56
56
  <Search ref={ref} onChange={handleChange} value={search} placeholder={message} />
57
57
  )}
58
58
  </FormattedMessage>
@@ -53,7 +53,7 @@ const LeftMenuLinksSection = ({
53
53
  ) : (
54
54
  <EmptyLinksListWrapper>
55
55
  <FormattedMessage id={emptyLinksListMessage} defaultMessage="No plugins installed yet">
56
- {msg => <EmptyLinksList>{msg}</EmptyLinksList>}
56
+ {(msg) => <EmptyLinksList>{msg}</EmptyLinksList>}
57
57
  </FormattedMessage>
58
58
  </EmptyLinksListWrapper>
59
59
  )}
@@ -4,12 +4,12 @@ import PropTypes from 'prop-types';
4
4
  const LinksContainer = styled.div`
5
5
  padding-top: 0.7rem;
6
6
  position: absolute;
7
- top: ${props => props.theme.main.sizes.leftMenu.height};
7
+ top: ${(props) => props.theme.main.sizes.leftMenu.height};
8
8
  right: 0;
9
9
  bottom: 0;
10
10
  left: 0;
11
11
  overflow-y: auto;
12
- height: calc(100vh - (${props => props.theme.main.sizes.leftMenu.height} + 3rem));
12
+ height: calc(100vh - (${(props) => props.theme.main.sizes.leftMenu.height} + 3rem));
13
13
  box-sizing: border-box;
14
14
  `;
15
15
 
@@ -14,11 +14,11 @@ const GlobalNotification = createGlobalStyle`
14
14
  top: 10px;
15
15
  left: 5px;
16
16
  border-radius: 10px;
17
- border: 1px solid ${props => props.theme.main.colors.green};
17
+ border: 1px solid ${(props) => props.theme.main.colors.green};
18
18
  display: flex;
19
19
  svg {
20
20
  margin: auto;
21
- color: ${props => props.theme.main.colors.green};
21
+ color: ${(props) => props.theme.main.colors.green};
22
22
  width: 10px;
23
23
  height: 10px;
24
24
  }
@@ -67,10 +67,10 @@ const GlobalNotification = createGlobalStyle`
67
67
  .notificationSuccess{
68
68
  .notificationIcon {
69
69
  div {
70
- border-color: ${props => props.theme.main.colors.green};
70
+ border-color: ${(props) => props.theme.main.colors.green};
71
71
  }
72
72
  svg {
73
- color: ${props => props.theme.main.colors.green};
73
+ color: ${(props) => props.theme.main.colors.green};
74
74
  }
75
75
  }
76
76
  }
@@ -78,10 +78,10 @@ const GlobalNotification = createGlobalStyle`
78
78
  .notificationWarning {
79
79
  .notificationIcon {
80
80
  div {
81
- border-color: ${props => props.theme.main.colors.orange};
81
+ border-color: ${(props) => props.theme.main.colors.orange};
82
82
  }
83
83
  svg {
84
- color: ${props => props.theme.main.colors.orange};
84
+ color: ${(props) => props.theme.main.colors.orange};
85
85
  }
86
86
  }
87
87
  }
@@ -89,10 +89,10 @@ const GlobalNotification = createGlobalStyle`
89
89
  .notificationError {
90
90
  .notificationIcon {
91
91
  div {
92
- border-color: ${props => props.theme.main.colors.red};
92
+ border-color: ${(props) => props.theme.main.colors.red};
93
93
  }
94
94
  svg {
95
- color: ${props => props.theme.main.colors.red};
95
+ color: ${(props) => props.theme.main.colors.red};
96
96
  }
97
97
  }
98
98
  }
@@ -100,10 +100,10 @@ const GlobalNotification = createGlobalStyle`
100
100
  .notificationInfo {
101
101
  .notificationIcon {
102
102
  div {
103
- border-color: ${props => props.theme.main.colors.blue};
103
+ border-color: ${(props) => props.theme.main.colors.blue};
104
104
  }
105
105
  svg {
106
- color: ${props => props.theme.main.colors.blue};
106
+ color: ${(props) => props.theme.main.colors.blue};
107
107
  }
108
108
  }
109
109
  }
@@ -116,7 +116,7 @@ const Li = styled.li`
116
116
  width: 300px;
117
117
  min-height: 60px;
118
118
  margin-bottom: 14px;
119
- background: ${props => props.theme.main.colors.white};
119
+ background: ${(props) => props.theme.main.colors.white};
120
120
  border-radius: 2px;
121
121
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15);
122
122
  color: #333740;
@@ -124,15 +124,15 @@ const Li = styled.li`
124
124
  overflow: hidden;
125
125
  z-index: 10;
126
126
  padding: 1rem;
127
- border-left: 2px solid ${props => props.theme.main.colors.green};
127
+ border-left: 2px solid ${(props) => props.theme.main.colors.green};
128
128
  &.notificationError {
129
- border-color: ${props => props.theme.main.colors.red};
129
+ border-color: ${(props) => props.theme.main.colors.red};
130
130
  }
131
131
  &.notificationWarning {
132
- border-color: ${props => props.theme.main.colors.orange};
132
+ border-color: ${(props) => props.theme.main.colors.orange};
133
133
  }
134
134
  &.notificationInfo {
135
- border-color: ${props => props.theme.main.colors.blue};
135
+ border-color: ${(props) => props.theme.main.colors.blue};
136
136
  }
137
137
 
138
138
  &:last-child {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Remove } from '@buffetjs/icons';
3
3
  import { components } from 'react-select';
4
4
 
5
- const ClearIndicator = props => {
5
+ const ClearIndicator = (props) => {
6
6
  const Component = components.ClearIndicator;
7
7
 
8
8
  return (
@@ -19,13 +19,14 @@ const MenuList = ({ selectProps, ...rest }) => {
19
19
  const Component = components.MenuList;
20
20
  const { arrayOfOptionsGroupedByCategory } = selectProps;
21
21
 
22
- const initCollapses = useMemo(() => createCollapsesObject(arrayOfOptionsGroupedByCategory), [
23
- arrayOfOptionsGroupedByCategory,
24
- ]);
22
+ const initCollapses = useMemo(
23
+ () => createCollapsesObject(arrayOfOptionsGroupedByCategory),
24
+ [arrayOfOptionsGroupedByCategory]
25
+ );
25
26
  const [collapses, setCollapses] = useState(initCollapses);
26
27
 
27
- const toggleCollapse = collapseName => {
28
- setCollapses(prevState => ({ ...prevState, [collapseName]: !collapses[collapseName] }));
28
+ const toggleCollapse = (collapseName) => {
29
+ setCollapses((prevState) => ({ ...prevState, [collapseName]: !collapses[collapseName] }));
29
30
  };
30
31
 
31
32
  return (
@@ -83,7 +84,7 @@ const MenuList = ({ selectProps, ...rest }) => {
83
84
  </Flex>
84
85
  </div>
85
86
  <SubUl tag="ul" isOpen={collapses[categoryName]}>
86
- {conditions.map(condition => {
87
+ {conditions.map((condition) => {
87
88
  const checkboxValue = get(selectProps.value, [categoryName, condition.id], false);
88
89
 
89
90
  return (
@@ -4,7 +4,7 @@
4
4
  * @param {array<array>} arrayOfCategories
5
5
  * @returns {object}
6
6
  */
7
- const createCollapsesObject = arrayOfCategories =>
7
+ const createCollapsesObject = (arrayOfCategories) =>
8
8
  arrayOfCategories.reduce((acc, current, index) => {
9
9
  acc[current[0]] = index === 0;
10
10
 
@@ -9,7 +9,7 @@ import { createArrayOfValues } from '../../utils';
9
9
  const Value = ({ children, selectProps, ...props }) => {
10
10
  const { formatMessage } = useIntl();
11
11
  const SingleValue = components.SingleValue;
12
- const valuesArray = createArrayOfValues(selectProps.value).filter(val => val);
12
+ const valuesArray = createArrayOfValues(selectProps.value).filter((val) => val);
13
13
 
14
14
  return (
15
15
  <SingleValue {...props}>
@@ -41,7 +41,7 @@ const ConditionsModal = ({
41
41
  const [state, setState] = useState(initState);
42
42
 
43
43
  const handleCategoryChange = ({ keys, value }) => {
44
- setState(prevState => {
44
+ setState((prevState) => {
45
45
  const updatedState = cloneDeep(prevState);
46
46
  const objToUpdate = get(prevState, keys, {});
47
47
  const updatedValues = updateValues(objToUpdate, value);
@@ -53,7 +53,7 @@ const ConditionsModal = ({
53
53
  };
54
54
 
55
55
  const handleChange = ({ keys, value }) => {
56
- setState(prevState => {
56
+ setState((prevState) => {
57
57
  const updatedState = cloneDeep(prevState);
58
58
 
59
59
  set(updatedState, keys, value);
@@ -2,13 +2,13 @@
2
2
  /* eslint-disable no-nested-ternary */
3
3
 
4
4
  const selectStyle = {
5
- container: base => ({
5
+ container: (base) => ({
6
6
  ...base,
7
7
  width: '70%',
8
8
  alignItems: 'center',
9
9
  height: '36px',
10
10
  }),
11
- menu: base => ({
11
+ menu: (base) => ({
12
12
  ...base,
13
13
  margin: '0',
14
14
  paddingTop: 0,
@@ -20,21 +20,21 @@ const selectStyle = {
20
20
  borderTop: '0 !important',
21
21
  fontSize: '13px',
22
22
  }),
23
- menuList: base => ({
23
+ menuList: (base) => ({
24
24
  ...base,
25
25
  paddingBottom: 9,
26
26
  paddingTop: 10,
27
27
  }),
28
- multiValue: base => ({
28
+ multiValue: (base) => ({
29
29
  ...base,
30
30
  backgroundColor: 'none',
31
31
  color: '#333740',
32
32
  }),
33
- multiValueLabel: base => ({
33
+ multiValueLabel: (base) => ({
34
34
  ...base,
35
35
  fontSize: '13px',
36
36
  }),
37
- multiValueRemove: base => ({
37
+ multiValueRemove: (base) => ({
38
38
  ...base,
39
39
  display: 'none',
40
40
  }),
@@ -79,13 +79,13 @@ const selectStyle = {
79
79
  borderBottom,
80
80
  };
81
81
  },
82
- valueContainer: base => ({
82
+ valueContainer: (base) => ({
83
83
  ...base,
84
84
  padding: '2px 4px 4px 10px',
85
85
  lineHeight: '18px',
86
86
  minWidth: 200,
87
87
  }),
88
- placeholder: base => ({
88
+ placeholder: (base) => ({
89
89
  ...base,
90
90
  paddingTop: 1,
91
91
  color: 'black',
@@ -24,18 +24,15 @@ const Collapse = ({
24
24
  pathToData,
25
25
  }) => {
26
26
  const [modalState, setModalState] = useState({ isOpen: false, isMounted: false });
27
- const {
28
- modifiedData,
29
- onChangeParentCheckbox,
30
- onChangeSimpleCheckbox,
31
- } = usePermissionsDataManager();
27
+ const { modifiedData, onChangeParentCheckbox, onChangeSimpleCheckbox } =
28
+ usePermissionsDataManager();
32
29
 
33
30
  const handleToggleModalIsOpen = () => {
34
- setModalState(prevState => ({ isMounted: true, isOpen: !prevState.isOpen }));
31
+ setModalState((prevState) => ({ isMounted: true, isOpen: !prevState.isOpen }));
35
32
  };
36
33
 
37
34
  const handleModalClose = () => {
38
- setModalState(prevState => ({ ...prevState, isMounted: false }));
35
+ setModalState((prevState) => ({ ...prevState, isMounted: false }));
39
36
  };
40
37
 
41
38
  // This corresponds to the data related to the CT left checkbox
@@ -14,7 +14,7 @@ const generateCheckboxesActions = (availableActions, modifiedData, pathToData) =
14
14
  const checkboxName = checkboxNameArray.join('..');
15
15
  const conditionsValue = get(modifiedData, [...baseCheckboxNameArray, 'conditions'], null);
16
16
 
17
- const hasConditions = createArrayOfValues(conditionsValue).some(val => val);
17
+ const hasConditions = createArrayOfValues(conditionsValue).some((val) => val);
18
18
 
19
19
  if (isEmpty(applyToProperties)) {
20
20
  const value = get(modifiedData, checkboxNameArray, false);
@@ -46,7 +46,7 @@ const ActionRow = ({
46
46
 
47
47
  const handleClick = useCallback(() => {
48
48
  if (isCollapsable) {
49
- setRowToOpen(prev => {
49
+ setRowToOpen((prev) => {
50
50
  if (prev === name) {
51
51
  return null;
52
52
  }
@@ -6,7 +6,7 @@ import { getCheckboxState } from '../../../../utils';
6
6
  * @param {array<object>} propertyActions
7
7
  * @returns {string} actionId
8
8
  */
9
- const getActionIdsFromPropertyActions = propertyActions => {
9
+ const getActionIdsFromPropertyActions = (propertyActions) => {
10
10
  const actionIds = propertyActions.reduce((acc, current) => {
11
11
  if (current.isActionRelatedToCurrentProperty) {
12
12
  acc.push(current.actionId);
@@ -32,7 +32,7 @@ const Header = ({ headers, label }) => {
32
32
  <PropertyLabelWrapper>
33
33
  <Text fontWeight="bold">{translatedLabel}</Text>
34
34
  </PropertyLabelWrapper>
35
- {headers.map(header => {
35
+ {headers.map((header) => {
36
36
  if (!header.isActionRelatedToCurrentProperty) {
37
37
  return <HeaderLabel key={header.label} />;
38
38
  }
@@ -29,15 +29,12 @@ const SubActionRow = ({
29
29
  parentName,
30
30
  propertyName,
31
31
  }) => {
32
- const {
33
- modifiedData,
34
- onChangeParentCheckbox,
35
- onChangeSimpleCheckbox,
36
- } = usePermissionsDataManager();
32
+ const { modifiedData, onChangeParentCheckbox, onChangeSimpleCheckbox } =
33
+ usePermissionsDataManager();
37
34
  const [rowToOpen, setRowToOpen] = useState(null);
38
35
 
39
- const handleClickToggleSubLevel = name => {
40
- setRowToOpen(prev => {
36
+ const handleClickToggleSubLevel = (name) => {
37
+ setRowToOpen((prev) => {
41
38
  if (prev === name) {
42
39
  return null;
43
40
  }
@@ -125,9 +122,8 @@ const SubActionRow = ({
125
122
  );
126
123
  }
127
124
 
128
- const { hasAllActionsSelected, hasSomeActionsSelected } = getCheckboxState(
129
- checkboxValue
130
- );
125
+ const { hasAllActionsSelected, hasSomeActionsSelected } =
126
+ getCheckboxState(checkboxValue);
131
127
 
132
128
  return (
133
129
  <CheckboxWithCondition
@@ -1,5 +1,5 @@
1
1
  const generateHeadersFromActions = (actions, propertyName) => {
2
- return actions.map(action => {
2
+ return actions.map((action) => {
3
3
  const isActionRelatedToCurrentProperty =
4
4
  Array.isArray(action.applyToProperties) &&
5
5
  action.applyToProperties.indexOf(propertyName) !== -1 &&
@@ -1,7 +1,7 @@
1
1
  import { Text } from '@buffetjs/core';
2
2
  import Chevron from '../../Chevron';
3
3
 
4
- const activeStyle = theme => `
4
+ const activeStyle = (theme) => `
5
5
  color: ${theme.main.colors.mediumBlue};
6
6
  ${Text} {
7
7
  color: ${theme.main.colors.mediumBlue};
@@ -1,5 +1,5 @@
1
1
  const getAvailableActions = (actions, targetSubject) => {
2
- return actions.map(action => {
2
+ return actions.map((action) => {
3
3
  const isDisplayed =
4
4
  Array.isArray(action.subjects) && action.subjects.indexOf(targetSubject) !== -1;
5
5
 
@@ -5,7 +5,7 @@ import ContentTypeCollapse from '../ContentTypeCollapse';
5
5
  const ContentTypeCollapses = ({ actions, isFormDisabled, pathToData, subjects }) => {
6
6
  const [collapseToOpen, setCollapseToOpen] = useState(null);
7
7
 
8
- const handleClickToggleCollapse = collapseName => {
8
+ const handleClickToggleCollapse = (collapseName) => {
9
9
  const nextCollapseToOpen = collapseToOpen === collapseName ? null : collapseName;
10
10
 
11
11
  setCollapseToOpen(nextCollapseToOpen);
@@ -1,7 +1,7 @@
1
1
  import React, { memo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
 
4
- const Curve = props => (
4
+ const Curve = (props) => (
5
5
  <svg
6
6
  style={{
7
7
  height: '14px',
@@ -1,4 +1,4 @@
1
- const findDisplayedActions = actions =>
1
+ const findDisplayedActions = (actions) =>
2
2
  actions.filter(({ subjects }) => subjects && subjects.length);
3
3
 
4
4
  export default findDisplayedActions;
@@ -1,11 +1,11 @@
1
1
  import { get } from 'lodash';
2
2
  import { getCheckboxState, removeConditionKeyFromData } from '../../utils';
3
3
 
4
- const getActionsIds = array => array.map(({ actionId }) => actionId);
4
+ const getActionsIds = (array) => array.map(({ actionId }) => actionId);
5
5
 
6
6
  const getRelatedActionIdData = (actionIdArray, dataObj) => {
7
7
  return actionIdArray.reduce((acc, actionId) => {
8
- Object.keys(dataObj).forEach(ctUid => {
8
+ Object.keys(dataObj).forEach((ctUid) => {
9
9
  const actionIdData = get(dataObj, [ctUid, actionId], {});
10
10
 
11
11
  const actionIdState = { [ctUid]: removeConditionKeyFromData(actionIdData) };