From 3cee5f524bbae4b12b59753f1808d7b38902c5f0 Mon Sep 17 00:00:00 2001
From: Mira Weller
Date: Tue, 5 May 2026 18:12:21 +0200
Subject: [PATCH] use slicksort for reordering questionnaires and questions
---
package-lock.json | 22 +++++++--------
package.json | 3 +-
.../js/ui/questionnaires/App.vue | 7 +++--
.../js/ui/questionnaires/Question.vue | 4 ++-
.../js/ui/questionnaires/Questionnaire.vue | 28 +++++++++++--------
5 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index cf536fde37..61431fe86d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,8 @@
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
- "vue": "^3.5.30"
+ "vue": "^3.5.30",
+ "vue-slicksort": "^2.0.5"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
@@ -1032,7 +1033,6 @@
"integrity": "sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/types": "^8.56.0",
@@ -1103,7 +1103,6 @@
"integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"undici-types": "~7.18.0"
}
@@ -1160,7 +1159,6 @@
"integrity": "sha512-XZzOmihLIr8AD1b9hL9ccNMzEMWt/dE2u7NyTY9jJG6YNiNthaD5XtUHVF2uCXZ15ng+z2hT3MVuxnUYhq6k1g==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.57.0",
"@typescript-eslint/types": "8.57.0",
@@ -1568,7 +1566,6 @@
"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
"dev": true,
"license": "MIT",
- "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -1961,7 +1958,6 @@
"integrity": "sha512-COV33RzXZkqhG9P2rZCFl9ZmJ7WL+gQSCRzE7RhkbclbQPtLAWReL7ysA0Sh4c8Im2U9ynybdR56PV0XcKvqaQ==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.2",
@@ -2018,7 +2014,6 @@
"integrity": "sha512-f1J/tcbnrpgC8suPN5AtdJ5MQjuXbSU9pGRSSYAuF3SHoiYCOdEX6O22pLaRyLHXvDcOe+O5ENgc1owQ587agA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"natural-compare": "^1.4.0",
@@ -4269,7 +4264,6 @@
"integrity": "sha512-ZIdT8eUv8tegmqy1tTIdJv9We2DumkNZFdCF5mz/Kpq3OcTaxSuCAYZge6HKK2CmNC02G1eJig2RV7XTw5hQrA==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@adobe/css-tools": "~4.3.3",
"debug": "^4.3.2",
@@ -4469,7 +4463,6 @@
"integrity": "sha512-fPGaRNj9Zytaf8LEiBhY7Z6ijnFKdzU/+mL8EFBaKr7Vw1/FWcTBAMW0wLPJAGMPX38ZPVCVgLceWiEqeoqL2Q==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"@oxc-project/runtime": "0.115.0",
"lightningcss": "^1.32.0",
@@ -4565,7 +4558,6 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.30.tgz",
"integrity": "sha512-hTHLc6VNZyzzEH/l7PFGjpcTvUgiaPK5mdLkbjrTeWSRcEfxFrv56g/XckIYlE9ckuobsdwqd5mk2g1sBkMewg==",
"license": "MIT",
- "peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.30",
"@vue/compiler-sfc": "3.5.30",
@@ -4588,7 +4580,6 @@
"integrity": "sha512-Vxi9pJdbN3ZnVGLODVtZ7y4Y2kzAAE2Cm0CZ3ZDRvydVYxZ6VrnBhLikBsRS+dpwj4Jv4UCv21PTEwF5rQ9WXg==",
"dev": true,
"license": "MIT",
- "peer": true,
"dependencies": {
"debug": "^4.4.0",
"eslint-scope": "^8.2.0 || ^9.0.0",
@@ -4620,6 +4611,15 @@
"vue-eslint-parser": "^10.0.0"
}
},
+ "node_modules/vue-slicksort": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/vue-slicksort/-/vue-slicksort-2.0.5.tgz",
+ "integrity": "sha512-fXz1YrNjhUbJK7o0tMk27mIr4pMAZYLSYvtmLazCtfpvz+zafPCn34ILDL8B7hT7WLVZKreYs6JVe5VWymqmzA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "vue": ">=3.0.0"
+ }
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/package.json b/package.json
index edfe2ce77e..2335c571a4 100644
--- a/package.json
+++ b/package.json
@@ -27,7 +27,8 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
- "vue": "^3.5.30"
+ "vue": "^3.5.30",
+ "vue-slicksort": "^2.0.5"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
diff --git a/src/pretix/static/pretixcontrol/js/ui/questionnaires/App.vue b/src/pretix/static/pretixcontrol/js/ui/questionnaires/App.vue
index 86e03c0b98..ce125c908a 100644
--- a/src/pretix/static/pretixcontrol/js/ui/questionnaires/App.vue
+++ b/src/pretix/static/pretixcontrol/js/ui/questionnaires/App.vue
@@ -3,6 +3,7 @@ import Questionnaire from './Questionnaire.vue';
import {get_datafields, get_items, get_questionnaires} from './api';
import { i18n_any, QUESTION_TYPE } from './helper';
import { ref } from 'vue';
+import { SlickList, SlickItem } from 'vue-slicksort';
const datafields_response = await get_datafields();
const questionnaires_response = await get_questionnaires();
@@ -56,14 +57,16 @@ export default {
+
+
+
+
-
diff --git a/src/pretix/static/pretixcontrol/js/ui/questionnaires/Question.vue b/src/pretix/static/pretixcontrol/js/ui/questionnaires/Question.vue
index b40edd4adf..504780f5bf 100644
--- a/src/pretix/static/pretixcontrol/js/ui/questionnaires/Question.vue
+++ b/src/pretix/static/pretixcontrol/js/ui/questionnaires/Question.vue
@@ -3,6 +3,8 @@ import { i18n_any, QUESTION_TYPE, QUESTION_TYPE_LABEL, SYSTEM_DATAFIELDS } from
import NativeDialog from './NativeDialog.vue';
import I18nTextField from './I18nTextField.vue';
import { useId, ref } from 'vue'
+import { DragHandle } from 'vue-slicksort';
+
const id = useId();
const props = defineProps(['question', 'datafields', 'editable'])
const emit = defineEmits(['removeSelf']);
@@ -23,7 +25,7 @@ const editor = ref();