From 4a958d676666cdffac9a8d4dde7aee1afff26e87 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 17 Feb 2024 01:35:35 +0000 Subject: [PATCH] Update backend docs on Sat Feb 17 01:35:35 UTC 2024 --- index.html | 56 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index eedb25b..1ae0bd5 100644 --- a/index.html +++ b/index.html @@ -2866,7 +2866,7 @@ }; })(SyntaxHighlighter); Metabase -- Marginalia

Metabase


The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋

-



(this space intentionally left almost blank)

namespaces

 

Metabase Backend Developer Documentation

+



(this space intentionally left almost blank)

namespaces

 

Metabase Backend Developer Documentation

Welcome to Metabase! Here are links to useful resources.

@@ -15075,14 +15075,15 @@

Important Libraries

{settings :map} (api/check-superuser) (let [ldap-settings (-> settings - (select-keys (keys ldap/mb-settings->ldap-details)) (assoc :ldap-port (when-let [^String ldap-port (not-empty (str (:ldap-port settings)))] (Long/parseLong ldap-port))) - (update :ldap-password update-password-if-needed)) + (update :ldap-password update-password-if-needed) + (dissoc :ldap-enabled)) ldap-details (set/rename-keys ldap-settings ldap/mb-settings->ldap-details) results (ldap/test-ldap-connection ldap-details)] (if (= :SUCCESS (:status results)) (t2/with-transaction [_conn] + ;; We need to update the ldap settings before we update ldap-enabled, as the ldap-enabled setter tests the ldap settings (setting/set-many! ldap-settings) (setting/set-value-of-type! :boolean :ldap-enabled (boolean (:ldap-enabled settings)))) ;; test failed, return result message @@ -22019,6 +22020,7 @@

Important Libraries

[clojure.string :as str] [metabase.automagic-dashboards.populate :as populate] [metabase.query-processor.util :as qp.util] + [metabase.shared.dashboards.constants :as dashboards.constants] [metabase.util :as u] [metabase.util.files :as u.files] [metabase.util.i18n :as i18n :refer [deferred-trs LocalizedString]] @@ -22246,7 +22248,18 @@

Important Libraries

(comp (partial re-find #".+(?=\.yaml$)") str (memfn ^Path getFileName)))
(defn- specificity
   [dashboard-template]
-  (transduce (map (comp count ancestors)) + (:applies_to dashboard-template)))
+ (transduce (map (comp count ancestors)) + (:applies_to dashboard-template)))

Given a card definition from a template, fill in the card template with default width and height +values based on the template display type if those dimensions aren't already present.

+
(defn- ensure-default-card-sizes
+  [card-spec]
+  (update-vals
+    card-spec
+    (fn [{:keys [visualization] :as card-spec}]
+      (let [defaults (get-in dashboards.constants/card-size-defaults [(keyword visualization) :default])]
+        (into defaults card-spec)))))

Update the card template dimensions to align with the default FE dimensions.

+
(defn- set-default-card-dimensions
+  [dashboard-template]
+  (update dashboard-template :cards #(mapv ensure-default-card-sizes %)))
(defn- make-dashboard-template
   [entity-type {:keys [cards] :as r}]
   (-> (cond-> r
@@ -22255,6 +22268,7 @@ 

Important Libraries

(assoc :dashboard-template-name entity-type :specificity 0) (update :applies_to #(or % entity-type)) + set-default-card-dimensions dashboard-template-validator (as-> dashboard-template (assoc dashboard-template @@ -23160,9 +23174,9 @@

Important Libraries

(def ^Long grid-width
   24)

Default card width.

(def ^Long default-card-width
-  6)

Default card height

+ 12)

Default card height

(def ^Long default-card-height
-  4)

Create and return a new collection.

+ 6)

Create and return a new collection.

(defn create-collection!
   [title description parent-collection-id]
   (first (t2/insert-returning-instances!
@@ -91609,7 +91623,33 @@ 

`::position`

(swap! app-db-id->user-exists? assoc (mdb.connection/unique-identifier) exists?) exists?)))))) :doc false - :audit :never)
 

Formatting for dates, times, and ranges.

+ :audit :never)
 
+
(ns metabase.shared.dashboards.constants)

Default width of a dashboard

+
(def ^:export GRID_WIDTH
+  24)

Default card sizes per visualization type

+
(def card-size-defaults
+  {:table       {:min {:width 4 :height 3} :default {:width 12 :height 9}}
+   :gauge       {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :bar         {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :pie         {:min {:width 4 :height 3} :default {:width 12 :height 8}}
+   :scatter     {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :waterfall   {:min {:width 4 :height 3} :default {:width 14 :height 6}}
+   :combo       {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :stacked     {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :scalar      {:min {:width 2 :height 2} :default {:width 6 :height 3}}
+   :line        {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :link        {:min {:width 1 :height 1} :default {:width 8 :height 1}}
+   :action      {:min {:width 1 :height 1} :default {:width 4 :height 1}}
+   :area        {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :pivot       {:min {:width 4 :height 3} :default {:width 12 :height 9}}
+   :funnel      {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :progress    {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :smartscalar {:min {:width 2 :height 2} :default {:width 6 :height 3}}
+   :map         {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :object      {:min {:width 4 :height 3} :default {:width 12 :height 9}}
+   :row         {:min {:width 4 :height 3} :default {:width 12 :height 6}}
+   :heading     {:min {:width 1 :height 1} :default {:width GRID_WIDTH :height 1}}
+   :text        {:min {:width 1 :height 1} :default {:width 12 :height 3}}})
 

Formatting for dates, times, and ranges.

(ns metabase.shared.formatting.date
   (:require
    [metabase.shared.formatting.constants :as constants]
@@ -117166,7 +117206,7 @@ 

Java system property user.dir

[] [{:model :model/QueryExecution :timestamp-col :started_at} {:model :model/AuditLog :timestamp-col :timestamp} - {:model :model/ViewLog :timestamp-col :timestamp}])