Skip to content

Commit

Permalink
Merge pull request #12 from xtdb/fix-bugs
Browse files Browse the repository at this point in the history
Fix some small bugs
  • Loading branch information
Akeboshiwind authored Mar 8, 2024
2 parents 4ae09f3 + 8fcc9b2 commit b5e2cca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/xt_fiddle/client.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
(for [k all-keys]
^{:key k}
[:th {:class "text-left p-4"}
k])]]
(-> k symbol str)])]]
[:tbody
(for [[i row] (map-indexed vector results)]
^{:key i}
Expand All @@ -205,7 +205,8 @@
^{:key k}
[:td {:class "text-left p-4"}
(let [value (get row k)]
(if (map? value)
(if (and (not (string? value))
(seqable? value))
(case type
:xtql [highlight-code {:language "clojure"}
(pr-str value)]
Expand Down Expand Up @@ -252,17 +253,19 @@
[:<>
[:div {:class "flex-1 flex flex-col"}
[:h2 "Transactions:"]
[:div {:class "grow"}
; NOTE: The min-h-0 somehow makes sure the editor doesn't
; overflow the flex container
[:div {:class "grow min-h-0"}
[editor {:source @(rf/subscribe [:txs])
:change-callback #(rf/dispatch [:set-txs %])}]]]
[:div {:class "flex-1 flex flex-col"}
[:h2 "Query:"]
[:div {:class "grow"}
[:div {:class "grow min-h-0"}
[editor {:source @(rf/subscribe [:query])
:change-callback #(rf/dispatch [:set-query %])}]]]])]
[:section {:class "h-1/2 flex flex-col"}
[:h2 "Results:"]
[:div {:class "grow border p-2 overflow-auto"}
[:div {:class "grow min-h-0 border p-2 overflow-auto"}
(if @(rf/subscribe [:twirly?])
[spinner]
(let [{:keys [results failure]} @(rf/subscribe [:results-or-failure])]
Expand Down

0 comments on commit b5e2cca

Please sign in to comment.