307307</template >
308308
309309<script >
310- import axios from ' @nextcloud/axios'
311- import { showError } from ' @nextcloud/dialogs'
312- import { generateOcsUrl } from ' @nextcloud/router'
313- import { VueDraggable as Draggable } from ' vue-draggable-plus'
314- import NcActionButton from ' @nextcloud/vue/components/NcActionButton'
315- import NcActions from ' @nextcloud/vue/components/NcActions'
316- import NcButton from ' @nextcloud/vue/components/NcButton'
317310// Icons
318311import IconPlus from ' @material-symbols/svg-400/outlined/add.svg?raw'
319312import IconArrowDownDropCircleOutline from ' @material-symbols/svg-400/outlined/arrow_drop_down_circle.svg?raw'
@@ -328,6 +321,14 @@ import IconRadioboxMarked from '@material-symbols/svg-400/outlined/radio_button_
328321import IconClockOutline from ' @material-symbols/svg-400/outlined/schedule.svg?raw'
329322import IconTextShort from ' @material-symbols/svg-400/outlined/short_text.svg?raw'
330323import IconTextLong from ' @material-symbols/svg-400/outlined/subject.svg?raw'
324+ import IconSwapVertical from ' @material-symbols/svg-400/outlined/swap_vert.svg?raw'
325+ import axios from ' @nextcloud/axios'
326+ import { showError } from ' @nextcloud/dialogs'
327+ import { generateOcsUrl } from ' @nextcloud/router'
328+ import { VueDraggable as Draggable } from ' vue-draggable-plus'
329+ import NcActionButton from ' @nextcloud/vue/components/NcActionButton'
330+ import NcActions from ' @nextcloud/vue/components/NcActions'
331+ import NcButton from ' @nextcloud/vue/components/NcButton'
331332import NcIconSvgWrapper from ' @nextcloud/vue/components/NcIconSvgWrapper'
332333import BranchConditionEditor from ' ./BranchConditionEditor.vue'
333334import Question from ' ./Question.vue'
@@ -339,6 +340,7 @@ import QuestionFile from './QuestionFile.vue'
339340import QuestionLinearScale from ' ./QuestionLinearScale.vue'
340341import QuestionLong from ' ./QuestionLong.vue'
341342import QuestionMultiple from ' ./QuestionMultiple.vue'
343+ import QuestionRanking from ' ./QuestionRanking.vue'
342344import QuestionShort from ' ./QuestionShort.vue'
343345import QuestionMixin from ' ../../mixins/QuestionMixin.js'
344346import logger from ' ../../utils/Logger.js'
@@ -356,6 +358,7 @@ const QUESTION_COMPONENTS = {
356358 linearscale: QuestionLinearScale,
357359 color: QuestionColor,
358360 file: QuestionFile,
361+ ranking: QuestionRanking,
359362}
360363
361364export default {
@@ -377,6 +380,7 @@ export default {
377380 QuestionLong,
378381 QuestionMultiple,
379382 QuestionShort,
383+ QuestionRanking,
380384 },
381385
382386 mixins: [QuestionMixin],
@@ -482,6 +486,11 @@ export default {
482486 },
483487 { type: ' color' , label: t (' forms' , ' Color' ), icon: IconPalette },
484488 { type: ' file' , label: t (' forms' , ' File' ), icon: IconFile },
489+ {
490+ type: ' ranking' ,
491+ label: t (' forms' , ' Ranking' ),
492+ icon: IconSwapVertical,
493+ },
485494 ]
486495 },
487496
@@ -588,6 +597,7 @@ export default {
588597 linearscale: ' QuestionLinearScale' ,
589598 color: ' QuestionColor' ,
590599 file: ' QuestionFile' ,
600+ ranking: ' QuestionRanking' ,
591601 }
592602 return componentMap[type] || null
593603 },
@@ -714,6 +724,12 @@ export default {
714724 warningInvalid: t (' forms' , ' This question needs a title!' ),
715725 validate : () => true ,
716726 },
727+
728+ ranking: {
729+ titlePlaceholder: t (' forms' , ' Ranking question title' ),
730+ warningInvalid: t (' forms' , ' This question needs a title!' ),
731+ validate : () => true ,
732+ },
717733 }
718734 return configs[type] || { validate : () => true }
719735 },
0 commit comments