-
- {{ preset.label }}
+ {{ pq.label }}
diff --git a/frontend/src/seqvars/components/QueryList.vue b/frontend/src/seqvars/components/QueryList.vue
index 448574b6d..c1d885c6c 100644
--- a/frontend/src/seqvars/components/QueryList.vue
+++ b/frontend/src/seqvars/components/QueryList.vue
@@ -1,20 +1,21 @@
@@ -26,12 +27,23 @@ let count: number
v-for="(query, index) in queries"
:key="index"
:selected="index === selectedIndex"
+ :modified="
+ !!query &&
+ !matchesPredefinedQuery(
+ presets,
+ query,
+ presets.seqvarspredefinedquery_set.find(
+ (pq) => pq.sodar_uuid === query.predefinedquery,
+ )!,
+ )
+ "
@click="selectedIndex = index"
+ @revert="$emit('revert')"
>
#{{ index + 1 }}
{{
- predefinedQueries.find(
+ presets.seqvarspredefinedquery_set.find(
(pq) => pq.sodar_uuid === query.predefinedquery,
)?.label
}}
@@ -47,10 +59,7 @@ let count: number
>
-
-
diff --git a/frontend/src/seqvars/components/utils.ts b/frontend/src/seqvars/components/utils.ts
new file mode 100644
index 000000000..838d0e9df
--- /dev/null
+++ b/frontend/src/seqvars/components/utils.ts
@@ -0,0 +1,25 @@
+import {
+ SeqvarsPredefinedQuery,
+ SeqvarsQueryPresetsSetVersionDetails,
+} from '@varfish-org/varfish-api/lib'
+import { Query } from '@/seqvars/types'
+
+import { matchesFrequencyPreset } from './FrequencySelect/utils'
+import { matchesGenotypePreset } from './GenotypeSelect/utils'
+
+export function matchesPredefinedQuery(
+ presets: SeqvarsQueryPresetsSetVersionDetails,
+ query: Query,
+ pq: SeqvarsPredefinedQuery,
+): boolean {
+ const genotype = pq.genotype?.choice
+ const frequency = presets.seqvarsquerypresetsfrequency_set.find(
+ (f) => f.sodar_uuid === pq.frequency,
+ )
+ return (
+ !!genotype &&
+ matchesGenotypePreset(query.genotype, genotype) &&
+ !!frequency &&
+ matchesFrequencyPreset(query.frequency, frequency)
+ )
+}
diff --git a/frontend/src/seqvars/views/SeqvarsFiltration.vue b/frontend/src/seqvars/views/SeqvarsFiltration.vue
index 130cc28da..9bc6a2e02 100644
--- a/frontend/src/seqvars/views/SeqvarsFiltration.vue
+++ b/frontend/src/seqvars/views/SeqvarsFiltration.vue
@@ -73,16 +73,28 @@ const createQuery = (pq: SeqvarsPredefinedQuery): Query => {
>
queries.splice(index, 1)"
+ @update:selected-index="(index) => (selectedQueryIndex = index)"
+ @remove="(index) => queries.splice(index, 1)"
+ @revert="
+ () => {
+ const preset = presets.seqvarspredefinedquery_set.find(
+ (p) => p.sodar_uuid === selectedQuery?.predefinedquery,
+ )
+ if (preset) {
+ selectedQuery = createQuery(preset)
+ }
+ }
+ "
/>
{
const preset = presets.seqvarspredefinedquery_set.find(
(p) => p.sodar_uuid === id,