@retikolo/drag-drop-content-types 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -5,9 +5,6 @@
5
5
 
6
6
  ![drag-drop-preview](https://user-images.githubusercontent.com/37687705/191790500-f7bc7968-cf10-4448-a049-3350d96d2d8b.png)
7
7
 
8
- ## 🚧 THIS PLUGIN IS IN BETA
9
- Be warned. Although not planned - breaking changes could happen. Unexpected things could happen. Woosh!
10
-
11
8
  ## ⚠ Important
12
9
  This plugin might NOT behave like you expect. Since Strapi does not allow to fully access all page components, the content itself cannot be drag-and-dropped. Instead this plugin adds a panel, which allow sort content via drag-and-drop. This is not a very intuitive way, but might be better than nothing...
13
10
 
@@ -58,7 +58,7 @@ const SortModal = () => {
58
58
  const fetchContentType = async () => {
59
59
  try {
60
60
  const { data } = await axiosInstance.get(
61
- `/content-manager/collection-types/${contentTypePath}?sort=rank:asc`
61
+ `/content-manager/collection-types/${contentTypePath}?sort=rank:asc&locale=${locale}`
62
62
  );
63
63
  setStatus('success');
64
64
  setData(data.results);
@@ -102,7 +102,7 @@ const SortModal = () => {
102
102
  // Render the menu
103
103
  const showMenu = () => {
104
104
  const SortableItem = SortableElement(({ value }) => (
105
- <MenuItem style={{ zIndex: 10 }} ><Icon height={"0.6rem"} as={Drag} />&nbsp;<span title={value[settings.title]}>{shortenString(value[settings.title])}</span></MenuItem>
105
+ <MenuItem style={{ zIndex: 10, cursor: 'all-scroll' }} ><Icon height={"0.6rem"} as={Drag} />&nbsp;<span title={value[settings.title]}>{shortenString(value[settings.title])}</span></MenuItem>
106
106
  ));
107
107
 
108
108
  const SortableList = SortableContainer(({ items }) => {
@@ -139,7 +139,9 @@ const SortModal = () => {
139
139
 
140
140
  // Get content type from url
141
141
  const paths = window.location.pathname.split('/')
142
+ const queryParams = new URLSearchParams(window.location.search);
142
143
  const contentTypePath = paths[paths.length - 1]
144
+ const locale = queryParams.get('plugins[i18n][locale]');
143
145
 
144
146
 
145
147
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@retikolo/drag-drop-content-types",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
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",