Skip to content

Commit

Permalink
Autoformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
heralden committed Dec 4, 2019
1 parent 20046fc commit 72bd7b2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 28 deletions.
3 changes: 2 additions & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
[lein-pdo "0.1.1"]
[lein-cljfmt "0.6.1"]]

:cljfmt {:indents {wait-for [[:inner 0]]}}
:cljfmt {:indents {wait-for [[:inner 0]]
after-load [[:inner 0]]}}

:aliases {"dev" ["do" "clean"
["pdo"
Expand Down
4 changes: 2 additions & 2 deletions src/im_tables/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@
(sandbox)
(fn [{db :db} [_ loc & {:keys [force?]}]]
(let [deconstructed-query (->> (query/deconstruct-by-class
(get-in db [:service :model])
(get-in db [:query]))
(get-in db [:service :model])
(get-in db [:query]))
vals
(apply merge))]
(cond-> {:db (assoc db :query-parts deconstructed-query)}
Expand Down
12 changes: 6 additions & 6 deletions src/im_tables/views/dashboard/save.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@
(fn [loc]
[:div.dropdown
{:ref (on-event
"show.bs.dropdown"
#(when (nil? @counts)
"show.bs.dropdown"
#(when (nil? @counts)
;; This will only run for the initial query. For any
;; subsequent queries, we'll `:main/count-deconstruction`
;; alongside the query.
(doseq [event (map (fn [[part details]]
[:main/count-deconstruction loc part details])
@query-parts)]
(dispatch event))))}
(doseq [event (map (fn [[part details]]
[:main/count-deconstruction loc part details])
@query-parts)]
(dispatch event))))}
[:button.btn.btn-default.dropdown-toggle
{:data-toggle "dropdown"} [:span [:i.fa.fa-cloud-upload] " Save List"]]
(into [:ul.dropdown-menu]
Expand Down
26 changes: 13 additions & 13 deletions src/im_tables/views/table/head/controls.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,16 @@
(let [active-filters? (not-empty (filter (partial constraint-has-path? view) (:where @query)))]
[:span.dropdown
{:ref (on-event
"hide.bs.dropdown"
(fn []
"hide.bs.dropdown"
(fn []
;; Reset the blank constraint atom when the dropdown is closed
(reset! blank-constraint-atom {:path view :op "=" :value nil})
(reset! blank-constraint-atom {:path view :op "=" :value nil})
;; *Try* to save the changes every time the dropdown is
;; closed, even by just clicking off it. This means a user
;; can remove a handful of filters without having to click
;; Apply. The event will do a diff to make sure something
;; has actually changed before rerunning the query
(dispatch [:filters/save-changes loc])))}
(dispatch [:filters/save-changes loc])))}
[:i.fa.fa-filter.dropdown-toggle.filter-icon
{:on-click (fn [] (dispatch [:main/set-temp-query loc]))
:data-toggle "dropdown"
Expand Down Expand Up @@ -366,15 +366,15 @@
;; want to know what's selected (for instance, highlighting the
;; histogram).
{:ref (comp
(on-event
"hide.bs.dropdown"
(fn []
(reset! local-state {})
(dispatch [:select/clear-selection loc view])))
(on-event
"show.bs.dropdown"
#(when (nil? @response)
(dispatch [:main/summarize-column loc view]))))}
(on-event
"hide.bs.dropdown"
(fn []
(reset! local-state {})
(dispatch [:select/clear-selection loc view])))
(on-event
"show.bs.dropdown"
#(when (nil? @response)
(dispatch [:main/summarize-column loc view]))))}
[:i.fa.fa-bar-chart.dropdown-toggle
{:data-toggle "dropdown"
:ref (fn [el] (reset! !summary-dropdown el))}]
Expand Down
4 changes: 2 additions & 2 deletions test/cljs/im_tables/core_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
(let [loc [:default]]
(utils/after-load loc im-config
(testing "im-table runs query"
(let [response @(rf/subscribe [:main/query-response loc])]
(is (some? response)))))))
(let [response @(rf/subscribe [:main/query-response loc])]
(is (some? response)))))))

(deftest column-summary
(let [loc [:default]]
Expand Down
8 changes: 4 additions & 4 deletions test/cljs/im_tables/test_utils.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{:before (fn []
(when-let [vars (seq @stubbed-variables)]
(doseq [restore-fn vars]
(restore-fn))
(restore-fn))
(reset! stubbed-variables '()))
(rf/dispatch-sync [:clear-db]))}))

Expand Down Expand Up @@ -91,6 +91,6 @@
"Common operation that includes loading im-tables-3."
[location im-config & body]
`(run-test-async
(rf/dispatch-sync [:im-tables/load ~location ~im-config])
(wait-for [:main/replace-query-response]
~@body)))
(rf/dispatch-sync [:im-tables/load ~location ~im-config])
(wait-for [:main/replace-query-response]
~@body)))

0 comments on commit 72bd7b2

Please sign in to comment.