From 6e47395327f60fefd963b73560e9f9944bc809ba Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Wed, 7 Jun 2023 13:52:21 +0200 Subject: [PATCH] Fixed some error text not showing in create dialog --- app/imports/client/ui/properties/PropertyForm.vue | 12 ++++++++++++ .../client/ui/properties/forms/ActionForm.vue | 4 ++-- .../client/ui/properties/forms/AttributeForm.vue | 2 +- app/imports/client/ui/properties/forms/BuffForm.vue | 2 +- app/imports/client/ui/properties/forms/ClassForm.vue | 2 +- .../client/ui/properties/forms/ClassLevelForm.vue | 2 +- .../client/ui/properties/forms/ContainerForm.vue | 2 +- .../client/ui/properties/forms/FeatureForm.vue | 4 ++-- app/imports/client/ui/properties/forms/ItemForm.vue | 2 +- app/imports/client/ui/properties/forms/NoteForm.vue | 4 ++-- app/imports/client/ui/properties/forms/SkillForm.vue | 2 +- .../client/ui/properties/forms/SlotFillerForm.vue | 2 +- app/imports/client/ui/properties/forms/SlotForm.vue | 2 +- app/imports/client/ui/properties/forms/SpellForm.vue | 4 ++-- .../client/ui/properties/forms/SpellListForm.vue | 2 +- .../client/ui/properties/forms/TriggerForm.vue | 2 +- 16 files changed, 31 insertions(+), 19 deletions(-) diff --git a/app/imports/client/ui/properties/PropertyForm.vue b/app/imports/client/ui/properties/PropertyForm.vue index 75c7ed1c..1852494a 100644 --- a/app/imports/client/ui/properties/PropertyForm.vue +++ b/app/imports/client/ui/properties/PropertyForm.vue @@ -12,6 +12,7 @@ label="Name" style="flex-basis: 320px;" :value="model.name" + :error-messages="errors.name" @change="(value, ack) => $emit('change', {path: ['name'], value, ack})" /> @@ -60,6 +63,7 @@ min="0" hint="How many properties this counts as when filling a slot" :value="model.slotQuantityFilled" + :error-messages="errors.slotQuantityFilled" @change="(value, ack) => $emit('change', {path: ['slotQuantityFilled'], value, ack})" /> @@ -73,6 +77,7 @@ hint="A caclulation to determine if this property can be added to a character" placeholder="Always active" :value="model.slotFillerCondition" + :error-messages="errors.slotFillerCondition" @change="(value, ack) => $emit('change', {path: ['slotFillerCondition'], value, ack})" /> @@ -86,6 +91,7 @@ hint="Text to display if the condition isn't met" placeholder="Always active" :value="model.slotFillerConditionNote" + :error-messages="errors.slotFillerConditionNote" @change="(value, ack) => $emit('change', {path: ['slotFillerConditionNote'], value, ack})" /> @@ -99,6 +105,7 @@ deletable-chips hint="Used to let slots find this property in a library" :value="model.libraryTags" + :error-messages="errors.libraryTags" @change="(value, ack) => $emit('change', {path: ['libraryTags'], value, ack})" /> @@ -119,6 +126,7 @@ deletable-chips hint="Tags let other properties target this property with interactions" :value="model.tags" + :error-messages="errors.tags" @change="(value, ack) => $emit('change', {path: ['tags'], value, ack})" /> @@ -229,6 +237,10 @@ export default { type: String, default: 'creatureProperties' }, + errors: { + type: Object, + default: () => ({}), + }, embedded: Boolean, // This dialog is embedded in a page noChildInsert: Boolean, // Don't allow inserting of children in this form }, diff --git a/app/imports/client/ui/properties/forms/ActionForm.vue b/app/imports/client/ui/properties/forms/ActionForm.vue index 33137670..1b89930e 100644 --- a/app/imports/client/ui/properties/forms/ActionForm.vue +++ b/app/imports/client/ui/properties/forms/ActionForm.vue @@ -79,7 +79,7 @@ label="Summary" hint="This will appear in the action card in the character sheet, summarize what the action does" :model="model.summary" - :error-messages="errors.summary" + :error-messages="errors['summary.text']" @change="({path, value, ack}) => $emit('change', {path: ['summary', ...path], value, ack})" /> @@ -88,7 +88,7 @@ label="Description" hint="This text will be displayed in the log when the action is taken" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/AttributeForm.vue b/app/imports/client/ui/properties/forms/AttributeForm.vue index 0d5e5f33..02f53aaa 100644 --- a/app/imports/client/ui/properties/forms/AttributeForm.vue +++ b/app/imports/client/ui/properties/forms/AttributeForm.vue @@ -70,7 +70,7 @@ diff --git a/app/imports/client/ui/properties/forms/BuffForm.vue b/app/imports/client/ui/properties/forms/BuffForm.vue index 95d63e0a..38e19afa 100644 --- a/app/imports/client/ui/properties/forms/BuffForm.vue +++ b/app/imports/client/ui/properties/forms/BuffForm.vue @@ -3,7 +3,7 @@ diff --git a/app/imports/client/ui/properties/forms/ClassForm.vue b/app/imports/client/ui/properties/forms/ClassForm.vue index c75a871b..08c8b5fb 100644 --- a/app/imports/client/ui/properties/forms/ClassForm.vue +++ b/app/imports/client/ui/properties/forms/ClassForm.vue @@ -17,7 +17,7 @@ diff --git a/app/imports/client/ui/properties/forms/ClassLevelForm.vue b/app/imports/client/ui/properties/forms/ClassLevelForm.vue index bb4d630f..5ee2f04b 100644 --- a/app/imports/client/ui/properties/forms/ClassLevelForm.vue +++ b/app/imports/client/ui/properties/forms/ClassLevelForm.vue @@ -33,7 +33,7 @@ label="Description" hint="A brief description of what this class level gives a character" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/ContainerForm.vue b/app/imports/client/ui/properties/forms/ContainerForm.vue index 6af54725..71e4ccec 100644 --- a/app/imports/client/ui/properties/forms/ContainerForm.vue +++ b/app/imports/client/ui/properties/forms/ContainerForm.vue @@ -66,7 +66,7 @@ class="mt-4" label="Description" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/FeatureForm.vue b/app/imports/client/ui/properties/forms/FeatureForm.vue index 9e814976..fbde4df8 100644 --- a/app/imports/client/ui/properties/forms/FeatureForm.vue +++ b/app/imports/client/ui/properties/forms/FeatureForm.vue @@ -4,7 +4,7 @@ label="Summary" hint="This will appear in the feature card in the character sheet" :model="model.summary" - :error-messages="errors.summary" + :error-messages="errors['summary.text']" @change="({path, value, ack}) => $emit('change', {path: ['summary', ...path], value, ack})" /> @@ -13,7 +13,7 @@ label="Description" hint="The rest of the description that doesn't fit in the summary goes here" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/ItemForm.vue b/app/imports/client/ui/properties/forms/ItemForm.vue index 74899c8a..94182d0e 100644 --- a/app/imports/client/ui/properties/forms/ItemForm.vue +++ b/app/imports/client/ui/properties/forms/ItemForm.vue @@ -75,7 +75,7 @@ diff --git a/app/imports/client/ui/properties/forms/NoteForm.vue b/app/imports/client/ui/properties/forms/NoteForm.vue index f0e9456d..0d14aabe 100644 --- a/app/imports/client/ui/properties/forms/NoteForm.vue +++ b/app/imports/client/ui/properties/forms/NoteForm.vue @@ -4,7 +4,7 @@ label="Summary" hint="This will appear in the card in the character sheet" :model="model.summary" - :error-messages="errors.summary" + :error-messages="errors['summary.text']" @change="({path, value, ack}) => $emit('change', {path: ['summary', ...path], value, ack})" /> @@ -13,7 +13,7 @@ label="Description" hint="Text that does not fit in the summary" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/SkillForm.vue b/app/imports/client/ui/properties/forms/SkillForm.vue index 4126cfed..d33d0613 100644 --- a/app/imports/client/ui/properties/forms/SkillForm.vue +++ b/app/imports/client/ui/properties/forms/SkillForm.vue @@ -47,7 +47,7 @@ diff --git a/app/imports/client/ui/properties/forms/SlotFillerForm.vue b/app/imports/client/ui/properties/forms/SlotFillerForm.vue index fbf5299c..daa8eb98 100644 --- a/app/imports/client/ui/properties/forms/SlotFillerForm.vue +++ b/app/imports/client/ui/properties/forms/SlotFillerForm.vue @@ -3,7 +3,7 @@ diff --git a/app/imports/client/ui/properties/forms/SpellForm.vue b/app/imports/client/ui/properties/forms/SpellForm.vue index 91df8045..c09e66c7 100644 --- a/app/imports/client/ui/properties/forms/SpellForm.vue +++ b/app/imports/client/ui/properties/forms/SpellForm.vue @@ -220,14 +220,14 @@ label="Summary" hint="This will appear in the action card in the character sheet, summarise what the action does" :model="model.summary" - :error-messages="errors.summary" + :error-messages="errors['summary.text']" @change="({path, value, ack}) => $emit('change', {path: ['summary', ...path], value, ack})" /> diff --git a/app/imports/client/ui/properties/forms/SpellListForm.vue b/app/imports/client/ui/properties/forms/SpellListForm.vue index a082f647..d6413189 100644 --- a/app/imports/client/ui/properties/forms/SpellListForm.vue +++ b/app/imports/client/ui/properties/forms/SpellListForm.vue @@ -58,7 +58,7 @@ diff --git a/app/imports/client/ui/properties/forms/TriggerForm.vue b/app/imports/client/ui/properties/forms/TriggerForm.vue index ece57be5..254f59c7 100644 --- a/app/imports/client/ui/properties/forms/TriggerForm.vue +++ b/app/imports/client/ui/properties/forms/TriggerForm.vue @@ -77,7 +77,7 @@ label="Description" hint="The rest of the description that doesn't fit in the summary goes here" :model="model.description" - :error-messages="errors.description" + :error-messages="errors['description.text']" @change="({path, value, ack}) => $emit('change', {path: ['description', ...path], value, ack})" />