Skip to content

Commit

Permalink
[ALS-7572] Only show option cards when enabled (#254)
Browse files Browse the repository at this point in the history
Co-authored-by: Gcolon021 <34667267+Gcolon021@users.noreply.github.com>
  • Loading branch information
JamesPeck and Gcolon021 authored Oct 16, 2024
1 parent ef87741 commit f5df143
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import { branding } from '$lib/configuration';
import { branding, features } from '$lib/configuration';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
Expand Down Expand Up @@ -30,7 +30,11 @@
import { addFilter, getFiltersByType } from '$lib/stores/Filter';
let edit = $page.url.searchParams.get('edit') || '';
let selectedOption: Option = ['snp', 'genomic'].includes(edit) ? (edit as Option) : Option.None;
let selectedOption: Option = (() => {
if (features.enableGENEQuery && !features.enableSNPQuery) return Option.Genomic;
if (!features.enableGENEQuery && features.enableSNPQuery) return Option.SNP;
return ['snp', 'genomic'].includes(edit) ? (edit as Option) : Option.None;
})();
function clearFilters() {
clearGeneFilters();
Expand Down Expand Up @@ -80,10 +84,10 @@
backTitle="Back to Explore"
transition={true}
>
{#if selectedOption === Option.None}
<FilterType class="my-4" on:select={onSelectFilterType} active={selectedOption} />
{:else}
{#if features.enableGENEQuery && features.enableSNPQuery}
<FilterType class="my-4" on:select={onSelectFilterType} active={selectedOption} />
{/if}
{#if selectedOption !== Option.None}
{#if selectedOption === Option.Genomic}
<GeneSearch class="mb-0 mt-6" />
{:else}
Expand Down

0 comments on commit f5df143

Please sign in to comment.