From ee015f5b91fdce6f0b55e9eac6b7b9579f541c3b Mon Sep 17 00:00:00 2001 From: Oliver Stolpe Date: Mon, 21 Oct 2024 16:24:57 +0200 Subject: [PATCH] feat: quick preset editor must force values to be set on creation (#2028) --- .../components/FilterForm/QuickPresets.vue | 26 ++++++++++++++++++- .../components/QueryPresets/SetEditor.vue | 1 - .../QueryPresets/SetQuickPresets.vue | 22 ++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/frontend/src/variants/components/FilterForm/QuickPresets.vue b/frontend/src/variants/components/FilterForm/QuickPresets.vue index ef00d1c77..c715440e1 100644 --- a/frontend/src/variants/components/FilterForm/QuickPresets.vue +++ b/frontend/src/variants/components/FilterForm/QuickPresets.vue @@ -323,6 +323,30 @@ const quickPresetWrapper = computed({ }, }) +const quickPresetsComplete = computed(() => { + const result = {} + for (const [name, theQuickPresets] of Object.entries(props.quickPresets)) { + let skip = false + for (const key of [ + 'inheritance', + 'frequency', + 'impact', + 'quality', + 'chromosomes', + 'flagsetc', + ]) { + if (!theQuickPresets[key]) { + skip = true + break + } + } + if (!skip) { + result[name] = theQuickPresets + } + } + return result +}) + /** Refresh all presets. */ const refreshAllRefs = () => { refreshInheritanceRef() @@ -366,7 +390,7 @@ onMounted(() => { v-model="quickPresetWrapper" class="custom-select custom-select-sm" > - diff --git a/frontend/src/variants/components/QueryPresets/SetEditor.vue b/frontend/src/variants/components/QueryPresets/SetEditor.vue index c3c5f362d..b1406aeef 100644 --- a/frontend/src/variants/components/QueryPresets/SetEditor.vue +++ b/frontend/src/variants/components/QueryPresets/SetEditor.vue @@ -250,7 +250,6 @@ const handleAddClicked = async (category) => { quality: null, chromosome: null, flagsetc: null, - inheritance: null, } } else if (category === 'qualitypresets') { payload = { diff --git a/frontend/src/variants/components/QueryPresets/SetQuickPresets.vue b/frontend/src/variants/components/QueryPresets/SetQuickPresets.vue index 114930447..3af1c2122 100644 --- a/frontend/src/variants/components/QueryPresets/SetQuickPresets.vue +++ b/frontend/src/variants/components/QueryPresets/SetQuickPresets.vue @@ -1,6 +1,8 @@