strapi-plugin-navigation 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,10 +23,10 @@ A plugin for [Strapi Headless CMS](https://github.com/strapi/strapi) that provid
23
23
 
24
24
  <img src="public/assets/preview.png" alt="UI preview" />
25
25
 
26
- ### Versions
26
+ ### ⚙️ Versions
27
27
 
28
- - **Stable** - [v1.1.2](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation)
29
- - **Beta** - v4 support - [v2.0.0-beta.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/feat/strapi-v4-support)
28
+ - **Strapi v4** - [v2.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation)
29
+ - **Strapi v3** - (current) - [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v3)
30
30
 
31
31
  ### ⏳ Installation
32
32
 
@@ -413,7 +413,8 @@ For general help using Strapi, please refer to [the official Strapi documentatio
413
413
  - [Slack](http://slack.strapi.io) We're present on official Strapi slack workspace. Look for @cyp3r and DM.
414
414
  - [Slack - VirtusLab Open Source](https://virtuslab-oss.slack.com) We're present on a public channel #strapi-molecules
415
415
  - [GitHub](https://github.com/VirtusLab/strapi-plugin-navigation/issues) (Bug reports, Contributions, Questions and Discussions)
416
+ - [E-mail](mailto:strapi@virtuslab.com) - we will respond back as soon as possible
416
417
 
417
418
  ## License
418
419
 
419
- [MIT License](LICENSE.md) Copyright (c) 2021 [VirtusLab Sp. z o.o.](https://virtuslab.com/) &amp; [Strapi Solutions](https://strapi.io/).
420
+ [MIT License](LICENSE.md) Copyright (c) [VirtusLab Sp. z o.o.](https://virtuslab.com/) &amp; [Strapi Solutions](https://strapi.io/).
@@ -36,7 +36,6 @@ const DataManagerProvider = ({ children }) => {
36
36
  const [reducerState, dispatch] = useReducer(reducer, initialState, init);
37
37
  const {
38
38
  autoReload,
39
- emitEvent,
40
39
  currentEnvironment,
41
40
  formatMessage,
42
41
  } = useGlobalContext();
@@ -195,47 +194,36 @@ const DataManagerProvider = ({ children }) => {
195
194
  };
196
195
 
197
196
  const handleChangeNavigationPopupVisibility = (visible) => {
198
- emitEvent("willChangeNavigationPopupVisibility");
199
197
  dispatch({
200
198
  type: CHANGE_NAVIGATION_POPUP_VISIBILITY,
201
199
  navigationPopupOpened: visible,
202
200
  });
203
- emitEvent("didChangeNavigationPopupVisibility");
204
- emitEvent(`navigationPopup${visible ? "Visible" : "Hidden"}`);
205
201
  };
206
202
 
207
203
  const handleChangeNavigationItemPopupVisibility = (visible) => {
208
- emitEvent("willChangeNavigationItemPopupVisibility");
209
204
  dispatch({
210
205
  type: CHANGE_NAVIGATION_ITEM_POPUP_VISIBILITY,
211
206
  navigationItemPopupOpened: visible,
212
207
  });
213
- emitEvent("didChangeNavigationItemPopupVisibility");
214
- emitEvent(`navigationItemPopup${visible ? "Visible" : "Hidden"}`);
215
208
  };
216
209
 
217
210
  const handleChangeNavigationData = (payload, forceClosePopups) => {
218
- emitEvent("willChangeNavigationData");
219
211
  dispatch({
220
212
  type: CHANGE_NAVIGATION_DATA,
221
213
  changedActiveItem: payload,
222
214
  forceClosePopups,
223
215
  });
224
- emitEvent("didChangeNavigationData");
225
216
  };
226
217
 
227
218
  const handleResetNavigationData = () => {
228
- emitEvent("willResetNavigationChanges");
229
219
  dispatch({
230
220
  type: RESET_NAVIGATION_DATA,
231
221
  activeItem,
232
222
  });
233
- emitEvent("didResetNavigationChanges");
234
223
  };
235
224
 
236
225
  const handleSubmitNavigation = async (formatMessage, payload = {}) => {
237
226
  try {
238
- emitEvent("willSubmitNavigation");
239
227
  dispatch({
240
228
  type: SUBMIT_NAVIGATION,
241
229
  });
@@ -255,7 +243,6 @@ const DataManagerProvider = ({ children }) => {
255
243
  items: prepareItemToViewPayload(navigation.items, null, config),
256
244
  },
257
245
  });
258
- emitEvent("didSubmitNavigation");
259
246
 
260
247
  strapi.notification.success(getTradId('notification.navigation.submit'));
261
248
  } catch (err) {
@@ -264,7 +251,6 @@ const DataManagerProvider = ({ children }) => {
264
251
  error: err.response.payload.data
265
252
  });
266
253
  console.error({ err: err.response });
267
- emitEvent('didNotSubmitNavigation');
268
254
  if (err.response.payload.data && err.response.payload.data.errorTitles) {
269
255
  return strapi.notification.error(
270
256
  formatMessage(
@@ -252,7 +252,7 @@ export const extractRelatedItemLabel = (item = {}, fields = {}, config = {}) =>
252
252
  const { __collectionName } = item;
253
253
  const contentType = contentTypes.find(_ => _.uid === __collectionName)
254
254
  const { default: defaultFields = [] } = fields;
255
- return get(fields, `${contentType ? contentType.collectionName : ''}`, defaultFields).map((_) => item[_]).filter((_) => _)[0] || '';
255
+ return get(fields, `${contentType ? contentType.collectionName : __collectionName}`, defaultFields).map((_) => item[_]).filter((_) => _)[0] || '';
256
256
  };
257
257
 
258
258
  export const usedContentTypes = (items = []) => items.flatMap(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-navigation",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Strapi - Navigation plugin",
5
5
  "strapi": {
6
6
  "name": "Navigation",
@@ -27,8 +27,8 @@
27
27
  "reactstrap": "8.4.1",
28
28
  "redux-saga": "^0.16.0",
29
29
  "request": "^2.83.0",
30
- "strapi-helper-plugin": "3.6.5",
31
- "strapi-utils": "3.6.5",
30
+ "strapi-helper-plugin": "3.6.8",
31
+ "strapi-utils": "3.6.8",
32
32
  "uuidv4": "^6.2.6",
33
33
  "slugify": "^1.4.5",
34
34
  "pluralize": "^8.0.0"
@@ -40,6 +40,9 @@
40
40
  "jest-styled-components": "^7.0.2",
41
41
  "codecov": "^3.7.2"
42
42
  },
43
+ "peerDependencies": {
44
+ "strapi": "3.x"
45
+ },
43
46
  "author": {
44
47
  "name": "VirtusLab // Mateusz Ziarko",
45
48
  "email": "mziarko@virtuslab.com",