Skip to content
Snippets Groups Projects
Commit 6206257f authored by Chandrakant Gopalan's avatar Chandrakant Gopalan
Browse files

Changed to clojure style and fixed indentation

parent 33c52e65
Branches
Tags
No related merge requests found
......@@ -154,9 +154,8 @@
(s/defn ^:private default-value-for-dimension :- (s/maybe DimensionValue)
"Return the default value for a Dimension (Field Filter) param defined by the map TAG, if one is set."
[tag :- TagParam]
(or (:default tag)
(when (:required tag)
(throw (Exception. (str (tru "''{0}'' is a required param." (:display-name tag)))))))
(when (and (:required tag) (not (:default tag)))
(throw (Exception. (str (tru "''{0}'' is a required param." (:display-name tag))))))
(when-let [default (:default tag)]
{:type (:widget-type tag :dimension) ; widget-type is the actual type of the default value if set
:target [:dimension [:template-tag (:name tag)]]
......
......@@ -321,9 +321,9 @@
;; dimension -- required but unspecified
(expect Exception
(into {} (#'sql/value-for-tag {:name "checkin_date", :display-name "Checkin Date", :type "dimension", :required true,
:dimension ["field-id" (data/id :checkins :date)]}
nil)))
(into {} (#'sql/value-for-tag {:name "checkin_date", :display-name "Checkin Date", :type "dimension", :required true,
:dimension ["field-id" (data/id :checkins :date)]}
nil)))
;; dimension -- required and default specified
(expect
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment