Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 288494d

Browse files
camsaulnemanjaglumacflamberAriya Hidayat
authored
Merge x.37.5back into master (metabase#14282)
* metabase#11907 Repro: Tooltip should display correct value for unaggregated data [ci skip] (metabase#14102) Co-authored-by: flamber <[email protected]> * metabase#11957 Repro: Changing filters shouldn't drop aggregated filter [ci skip] (metabase#14103) * metabase#13187 Repro: FE should respect (BE) settings for `auto_run_queries` [ci skip] (metabase#14120) * Mac App build script tweaks * Defer the parser and its related construction until it's needed (metabase#14133) Expression parser construction is expensive (mainly due to grammar validation via Chevrotain's performSelfAnalysis). Thus, instantiating the parsers at the initialization time will lead to a signifant delay in DOMContentLoaded, thereby affecting (among others) the embedding performance. To avoid this, simply defer that step until parsing is really needed (which is actually far far later, i.e. when the user is using the notebook). * Add a clarifying comment regarding parser lazy loading * Fix metabase#13187: FE should respect settings for `auto_run_queries` on page load (metabase#14121) Closes metabase#13187 * Remove initial state from `auto_run_queries` * Assert that `auto_run_queries` is ON by default for sample dataset This test confirms that toggle works without explicitly setting the initial state to `true`. * Improve toggle's accessibility Reference: https://a11y-style-guide.com/style-guide/section-forms.html#kssref-forms-toggles * Adjust Cypress tests * metabase#13415 Repro: Visualization type should be respected when entering a question from a dashboard [ci skip] (metabase#14142) * Fix metabase#13299: Misconfigured "Port" label and input fields (metabase#14134) Closes metabase#13299 * Add `aria-labelledby` attribute to numeric form fields * Update affected Cypress tests * metabase#13175 Repro: Can not do arithmetic in filter expressions (metabase#14155) * metabase#14193 Repro: Custom column is dropped after removing filter (that comes after aggregation) [ci skip] (metabase#14197) * Fix 13868 (second try) (metabase#14248) * Fix 13868 * Unskip Cypress test * metabase#14255 Repro: CC and table column same name [REGRESSION] [ci skip] (metabase#14267) * Backport migrations fixups from master (metabase#14276) * Misc code improvements (metabase#14247) * Add test-cypress-open-no-backend * Enable test endpoints for dev * More are+ test util function to metabase.test * Improve the way with-temp-defaults are reloaded for models * Simplify defendpoint macro a bit; convert tests to new style * Rework a few more tests * Code cleanup Co-authored-by: Nemanja Glumac <[email protected]> Co-authored-by: flamber <[email protected]> Co-authored-by: Ariya Hidayat <[email protected]>
1 parent 52c5ad3 commit 288494d

File tree

37 files changed

+835
-506
lines changed

37 files changed

+835
-506
lines changed

OSX/Metabase/Metabase-Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.34.3</string>
20+
<string>0.37.2</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>0.34.3</string>
24+
<string>0.37.2</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.utilities</string>
2727
<key>LSMinimumSystemVersion</key>
File renamed without changes.

OSX/release.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ cd "$script_directory"
88
source "../bin/check-clojure-cli.sh"
99
check_clojure_cli
1010

11-
cd OSX/macos_release
1211
clojure -M -m macos-release $@

OSX/src/macos_release/create_dmg.clj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(ns macos-release.create-dmg
22
(:require [macos-release
33
[codesign :as codesign]
4-
[common :as c]]))
4+
[common :as c]]
5+
[metabuild-common.core :as u]))
56

67
(def ^:private dmg (c/artifact "Metabase.dmg"))
78
(def ^:private temp-dmg "/tmp/Metabase.dmg")
@@ -10,7 +11,7 @@
1011

1112
(defn- copy-app-to-source-dir! []
1213
(c/step "Copy app to source dir"
13-
(c/delete-file! source-dir)
14+
(u/delete-file-if-exists! source-dir)
1415
(c/create-directory-unless-exists! source-dir)
1516
(let [source-app (c/assert-file-exists (c/artifact "Metabase.app"))
1617
dest-app (str source-dir "/Metabase.app")]
@@ -19,7 +20,7 @@
1920
(codesign/verify-codesign dest-app))))
2021

