From 6f8d5a2356ca4e96ec510c905530056fa424034c Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sun, 10 Mar 2024 01:41:38 +0000
Subject: Change row priority on task configurations

---
 components/editor/task/Configuration.vue | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'components/editor/task/Configuration.vue')

diff --git a/components/editor/task/Configuration.vue b/components/editor/task/Configuration.vue
index f408726..9cb55d1 100644
--- a/components/editor/task/Configuration.vue
+++ b/components/editor/task/Configuration.vue
@@ -23,13 +23,13 @@ const requiredFields = computed(() => {
   return Object.keys(taskDefintion.value.configuration).filter((fieldName) => taskDefintion.value.configuration[fieldName].required);
 });
 
-const givenRequiredFields = computed(() => {
-  return requiredFields.value.filter((fieldName) => taskConfig.value[fieldName]);
-});
+// const givenRequiredFields = computed(() => {
+//   return requiredFields.value.filter((fieldName) => taskConfig.value[fieldName]);
+// });
 
-const missingFields = computed(() => {
-  return requiredFields.value.filter((fieldName) => !props.quest.tasks[props.taskId].config[fieldName]);
-});
+// const missingFields = computed(() => {
+//   return requiredFields.value.filter((fieldName) => !props.quest.tasks[props.taskId].config[fieldName]);
+// });
 
 const remainingGivenFields = computed(() => {
   return Object.keys(taskConfig.value).filter((fieldName) => !requiredFields.value.includes(fieldName));
@@ -103,8 +103,7 @@ const deleteTaskType = (taskId: string) => {
       </div>
 
       <div v-if="taskDefintion">
-        <EditorTaskConfigurationRow
-          v-for="fieldName in [...givenRequiredFields, ...missingFields, ...remainingGivenFields]"
+        <EditorTaskConfigurationRow v-for="fieldName in [...requiredFields, ...remainingGivenFields]"
           :key="`${quest.id}-${props.taskId}-${taskType}-${fieldName}`" :required="requiredFields.includes(fieldName)"
           :configKey="fieldName" :initialValue="taskConfig[fieldName]" :taskType="taskType"
           :type="(taskDefintion.configuration[fieldName].type as string)"
-- 
cgit v1.2.3-70-g09d2

