diff --git a/src/metabase/api/embed.clj b/src/metabase/api/embed.clj index c96ced34d882d90944e784056d8d3bd413d5ebc2..7ca413b4ea187d6ba98c2573f1d9050e79a8ea5d 100644 --- a/src/metabase/api/embed.clj +++ b/src/metabase/api/embed.clj @@ -393,6 +393,8 @@ ;;; --------------------------------------------------- Remappings --------------------------------------------------- (api/defendpoint GET "/card/:token/field/:field-id/remapping/:remapped-id" + "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with + embedded Cards." [token field-id remapped-id value] {value su/NonBlankString} (let [unsigned-token (eu/unsign token) @@ -401,6 +403,8 @@ (public-api/card-field-remapped-values card-id field-id remapped-id value))) (api/defendpoint GET "/dashboard/:token/field/:field-id/remapping/:remapped-id" + "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with + embedded Dashboards." [token field-id remapped-id value] {value su/NonBlankString} (let [unsigned-token (eu/unsign token) diff --git a/src/metabase/api/public.clj b/src/metabase/api/public.clj index 3d665bdb476e860e15f4bb6a2efbfbc56767639f..f31a4063ee265febb0071ab5ca9116ef68149a13 100644 --- a/src/metabase/api/public.clj +++ b/src/metabase/api/public.clj @@ -326,6 +326,8 @@ (field-remapped-values field-id remapped-field-id value-str)) (api/defendpoint GET "/card/:uuid/field/:field-id/remapping/:remapped-id" + "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with public + Cards." [uuid field-id remapped-id value] {value su/NonBlankString} (api/check-public-sharing-enabled) @@ -333,6 +335,8 @@ (card-field-remapped-values card-id field-id remapped-id value))) (api/defendpoint GET "/dashboard/:uuid/field/:field-id/remapping/:remapped-id" + "Fetch remapped Field values. This is the same as `GET /api/field/:id/remapping/:remapped-id`, but for use with public + Dashboards." [uuid field-id remapped-id value] {value su/NonBlankString} (api/check-public-sharing-enabled) diff --git a/test/metabase/driver/mongo_test.clj b/test/metabase/driver/mongo_test.clj index 16a88f404fe05b65f28659fb5eac0e60e80bf073..4a346543db6a20e7ac834315ba7cdb6f819b8137 100644 --- a/test/metabase/driver/mongo_test.clj +++ b/test/metabase/driver/mongo_test.clj @@ -141,11 +141,11 @@ ;; Test that Tables got synced correctly, and row counts are correct (datasets/expect-with-engine :mongo - [{:rows 75, :active true, :name "categories"} - {:rows 1000, :active true, :name "checkins"} - {:rows 15, :active true, :name "users"} - {:rows 100, :active true, :name "venues"}] - (for [field (db/select [Table :name :active :rows] + [{:active true, :name "categories"} + {:active true, :name "checkins"} + {:active true, :name "users"} + {:active true, :name "venues"}] + (for [field (db/select [Table :name :active] :db_id (data/id) {:order-by [:name]})] (into {} field))) @@ -157,7 +157,7 @@ [{:special_type :type/PK, :base_type :type/Integer, :name "_id"} {:special_type nil, :base_type :type/DateTime, :name "date"} {:special_type :type/Category, :base_type :type/Integer, :name "user_id"} - {:special_type :type/Category, :base_type :type/Integer, :name "venue_id"}] + {:special_type nil, :base_type :type/Integer, :name "venue_id"}] [{:special_type :type/PK, :base_type :type/Integer, :name "_id"} {:special_type nil, :base_type :type/DateTime, :name "last_login"} {:special_type :type/Name, :base_type :type/Text, :name "name"} diff --git a/test/metabase/query_processor_test.clj b/test/metabase/query_processor_test.clj index cf5ed299b62bea9c546e2c62d3978696ee3e6039..ee65f606d429db920cc8921f9d87e63111a8ee8b 100644 --- a/test/metabase/query_processor_test.clj +++ b/test/metabase/query_processor_test.clj @@ -230,9 +230,8 @@ {:target_table_id (data/id :venues)} {}) :target (target-field (venues-col :id)) - :special_type (if (data/fks-supported?) - :type/FK - :type/Category) + :special_type (when (data/fks-supported?) + :type/FK) :base_type (data/expected-base-type->actual :type/Integer) :name (data/format-name "venue_id") :display_name "Venue ID"