Skip to content
Snippets Groups Projects
Unverified Commit 519e2d32 authored by Jerry Huang's avatar Jerry Huang Committed by GitHub
Browse files

Hydrate display for cards in search (#37755)

* hydrate display

* fix tests
parent 028dcc18
No related branches found
No related tags found
No related merge requests found
......@@ -147,11 +147,12 @@
:bookmark :boolean
;; returned for everything except Collection
:updated_at :timestamp
;; returned for Card only, used for scoring
;; returned for Card only, used for scoring and displays
:dashboardcard_count :integer
:last_edited_at :timestamp
:last_editor_id :integer
:moderated_status :text
:display :text
;; returned for Metric and Segment
:table_id :integer
:table_schema :text
......@@ -265,7 +266,7 @@
(defmethod columns-for-model "card"
[_]
(conj default-columns :collection_id :collection_position :dataset_query :creator_id
(conj default-columns :collection_id :collection_position :dataset_query :display :creator_id
[:collection.name :collection_name]
[:collection.authority_level :collection_authority_level]
bookmark-col dashboardcard-count-col))
......
......@@ -53,6 +53,7 @@
:database_id false
:dataset_query nil
:description nil
:display nil
:id true
:initial_sync_status nil
:model_id false
......@@ -106,8 +107,8 @@
(sorted-results
[(make-result "dashboard test dashboard", :model "dashboard", :bookmark false :creator_id true :creator_common_name "Rasta Toucan")
test-collection
(make-result "card test card", :model "card", :bookmark false, :dashboardcard_count 0 :creator_id true :creator_common_name "Rasta Toucan" :dataset_query nil)
(make-result "dataset test dataset", :model "dataset", :bookmark false, :dashboardcard_count 0 :creator_id true :creator_common_name "Rasta Toucan" :dataset_query nil)
(make-result "card test card", :model "card", :bookmark false, :dashboardcard_count 0 :creator_id true :creator_common_name "Rasta Toucan" :dataset_query nil :display "table")
(make-result "dataset test dataset", :model "dataset", :bookmark false, :dashboardcard_count 0 :creator_id true :creator_common_name "Rasta Toucan" :dataset_query nil :display "table")
(make-result "action test action", :model "action", :model_name (:name action-model-params), :model_id true,
:database_id true :creator_id true :creator_common_name "Rasta Toucan" :dataset_query (update (mt/query venues) :type name))
(merge
......@@ -244,6 +245,7 @@
[:like [:lower :description] "%foo%"] [:inline 0]
[:like [:lower :collection_name] "%foo%"] [:inline 0]
[:like [:lower :collection_type] "%foo%"] [:inline 0]
[:like [:lower :display] "%foo%"] [:inline 0]
[:like [:lower :table_schema] "%foo%"] [:inline 0]
[:like [:lower :table_name] "%foo%"] [:inline 0]
[:like [:lower :table_description] "%foo%"] [:inline 0]
......@@ -353,7 +355,8 @@
(def ^:private dashboard-count-results
(letfn [(make-card [dashboard-count]
(make-result (str "dashboard-count " dashboard-count) :dashboardcard_count dashboard-count,
:model "card", :bookmark false :creator_id true :creator_common_name "Rasta Toucan" :dataset_query nil))]
:model "card", :bookmark false :creator_id true :creator_common_name "Rasta Toucan"
:dataset_query nil :display "table"))]
(set [(make-card 5)
(make-card 3)
(make-card 0)])))
......
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