diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 01:31:42 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-03-10 01:31:42 +0000 |
| commit | 71e4ad2c71efea471923ea47f01bfda841387f81 (patch) | |
| tree | f08293fdc56b4eb2e3d0e520b79b4d8aad78924c /components/Editor/Quest/Task/Modal/ChangeTaskModal.vue | |
| parent | 4495c02c41b95ce6df0c34dbf6ac62f7addae7a3 (diff) | |
Use nuxt auto import magic
Diffstat (limited to 'components/Editor/Quest/Task/Modal/ChangeTaskModal.vue')
| -rw-r--r-- | components/Editor/Quest/Task/Modal/ChangeTaskModal.vue | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/components/Editor/Quest/Task/Modal/ChangeTaskModal.vue b/components/Editor/Quest/Task/Modal/ChangeTaskModal.vue deleted file mode 100644 index c6b5921..0000000 --- a/components/Editor/Quest/Task/Modal/ChangeTaskModal.vue +++ /dev/null @@ -1,77 +0,0 @@ -<script setup lang="ts"> -import Modal from '@/components/Control/Modal.vue'; -import Button from '@/components/Control/Button.vue'; -import { computed, ref } from 'vue'; -import { useSessionStore } from '@/stores/session'; - -const model = defineModel(); - -const emit = defineEmits(['update']); - -const session = useSessionStore(); - -const props = defineProps({ - taskId: String, - currentTaskType: String, -}); - -const knownTaskTypes = computed(() => session.getKnownTaskTypes()); - -const newType = ref(''); -const unknownTaskType = computed(() => !knownTaskTypes.value.includes(newType.value)); -const noChange = computed(() => newType.value === props.currentTaskType); -const newTypeDescription = computed(() => session.getTaskDefinitionByTaskType(newType.value)?.description); -</script> - -<template> - <Modal v-model="model"> - <template v-slot:header> - <h2>Change the task type of '{{ taskId }}'</h2> - </template> - - <template v-slot:body> - <div id="body"> - <div class="option-group"> - <label for="new-type">New type</label> - <multiselect - id="new-type" - v-model="newType" - :options="knownTaskTypes" - :searchable="true" - placeholder="Select a new type" - ></multiselect> - </div> - <p v-if="unknownTaskType" class="error-text">Invalid task type.</p> - <p v-if="newTypeDescription">{{ newTypeDescription }}</p> - <p>Any configured options for this task will be overwritten.</p> - <div id="confirm" class="control-group"> - <Button - :icon="['fas', 'fa-times']" - :label="'Cancel'" - @click="model = false" - ></Button> - <Button - type="solid" - :icon="['fas', 'fa-check']" - :label="'Change'" - :disabled="unknownTaskType || noChange" - @click="emit('update', newType)" - ></Button> - </div> - </div> - </template> - </Modal> -</template> - -<style scoped> -#confirm { - display: flex; - justify-content: flex-end; -} - -#body { - display: flex; - flex-direction: column; - gap: 0.5rem; -} -</style>
\ No newline at end of file |
