This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Jul 25, 2023
-
-
Jerry Huang authored
* initial commit * remove print * add fix * remove load * fix tests
-
- Mar 22, 2023
-
-
Braden Shepherdson authored
It's broken there because it tries to capture the Var returned by `defn` in a `let`. Vars aren't real in CLJS, so this doesn't work. The compile succeeds but the JS output is subtly broken.
-
- Mar 16, 2023
-
-
metamben authored
* Add filter constructor functions * Revert changes to defop * Address linter complaints * Add function to set the query filter * Address linter complaints * Fix test name
-
Case Nelson authored
* Add an aggregate function to add aggregations to queries * Call ->op-arg on aggregate input * Allow any in aggregations for now because expressions on aggregates are allowed * We have to recurse into clauses
-
- Mar 13, 2023
-
-
Case Nelson authored
* Initial aggregation functions for metabase-lib * Remove comment for build? * Move defop to common * Add docstrings * Make eastwood happy
-
- Feb 27, 2023
-
-
Braden Shepherdson authored
Dev experience: - CLJS now has source maps - Devtools extension renders CLJS data in Chrome (et al) Devtools - Use a debug build of CLJS in the tests - Fixed line numbers and breakpoints being off-by-one in Devtools CLJC infra: - More robust direct approach to JS<->CLJS conversions, powered by Malli transformers. - Powerful `define-getters-and-setters` macro to generate the accessors.
-
- Feb 14, 2023
-
-
Braden Shepherdson authored
A `metabase.domain-entities.malli/defn` macro that (in CLJS) uses the schemas for the arguments to drive wrapping of vanilla JS objects for idiomatic use in CLJC code. See the first two functions in `metabase.domain-entities.queries.util` which get passed vanilla JS objects but can use them as CLJS maps.
-
- Feb 10, 2023
-
-
Braden Shepherdson authored
Some JVM-specific functions are now in `metabase.util.jvm`, but they are re-exported (in CLJ) by `metabase.util`.
-
- Feb 02, 2023
-
-
Mark Bastian authored
Added bans for print and friends. Fixed issues in kondo config where a macroexpansion put in a print by replacing with (constantly nil) as a no-op.
-
- Jan 19, 2023
-
-
Cam Saul authored
* Switch to Toucan 2 part 1 * Fix Kondo errors * Switch to Toucan 2, part 2 * Fix Kondo errors
-
- Jan 18, 2023
-
-
Tim Macdonald authored
* Bump clj-kondo to 2022.12.10 [Fixes #27512] * Use Kondo's :config-in-call instead of grosser hacks
-
- Jan 13, 2023
-
-
Braden Shepherdson authored
This adds a cross-platform date/time formatting library in CLJC, with (nearly) identical output in both JVM and JS environments. The only known difference is week numbers. CLJS (through Moment.js) has ordinal numbers, and renders the week number as "34th". Neither the JVM nor Clojure has a handy library for this (I'm sure it's out there somewhere, but it seems like a silly dep to add) so it renders week numbers as simply "34". Both platforms have date formatters that use pattern strings (eg. `"YYYY-MM-dd"`) to turn date/time objects into strings. There's a strong resemblance in how these work and what letters stand for what parts of the date and time, but they are far from identical. Rather than try to hackily convert one set of strings to another with regexes or other manipulations, this PR defines a set of names for fragments of dates (eg. `:year`, `:day-of-week-full`, `:hour-24-dd`) and includes functions to transform a list of these keys into a platform-specific format function. This is portable and transparent, and can be written in Clojure or JS code: ```clj [:year "-" :month-dd "-" :day-of-month-dd] ; 2022-04-08 [:month-full " " :day-of-month-d ", " :year] ; April 8, 2022 [:hour-12-dd ":" :minute-dd " " :am-pm] ; 7:52 AM ``` ```js [":year", "-", ":month-dd", "-", ":day-of-month-dd"] ; 2022-04-08 [":month-full", " ", ":day-of-month-d", ", ", ":year"] ; April 8, 2022 [":hour-12-dd", ":", ":minute-dd", " ", ":am-pm"] ; 7:52 AM ``` Note that the original code allowed an unrecognized `:date-style` string to be used directly as the formatting string. With the move to formatting data structures that no longer works. Instead there is a fixed map of format strings to the above data structures, that contains all the currently used `:date-style` inputs. If some caller needs a new format someday, we can either: (a) add the style to the map; or (b) pass the data structure form directly to the `:date-format` option, which if provided is used as the format. It's tempting to go to all the call sites and replace these `:date-style` strings with the new format structures. However, the strings are still embedded in the `:visualization_settings` in user appDBs, so we still need to recognize them. Most of the existing functions in the TS library have the same API. The set of allowed `:date-style` and `:time-style` values is turned into a type using `keyof`, so that we get precise type-checking of these values rather than simply `string`. One function has been dropped from the API: `getDateFormatFromStyle`. There was no practical way to implement it using the new format data structures. The only caller was the date format column settings, and it has been rewritten to use the formatted string for its sample date as its key instead.
-
- Sep 26, 2022
-
-
dpsutton authored
* Substitute persisted queries in parameter card references ```sql select o.total, o.quantity, model_p.category, model_p.title from orders o left join {{#14-pg-products}} model_p -- reference to products model on o.product_id = model_p.id limit 4 ``` Testing: I'm unhappy with how verbose the test is. At some point we're going to need a better, standardized way to test persistence. But the test makes a persisted table of the test-data.categories table (test/metabase/test/data/dataset_definitions/test-data.edn). It runs some sql to update the values in the table to turn `"Winery"` -> `"Winery from cached table"`, joins the two tables together to have both at once. There's a lot of moving pieces and the setup is a bit verbose. There's also no obvious place where these types of tests should go. We'll need to consolidate them in the future (and extend them). * persisted macro * docstring for `persisted-info-native-query` * alignments and small nits * Reuse persistence macro * clj-kondo cleanups * remove clj-kondo change before rebase
-
- Sep 22, 2022
-
-
Cam Saul authored
* 347 errors, 34 warnings * 89 errors, 66 warnings * 63 errors, 39 warnings * 52 errors, 33 warnings * 23 errors, 22 warnings * 13 errors, 4 warnings * Fix the last few errors. * Sort Kondo config
-
- Aug 22, 2022
-
-
Cam Saul authored
* [Toucan 2 prep] Don't invoke Toucan models as functions * Some fixes * Test fixes * Test fix * [Toucan 2 prep] Don't call `type` or `class` on Toucan models * Test fixes * More test fixes
* [Toucan 2 Prep] Don't use <model>Instance classes * Sort namespaces
-
- May 19, 2022
-
-
Cam Saul authored
* `defsetting` setter functions should end in `!` * Fix typo * Update .clj-kondo/hooks/metabase/models/setting.clj * Fix clj-kondo for Toucan defmodel not emitting a docstring * Remove `^:private` metadata on a couple of Settings since it makes Eastwood fussy
-
- May 02, 2022
-
-
Braden Shepherdson authored
Background: We had two lint configs: lint-config.edn which was enfored by Github Actions, and .clj-kondo/config.edn, the default location used by editors. Problem: Patchy enforcement of the (larger) config in .clj-kondo/config.edn since not everyone uses an editor. Some new lint, like canonical namespace aliases (#21738, #19930) is not enforced automatically and has begun to bit-rot. Solution: Combine both configs, fix any outstanding lint, and update our tooling to use the unified config. Caveats: Anyone who has their local editor configured to use lint-config.edn will have their linting broken by this change.
-
- Mar 04, 2022
-
-
Michiel Borkent authored
-
- Feb 10, 2022
-
-
Michiel Borkent authored
* honeysql var improvements * Define routes * Define routes * define-routes improvement * honeysql helpers * honesql * abs in clojure 1.11 * fix logic unresolved vars * deprecated * deprecated var warnings * undo replace
-
- Feb 03, 2022
-
-
Michiel Borkent authored
* Turn defendpoint config macro into analyze-call hook for better linting * Simplify hook * Remove previous macro config * Fix all errors concerning third party libs * revert whitespace change:
-
- Jan 25, 2022
-
-
Michiel Borkent authored
* Linting improvements: 0 errors in src + shared/src * satisfy other linter
-