Skip to content

Commit

Permalink
[ALS-7501] Refactor and fix tool suite conditions (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck authored Oct 16, 2024
1 parent f5df143 commit 65abd33
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/lib/components/explorer/results/ResultsPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@
totalPatients !== 0 &&
hasFilterOrExport;
$: showExplorerDistributions =
!isOpenAccess &&
features.explorer.distributionExplorer &&
$filters.length !== 0 &&
!$filters.every((filter) => filter.filterType === 'genomic' || filter.filterType === 'snp');
$: showDiscoverDistributions =
isOpenAccess && features.discoverFeautures.distributionExplorer && $filters.length !== 0;
$: showVariantExplorer = !isOpenAccess && features.explorer.variantExplorer && $hasGenomicFilter;
$: showToolSuite =
totalPatients !== 0 &&
($filters.length !== 0 || $exports.length !== 0) &&
(showExplorerDistributions || showDiscoverDistributions || showVariantExplorer);
onMount(async () => {
unsubFilters = filters.subscribe(() => {
triggerRefreshCount = getCount();
Expand Down Expand Up @@ -196,12 +212,12 @@
</div>
{/if}
</div>
{#if totalPatients !== 0 && ($filters.length !== 0 || $exports.length !== 0)}
{#if showToolSuite}
<div class="flex flex-col items-center mt-7">
<hr class="!border-t-2" />
<h5 class="text-center text-xl mt-7">Tool Suite</h5>
<div class="flex flex-row flex-wrap justify-items-center gap-4 w-80 justify-center">
{#if !isOpenAccess && features.explorer.distributionExplorer && $filters.length !== 0}
{#if showExplorerDistributions}
<CardButton
href="/explorer/distributions"
data-testid="distributions-btn"
Expand All @@ -210,7 +226,7 @@
size="md"
/>
{/if}
{#if isOpenAccess && features.discoverFeautures.distributionExplorer && $filters.length !== 0}
{#if showDiscoverDistributions}
<CardButton
href="/discover/distributions"
data-testid="distributions-btn"
Expand All @@ -219,7 +235,7 @@
size="md"
/>
{/if}
{#if !isOpenAccess && features.explorer.variantExplorer && $hasGenomicFilter}
{#if showVariantExplorer}
<CardButton
href="/explorer/variant"
data-testid="variant-explorer-btn"
Expand Down

0 comments on commit 65abd33

Please sign in to comment.