Skip to content

Commit

Permalink
Only show export options applicable to filetype
Browse files Browse the repository at this point in the history
  • Loading branch information
heralden committed Sep 30, 2022
1 parent 2682a09 commit 67cace2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/im_tables/views/dashboard/exporttable.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
:rdf [:span [:i.fa.fa-sitemap] " RDF"]
:ntriples [:span [:i.fa.fa-sitemap] " N-Triples"]})

(defn bioinf? [format] (contains? #{"fasta" "gff3" "bed"} format))
(defn tabular? [format] (contains? #{"tsv" "csv"} format))

(defn format-dropdown
"creates the dropdown to allow users to select their preferred format"
[loc {:keys [format accepted-formats order-formats]}]
Expand Down Expand Up @@ -140,7 +143,7 @@

(defn modal-body
[loc]
(let [data-out @(subscribe [:settings/data-out loc])]
(let [{:keys [format] :as data-out} @(subscribe [:settings/data-out loc])]
[:div.exporttable-body
[:div.form
[:div.form-group
Expand All @@ -154,8 +157,10 @@
[format-dropdown loc data-out]]]]]
[:div.export-options
[preview-panel loc]
[column-headers-panel loc data-out]
[rows-panel loc data-out]
(when (tabular? format)
[column-headers-panel loc data-out])
(when-not (bioinf? format)
[rows-panel loc data-out])
[data-package-panel loc data-out]
[compression-panel loc data-out]]]))

Expand Down

0 comments on commit 67cace2

Please sign in to comment.