2122
(defn- create-dmg-from-source-dir! []
22-
(c/delete-file! temp-dmg)
23+
(u/delete-file-if-exists! temp-dmg)
2324
(c/step (format "Create DMG %s from source dir %s" temp-dmg source-dir)
2425
(c/sh "hdiutil" "create"
2526
"-srcfolder" (str (c/assert-file-exists source-dir) "/")
@@ -71,14 +72,14 @@
7172

7273
(defn- add-applications-shortcut! []
7374
(c/assert-file-exists mounted-dmg)
74-
(c/sh "osascript" (c/assert-file-exists (str c/macos-source-dir "/macos_release/addShortcut.scpt"))))
75+
(c/sh "osascript" (c/assert-file-exists (u/filename c/macos-source-dir "src" "macos_release" "addShortcut.scpt"))))
7576

7677
(defn- delete-temporary-files-in-dmg!
7778
"Delete any temporary files that might have creeped in."
7879
[]
7980
(c/assert-file-exists mounted-dmg)
80-
(c/delete-file! (str mounted-dmg "/.Trashes")
81-
(str mounted-dmg "/.fseventsd")))
81+
(u/delete-file-if-exists! (str mounted-dmg "/.Trashes")
82+
(str mounted-dmg "/.fseventsd")))
8283

8384
(defn- set-dmg-permissions! []
8485
(c/sh "chmod" "-Rf" "go-w" (c/assert-file-exists mounted-dmg)))
@@ -88,7 +89,7 @@
8889

8990
(defn- compress-and-copy-dmg!
9091
[]
91-
(c/delete-file! dmg)
92+
(u/delete-file-if-exists! dmg)
9293
(c/step (format "Compress DMG %s -> %s" (c/assert-file-exists temp-dmg) dmg)
9394
(c/sh "hdiutil" "convert" temp-dmg
9495
"-format" "UDZO"
@@ -98,11 +99,11 @@
9899

99100
(defn- delete-temp-files! []
100101
(c/step "Delete temp files"
101-
(c/delete-file! temp-dmg source-dir)))
102+
(u/delete-file-if-exists! temp-dmg source-dir)))
102103

103104
(defn create-dmg! []
104105
(c/step (format "Create %s" dmg)
105-
(c/delete-file! dmg temp-dmg source-dir)
106+
(u/delete-file-if-exists! dmg temp-dmg source-dir)
106107
(copy-app-to-source-dir!)
107108
(create-dmg-from-source-dir!)
108109
(with-mounted-dmg [_ temp-dmg]

OSX/src/macos_release/sparkle_artifacts.clj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[macos-release
77
[codesign :as codesign]
88
[common :as c]]
9+
[metabuild-common.core :as u]
910
[pl.danieljanus.tagsoup :as tagsoup])
1011
(:import [java.io File FileOutputStream OutputStreamWriter]
1112
java.nio.charset.StandardCharsets))
@@ -17,7 +18,7 @@
1718
(defn- verify-zip-codesign []
1819
(c/step (format "Verify code signature of Metabase.app archived in %s" zip-file)
1920
(let [temp-file "/tmp/Metabase.zip"]
20-
(c/delete-file! temp-file)
21+
(u/delete-file-if-exists! temp-file)
2122
(c/sh {:quiet? true}
2223
"unzip" (c/assert-file-exists zip-file)
2324
"-d" temp-file)
@@ -26,7 +27,7 @@
2627
(codesign/verify-codesign unzipped-app-file)))))
2728

2829
(defn- create-zip-archive! []
29-
(c/delete-file! zip-file)
30+
(u/delete-file-if-exists! zip-file)
3031
(c/step (format "Create ZIP file %s" zip-file)
3132
(c/assert-file-exists (c/artifact "Metabase.app"))
3233
;; Use ditto instead of zip to preserve the codesigning -- see https://forums.developer.apple.com/thread/116831
@@ -38,8 +39,8 @@
3839

3940
(defn- generate-file-signature [filename]
4041
(c/step (format "Generate signature for %s" filename)
41-
(let [private-key (c/assert-file-exists (str c/macos-source-dir "/dsa_priv.pem"))
42-
script (c/assert-file-exists (str c/root-directory "/bin/lib/sign_update.rb"))
42+
(let [private-key (c/assert-file-exists (u/filename c/macos-source-dir "dsa_priv.pem"))
43+
script (c/assert-file-exists (u/filename c/macos-source-dir "bin" "sign_update.rb"))
4344
[out] (c/sh script (c/assert-file-exists filename) private-key)
4445
signature (str/trim out)]
4546
(assert (seq signature))
@@ -89,7 +90,7 @@
8990
:sparkle/dsaSignature signature}]]]])))
9091

9192
(defn- generate-appcast! []
92-
(c/delete-file! appcast-file)
93+
(u/delete-file-if-exists! appcast-file)
9394
(c/step (format "Generate appcast %s" appcast-file)
9495
(with-open [os (FileOutputStream. (File. appcast-file))
9596
w (OutputStreamWriter. os StandardCharsets/UTF_8)]
@@ -117,7 +118,7 @@
117118
[:body (release-notes-body)]])
118119

119120
(defn- generate-release-notes! []
120-
(c/delete-file! release-notes-file)
121+
(u/delete-file-if-exists! release-notes-file)
121122
(c/step (format "Generate release notes %s" release-notes-file)
122123
(let [notes (release-notes)]
123124
(with-open [w (io/writer release-notes-file)]

frontend/src/metabase/components/form/widgets/FormNumericInputWidget.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const FormInputWidget = ({ placeholder, field }) => (
88
<NumericInput
99
className="Form-input full"
1010
placeholder={placeholder}
11+
aria-labelledby={`${field.name}-label`}
1112
{...formDomOnlyProps(field)}
1213
/>
1314
);

frontend/src/metabase/components/form/widgets/FormToggleWidget.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import React from "react";
33
import Toggle from "metabase/components/Toggle";
44

55
const FormToggleWidget = ({ field }) => (
6-
<Toggle aria-labelledby={`${field.name}-label`} {...field} />
6+
<Toggle
7+
aria-labelledby={`${field.name}-label`}
8+
aria-checked={field.value}
9+
role="switch"
10+
{...field}
11+
/>
712
);
813

914
export default FormToggleWidget;

frontend/src/metabase/entities/databases/forms.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ const forms = {
282282
type: "boolean",
283283
title: t`Automatically run queries when doing simple filtering and summarizing`,
284284
description: t`When this is on, Metabase will automatically run queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if querying this database is slow. This setting doesn’t affect drill-throughs or SQL queries.`,
285-
initial: true,
286285
hidden: !engine,
287286
},
288287
{

frontend/src/metabase/lib/expressions/process.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { parse } from "metabase/lib/expressions/parser";
2-
import { compile } from "metabase/lib/expressions/compile";
3-
import { suggest } from "metabase/lib/expressions/suggest";
4-
import { syntax } from "metabase/lib/expressions/syntax";
5-
61
// combine compile/suggest/syntax so we only need to parse once
72
export function processSource(options) {
3+
// Lazily load all these parser-related stuff, because parser construction is expensive
4+
// https://github.com/metabase/metabase/issues/13472
5+
const parse = require("./parser").parse;
6+
const compile = require("./compile").compile;
7+
const suggest = require("./suggest").suggest;
8+
const syntax = require("./syntax").syntax;
9+
810
const { source, targetOffset } = options;
911

1012
let expression;

frontend/test/__runner__/backend.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ export const BackendResource = createSharedResource("BackendResource", {
2222
create({ dbKey = DEFAULT_DB_KEY }) {
2323
const dbFile = getDbFile();
2424
const absoluteDbKey = dbKey ? __dirname + dbKey : dbFile;
25-
if (process.env["E2E_HOST"] && dbKey === DEFAULT_DB_KEY) {
25+
const e2eHost = process.env["E2E_HOST"];
26+
if (e2eHost) {
2627
return {
2728
dbKey: absoluteDbKey,
28-
host: process.env["E2E_HOST"],
29+
host: e2eHost,
2930
process: { kill: () => {} },
3031
};
3132
} else {

0 commit comments

Comments
 (0)