@retikolo/drag-drop-content-types 1.3.10 → 1.3.11

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.
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from "react";
2
2
  import { useDispatch } from "react-redux";
3
- import { getData, getDataSucceeded } from "@strapi/admin/admin/src/content-manager/pages/ListView/actions";
3
+ import { getData, getDataSucceeded } from "../../utils/strapi";
4
4
  import axiosInstance from "../../utils/axiosInstance";
5
5
  import { SortableContainer, SortableElement } from "react-sortable-hoc";
6
6
  import { arrayMoveImmutable } from "array-move";
@@ -11,6 +11,8 @@ import { IconButton } from "@strapi/design-system/IconButton";
11
11
  import { Icon } from "@strapi/design-system/Icon";
12
12
  import Drag from "@strapi/icons/Drag";
13
13
  import Layer from "@strapi/icons/Layer";
14
+ import { useHistory } from "react-router-dom";
15
+
14
16
 
15
17
  const SortModal = () => {
16
18
  const [data, setData] = useState([]);
@@ -166,11 +168,18 @@ const SortModal = () => {
166
168
  }
167
169
  };
168
170
 
171
+ // TODO: this is a hotfix caused by an update in strapi 4.15.2 that disabled direct imports.
172
+ const history = useHistory();
169
173
  // Actions to perform after sorting is successful
170
174
  const afterUpdate = (pagination, newData) => {
175
+ // TODO: remove this
176
+ history.go(0);
177
+
178
+ // TODO: reenable this
171
179
  // Avoid full page reload and only re-render table.
172
- refetchEntries();
173
- refetchEntriesSucceeded(pagination, newData);
180
+ //refetchEntries();
181
+ //refetchEntriesSucceeded(pagination, newData);
182
+
174
183
  };
175
184
 
176
185
  // Render the menu
@@ -0,0 +1,18 @@
1
+ export const GET_DATA = 'ContentManager/ListView/GET_DATA';
2
+ export const GET_DATA_SUCCEEDED = 'ContentManager/ListView/GET_DATA_SUCCEEDED';
3
+
4
+ export function getData(uid, params) {
5
+ return {
6
+ type: GET_DATA,
7
+ uid,
8
+ params,
9
+ };
10
+ }
11
+
12
+ export function getDataSucceeded(count, data) {
13
+ return {
14
+ type: GET_DATA_SUCCEEDED,
15
+ count,
16
+ data,
17
+ };
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retikolo/drag-drop-content-types",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "This plugin add a drag and droppable list that allows you to sort content type entries.",
5
5
  "strapi": {
6
6
  "name": "drag-drop-content-types",
@@ -44,7 +44,7 @@
44
44
  "order"
45
45
  ],
46
46
  "engines": {
47
- "node": ">=14.19.1 <=18.x.x",
47
+ "node": ">=14.19.1",
48
48
  "npm": ">=6.0.0"
49
49
  },
50
50
  "license": "MIT"