       "graph" (alert-graph {:date date, :description description} owner)
       nil)))
 
-(defn alerts-list [{:keys [alerts selected-filter]}]
+(defn alerts-list [{:keys [alerts metrics-filter]}]
   (reify
     om/IRender
     (render [_]
       (html [:div.list-group
              (om/build-all alert
-                           (filter #(re-find (re-pattern (or selected-filter ".*"))
+                           (filter #(re-find (re-pattern (or metrics-filter ".*"))
                                              (:metric_name %))
                                    alerts))]))))
 
-(defn description [{:keys [alerts selected-detector selected-filter selected-metric login subscriptions]} owner]
+(defn description [{:keys [alerts selected-detector metrics-filter selected-metric login subscriptions]} owner]
   (reify
     om/IRenderState
     (render-state [_ {:keys [event-channel]}]

               (html/text-field {:ref "metrics-filter"
                                 :class "form-control"
                                 :on-change handler}
                                "metrics-filter" selected-filter)])))))

(defn query-controls [{:keys [selected-filter metrics selected-metric selected-date-range] :as state} owner]
  (reify
    om/IRenderState
    (render-state [_ {:keys [event-channel]}]
      (html
       [:form
        (om/build metrics-filter
                  (select-keys state [:selected-filter :metrics])
                  {:init-state {:event-channel event-channel}})
        (om/build metrics-list
                  (select-keys state [:selected-filter :metrics :selected-metric])
                  {:init-state {:event-channel event-channel}})
        (om/build date-selector
                  (select-keys state [:selected-date-range])

                  (when (not= pre-query (extract-query)) (retrieve-alerts)))

                :filter-selected
                (route-update {:metrics-filter message})

                :detector-selected
                (route-update {:selected-detector message
