add converted mana cost search filtering
This commit is contained in:
parent
2e0644057e
commit
ad413d5399
|
@ -120,6 +120,7 @@
|
||||||
(def search-filter-defs
|
(def search-filter-defs
|
||||||
{:name {:label "Name" :type :text :comparisons [:like :=]}
|
{:name {:label "Name" :type :text :comparisons [:like :=]}
|
||||||
:set-code {:label "Set" :type :text :comparisons [:=] :component set-search-field-element}
|
:set-code {:label "Set" :type :text :comparisons [:=] :component set-search-field-element}
|
||||||
|
:cmc {:label "Converted Mana Cost" :type :numeric :comparisons [:= :> :<] :validation-fn valid-integer? :transform-fn js/parseInt}
|
||||||
:colors {:label "Colors" :type :checkbox :comparisons [:like :=] :choices ["Black" "Blue" "Green" "Red" "White"] :component checkboxes-search-field-element}
|
:colors {:label "Colors" :type :checkbox :comparisons [:like :=] :choices ["Black" "Blue" "Green" "Red" "White"] :component checkboxes-search-field-element}
|
||||||
:color-identity {:label "Color Identity" :type :checkbox :comparisons [:like :=] :choices [["Black" "B"] ["Blue" "U"] ["Green" "G"] ["Red" "R"] ["White" "W"]] :component checkboxes-search-field-element}
|
:color-identity {:label "Color Identity" :type :checkbox :comparisons [:like :=] :choices [["Black" "B"] ["Blue" "U"] ["Green" "G"] ["Red" "R"] ["White" "W"]] :component checkboxes-search-field-element}
|
||||||
:type {:label "Type" :type :text :comparisons [:like :=]}
|
:type {:label "Type" :type :text :comparisons [:like :=]}
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
(def search-field-where-clauses
|
(def search-field-where-clauses
|
||||||
{:name (text-comparison-fn [:name :normalized_name])
|
{:name (text-comparison-fn [:name :normalized_name])
|
||||||
:set-code (text-comparison-fn [:set_code] true)
|
:set-code (text-comparison-fn [:set_code] true)
|
||||||
|
:cmc (numeric-comparison-fn [:converted_mana_cost])
|
||||||
:colors (fn [value comparison]
|
:colors (fn [value comparison]
|
||||||
(let [colors (as-> value x
|
(let [colors (as-> value x
|
||||||
(map string/trim x)
|
(map string/trim x)
|
||||||
|
|
Loading…
Reference in a new issue