Skip to content
Snippets Groups Projects
Commit d1340a29 authored by Ryan Senior's avatar Ryan Senior
Browse files

Search results should not include alerts

These were coming back with pulses, needed to include another query
clause to remove them.
parent 6892ef9b
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,9 @@
(when-not archived?
(-> (make-honeysql-search-query Pulse "pulse" pulse-columns-without-type)
(merge-name-search search-ctx)
(add-collection-criteria :collection_id search-ctx))))
(add-collection-criteria :collection_id search-ctx)
;; We don't want alerts included in pulse results
(h/merge-where [:= :alert_condition nil]))))
(s/defmethod ^:private create-search-query :metric
[_ search-ctx :- SearchContext]
......
......@@ -217,3 +217,13 @@
Metric [_ (archived {:name "metric test metric"})]
Segment [_ (archived {:name "segment test segment"})]]
(search-request :crowberto :q "test", :archived "true"))))
;; Search should not return alerts
(expect
[]
(with-search-items-in-root-collection "test"
(tt/with-temp* [Pulse [pulse {:alert_condition "rows"
:alert_first_only false
:alert_above_goal nil
:name nil}]]
(filter #(= (u/get-id pulse) (:id %)) ((user->client :crowberto) :get 200 "search")))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment