From 92391c88133543fb87ad426082bc8831002588bf Mon Sep 17 00:00:00 2001 From: Karan Nayak Date: Thu, 19 Oct 2023 16:03:29 +1300 Subject: [PATCH 1/5] Fixed typo in Ecology options --- components/formset_basic.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/formset_basic.vue b/components/formset_basic.vue index bcd88d3..db67683 100644 --- a/components/formset_basic.vue +++ b/components/formset_basic.vue @@ -88,7 +88,7 @@ class="form-input" v-model="ecology" @change="addMushKey('ecology', ecology)"> - + From 1a21de088146bb9ef2aaa85304e693c434a51200 Mon Sep 17 00:00:00 2001 From: Karan Nayak Date: Thu, 19 Oct 2023 16:43:10 +1300 Subject: [PATCH 2/5] Fixed native field write back and changed stored ints to floats --- components/formset_basic.vue | 2 +- components/formset_cap.vue | 8 ++++---- components/formset_stipe.vue | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/formset_basic.vue b/components/formset_basic.vue index db67683..4fdc219 100644 --- a/components/formset_basic.vue +++ b/components/formset_basic.vue @@ -239,7 +239,7 @@ watch(mushJSON, async (newMushJSON, oldMushJSON) => { timeOfYear.value = mushJSON.value['time_of_year'] } if (mushJSON.value['native_or_introduced']) { - native.value = mushJSON.value('native') + native.value = mushJSON.value('native_or_introduced') /* if (mushJSON.value['native_or_introduced'] == true) { native.value ="Native" } else { diff --git a/components/formset_cap.vue b/components/formset_cap.vue index d145f74..fdc29bf 100644 --- a/components/formset_cap.vue +++ b/components/formset_cap.vue @@ -49,7 +49,7 @@ id="mush_cap_diameter_min" class="form-input" v-model="capDiaMin" - @change="addMushKey('cap_features', parseInt(capDiaMin), 'diameter_min')" /> + @change="addMushKey('cap_features', parseFloat(capDiaMin), 'diameter_min')" /> + @change="addMushKey('cap_features', parseFloat(capDiaMax), 'diameter_max')" /> + @change="addMushKey('cap_features', parseFloat(capThcMin), 'thickness_min')" /> + @change="addMushKey('cap_features', parseFloat(capThcMax), 'thickness_max')" /> + @change="addMushKey('stipe_features', parseFloat(stipeDiaMin), 'diameter_min')" /> + @change="addMushKey('stipe_features', parseFloat(stipeDiaMax), 'diameter_max')" /> + @change="addMushKey('stipe_features', parseFloat(stipeLenMax), 'length_max')" /> + @change="addMushKey('stipe_features', parseFloat(stipeHgtMax), 'height_max')" /> --> From 63147cee28f6897484f2b532ad9846bdbaa0ef35 Mon Sep 17 00:00:00 2001 From: Karan Nayak Date: Sat, 21 Oct 2023 12:49:32 +1300 Subject: [PATCH 5/5] Updated initData to enforce all fields being initialised to blank --- assets/data/initData.js | 47 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/assets/data/initData.js b/assets/data/initData.js index 45f4ffb..296cbf6 100644 --- a/assets/data/initData.js +++ b/assets/data/initData.js @@ -1,6 +1,45 @@ export default { - id: 0, - stipe_features: {}, - gills: {}, - cap_features: {} + "id": 0, + "tags": [], + "common_names": [], + "latin_names": [], + "maori_names": [], + "genus": "", + "description": "", + "lookalikes": [], + "lookalikes_description": "", + "links": [], + "nz_books": [], + "edibility": "", + "ecology": "", + "environment": "", + "time_of_year": [], + "native_or_introduced": "", + "photos": [], + "cap_features": { + "description": "", + "colour": [], + "diameter_min": null, + "diameter_max": null, + "thickness_min": null, + "thickness_max": null, + "texture": "", + "shape": [] + }, + "gills": { + "description": "", + "colour": [], + "attachment": "", + "spore_colour": "" + }, + "stipe_features": { + "description": "", + "diameter_min": null, + "diameter_max": null, + "colour": [], + "length_min": null, + "length_max": null, + "bruising_colour": "na", + "type": "" + } } \ No newline at end of file