Enable case insensitive filtering

This commit is contained in:
Saskia Lindner 2017-07-26 17:08:51 +02:00
parent 5dce696e29
commit a9000d2c27

View File

@ -118,7 +118,7 @@
(defn search-input [{:keys [title on-save on-stop]}] (defn search-input [{:keys [title on-save on-stop]}]
(let [val (r/atom title) (let [val (r/atom title)
save #(let [v (-> @val str clojure.string/trim)] save #(let [v (-> @val str str/trim)]
(on-save v))] (on-save v))]
(fn [] (fn []
[:input {:type "text" [:input {:type "text"
@ -139,7 +139,7 @@
(let [slower-than-ms-int (js/parseInt @slower-than-ms) (let [slower-than-ms-int (js/parseInt @slower-than-ms)
slower-than-bold-int (js/parseInt @slower-than-bold) slower-than-bold-int (js/parseInt @slower-than-bold)
op-filter (when-not (str/blank? @filter-items) op-filter (when-not (str/blank? @filter-items)
(filter #(str/includes? (str (:operation %) " " (:op-type %)) @filter-items))) (filter #(str/includes? (str/lower-case (str (:operation %) " " (:op-type %))) @filter-items)))
ms-filter (when-not (str/blank? @slower-than-ms) ms-filter (when-not (str/blank? @slower-than-ms)
(filter #(< slower-than-ms-int (:duration %)))) (filter #(< slower-than-ms-int (:duration %))))
transducers (apply comp (remove nil? [ms-filter op-filter])) transducers (apply comp (remove nil? [ms-filter op-filter]))