The Portal diff view wants `[before after]` pairs of the original data,
not the three-part output of `clojure.data/diff`. This fixes the
`qp.debug/debug>` output from the preprocessing middleware to emit
correct diffs.
Also, since the diffs are not useful when the query is converted between
legacy and pMBQL, this also attaches the *converted* input query to the
output query's Clojure metadata, and this converted value is used as the
basis for the diff.
* entity id translation + tests
* add api level test
* simplify definition of eid-table->model + add test
* update tests to take keywords
* improve comment
* generate the eid-table->model map
* delete now-obsolete test
* make it work in oss
* put the resulting response into a key, so we can add more information later
* formatting
* use model names without the model/ prefix as keys
* Creates list of `api/model->db-model`
- update keys for util/entity_id request
- update shape of util/entity_id response
- add test for not-found eids
* formatting
* Respond to code review feedback
* entity-ids work on /embed/{card,dashboard}* routes
* make entity id translation work for all tokens
* Merge branch 'static-embed-dashboard-and-question-endpoints' of github.com:metabase/metabase into static-embed-dashboard-and-question-endpoints
* massage schema. add tons of tests
* decode more eids
* test alignment
* don't require ns inside of itself :think:
* make the test functions to create tokens better
* bring back `dashboard-url`
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
* Query Validator FE
* collection path, unit tests
* wrapping feature with token flag
* updating util function, adding row type
* updating session_test.clj
* type adjustment
* fixing other table sorting
* Empty state, clean up utils
* unit test adjustment
* e2e adjustment
* another attempt at perms fix
* try again
* try manual graphql auth
* try with global env
* Try setting defaults in graphql
* try some more things
* use my own graphql instance
* one more test
* remove test code
* remove rogue curly brace
== Goal ==
Hide attached DWH database details from anyone incl. admins:
* Do not show them in the UI
* Do not permit to change them
* Do not serialize them
The aim is that customers cannot gain access to (parts of) credentials,
and they cannot break a feature they are paying for by changing
connection details.
== Implementation ==
The Metabase backend already contains provisions in the implementation
of `metabase.models.interface/to-json` for `:model/Database` to hide the
`details` of the database in HTTP responses, if the user lacks write
permission on the database. We utilize this by adding an
`is_attached_dwh` column to the `database` table and rejecting
`metabase.models.interface/can-write?` when this flag is enabled. In
the "admin" UI, we show a replacement text instead of the edit form when
the flag is set. (It might be correct to show this whenever `details`
is absent. See below for possible follow-up work.)
However, several sections of the frontend code expected the `details`
field to always be present. In order to make `details` optional, as the
backend seems to handle it, we fix the respective code to treat this
case in the way that appears appropriate in the context.
Database details are already generally excluded from H2 dump snapshots
(see `metabase.cmd.copy/*copy-h2-database-details*`), thus nothing
changes there.
== How to test ==
=== New behaviour ===
Setting the `is_attached_dwh` field hides the database details:
1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
- In addition to the fields you would normally set, also set
`is_attached_dwh: true`.
- This also works when adding this flag to a database that previously
did not have this flag set.
2. Start your Metabase instance.
3. Verify the database shows up in the "admin" section
(`/admin/databases`).
4. Verify that clicking the database to see its details only reveals
"This database cannot be modified."
5. Verify that responses from the backend do not include a `details`
field for this database.
=== Original behaviour ===
Behaviour without setting the `is_attached_dwh` field is unchanged:
1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
- Only set the fields you would normally set. Do not set
`is_attached_dwh` (or set it to `false`).
2. Start your Metabase instance.
3. Verify the database shows up in the "admin" section
(`/admin/databases`).
4. Verify that clicking the database to see its details only reveal the
regular edit form, showing connection fields like `host`, `user`,
etc. with the values you configured.
== How this will be rolled out ==
1. Upgrade existing Metabase Cloud instances with data warehouse to a
Metabase version that supports `is_attached_dwh`.
2. Set `is_attached_dwh` in the database section of the config file for
Metabase Cloud instances with a data warehouse.
== Possible follow-up work ==
In https://github.com/metabase/metabase/issues/25715, absent
`database.details` was identified as a bug. Since then, `details` was
made `NOT NULL` in the application database, so this bug can no longer
occur. However, today backend responses can be missing the `details`
field, if the current user lacks write permission to the database
setting (see above). Fully re-evaluating the fix to #25715 in this
context is outside the scope of this PR.
Closes: https://github.com/metabase/harbormaster/issues/5051
* Add `clojure -M:kondo` and `clojure -M:kondo:kondo/all` and bump version
* Fix Kondo errors
* Fix Kondo+LSP issues with `defendpoint`, `defenterprise`, etc.
* Use replace-deps instead of deps for speed
* Ok apparently maybe we do need to copy configs when we run Kondo on CI
* Oops `./bin/kondo.sh` should not try to use `clj-kondo`
* Remove references to GA driver folders
These migrations will be backported to v49.
Three changes:
- update IDs/locations of the migrations to v49 vs v51
- add one preCondition (when adding the foreign key constraint)
- add `onFail: MARK_RAN` to the index preconditions. I forgot this
before, so it blows up when the precondition doesn't hold.
* allow re-ordering and re-naming pie chart slices
* aggregate rows with same dimension value
* show warning when dimension has unaggregated values
* change colors from sidebar
* implement renaming
* styles for slice name widget
* handle numeric slice keys for binned values relative dates etc
* implement slice disabling
* remove old colors setting
* implement merging new and removing existing rows from query results
* fix formatting bugs
* port settings to static viz
* fix bug with unaggregated data
* address todos
* add loki test
* fix measure column settings widget erroring
* fix settings sidebar crashing
* add e2e tests
* update snapshots
* fix pie_chart.cy.spec.js CI-only flakes
* fix#21504 repro failure
* fix click action value
* use nestedSettings instead of seriesSettings
* fix settings sidebar crashing
* fix row with 0 key not being draggable
* fix flaky test
* filter other slices from sidebar
* combine filter header buttons
* refined styling
* unit tests
* another import conflict
* omg another one
* remove double border for filter button
* use vars and update imports
* Increase log level to INFO from error
Closes#47396
logs before:
```
2024-08-29 08:37:03,836 INFO db.liquibase :: Checking if Database has unrun migrations...
2024-08-29 08:37:04,045 INFO db.liquibase :: Database has unrun migrations. Checking if migration lock is taken...
2024-08-29 08:37:04,047 INFO db.liquibase :: No migration lock found.
2024-08-29 08:37:04,047 INFO db.liquibase :: Migration lock acquired.
2024-08-29 08:37:04,167 INFO db.liquibase :: Running 83 migrations ...
```
logs after:
```
2024-08-29 08:39:45,019 INFO db.liquibase :: Running 83 migrations ...
...
2024-08-29 08:39:45,166 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:00::calherries ran successfully in 0ms
2024-08-29 08:39:45,182 INFO liquibase.changelog :: Columns is_defective_duplicate(boolean) added to metabase_field
2024-08-29 08:39:45,182 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:01::calherries ran successfully in 14ms
2024-08-29 08:39:45,199 INFO liquibase.changelog :: Custom SQL executed
2024-08-29 08:39:45,200 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:02::calherries ran successfully in 16ms
2024-08-29 08:39:45,202 INFO liquibase.changelog :: Foreign key fk_field_parent_ref_field_id dropped
2024-08-29 08:39:45,202 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:03::calherries ran successfully in 1ms
2024-08-29 08:39:45,204 INFO liquibase.changelog :: Foreign key constraint added to metabase_field (parent_id)
2024-08-29 08:39:45,205 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:04::calherries ran successfully in 2ms
...
```
* empty commit to bump CI
* handle cache config overflowed
* fix root too
* do not comment out test
* make cljfmt happy
---------
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
* Make metric metadata keep the metric's name
This is a fix for the problem reported in #40355, which is fixed separately for v50 and backported to v49.
* Patch broken test
* Normalize dataset-query
* Normalize legacy queries only
* ask for tenancy isolation columns
* deny all permissions for all users group
* create new collections
* add jwt group mappings
* add the permissions step
* add multi-tenancy message in helper text format
* add permission graph
* wire together permissions
* use schema permissions
* use fields from table metadata from query_metadata
* add tenancy field reference
* remove log messages
* deny access to unsandboxed tables
* make permission graph more explicit
* deny access to sample database for customer groups
* add unit test for permission graph
* split permission groups and sandboxes
* jwt settings and hard-coded user attributes
* handle errors when updating sso mappings
* add express api and user switcher
* only fallback to api keys when license is invalid
* add util to sample tenancy column values
* conditional BASE_SSO_API imports
* improve embedding error message
* setup jwt configuration after license step
* setup permissions at the last step
* add missing import
* update steps that requires license
* fix incorrect imports
* add missing useContext
* handle permission update error
* remove tenancyIsolationEnabled field
* add tenancy column sampling
* differentiate tenancy column query error
* rename tenancyColumnValues to tenantIds
* assign sampled tenant ids to user attributes
* add tenant ids
* define collection permissions
* reference sandboxing group by name
* update snippet to be same as the README
* extract ask for tenancy columns to a separate step
* use the customer_id attribute
* query the table query metadata at origin
* append tables correctly
* improve error handling in table scanning
* add retry logic to metadata fetching
* only query metadata for selected fields
* fix race condition with retry
* update loading state and retries
* update comments on jwt license
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* filter the target table by id
* highlight last selected tenant column
* use breakout to get list of ids
* temporary workaround to reload the whole page
* update row value types
* update row value types
* block non-selected tables
* remove the source-field from sandboxing
* use the fk_target_field_id as instead of target.id
* update unit test
* remove source-field as we only reference our own column
* make native permission types more strict
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
* ask for tenancy isolation columns
* deny all permissions for all users group
* create new collections
* add jwt group mappings
* add the permissions step
* add multi-tenancy message in helper text format
* add permission graph
* wire together permissions
* use schema permissions
* use fields from table metadata from query_metadata
* add tenancy field reference
* remove log messages
* deny access to unsandboxed tables
* make permission graph more explicit
* deny access to sample database for customer groups
* add unit test for permission graph
* split permission groups and sandboxes
* jwt settings and hard-coded user attributes
* handle errors when updating sso mappings
* add util to sample tenancy column values
* improve embedding error message
* setup jwt configuration after license step
* setup permissions at the last step
* handle permission update error
* add tenancy column sampling
* differentiate tenancy column query error
* rename tenancyColumnValues to tenantIds
* define collection permissions
* reference sandboxing group by name
* extract ask for tenancy columns to a separate step
* query the table query metadata at origin
* append tables correctly
* improve error handling in table scanning
* add retry logic to metadata fetching
* only query metadata for selected fields
* fix race condition with retry
* update loading state and retries
* filter the target table by id
* highlight last selected tenant column
* use breakout to get list of ids
* update row value types
* block non-selected tables
* remove the source-field from sandboxing
* use the fk_target_field_id as instead of target.id
* update unit test
* remove source-field as we only reference our own column
* make native permission types more strict
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Previously, truncating a `:type/DateTime` column by `:month` or `:day`
would return a `:type/Date`, which subtly broke the query.
In particular, if you try to order-by the breakout column `Created At (month)`
then it would not get de-duplicated, causing a SQL error about conflicting
ORDER BY clauses.
Fixes#46992.
Previously, `visible-collection-ids` was effectively "free" in that we'd
cached `collection-id->collection` for *all* collections, within a
single request, and then locally filtered it for permissions without
needing to hit the database again.
To be honest, there is probably a better fix for this - we're repeatedly
calling `visible-collection-ids` when we probably could just save a
single copy of it and use it when calculating the effective location of
every collection.
However, this is a very quick and low-risk fix, and I want to prioritize
getting this done, and then we can improve it later.
Locally, I copied down the database from stats and timed the
`/api/search?model_ancestors=true` endpoint.
Before my "speedup" PR (https://github.com/metabase/metabase/pull/46942)
it took ~7 seconds to return results.
After my "speedup" PR, it took ~15s to return results. :grimace:
With this change, it takes 818ms to return results. 🎉
* Fix typo in expression-clause-normalization-test
s/time-interval/relative-time-interval/
* Add missing table-id to card def to fix failing legacy-ref-test
* Ensure that if yarn test-cljs fails it fails the CI checks
When configured to autorun, the command
shadow-cljs compile test
will exit success even if test failures occur in the node test. See
https://github.com/thheller/shadow-cljs/issues/425
In order to ensure our CI checks fail when cljs tests fail, we need to invoke
node directly. To prevent running the tests twice, remove `:autorun true` from
the `:test` target in shadow-cljs.edn.
* zoom-in-timeseries-drill: do not include :hour and :minute for DATE columns
When the user attempts to drill through a DATE column, we should not return :hour or :minute drill throughs from
available-drill-thrus. Previously we did, which resulted in an error being displayed when the user attempted to select
them.
Modify next-breakout-unit in zoom_in_timeseries.cljc to not return :hour or :minute units for :type/Date columns,
which prevents these from being returned by available-drill-thrus, which prevents them appearing in UI context menus.
* Use lib.temporal-bucket/available-temporal-buckets
Per review feedback, use lib.temporal-bucket/available-temporal-buckets to get the valid-current-units in
metabase.lib.drill-thru.zoom-in-timeseries.
* Do not construct zipmap just to lookup the next unit
Rather than constructing a zipmap from `valid-current-units', which requires iterating over the seq twice, just
traverse the seq once and return the next item in the seq (if any).
Constructing a zipmap made sense in the old code because it was constructed once from static data and used many times
for lookup. In the new version, the vec of `valid-current-units` is dynamic and dependent on the type of the breakout.
* PR suggestion: use threading macro rather than nested sexps
Co-authored-by: Braden Shepherdson <braden@metabase.com>
* PR suggestion: use threading macro rather than transducer / eduction
* PR suggestion: reduce boilerplate in zoom-in-timeseries tests
Reduce code dup by looping over aggregation and bucketing options rather than having a separate deftest for each.
---------
Co-authored-by: Braden Shepherdson <braden@metabase.com>
Fixes#39366
* use loki to test png exports on questions
* try to put the img in the body to see if it fixes the scrollbar issues in ci
* fix linting issues
* let's try again in ci
* Attempt to make CI wait before taking a snapshot for downloaded PNGs
* Use the snapshots from CI for PNG downloads
* pdf export test thanks to kelvin suggestion about just testing the png
* refactored the code to extract a util function
* remove pdf tests as they broke in ci 🤷
* Update frontend/src/metabase/env.ts
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Update frontend/src/metabase/lib/loki-utils.ts
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* entity id translation + tests
* add api level test
* simplify definition of eid-table->model + add test
* update tests to take keywords
* improve comment
* generate the eid-table->model map
* delete now-obsolete test
* make it work in oss
* put the resulting response into a key, so we can add more information later
* formatting
* use model names without the model/ prefix as keys
* Creates list of `api/model->db-model`
- update keys for util/entity_id request
- update shape of util/entity_id response
- add test for not-found eids
* formatting
* Respond to code review feedback
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
* Don't encrypt boolean settings (by default)
We have tooling to disable encryption on settings even when the
`MB_ENCRYPTION_SECRET_KEY` is set. Turn it on by default for all boolean
settings, which don't need to be encrypted.
I also optimized the code that decrypts settings on startup because I
didn't want to delay startup if someone had set a bunch of boolean
settings. With 20 set, the old version added about 200+ ms to startup,
about 10ms per boolean setting, whether or not it was encrypted or in
the DB already. The optimized version selects all the never-encrypt
values from the database at once (a bit silly, but we also just exclude
raw `true` and `false` values so we don't bother checking them) and
updates them if they're encrypted - this adds ~40ms to startup with 20
encrypted boolean settings (about 2ms per boolean setting) and ~5ms to
startup on subsequent runs, when no encrypted values are in the DB.
This testing is too strict to support some legitimate use cases that
have no workaround at present. We can bring back this type-checking
eventually, once it's possible to correctly express things like
automatic coercion of strings to numbers in `SUM` aggregations.
Fixes#44431.
* Update appearance.md
Adding information about how colors are selected by Metabase because there is the confusion that the order in which you select colors is the order you get on the chart
* Update appearance.md
Removed code reference and tried to simplify the context
* Update docs/configuring-metabase/appearance.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
There are a few separate changes here:
- Migrations: add and populate indexed columns perm_value, perm_type, and collection_id to permissions
These fields allows us to efficiently run queries based on collection permissions in the DB without string manipulation. Keeping the table as permissions allows us to do this migration in-place. Note that in some cases collections may have been deleted from the database without deleting the associated permissions row (since there was no foreign key before). We need to be defensive here: if we have a permissions row without a corresponding collection, delete the row before running the rest of the migration.
- Write perm_value, perm_type, and collection_id for new collection permissions
A very simple before-insert method sets these fields before a collection permission is written to the DB.
- Replace collection/permissions-set->visible-collection-ids and collection/visible-collection-ids->honeysql-filter-clause with collection/honeysql-filter-clause
Previously, just about everywhere we used permissions-set->visible-collection-ids, what we were essentially doing was an in-app join: select all the collection IDs you have permission on, then convert it to a SQL clause like WHERE collection_id IN ( all of those collection IDs).
Replace both of these with honeysql-filter-clause, which uses the new fields we added to permissions above to construct a honeysql filter representing "all the collections I have permissions on", without needing to round-trip them to the application and back to the DB.
Of course, we can then write a function visible-collection-ids, which uses honeysql-filter-clause, for those cases where we do actually need the whole bunch in the application (we use this, for example, when constructing the effective-location for a collection).
I also added one more toggle to the VisibilityConfig that's passed into the honeysql-filter-clause (and used to be passed to permissions-set->visible-collection-ids), allowing you to select only the effective children of some collection.
* [MBQL lib] Map dashboard filters to last stage w/aggregations
Originally we used the last stage's columns for dashboard filters, but
then if you eg. use a custom expression to clean up the results of the
aggregation, then you can't filter at the most useful spot - before the
aggregations.
Fixes#19744. Related to #26244, #33958.
* Add stage-number option to the dimension not to the field
* Remove FE changes
* Support negative stage numbers
* Add tests for multi-stage parameter expansion
* Specify schema for dimension options
* Fix legacy MBQL schema
* Append stage when running cards with top level summary
* Fix schema
* Only ensure filter stage when the parameters say it's used
* Implement ensure-filter-stage
* Format clj
* Add ensure-filter-stage test
---------
Co-authored-by: Braden Shepherdson <braden@metabase.com>
* Fix DateTimeRange substitution for open ranges
* Add E2E repro for #47172
* cljfmt
* Add test for datetime column
* Update range boundary for open range
* Update test names
* Apply suggestions from code review
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Fix e2e
---------
Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Add database type adjustments to server side generated temporal values
* Speculative base type change
* Infer timezone only from _actual_ user, not global user level
* Set timezone for actual user in test extensions
* Add test case
* Update type info generation
* Adjust server side relative datetime
* Update src/metabase/driver/sql/query_processor.clj
Co-authored-by: Braden Shepherdson <braden@metabase.com>
* Fix base type logic
* Fix typo
* Fix formatting
* Update user name handling
* cljfmt
* Address review comments
---------
Co-authored-by: Braden Shepherdson <braden@metabase.com>
* reorganizes data-permissions.ts to be a folder split by a file per concern, moves some logic out into other utils files where it makes sense
* pr feedback and fix lints
* only use viz height for visualization view
* move the default viz height fallback
* default to full-height if height is zero or unavailable
* remove test wrapper
* recents updates to better support metrics
allows updating metric views through the API
improves parent_collection calculation
* add 2 tests for metrics
* Use global search for aggregation picker
* Add names to aggregation picker items so they can be searched
* Render info icon metric descriptions
* Add unit tests for global aggregation picker search
* Add test for searching metrics
* Add a test for metrics descriptions
* Sort metrics
* Fix e2e test
* Use Flex from metabase/ui
* Handle markdown in metric description
* Add test for sorted metrics
* Update Markdown styling in metric description
* Fix clojure formatting
* Test for markdown in the Metric description
* Fix lint
* Fix test for markdown
* Use simpler equality test
* Fix overflow in test
* QuestionAlertWidget to FC + TS
* update e2e tests
* use regular alert for unsubscribes
* Create Question and Dashboard Sharing Menu
* Handle some edge cases
* top notch unit tests
* more testing and tweaking
* fix imports
* more tests
* add alerts to question sharing menu
* add tests for alerts
* update e2e tests
* use Oisin's toolbarbutton
* fix rebase
* prompt to save before sharing questions
* show prompt to set up notification channels
* fix import
* update tests and hide on notebook screen
* fixes
* clean up pulse types
* update e2e tests
* fix a bunch more tests
* more e2e test fixes
* maybe green now? 🤞
* last one 🥺
* design updates
* make channel setup modal nicer
* simpler component props
* lint fix
* lint fixes
* poc of removing data usage step for the tech plan
* pretend it's not cloud if hasAddedPaidPlanInPreviousStep is true
* split the jest tests files to simulate pro cloud, pro selfhosted and starter cloud scenarios
* open metabase store to get trial token
* remove license env from instance setup as we provide the license key later
* activate metabase license
* fix password field missing
* fix formatting for generated component files message
* activate license key
* add missing auth options for postgres
* add function to print with padding
* prevent infinite loop and update section representation
* show the activate license error in red
* rename variable
* Add offset presets
* Render OffsetPresets initially
* Add BucketInput
* Render BucketInput and do not rely on referential equality for Lib.Bucket
* Make sure the currently selected bucket shows in the presets
* Lift label into CompareAggregations
* Fix spacing of label
* Fix labels based on comparison type
* Use Switch for include current period
* Include current bucket in CurrentPeriodInput label
* Fix unit tests
* Add more unit tests for CompareAggregations
* Update e2e test for column compare to handle presets
* Group offset tests
* Add tests for moving average
* Add tests to verify changing the bucket works
* Fix type
* Make sure temporal columns are buckatable before picking them
* Make getPreferredPresets more clear
* Add test for temporal expression column
* Fix lint
* refactor: sort import members inside destructuring
* Show an error message when the temporal unit is not applicable to a dashboard card (#46983)
* Fix tests
* Add tests
* Add tests
* Fix types
* Fix types
---------
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* make the newsletter signup a checkbox instead of a button
* update copy on unit test
* fix describe nesting
* update the ui to be like the design
* make tests use userEvent.click to avoid warning about missing act
* use the subscribeToNewsletter function
* add basic e2e test for newsletter subscription
* move wait to the end of the test to see if it passes in ci
* remove async to see if it fixes the issue
* trying to mock the response
* make it clear why we're mocking the response
* use getUserEmail as suggested by Sloan
* inline var a suggested on code review
* Kondo Config cleanup
* Restore warnings for with-log-messages-for-level until #28827 is merged
* Updated clojure.test hooks
* Fix kondo warning
* Test defn/defmacro exclamation point linter should also use :parallel/disallowed (part 1)
* WIP
* Time for me to learn to spell
* Finish the cleanup
* Remove code I was typing as an example
* Fix renamed var
* Fix the SAML tests
* Fix Kondo warning
* allow `:blocked` to be saved for table level perms
* Adds 2 tests for table level blocked permission settings
- N.B. these are NOT ENFORCED YET
* update test that asserted we cannot set block on tables (we can)
* WIP: Pairing on making perms checking less wild
* cleanup, update docs, and add a test for view-data perm only
- Added a test where we have data permissions, but not create query, and
I think it is failing when we have create query and blocked data
permissions.
- renamed some functions from check-x -> has-x? since they return a
value instead of throwing now
* Revert "WIP: Pairing on making perms checking less wild"
Keep the same behavior, but stick with the saner flow control
This reverts commit 63bcb5b401138555a081378574b15d6506469e60.
* update docs
* update test to be passing
- TODO: make sure it's correct w.r.t. perm settings
* Allow schema level blocked setting in permgraph
* remove invalid test cases
- continue to have a forcing function to test newly added perms
* conform function output
* ensure a single blocked table blocks native queries to its DB
* update error message
- we now catch this error in `metabase.models.query.permissions/has-perm-for-query?`
* we now check for data permissions to process query for card
* add more explanation to what we are testing
- to help see why it fails on CI and passes locally
* remove excess `def`
* Add test for table-level data X collection perms
- update test found to be in-error
* update param values qp permission check style
* set view-data and create-query explicitly
* set viewdata and createquery explicitly in qp test
* Respond to review comments (which fixes a case)
* setting a table to blocked: leave other tables the same
* [Permissions] Add "No access" schema/table permission (#46509)
* first pass
* refactors downgrading native permission logic and updates calculation so that "No access" downgrades native permissions to "No"
* stub for permissions help info on table block
* modal changes wip, updates downgrading create queries permissions to all happen at a single call site
* clean up, sandboxing modal copy changes, removes rekoke/limit access modal changes to make the diff smaller and move code to a seperate PR
* updates permissions help section to contain the final copy
* sandboxing copy fix and remove modal that was dropped from requirements
* adds blocked at the schema level, updates no access copy to blocked, updates permissions help section to contain new blocked and schema level changes
* fixes failed unit and e2e tests after sandboxing copy changes
* improve the block e2e test to include table blocking
* fixes failing blocked test, fixes other schemas create queries permissions getting correct with one schema was droped to blocked view data access, fixes a bug that prevents the save bar from going away when all permissions for group are set to the default values
* clean up
* remove color changes
* prevents parent being set to blocked preventing edits for children entities
* add new hasPermissionValueInSubgraph fn, adds modal to warn users we have to upgrade the view data permissions when they upgrade create queries permissions when a child entity is set to blocked
* adds test coverage for new modal
* removes unused function, adds new updateEntityPermission fn to help consolidate some logic elsewhere
* unit test fix and type fix
* most pr feedback
* updates the confirmation modal copy when changing a parent entity that contains a child with blocked permissions and/or sandboxed children, adds test coverage for that, adds test coverage for permission view data column not appearing in oss
* type fix
* [Permissions] Add e2e test coverage for blocked permissions enforcements (#46663)
* adds test coverage for enforcement of blocked permissions
* moves tests around based on pr feedback
* copy changes
* adds fix to make sure that blocked permissions are not removed from sibling tables that have the create queries permissions upgraded (#46854)
* Fix table name lookup for dbs w/ 1 schema per db
* add test for blank schema identifiers
* Refine sandboxed user perms for query builder access (#46939)
* Refine sandboxed user perms for query builder access
- Limit create-queries permissions to unblocked tables only
- Check user permissions for each table before granting query builder access
- Prevent querying of blocked joined tables from query builder for sandboxed users
* Adjust permissions for sandboxed users
- Grant view-data permissions only for unblocked tables
- Revert create-queries permissions to all tables in sandbox
- Remove unnecessary intermediate variable
* when sandboxing we no longer grant unrestricted view perms for blocked tables
* Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj
remove blank line
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
* - make coalesce-test exhaustive (except for sandbox)
* Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
* t2/select ... -> database/table-id->database-id
* update comment
* [Permissions] Prevent "Granular" option in DB View Data options from changing permissions to unrestricted (#46976)
* fix
* adds back most of the code and limits it to only happen with impersonations, updates test to handle differing logic between the two flows
* removes test that is not longer needed
* more sandbox join table perms tests
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
* Update outdated loki snapshots
* Update the line snapshot using the one from CI
* try bumping the timeout to reduce flake
* Revert the linechart snapshot since it's still flaking
* skip the flaking story for themed line chart
* skip the flaking story for line chart
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
If the content-type header is missing entirely, let it through. We're
not trying to be overly restrictive here, just prohibit things that are
clearly not GeoJSON.
Fixes https://github.com/metabase/metabase/issues/46918
* Add new strings for v50.20
* update translations for 50.21
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
* Throw reasonable error when incompatible temporal unit is used in time unit param
* Remove redundant function
* Add :curated flag to catch exceptions
* Update test/metabase/query_processor_test/date_bucketing_test.clj
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Address review remarks
* Update test
* Make vars private
---------
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* use ee api to find custom reports collection
* remove deprecated hook
* fix race condition
* add unit tests
* fix circular dependency
* fix unit tests
* another plugin strategy
* Remove unused file
* Refactor getCurrentUser command to a TS function util
* Refactor createAlert command to a TS function util
* Refactor createModerationReview command to a TS function util
* Reuse createModerationReview
* Refactor createPulse command to a TS function util
* Remove references to deleted files
* Improve typing
* Kondo Config cleanup
* Restore warnings for with-log-messages-for-level until #28827 is merged
* Updated clojure.test hooks
* Fix kondo warning
* Time for me to learn to spell
* use ECharts tooltip on cartesian charts
* fix tooltip lag when changing hovered series
* facelift tooltip
* fix static viz crashes due to tooltip option
* facelift
* pie chart echarts tooltip
* facelift
* facelift
* facelift
* tweaks
* e2e specs
* return back the pie other slices tooltip
* more specs
* specs
* fix pie total
* fix tooltip overflow
* fix specs
* fix infinite rerender in embedding mode for charts that have warnings
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Beautiful log message capturing ⭐😻
* Don't have log.cljs try to load log.capture, don't know how to make that work
* Remove restriction against use in parallel tests
* Fix tests using invalid syntax
* Port legacy tests
* Make this stuff work with Cljs
* Fix bad syntax
* Convert usages of old version of with-log-messages-for-level to new version
* Update other stuff to use the updated macro
* Fix stuff
* Fix Cljs tests
* Fix world's largest test
* Appease Kondo
* Fix comment
* ClojureScript: only emit capture code in dev builds
* perf: Use more efficient iteration and formatting in CSV export
* perf: Replace clojure.data.csv functions with more efficient implementations
* fix: Fix formatting for integer numbers in scientific notation
* concat
* we fixed this!
* format
* links
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* refactor: memoize getSteps selector
* screen.getXXX.click() => userEvent.click(...) to avoid missing act() warning
* use mockSettings so that MetabaseSettings.setAll is called and we avoid the unknown features warning
* Add type picker to comparison modal
* Adjust offset input labels based of comarison type
* Pass comparisonType to column picker
* Add current period picker
* Use deepCompareEffect to avoid rerender loops
* Add moving average helpers
* Add moving average clause to query
* Prevent less than 1 period moving average from being created
* Fix unit test for CompareAggregations
* Use the ComparisonType type for the comparisonType arg
* Hardcode the mapping for offset <-> moving-average column types
* Convert column types in the comparisonType callback instead of a hook
* Remove unused parameter
* Automatically change to 2 when setting an invalid value for moving average periods
* Use expression parts in test
* Use named arguments for movingAverage
* Fixup test for moving average offset input
* Fix type issue
* Pass on includePreviousPeriod to getAggregations
* Add defaultTemporalBucket helper
* Add helper to pick default breakout
* Move breakout to the front or add one if it does not exist
* Add updateQuery to AggregationPicker props
* Add tests for creation and reordering of temporal breakouts
* Reuse defaultTemporalBucket in withDefaultTemporalBucket
* Reorder query operations to make sure the correct names get generated
* Remove dependency on referential equality of breakout
* Rename updateQuery to onQueryChange
* Remove onAddAggregations and onUpdateAggregation for onQueryChange
* Extract query update in to separate function
* Remove on{Add,Update,Remove}Aggregation in favor of onQueryChange
* Remove aggregations from summarize details
* Fix e2e tests
* Remove conflicting test
* Fix recent clause in unit tests
* Fix superflouous check for columnAndBucket
* Future proof breakout check
* Remove reliance on details in the useSummarize hook
* Remove details in unit tests
* Removal of default summarization should not trigger a query change
* new version of data_access migration + run ANALYZE beforehand
* relax constraints on migration timestamps
* more migration rewrites
* fix bug in migration
* fix another bug and remove extraneous logging
* reorder migrations to fix ID validation
* start adapting the changes to mysql as well
* wip
* add more ANALYZE calls
* revert logging changes
* finish duplicating work for mysql + a bit of clean up
* create H2 versions of migrations without the ANALYZE calls
* remove ANALYZE call from view_data.sql (probably not necessary)
* fix mysql syntax
* fix another mysql bug
* another mysql fix
* Don't exclude inactive tables for data_access
* Don't write rows for Administrators group
* Don't write rows for Admins (H2/MySQL)
* disable triggers before perms migration
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
* add setup commands
* fix settings definition
* update environment variables for cli
* handle instances not being ready
* update error messages
* add more specific loading messages
* loading spinner state
* improve error message
* use a fixed demo setup token
* remove extraneous spinner
* update status checks
* update container messages
* update wait timing
* create api keys
* extract constants
* remove manual steps
* Add anonymous tracking + other things. will need to clean up
* Modify SDK for better structure
* remove line from print.ts
* Update webpack.embedding-sdk-cli.config.js back to production
* Add types and add quick note
* Fix a typo
* Add index file, simplify types, use an array
* Add safer json parsing
* use delay of 100ms between each setup call
* Suggestions from review
* ensure that cli works
* Attempt to fix jest errors
* Remove node-fetch from sdk code to hopefully get unit tests working again
* add database connection
* add connection details handling
* refactor asking for database connection info
* apply actual database id for syncing schema
* fix failing database sync step
* allow table selection
* create model for each table
* handle errors in model creation
* fix incorrect model display name
* create x-rays based on user data
* consolidate instance setup message
* workaround for inquirer eventemitter issue
* add sample components
* fix yarn.lock file
* add sample components
* set spinner to fail state when instance setup fails
* use a transparent background by default
* update cli welcome messages
* add import notice
* refactor imports
* update snippet to add dashboard dropdown
* cli add credential file to users .gitignore
* add docs on quickstart
* clear screen with console.clear
* address code review feedback
Co-authored-by: Nicolò Pretto <info@npretto.com>
* allow node 18 lts
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
* Fix tooltip styles leaking to popover
* Fix snapshot now showing the tooltips and dropdowns
* Update the loki snapshot using built storybook for consistency
* Show new model loading state while fetching
* Show new model loading state while fetching
* Add unit test
* Use `DelayedLoadingSpinner` instead
* Update the test
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Prettier
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Add Timeseries insights even when Custom Columns exist
WIP
Fixes 46244
I don't know why it was (maybe still is) required that the :other columns be empty before providing insights.
* might be a solution to changing trendlines when data doesn't change
The insights code that powers the frontend trendline requires taking a sample of the dataset.
This sampling has some randomness associated by design, and should maintain its randomness. But it makes some sense to
use the exact same sample when the input has not changed at all, hence trying this memoize approach out.
Might not be the final solution, but it's a start
* add test to show that insights are computed
* use java.util.random with a seed to keep insights stable
* Add testcase from https://github.com/metabase/metabase/issues/43915
* Try a custom formatter if the default formatter for OffsetDateTime doesn't work
* Add testcase
* Make auxillary formatter private
* Catch a more specific exception
* Throw IllegalArgumentException on invalid dates
* Use strict resolver and fix test
* Empty commit to assign credit where it's due
---------
Co-authored-by: Chris Truter <chris@metabase.com>
* Dowload Row Limit Env Var
Adds `MB_DOWNLOAD_ROW_LIMIT` to enable changing the row limit on downloads and alert/subscription attachments (not the
rendered tables, but the .csv, etc.).
Based on: #44982 (Thanks, @r-kot)
Partially implements: #28144
The difference in this PR compared to #44982 is that the download limit applies to all downloads, the only exception
being when the limit is above `qp.i/absolute-max-results` (1048575, based on Excel's limitation); in such a case, the
user supplied limit is only used if the download is csv or json, and `qp.i/absolute-max-results` is used for xlsx.
This PR also fixes alert/subscription attachment limits; prior to this, they were set to the in-app limit of 2000
rows, but now they will follow the user supplied download-row-limit.
This PR also adds a test to the downloads-and-exports test namespace, confirming that they follow the supplied limit,
or the max limit if none is supplied.
* add test confirming the default limit works
* fix test to use the download-row-limit
* address review feedback
* Update src/metabase/public_settings.clj
Co-authored-by: Cal Herries <39073188+calherries@users.noreply.github.com>
* add test covering case where download-row-limit is unset
---------
Co-authored-by: Cal Herries <39073188+calherries@users.noreply.github.com>
* Revert "Remove unused humanizeCoercionStrategy and its test suite (#36136)"
This reverts commit 5375347e33.
* humanize coercion strategies, add e2e test
* unit test adjustment
* pr feedback
* conditional dismissal step
* check for download status in the container
* try fixing flakes again
* try again
* chartPathWithFillColor already verifies chart has been rendered
* Introduce subpath-safe URL utils
* Open data source links from a notebook safely on a subpath
* Open browse model links safely on a subpath
* Uniform naming
* Use the existing URL helper
* Trim url
* Add unit tests
* Add one more test case
* Fix test name 😅
* Make URLs non-optional strings
* Export Formatting Correctness
WIP
Several bugs exist around the correctness of export formatting, this aims to fix them.
Fixes#27374
When a model has viz settings/metadata changed after save, the download won't incorporate said changes. At least it's
clear that scale doesn't work.
* number formatter merges settings from columns too
* column formatting on aggregated cols works in xlsx now too
* fixes 43040 by grabbing global-type-settings in csv formatter
* Refactor
* Fix wrong colors when passing empty SDK `colors`
* Clean up CSS custom properties
* Add missing color mapping to the SDK
* Add missing colors to the main app
* Only override additional dynamic colors when values are passed
* Fix unit tests
* Address review
Co-authored-by: Phoomparin Mano <poom@metabase.com>
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Move the compare to the past aggregation to the bottom of the dropdown
* Fix missing icon property
* Hide 'Compare to the past' when there are no temporal columns
* Update copy in tests
* Add test for questions with no temporal columns
* Fix unit test for AggregationPicker
* Allow adding a compare aggregation when the first breakout is not temporal too
* Rename to 'Compare to the past' in custom column action
* Rename to 'Compare to the past' in column drill
* Update copy in tests for actions and drills
* Move canAddTemporalAggregation to CompareAggregation utils
* Use aggregations from the query always
* Remove unnecessary displayName check
* Last Used Param Value doesn't fill in with default value if cleared
Fixes#46368
The Last used parameter value is cleared when the frontend sends `nil` as the parameter's value. This works except in
cases where a user clears a parameter with a default value. In this case, we want to indicate that the parameter is
cleared, so we store `nil` in the appdb in such a case.
* Update src/metabase/query_processor/dashboard.clj
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* add assertion showing that 'nil' with default is still stored
---------
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Fixes: #46558
In #45575 we introduced casting uuid fields for drilldowns.
However we failed to include a check that the rhs was itself another
field of uuid type and so no casting should occur. This broke joins on
models when the database_type of the field may not be known.
* Add tooltip to the data step cell
* Conditionally display tooltip
* Add unit tests for the data step
* Add unit tests for the join step
* Move the abstraction to the NotebookDataPicker
* Cover the tooltip behavior with E2E test
* Update test
* Add test boilerplate
* Rename test and add assertions
* Add broken test for models
* Add unit of time tests
* Deduplicate code
* Add date parameter tests
* Add test for multiple stages
* Fix model test setup and refactor getColumnsInfos
* Remove redundant assertions
* Format codee
* Extract createQuestion and createModel
* Add unit of time model tests
* Add test for model
* Extract constants
* Add a warning
* Build dataset queries with mbql
* Introduce queryOrders
* Revert redundant change
* Improve Question creation
* Fix spammy GitHub Actions comments
* [DEBUG] trigger conventional commit reminder
* fix syntax errors
* Mock update
* mock another update
* 3rd update
* test if the comment would be updated only if the actual commet changes
* Remove all code relating to testing
* Fix type not compatible with node 18
* Update new Metabase base colors
* Make hover and selected state consistency
* Fix wrong embed frame border color
* Refactor: extract props
* Fix border color
* Fix pivot table cell hover color
* Fix smart scalar text contrast
* Add smart scalar tests + update text color design
* Theme dashboard card menu
* Remove dashcard action menu tests since they don't work in loki
* Fix storybook background color for dark theme
* Update loki snapshots
* Disable untestable tests
* Make sure all storybook inherit all necessary base styles
* Skip untestable tests
* Update loki snapshots
* add setup commands
* fix settings definition
* update environment variables for cli
* handle instances not being ready
* update error messages
* add more specific loading messages
* loading spinner state
* improve error message
* use a fixed demo setup token
* remove extraneous spinner
* update status checks
* update container messages
* update wait timing
* create api keys
* extract constants
* remove manual steps
* Add anonymous tracking + other things. will need to clean up
* Modify SDK for better structure
* remove line from print.ts
* Update webpack.embedding-sdk-cli.config.js back to production
* Add types and add quick note
* Fix a typo
* Add index file, simplify types, use an array
* Add safer json parsing
* use delay of 100ms between each setup call
* Suggestions from review
* ensure that cli works
* Attempt to fix jest errors
* Remove node-fetch from sdk code to hopefully get unit tests working again
* add database connection
* add connection details handling
* refactor asking for database connection info
* apply actual database id for syncing schema
* fix failing database sync step
* allow table selection
* create model for each table
* handle errors in model creation
* fix incorrect model display name
* create x-rays based on user data
* consolidate instance setup message
* workaround for inquirer eventemitter issue
* fix yarn.lock file
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
== Goal ==
Prevent admins of Metabase Cloud instances with Metabase Cloud Storage
from accidentally breaking their upload configuration, since in this
scenario that is automatically managed by Metabase Cloud to use the
attached data warehouse.
== How to test ==
On a subscription with Metabase Cloud Storage:
* The "Uploads" section in the left sidebar of `/admin/settings` does
not show
* A "not found" page is shown at `/admin/settings/uploads` where one
would otherwise expect the "Uploads Settings" page
* `PUT /api/setting` with an `uploads-settings` field in the body fails
with `403 Forbidden` and the setting is not changed
* `PUT /api/setting/uploads-settings` fails with `403 Forbidden` and
the setting is not changed
* `GET /api/setting` contains an element with `key: "uploads-settings"`
and a value
* `GET /api/setting/uploads-settings` responds with the value
* `GET /api/session/properties` contains the `uploads-settings` field
Closes: https://github.com/metabase/harbormaster/issues/5121
Co-authored-by: Ryan Laurie <iethree@gmail.com>
* truncate total text in pie chart
* add story
* Update Loki Snapshots
* add e2e test
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Add unit test for #46574
* Handle non-numeric values in NumberFingerprint
* Be more realistic about NumberFingerprintDisplayInfo type
* Add comment on why the types are unknown
* add setup commands
* fix settings definition
* update environment variables for cli
* handle instances not being ready
* update error messages
* add more specific loading messages
* loading spinner state
* improve error message
* use a fixed demo setup token
* remove extraneous spinner
* update status checks
* update container messages
* update wait timing
* create api keys
* extract constants
* remove manual steps
* Add anonymous tracking + other things. will need to clean up
* Modify SDK for better structure
* remove line from print.ts
* Update webpack.embedding-sdk-cli.config.js back to production
* Add types and add quick note
* Fix a typo
* Add index file, simplify types, use an array
* Add safer json parsing
* use delay of 100ms between each setup call
* Suggestions from review
* ensure that cli works
* Attempt to fix jest errors
* Remove node-fetch from sdk code to hopefully get unit tests working again
* fix yarn.lock file
* revert capture groups change
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
== Goal ==
Currently the config file (`MB_CONFIG_FILE_PATH`) only allows adding or
changing databases, but not removing them. Since connected databases
can be managed as a service by us, it becomes necessary to delete any
information Metabase has about them, including any stored credentials.
Since this is a destructive operation with no way to revert (without
restoring from a backup), we raise the bar for accidental deletion and
require not just a (boolean) flag, but a magic string to be set.
== How to test ==
1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
2. Start your Metabase instance.
3. Verify the database shows up in the "admin" section and it works.
Create a dashboard and questions using the database.
4. Add a `delete: "DELETE_WITH_DEPENDENTS:${name}"` line to your
database configuration section.
5. Restart your Metabase instance.
6. Verify the database no longer shows up in the "admin" section.
Notice that questions using it are gone, too.
References: https://github.com/metabase/harbormaster/issues/5173
* WIP Open notebook data source in new tab
* WIP
* Implement the new functionality with `pickerInfo`
* Use destructured value
* Add the simplest possible E2E test as PoC
* Smoke test
* Add basic coverage for questions
* Add basic coverage for models
* Source question has been archived scenario
* Add basic permissions test
* Expand to the user without wite query permissions
* Fix title
* Add another permission scenario
* Add E2E coverage for a source being native
* Add coverage for the native model
* Address review comment re: `pickerInfo`
* Extract `getUrl` to utils
* Add support for the middle/scroll click
* Add unit tests
* Add a negative test case
* Fix title
Fixes#46440
couple things come together here.
Bad escaping:
The `{` characters are used for format strings and placeholders like
```clojure
impl=> (translate "fr" "After {0}" ["Bob"])
"Après Bob"
```
And if you want _literal_ {'s in your translation string, you must
escape them like "'{" or "'}" using an apostrophe. But this isn't the
end of our worries.
in `resources/zh-CN.edn`, we actually have _two_ translations for the
original string:
```clojure
"User lookup filter. The placeholder '{login'} will be replaced by the user supplied login."
"用户找过滤器,占位符 '{login'} 将替换为用户提供的登录名。"
,,,
"User lookup filter. The placeholder '{login}' will be replaced by the user supplied login."
"用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。"
```
And this later has unescaped curlies.
The fix for that is at
https://poeditor.com/projects/po_edit?per_page=20&id=200535&id_language=31&filter=&order=&search=User+lookup+filter
but will need to wait for the new source translation string in this
instance with the corrected escaping.
```clojure
;; simulate what happens at runtime
impl=> (translated-format-string "zh_CN"
"User lookup filter. The placeholder '{login}' will be replaced by the user supplied login."
{})
"用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。"
impl=> (MessageFormat. *1 (locale "zh_CN"))
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
;; the problematic zh-CN string
impl=> (MessageFormat. "用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。")
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
;; minimal reproduction
impl=> (MessageFormat. "“{login}”")
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
```
* fix: mongo ObjectId should be orderable
Fixes#46259
Mongo ObjectId derive :type/TextLike but that can't be an orderable
type, so we mark the specific Mongo type as orderable for malli schemas.
* Fix test
* prevents users from moving items to the trash if they are in the trash already and archives instead of moves in cases where item is moved to or from the trash
* reverts detecting if dragging in or out of the trash not setting the collection id, this will be prevented on the BE instead
* adds test coverage for dragging and dropping items to/from/within the trash (one of which is failing until we can make a BE change)
* Throw away `collection_id` when marking archived
This is a hack around a frontend issue. Apparently, the undo
functionality depends on calculating a diff between the current state
and the previous state. Sometimes this results in the frontend telling
us to *both* mark an item as archived *and* "move" it to the Trash.
Let's just say that if you're marking something as archived, we throw
away any `collection_id` you passed in along with it.
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
### Description
This change should fix some explosions in stats due to phantom fields, while also making things a bit more rigorous.
- Record the table schema in query_field - especially useful for unknown tables
- Allow null table names in query_field - they might be phantoms, or they might not
- We still have the option to filter them out in tools we build on top
- Tighten up matching logic to consider schema
* Update popover dark theme on part of ParameterFieldWidget (#45813)
* Add filter visual tests
* Simplify embed CSS colors
* [WIP] theme filter popover
* Move theme to global node, so it affects portal too
* Fix embed colors
* Theme part of ParameterFieldWidget
* Add story for parameter with dropdown
* Update loki snapshots
* Update more popover style
* Update loki snapshots
* Remove outdated snapshots
* Update loki snapshots with production build
* Fix loki not working with `userEvent`
* Theme mantine popover
* Improve dark theme text-brand visibility
* Update loki snapshots from master change
* Fix new colors not working in SDK
* Fix flaky Loki tests
* Filter popover dark theme part 2 (#46284)
* Theme Date all options
* wip add month and year filter
* Fix wrong CSS custom property declaration
* Test hover state
* Update Loki snapshots
* Theme date month and year
* Add quarter and year tests
* Theme date single and date range
* Style relative date
* Update frontend/src/metabase/admin/datamodel/components/filters/pickers/DatePicker/DatePickerHeader.styled.tsx
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
---------
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Complete theming filter popover night mode (#46365)
* Style unit of time and number widget
* Attempt to fix flaky Loki snapshots
* Address white background checkbox on dark theme
* Style search filter single value
* Fix mis color
* Update snapshots
* Remove duplication on play functions since they're long
* Milestone 2 polishing (#46382)
* Matches the footer padding with header padding
* Update snapshots
* Add E2E to prevent further problem
* Try to reduce flaky Loki tests
* Remove unused color shades (#46421)
* Update no results illustration to work better on dark theme
* Update loki snapshots
---------
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Refactor dashboard helpers to TypeScript
* Reuse existing helper
* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there
* Merge TS command definitions into a single file
* Export types
* Make dashboardDetails optional
* Export StructuredQuestionDetails
* Remove duplicated function
* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!
* Reuse const
* Add test for unit of time parameters
* Improve assertions
* Extract createDashboardWithParameters
* Add tests for time parameters
* Fix hardcoded parameter_mappings ids
* Format code
* Extract checkButtonVisible
* Improve test names
* Add tests for location parameters
* Reuse const
* Update test name
* Add WidgetStatusButton
* Add unit tests for WidgetStatusButton
* Rename handler
* Remove redundant assertions
* Add iconSize prop
* Fix styling
* Replace WidgetStatusIcon with WidgetStatusButton
- Remove WidgetStatusIcon
* Fix tooltip issue
* Fix tooltip for good
* Use default compact button size
* Prevent overflow
* Fix alignment issues in parameter sidebar
- Remove iconSize prop
- Simplify StatusConfig
* Update padding in Unit of Time input to make it consistent with other inputs in dashboard parameter sidebar
* Update unit tests
* Rename WidgetStatusButton to WidgetStatus
* Explicitly specify what is a button
* Update helpers in tests
* Update when buttons are displayed according to the new spec, update tests
* Simplify label
* Remove utils
* Adjust padding
* Update reset icon
* Make the button gray when color is undesired
* Remove old definitions
* Add missing export
* Remove unused type
* Add test for location (single value)
* Add test for id (single value)
* Add more assertions
* Add test for id (multiple values)
* Improve name
* Add tests for number (single and multi value)
* Add tests for text (single and multi value)
* Rename file
* Update comment
* Update test name
* Use unique ids
* Use new color name
* Add a test for chevron icons alignment
* Lift className up
* Make types more specific
* Sort attributes
* Revert "Make types more specific"
This reverts commit 2e6994b5ed.
* Revert "Use new color name"
This reverts commit 2cc68df6ba.
* Remove TODO
* Introduce editFilter util, refactor chevron assertions to work with any number of chevrons
* Connect label to the default value input in ParameterSettings
* Add a whitespace in the default value label when required "(required)" is shown
* Add parameter sidebar tests for unit of time
* Add parameter sidebar tests for date filters
* Extract checkParameterSidebarDefaultValue
* Add parameter sidebar tests for location - single values
* Add parameter sidebar tests for location - multiple values
* Use constants for test case names
* Add parameter sidebar tests for id parameters - single values
* Add parameter sidebar tests for id parameters - multi values
* Add parameter sidebar tests for number parameters - single values
* Add parameter sidebar tests for number parameters - multi values
* Add parameter sidebar tests for text parameters - single values
* Add parameter sidebar tests for text parameters - multi values
* Extract checkDashboardFilters
* Use checkDashboardFilters in time parameters
* Use checkParameterSidebarDefaultValue in checkDashboardFilters
* Use checkDashboardFilters everywhere
* Sort helpers
* Rename checkDashboardFilters to checkDashboardParameters
* Rename checkOnlyOneButtonVisible to checkStatusIcon
* Add test suite for sql filters, coverage for text filter - single value
* Add a whitespace in the default value label when required "(required)" is shown - SQL filters
- Similar to 930dd3a50a
* Add test suite for sql filters, coverage for number filters
* Add test for sql filters - date
* Remove unused things, rename placeholder to labelOrPlaceholder
* Apply label only to 1 input
* Add test for sql filters - field parameters
* Fix date tests
* Make all sql filters tests work
* Add assertions for required without default in text filters
* Add assertions for required without default in date filters
* Add assertions for required without default in field filters
* Allow clearing required SQL filters without default value
* Add a test to ensure comma-separated numeric values work
* Update unit test
* Update helper
* Update e2e tests
* Use != null and == null checks with defaultValue instead of just checking if its truthy/falsy
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Add button boilerplate
* Add getCanResetFilters selector
* Move canResetFilters to utils
* Add explicit return types
* Implement the button action
* Rename
* Simplify action
* Optimize: use single action
* Use parameterHasNoDisplayValue to account for empty strings
* Run `yarn test-visual:loki` and then `yarn loki approve` after merging master
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Rename getHiddenParameterSlugs to getTabHiddenParameterSlugs
* Take all tabs into account
* Add unit tests for canResetFilter
* Format test name
* Fix non-human-friendly aria-label
* Add assertions for "Reset all filters" button's visibility
* Unnest helpers from describe
* Add a test for comma-separated values
* Improve typing
* Fix typing
* Add tests for multiple tabs and auto-apply-filters on/off
* Improve test name
* Remove redundant util
* Remove redundant condition
* Verify card results get filtered
* Test that all tabs are affected
* Fix test case with autoApplyFilters: false
* Add tests for resetting to default value
* Fix wrong initial state in reduce
* Fix updated parameters not being applied
* Add reset all filters assertions
* Remove unused attribute
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Refactor dashboard helpers to TypeScript
* Reuse existing helper
* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there
* Merge TS command definitions into a single file
* Export types
* Make dashboardDetails optional
* Export StructuredQuestionDetails
* Remove duplicated function
* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!
* Reuse const
* Add test for unit of time parameters
* Improve assertions
* Extract createDashboardWithParameters
* Add tests for time parameters
* Fix hardcoded parameter_mappings ids
* Format code
* Extract checkButtonVisible
* Improve test names
* Add tests for location parameters
* Reuse const
* Update test name
* Add WidgetStatusButton
* Add unit tests for WidgetStatusButton
* Rename handler
* Remove redundant assertions
* Add iconSize prop
* Fix styling
* Replace WidgetStatusIcon with WidgetStatusButton
- Remove WidgetStatusIcon
* Fix tooltip issue
* Fix tooltip for good
* Use default compact button size
* Prevent overflow
* Fix alignment issues in parameter sidebar
- Remove iconSize prop
- Simplify StatusConfig
* Update padding in Unit of Time input to make it consistent with other inputs in dashboard parameter sidebar
* Update unit tests
* Rename WidgetStatusButton to WidgetStatus
* Explicitly specify what is a button
* Update helpers in tests
* Update when buttons are displayed according to the new spec, update tests
* Simplify label
* Remove utils
* Adjust padding
* Update reset icon
* Make the button gray when color is undesired
* Remove old definitions
* Add missing export
* Remove unused type
* Add test for location (single value)
* Add test for id (single value)
* Add more assertions
* Add test for id (multiple values)
* Improve name
* Add tests for number (single and multi value)
* Add tests for text (single and multi value)
* Rename file
* Update comment
* Update test name
* Use unique ids
* Use new color name
* Add a test for chevron icons alignment
* Lift className up
* Make types more specific
* Sort attributes
* Revert "Make types more specific"
This reverts commit 2e6994b5ed.
* Revert "Use new color name"
This reverts commit 2cc68df6ba.
* Remove TODO
* Introduce editFilter util, refactor chevron assertions to work with any number of chevrons
* Connect label to the default value input in ParameterSettings
* Add a whitespace in the default value label when required "(required)" is shown
* Add parameter sidebar tests for unit of time
* Add parameter sidebar tests for date filters
* Extract checkParameterSidebarDefaultValue
* Add parameter sidebar tests for location - single values
* Add parameter sidebar tests for location - multiple values
* Use constants for test case names
* Add parameter sidebar tests for id parameters - single values
* Add parameter sidebar tests for id parameters - multi values
* Add parameter sidebar tests for number parameters - single values
* Add parameter sidebar tests for number parameters - multi values
* Add parameter sidebar tests for text parameters - single values
* Add parameter sidebar tests for text parameters - multi values
* Extract checkDashboardFilters
* Use checkDashboardFilters in time parameters
* Use checkParameterSidebarDefaultValue in checkDashboardFilters
* Use checkDashboardFilters everywhere
* Sort helpers
* Rename checkDashboardFilters to checkDashboardParameters
* Rename checkOnlyOneButtonVisible to checkStatusIcon
* Add test suite for sql filters, coverage for text filter - single value
* Add a whitespace in the default value label when required "(required)" is shown - SQL filters
- Similar to 930dd3a50a
* Add test suite for sql filters, coverage for number filters
* Add test for sql filters - date
* Remove unused things, rename placeholder to labelOrPlaceholder
* Apply label only to 1 input
* Add test for sql filters - field parameters
* Fix date tests
* Make all sql filters tests work
* Add assertions for required without default in text filters
* Add assertions for required without default in date filters
* Add assertions for required without default in field filters
* Allow clearing required SQL filters without default value
* Add a test to ensure comma-separated numeric values work
* Update unit test
* Update helper
* Update e2e tests
* Use != null and == null checks with defaultValue instead of just checking if its truthy/falsy
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Use parameterHasNoDisplayValue to account for empty strings
* Run `yarn test-visual:loki` and then `yarn loki approve` after merging master
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
* Make number also have custom parameter values
* Render the correct label in the dropdown for number inputs
* Mock paramter values endpoint in number input test
* Add test for custom labels on number input
* Fix number input test
* Allow entering comma separated values using labels
* Only show custom labels in popover
* Use getLabel and getValue helpers to avoid indexing confusion
* Remove calls to parameter endpoints for number input
* Do not parse the value from the label
* Add support for number parameters in the source picker modal
* Filter number values
* Add e2e test for number parameters with custom source
* Remove card option for number parameters
* Set the correct initial value for number parameters without fields
* Do not render number parameter as search box when it is a list
* Fix e2e tests for number lists
* Remove e2e tests for card source dashboard filters
* Add tests for native filter custom source
* Show the dropdown when picking the default value for number parameters
* Clear values_source_config when changing parameter type
* Restore a parameters' values_source_config when changing the parameter type back
* Clear and restore values_source_config for template tags when chaning type
* Add e2e test for restoring of template tag sources_value_config
* Add e2e test for clear and restore of static-list for dashboard parameters
* Fix input type for numbers
* Fix broken test
* Display labels for ParameterValuePicker too
* Clear and restore values_source_type when changing parameter type
* Clear and restore values_source_type for tag parameters
* Clear and restore values_query_type when changing parameter type
* Clear and restore value_query_type for parameters tags
* Update tests to test for reset to also apply to values_source_config and values_query_type
* wip
* moves code to enterprise folder, adds enterprise guards, updates conditionals as to when to show the feature
* impls filter date logic, improves styling, mocks out real endpoint with collection items endpoint, updates table with isLink boolean rath
er than using custom item renderer, removes dead code
* use the actual url for stale
* so many things... updated design, custom table component, polish, misc. refactors, more correct api typing
* updates to pagination component and reverts some now unused changes to the base items table
* impls pr feedback
* fixes
* fixes failing unit test
* completes pr feedback from raffi
* implements second round of feedback from raffi
* adds tests and couple of small fixes / feedback
* migrate clean up action to enterprise plugin and fix related e2e test, also skip the collection items count query when we do not need the value
* finish main base case e2e test
* clean up helper code for manual testing and add OSS test to make sure feature is not available in OSS
* better handling of min-height on smaller screens
* adds internal undo notification for bulk archiving in the clean up modal
* reset pagination when items are archived/unarchived to keep users from getting stuck on a page beyond the current view
* pr feedback
* further cleanup
* unit test fix
* fixes issue where archiving all items in the modal and then undoing does not result in the stale items list getting refetched
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
* hide notebook button for brand new questions
* test notebook button visibility for new questions
* move brand new check inside shouldRender
* test embedding SDK notebook button
* update unit tests
* add spy to shouldRender
* Fix coll permissions for audit collection
We've had a function in `models.collection` for a while that has taken a
permissions set and returned a set of collection IDs that the user has
permissions on. I refactored this recently, but didn't notice that it
was actually doing the permissions checks slightly incorrectly.
Specifically, because it only looks at the user's permissions and the
collection IDs and doesn't use `mi/can-read?` or `mi/can-write?`, it's
completely indifferent to whether a collection is an audit collection or
not.
This is arguably not a *permissions* issue: the two errors that could
come about here are:
- someone sees the audit collection even though the audit feature is
disabled, or
- someone is presented with the audit collection in a context where only
writable collections should be present - when they try to actually write
to it, it fails (since then we're doing the real permissions check).
The primary motivation for this fix was to prevent audit dashboards and
cards from appearing in the list of stale items.
* Fix hardcoded collection ID
We were creating a timeline in a fixed collection ID, that in tests
happened to be the ID of the Metabase Analytics collection.
* properly handle SMTP environment variables
* disable clear button when set by env var
* allow the SMTP form to validate with any combination of environment variables
* add unit tests for SMTP connection form
* BONUS: fix console error for jt keys
* fix types
* updates the ordering of create queries permissions options so that granular permissions is the last option
* fix unit test
* move granular option above no
* update static_embed_code_copied to use downloads (#45944)
* copy schema file for better diff
* adds downloads field to appearance in embed_flow schema
* update event to send `downloads` parameter, update e2e tests
* fix test for dwonloads: false
* fix: use correct schema version for embed flow analytics (#46053)
* update `dashboard_pdf_exported` and use it in embedding context (#46076)
* copy schema for better diff
* adds `dashboard_accessed_via` to the `dashboard_pdf_exported` event
* download_results_clicked event (#46132)
* adds download_results_clicked event + e2e tests
* make strings nullable
* adds maxLength
* switch back to if/then as it seems more readable
* refactor: use the resourceType to determine the download params instead of re-doing the logic
* fix ''question' is possibly 'undefined'.'
* split resource_type into resource_type and accessed_via to also consider interactive-embedding and sdk
* edit comment
* adds test for ad-hoc-question
* Update frontend/src/metabase/query_builder/actions/downloading.ts
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* makes describe message more consistent
* "else if" => if
* fix describe block name
* convert downloads event to use enum for download_type and export_type
* resource_type should be an enum too
* fix line added in the wrong place during merges
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* Update frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* adds enum schema to dashboard_accessed_via
* fix accessed_via for sdk embeds
* update comments to explain why we send 0 when dashboardId is null
* only send dashboard_id as a number when it is a number, as expected by snowplow
* remove un-needed async/await from saveAsPDF function
* rename frontend/src/metabase/redux/downloading-analytics.ts -> frontend/src/metabase/redux/downloads-analytics.ts
* fix cy.log message
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* update embed frame pdf button colors to use --mb-color- vars
* change download pdf button color to brand color
* testing adding the images that actually differ
Previously we unpacked everything and picked up first entry as the directory
containing the data. This works well when archives are passed as is. However,
if a user unpacks and then packs an archive, there is a good chance that some
hidden directories will appear - and they are first in order.
So we skip those right now, and additionally check known markers of the
serialization data directory.
* Squash
* Clean up query modifier for validating card references (#46283)
* Fixup bad git merge on test expectation
* Tweak docstrings and de-densify logic
* Allow filtering on collection
* Add `effective_ancestors` to collection data
Note: I removed the `qv=` comparator. I think it'.s better to be more explicit
about what exactly we're asserting. In particular, I hadn't updated the
`:count` when we were filtering on collection type, so the count was
still the total for *every* collection even though the results were being
restricted by the collection. However the `qv=-data` function was still
reporting that everything was OK, because it was accounting for other
data from the App DB by just asserting that the count we'd specified was
lower than the actual count. I'd argue it's better for tests to fail
locally because I have garbage in my app DB (which I can clean up) than
succeed when they really shouldn't.
* Consolidate effective ancestors
For the Search API, we're currently returning slightly different
ancestors:
- it never has the Root Collection, and
- the ancestors don't have a `personal_owner_id`
We could change the API (and maybe will soon - it seems pretty
unexpected to have `effective_ancestors` sometimes act one way and
sometimes act another) but for now we can just reshape things to look
the same as they did before, while using the same code under the hood.
* echarts pie
* setup rendering pipeline for static pie chart (#43547)
* setup rendering pipeline for static pie chart
* remove more donut code from BE
* compute viz settings for static pie chart (#43548)
* compute viz settings for static pie chart
* create chartModel for pie chart (#43549)
* create chartModel for pie chart
* render static pie chart (#43550)
* render static pie chart
* render static pie chart legend (#43551)
* disable animation
* alter static-viz pie chart be tests to account for echarts-impl
The old implementation had a different implementation for legends, separate from the 'categorical/donut' js
render. Echarts nicely combines the legend into the pie render, so we don't need to worry about that stuff anymore.
Instead, I've written a simple set of assertions on the echarts pie implementation now.
* Get rid of this test that was attempting to use old code path
* echarts pie
* One last spot where we don't need old pie stuff anymore.
* add loki specs
* save snapshots
* fix small slices disappearing
* update snapshots
* add repro story for exteremely small slice
* add snapshot
* fix rounded total
* fix percent formatting in legend
* fix date dimension formatting
* fix binned and relative date dimension labels on legend
* add specs and snapshots for null and unaggregated dimensions
* hide overlaping labels on chart
* fix null dimension color
* show error when metric column has a negative value
* move legend to botom
* make dot margin smaller
* add columns to legend
* sort legend vertically
* dont use grid if only one row for legend
* never hide legend in static viz
* fix empty column culling
* show single legend item
* add long dimension name story
* fix long dimension name in legend
* right justify percentages in legend
* remove negative error and re-add stories
* handle negative values
* create chart definition for dynamic pie chart
* render chart with responsiveness
* add comment for borderWidth calculation
* center legend
* fix legend centering
* add story for missing currency formatting
* fix missing currency formatting
* fix graalvm crashing
* fix column settings computation
* add another currency formatting repro
* fix wrong order of col settings computations
* convert colors to hex
* fix colors missing from viz settings
* temp todo comment
* fix colors in dynamic viz
* update snapshots
* fix crashing due to invalid dimension/metric setting
* fix chart crashing for boolean dimension with labels on chart
* add repro
* fix regression in label formatting
* fix labels on small slices
* update specs
* emphasis state for slice hover
* recreate old label hiding logic
* include height measurement in getIsLabelVisible
* move d3 slices to chart model
* fix labels on static viz
* wip basic hover state and tooltip
* fix emphasis style getting stuck by memoizing everything
* update total display value
* fix stuck emphasis by setting notMerge to false for pie only
* handle other slice in tooltip
* fix bugs in total graphic
* use OTHER_SLICE_KEY const in static viz legend
* implement legend and connect to hover state
* implement click actions
* fix slice not clickable
* handle all zero slices
* add repro
* update specs
* update pie_chart.cy.spec.js
* update chart_drill.cy.spec.js
* add repro for single column legend
* use minimum 2 legend columns
* fix legend text overlap
* use more margin for single row legend
* update specs
* add repro for 28568
* add repro for 38424
* fix percent label not showing on large slices
* hide total text when chart is small
* replace comment about animations
* show warning for mixed positive and negative values
* delete old chart files
* fix type errors
* update d3 import
* update specs
* remove branch from uberjar.yml
* dont put single slice into other
* fix lint errors and pie render test
* update more d3 imports
* remove unused settings
* revert preview-card-width change
* remove unused import
* remove majorWidth option from formatting
* use debounceLeading refresh mode in ChartWithLegend
* remove TOTAL_GRAPHIC_OPTION constant
* delete unit test for pie chart
* fix failing test by doing set comparison instead
* fix typo in comment
* remove SUNBURST_SERIES_OPTION constant
* fix lint by removing unused eslint-disable
* move default color computation to getValue
* fix static pie test to show that we will always render the legend
* update pie border color for night mode and embedding
* fix styles for embedding case and add stories
* skip embedding stories
---------
Co-authored-by: Adam James <adam.vermeer2@gmail.com>
* Make an internal API for retrieving stale content
This introduces the `metabase.stale` module, which has one public
function (so far): `metabase.stale/find-candidates`. This takes a set of
`collection-ids`, a cutoff date, and pagination/sort info.
Next, we introduce an HTTP API endpoint that will figure out the appropriate
set of `collection-ids` for a given user/request, call this function,
and return the results in the shape we want.
Also: for e2e tests, we need a way to mark a card or dashboard as stale. I
think the easiest way to do this is to just create a testing endpoint
that we can call to update the `last_used_at` or `last_viewed_at` of the
card/dashboard to set it to ~7 months ago.
---------
Co-authored-by: bryan <bryan.maass@gmail.com>
* use mantine buttons for filter and summarize
* Restore fancy color hover states
* Add css modules
* oh the cleverness of me
* better var name
---------
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Expands and refactors `metabase.util.memoize` to support better cross-platform memoization.
**Better basic memoization**
Use `clojure.core.memoize/memo` (and its clone in CLJS) rather than `clojure.core/memoize` for
the "everything forever" strategy.
**Bounded memoization**
There are a few places (eg. `u/kebab-case-en`) where we want zero-overhead *hits* and expect the input space
to be fixed. To guard against runaway memory usage, this **bounded** strategy dumps the entire cache when it
overflows. It logs an INFO level note when that happens - the intent here is that the threshold should never
actually get hit!
**Fast JVM versions**
In the special case where the function to memoize takes exactly 1 argument which is a valid map key, we can
use `ConcurrentHashMap.computeIfAbsent` as the basis of the cache and have much less overhead.
`fast-memo` and `fast-bounded` implement this in CLJ; in CLJS they just call `memo` and `bounded`.
* Use function helpers
* Only assert the resize down
* Refactor repro 31701
* Remove flaky tag
* Better organize describe blocks
* Move custom `requestTimeout` config to the common block for resizing tests
* Refactor dashboard helpers to TypeScript
* Reuse existing helper
* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there
* Merge TS command definitions into a single file
* Export types
* Make dashboardDetails optional
* Export StructuredQuestionDetails
* Remove duplicated function
* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!
* Reuse const
* Remove old definitions
* Add missing export
The `dashboard_load_id` is attached to the body for queries, not as a
query parameter. This correctly receives the `dashboard_load_id` and
uses it for `/query` calls.
* pull sdk info into data on-thread
* include api tests for query_execution and view_log
* Try mt/test-helpers-set-global-values!
- disambiguate names used in tests
* pass test + cleanup test helper
* make sure view logging is enabled in test
* fix conditional formatting color lookup with correct col names
The column names for color lookup are expected to be the same as the :name key of each column, and applying column
formatting broke this lookup. This fixes it.
* move overflow-x into pulse body div to exlude card title from scroll
* add a test for conditional formatting w/ a hidden row.
This still fails at the moment, working on a fix yet.
* apply conditional formatting in static viz even when col is hidden
Conditional formatting that depends on a hidden column was not being rendered in the static viz, but now we pass all
columns into the color selector fn, thus when rendering the table with the ordered/hidden columns, all other columns
will still use their appropriate conditional formatting
* I missed a linter warning
* fix tab rendering
* fix test
* fix up tests with some better structural searching
* Adds a middleware that sets 2 dynamic vars
- These vars will be used to insert context for embedding analytics
* migration adding embedding_client and embedding_version to qe and vl tables
* clarify function api
* headers come in -> dynamic vars -> written to db
When the vars are set we insert their values into query execution and
query_log under embedding_client and embedding_version.
* update update migrations
* add predconditions to migrations
* fix tablenames + dataset_test
* Code Review responses
- remove commented out requires
- clarify test for merge-count-maps
* Lock down the trash collection more
Oops. I was very thorough in checking that you couldn't modify the
trash collection in the sense of moving things to or from it. I missed
the most obvious thing: actually modifying the trash collection itself.
So if someone wanted, they could change the name of the Trash to
"Definitely Not the Trash".
* Remove the Trash Collection from serialization
Serialization tests were failing due to the previous change, but this
got me thinking, and I realized that serializing the Trash collection is
completely unnecessary. We want to create it programatically on
startup (which we are) and then nothing should change it afterwards.
I tightened this up by removing the condition here, thinking that CI
would catch it if it was necessary - but I'm getting failures in
development. Oops - didn't realize that this defmethod wasn't actually
applied during CI runs.
* Rewrite repro for 27643
* Add TODO for the remaining tasks
* Make a test name consistent with others
* Finish the E2E test for #27643
* Fix the test to use PostgresDB
Since H2 originally doesn't fail the test
* Attempt to fix a flake on CI by waiting for table to finish syncing
* Create QA snapshot with fully synced field metadata
* Fix failed tests from field metadata change
* Simplify question scenarios
* Simplify dashboard scenarios
* Fix permissions
* Rework titles
* Add comment about PG
* Add limit to speed things up
* Fix and improve dashboard assertions
* Fix and improve question assertions
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* Bigquery Pagination Use next page to get proper results
Fixes 45953
WIP
* use new-page in values-iterator
* disable just the part of the test that is still flaky
Want to keep the other part of the test that does prove we're not getting duplicates due to incorrect pagination.
* Number formatter Reports correct Decimal places for negative Numbers
Fixes#41640
Prior to this, the number formatter would get the incorrect number of decimal places for negative numbers.
The way the decimal places count is derived works as follows:
- convert number to a string
- split the string on the separator (decimal, comma, whatever the instance has set)
- destructure that split into [int decimal]
- count decimal to get the number of decimals.
That all works for positive numbers, but for negative numbers, the regex was just splitting on 'not digits', so we got
an extra group due to the leading negative sign. This would incorrectly destructure the 'int' part of the number into
the count, thus we would always get 1 instead of the correct value.
This fixes it by just taking last instead of destructuring.
* correct comparison to always use abs value in conditonal check
* tiny incorrectness in the test
* Modify the E2E stress test workflow to allow running PostgresDB
* Fix syntax
* Add qa_db to workflow summary
* Only run necessary containers
* Fix QA DB snapshots running when QA_DB_ENABLED=false
* Use more generic option that's not only specific to postgres
* perf: Add explicit .entryAt method for SnakeHatingMap
Otherwise, SHM invokes .keySet on itself which triggers the contstruction of the list of keys on each map access.
* perf: Cache (un)successful requiring of EE in dynamic-ee-oss-fn
* perf: Add a quicker path for getting metadatas from cache
* perf: Minor improvements
It's based on a (global, synchronized) `WeakHashMap` using the query map
itself as the key. That gives the cache the same lifespan as the query
map, which is generally brief but often includes many calls to
expensive, cached functions like `visible-columns`.
* Make filter corrupted again™
* Speed up the test by limiting the number of rows
* Make the repro more correct, and more resilient
* Remove intercepts
* Improve assertions
* add webpack configuration for cli
* add requirements checking
* docker check
* docker start command
* port checks
* add getting started steps
* add final install message
* cleanup cli text
* handle force-closing prompt
* build the cli when running build-embedding-sdk
* wording updates
* add redundant prompt in case of small terminals
* remove redundant instruction
* make sure the user confirms the step
* change container name to metabase-enterprise-embedding
* migrate cli to es modules instead of webpack
* add shebang line for npx
* add cli dependencies to devDependencies
* Revert "add cli dependencies to devDependencies"
This reverts commit 5d5e952c2b.
* Revert "add shebang line for npx"
This reverts commit 766fdda09e.
* Revert "migrate cli to es modules instead of webpack"
This reverts commit 7d1b065163.
* Embedding Parameter Values set in Tokens work properly when `nil` or empty list
Fixes: #40292
If a locked parameter's value is set to `nil` or `[]` in the embedding JWT, we want to treat this as 'no value has
been set' on that filter, but we should still run the query as normal. Likewise, any linked filters should still
properly derive their values from the unfiltered values of the filter to which they are linked.
* when a parameter's value is nil or empty seq, don't include it
This is a partial solution as I still need to find the place that's still erroring on the empty list case in terms of
the linked parameter's values.
* Treat empty list like `nil` for the token param
When you're using a filter in the App, it makes intuitive sense that when you've not selected anything from a filter's
drop down list (or entered any text, etc.), then the filter is effectively not applied.
For token params, we should behave similarly; `nil` and `[]` can both be accepted, and signal that the user intends
for that filter to basically NOT apply.
This also means we should not pass the constraint to the linked filters, since it errors, but even if it worked, it
would return 0 results, making it impossible to properly apply the linked filter at all.
So, this change causes empty lists to be treated as nil, AND will remove any parameters with `nil` as a value before
being passed to the query processor, which results in the proper behaviour of not having constraints on the linked
filter, and having the 'parent' filter not filtering anything.
* Embed preview should always use params from the token
In making a screenshot, I discovered a slight bug in previews, where if the embed had been previously published, it
could pull embedding params from the db that don't match the settings on screen. So, always pull the settings from the
token, which updates as the user is making changes in the Preview Embed UI.
* for previews, merge the embedding params sources instead
* alter 'nil' behaviour to work just as if the key doesn't exist
* fix one spot where I was passing maps into set functions
* Adjust tests to check for consistent behaviour in dash/qstn embeds
* fix an e2e test
* fix up last 2 failing e2e tests
* add the test case of a locked param having no value set in token
* some further e2e changes
We have N+1 detection for simple hydration methods that checks to see
whether the hydration method made any DB queries at all. This makes
sense, because a simple hydration method is called on each instance
individually - if we make database calls *each time*, we're in trouble.
Where this runs into issues is with cached data, where the simple
hydration method is populating the cache - e.g. `:can_read` or
`:can_write` dereferencing `api/*current-user-permissions-set*`.
Currently we specifically exclude those hydration methods from the
check.
But after running into this again for a different simple hydration
method, I think there's a more robust approach:
- first, run the hydration method without counting DB queries
- then, run it again and make sure we don't make any additional DB
queries.
There is a potential downside here: if someone wrote a simple hydration
method with side effects, they'd potentially be very confused (in
development - this doesn't run in prod!) when those side effects
happened twice for a single hydration. But I *think* that's fairly
unlikely.
* handle errors when useMetabaseAuthStatus is used outside of sdk context
* address review comments feedback
* extract useSdkContext
* fix import type error
* polyfill useSyncExternalStore for React 17
* adds the shim
* use ReactDOM.render instead of createRoot for backwards compat
* use createRoot for React 18 environment
* refactor renderRoot compatibility
* remove semver dependency
* add small test for version
* use the same check for react 17
- babel is kept to transpile fonts file as swc emotion plugin doesn't handle our case correctly. I didn't find a root cause of wrong behaviour, but the safe past is to keep using babel + emotion plugin for one file and all others can be transpiled with swc
- react fast-refresh now handled by swc
- swc-loader can't read browserslist config from package.json, so we had to manually specify supported browsers in webpack
* Uninstall ReplayIO
* Remove Replay config
* Install and use custom Chrome v111
* Simplify comment
* Set a specific Chrome version commit
* Skip repro for #22517
* fix: replacing joins and conditions updates alias
Fixes#37074
* Only change alias if conditions or table changed
* Fix test
* Fix fe test
* Address PR feedback
* Remove can_run_adhoc_query from the FE
* Remove can_run_adhoc_query from the FE
* Disable can_run_adhoc_query on dashboard
Was impacting performance on dashboard load. Timings locally for me:
get dash: 3178 -> 199
get metadata: 3604 -> 1002
So dashboard went from 6 seconds to load to 1 second.
* Fixup test from disabling can_run_adhoc_query
---------
Co-authored-by: dan sutton <dan@dpsutton.com>
* adds database_id to recents, and question collection items
* don't show unjoinable things in recents either
* unskip repro
* fix types
* fix repro
* fix tests in model/recent_views
* add unit test for invalid join in recents
* fix tests in test/metabase/api/collection_test.clj
* update type
* improve unit tests
---------
Co-authored-by: Ryan Laurie <iethree@gmail.com>
* Add `report_dashboard.last_viewed_at`
- defaults to `now()` (it's intended to be used as a timestamp after which
we're *sure* the item hasn't been used, not a definitive timestamp we're
sure the dashboard was actually used at)
- updated whenever the QP processes a query for a dashcard
---------
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
* remove dynamic import to make html2canvas work on the sdk
* Revert "remove dynamic import to make html2canvas work on the sdk"
This reverts commit a8b511fa28.
* manually import html2canvas-pro and jspdf in the sdk
Previously, due to over-eager `.flush()` calls in Cheshire, we were
flushing the output stream for every `data.rows` entry. Typically this
resulted in 3 + N TCP packets sent, where N is the number of rows being
returned.
This PR rebuilds how we stream the JSON responses to avoid extra
`.flush()` calls. For the unit test in this PR, that reduced the number
of packets sent over the wire from 37524 to 4.
Fixes#34795.
* Post sync hook stub for implicit joins testing stub
* Add join alias to field lvalues to enable sorting on joined fields
* Disable :foreign-keys on Mongo
* Require :left-join support for implicit joins instead of :foreign-keys
* Update implicit joins tests
* Adjust sync-fields-test
* Update implicit joins feature check test
* Transform post-sync-hook to normal function
* Add foreign key relationships only for dbmses without :foreign-keys feature
* Update test to handle Oracle correctly
* Split convoluted fn
* Avoid unnecessary computations for datasets with no fks
* Update docstring
* Fix driver usage
* Transform :foreign-keys to :metadata/key-constraints in test data loading code
* Update sync_test.clj
* Update driver_test.clj
* Update moviedb.clj
* Update dataset_definition_test.clj
* Update fetch_metadata.clj
* Update fields_test.clj
* Update driver.clj
* Update driver/sql.clj
* Set sql driver join support to true for all joins
Deriving drivers are expected to set to false where applicable.
* Update sqllite.clj
* Remove foreign-keys from spark
* Remove :foreign-keys from presto
* Remove :foreign-keys from Athena
* Remove foreign-keys from big query
Reading docs it seems fk inference should be ok. Let's see the test results. Act based on that.
* Update test_metadata.cljc
* Set key-constraints to false for bigquery
* Add foreign keys to sqlite manually until sync is fixed
* Return driver require to Athena
* Correct typo
* Add naive primary key heuristic
* Update pk fk logic to handle name components correctly
* Add alias escaping to presto
* Add ordering to test
* Add order by to test
* Update test
* Remove use of rewrite-fields-to-force-using-column-aliases in order by fields
* Add exception to alias forcing
* Different approach to exception from alias forcing
* Alternative approach for prefixing idents in bigq
* All seelcted fields by desired alias
* Rewrite only fields not from this source table
* Update test
* Enable breakout-on-fk-field-test for :left-join drivers
* Add feature comment
* Explicit joins tests foreign-keys removal
* Update nested_queries_test.clj
* Update remapping tests
* Update tests
* Update tests to handle sqlite results format
* Disable metadata/key-constraints on sqlite during tests until
* Address remarks
* Remove mt/with-mock-fks-for-drivers-without-fk-constraints
* Update bigquery test
* Update tests
* Adjust row level restrictions
* Add parameterized-sql feature
* Update comment
* Update leftovers
* Order keys
* Remove foreign keys from frontend
* Fix FE unit
* Update driver changelog
* Address review remark
* Update test/metabase/query_processor/test_util.clj
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Update docs/developers-guide/driver-changelog.md
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Update docs/developers-guide/driver-changelog.md
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Update modules/drivers/bigquery-cloud-sdk/src/metabase/driver/bigquery_cloud_sdk/query_processor.clj
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Update docs/developers-guide/driver-changelog.md
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Update test
* Update comment and reduce expression
* Update comment
* Address remarks
* Fix merge
---------
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Derive MySQLEnum from Text instead of TextLike
Fixes#44807.
This change is in accordance with https://dev.mysql.com/doc/refman/8.0/en/enum.html describing the ENUM types as a
kind of string. All our string operations seem to work with MySQL ENUM fields.
* docs: extract requires a db with regex
* Update docs/questions/sharing/visualizations/table.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* tests for drivers with spaces in their identifiers
* Add driver feature
* Fix tests
* Remove ambiguous alias for sqlite
* Try to fix bigquery and sqlite tests not seeing left-join support
* Add explicit support for left-join because of foreign-keys during test hacks
* Handle left-join support weirdness
* Fix test
* Fix falsy tabSelected/tabRenamed checks
* Update URL management (WIP)
* Fix tests failing because of whitespace changes
* Fix tests failing because of parameter order
* Use one hook for parameters and tab URL management
* Fix tests failing because of parameter order
* Fix test failing because of whitespace changes
* Revert
* Fix DashboardTabs tests
* Fix tests failing because of parameter order
* Fix test
* Fix test failing because of whitespace changes
* Remove unit tests that should be e2e tests now
* Fix tab navigation
* Fix string encoding/decoding
* Revert test changes
* Consistent question search params
* Update DashboardTabs tests
* Fix `SyncedParametersList`
* Fix e2e tests
* Fix nav usage
* Fix types
* Remove `useSyncedQueryString`
* Fix test
* Move slug utils to dashboard utils
* Fix nav
* Revert nav change
* Fix e2e tests
* Fix public/embedded dashboards, handle site url
* Add repro test
* Bring back and fix `PublicOrEmbeddedDashboardPage` tests
* Move `SyncedParametersList` to qb
* Refactor EditoTabs
- get rid of options prop
- use named export
* Remove unused data-testid
* Remove redundant id and aria-labelledby
* Remove redundant props spread
* Bring back data-testid in use
- Thanks VSCode for randomly showing me search results or not...
* Fix navigation issue
* Add a repro for first issue
* Adjust EntityPickerModal root element so that it works with "be.visible" assertion in Cypress
* Add a repro for second issue
* Refactor tests
- Fix not enough history entries issue
* Change order of tests to start with simpler one
* Fix invalid request issue
* Add more assertions
* Format code
* customize popover z-index
* make popover z-index customizable
* make the popover z-index customizable
* add tests for popover z-index
* also specify z-index for mantine popover
* Reuse connection for test data loading & JDBC data loading overhaul
* Revert silly change
* Remove unneeded logic for recording which datasets are loaded or not-yet-loaded
* Ok so I guess we do need the code to detect duplicate dataset loading after all
* B I G improvements
* Appease Kondo
* Test fixes 🔧
* More test fixes 🔧
* Fix dataset-already-loaded?-test
* Fix test
* Fix Presto JDBC and greatly improve test data load speed for it
* Postgres test fix 🔧
* Fix compilation errors
* MySQL fixes 🔧
* Fix syntax error
* MySQL fixes 🔧
* Implement `dataset-already-loaded?` for Athena and cache the set of existing databases
* Fix Redshift
* Fix Presto JDBC
* Vertica test fix 🔧
* Fix Oracle dataset-already-loaded?
* Test fixes and parallelize some API tests.
* Test fixes 🔧
* Oracle test fix? 🔧
* Another test fix 🔧
* Stop putting random spaces in code bodies this is not JavaScript code
* with-temp-vals-in-db should merge in original value of Database settings
* The most test fixes 🔧
* 3 or 4 test fixes 🔧
* Add schemas around stuff to catch errors
* Appease Kondo
* Implement dataset-already-loaded? for vertica
* Implement dataset-already-loaded? for SQLite and Snowflake
* [WIP] Testing driver filters
* Only test returned values in CI
* Add :uuid-type for dbs that support that type (test oracle's support)
* Try again for oracle test, redshift does not support uuid-type
* Add tests, support where available
* Add empty/null tests
* Adjust test query for athena
* Reset logging
* Fix comments
* Add Athena uuid conversion
* Address PR review
* Add comments
* Address PR comments
* Use varchar for portability. Add inline uuid casting for athena
---------
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
* Field Filter Value Normalization in Embedding Endpoints
Fixes 27643
Since we use query-params to pass paramter values, we have to normalize the parameter map values.
This PR is a WIP, as I'm trying to find a way to do this hollistically/properly.
First commit here is mostly as a marker for where to start working on this properly, as I think the json parsing won't
catch all cases, nor should the normalization happen without some attempt to use a schema to properly validate, maybe
even coerce things.
* read strings if boolean or numbers, replace blank str with nil
Also update the common dashboard param values fn to use embedding params from the URL blob if the app db doesn't have
embedding params. This happens upon first preview where nothing will have been written to the Appdb yet.
* Add query-param normalization test, add related embedding test
* schema didn't work in this case after all.
Worth a shot, but don't want this to block the PR, so reverting to the previous schema
* Add comment pointing out the downsides/reasons for this solution
It's nto a perfect solution, but it's probably the best we can get at the moment, without adding a new filter
type (boolean) and/or improving the design of hte embedding endpoints and how filters/parameters work
When we run queries, we preprocess them, during which the sandboxing
middleware adds information that we use when checking permissions
later on in query processing.
When we checked data permissions before saving a card, we were checking
permissions on the raw query, without preprocessing. Without the data
provided by the sandboxing middleware, the permission check sometimes
failed (depending on the permissions for other tables in the DB).
Note the big hack here: preprocessing can fail, for lots of reasons.
This broke a *lot* of tests that were passing in invalid queries. If an
exception occurs during preprocessing, we catch and just use the
original query like we were before.
* refactor: Simplify code (#44275)
* Remove dead code
* Remove values same as default options
* Simplify hook API: Removing unused argument
* review: Remove redundant code
* Update look and feel copy (#44277)
* Update static embed tab name
* Update copies + rearrange settings
* Use Mantine Select
* Fix E2E tests by applying new copies
* Fix unit tests
* Fix more E2E tests
* review: Add a comment on Mantine `value` quirk
* Adjust spacing and relevant tests
* Move `transparent` theme to its own toggle option (#44362)
* Reorder the function to match the visual order
* Make function name consistent
* Introduce the new background option (do nothing yet)
* Remove redundant exports
* Tighten up values to reduce confusion
* Make the parameters order consistent
* Only show background option on dashboads (spec)
* Allow dashboard embed background to be transparent
* Make filter background and header/footer transparent
* Fix type error
* Fix unit tests
* Fix E2E tests
* Fix checkerboard pattern not showing when no background
* Add unit tests
* Add missing copy update
* Remove remnants from outdated solutions within the PR
* Improve code comment references
* Fix E2E tests since the last copy change
* Fix type errors from merging master
* Update light theme style (#44488)
* Add background to dashboard filter on light theme
* Make position sticky works with transparent background
* Fix sticky filters not working on theme=transparent
* Fix unit tests
* Simplify IntersectionObserver components + fix E2E tests
* Add storybook for embedded dashboard
* Clarify the use of ExplicitSize context
* Remove unused code
* Formatting
* Review: Better mock `isWithinIframe`
* Update dark theme to match the new design (#45134)
* Update light theme checkerboard colors
* Update checkerboard colors
* Consolidate dashboard light/dark border style
* Use `--mb-color-text-primary` for light theme dashboard
* Update embed dashboard dark theme primary color
* Migrate dashboard text-secondary color
* Migrate text-tertiary color
* Migrate gold, axis, and split line to CSS custom properties
* Fix failed e2e tests
* Fix static viz not working
* Update loki snapshots
* Remove unnecessary CSS custom property
* Make diff more consistent
* Address review: reusing type
* Support backward compatibility when passing `theme=transparent` (#45214)
* Match preview query with the actual code query
* Handle backward compatibility when `theme=transparent` on dashboard
* Add unit tests
* Address review: Make tests less repetitive
* Update Metabase banner upsell UI (#45424)
* Prepare folder for nested components
* Update upsell UI
- add `fullWidth` variant
- align title to the left
* Fix Upsell banner having horizontal scroll on full width
* Add new Metabase banner upsell component
* Fix unit tests
* Address review: Fix typo
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
* Address review: Move upsel UI to `admin/upsells`
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
* Remove unnecessary ESLint disable comment
We can remove it since the file is in admin folder, and is already excluded from the rule.
* Address review: remove default value property
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Address review: Extract magic number
---------
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* More UI updates (#45450)
* Update dark theme text colors to match the new design
* Update powered by metabase logo
* Update loki snapshots
* Fix unit tests
* Fix formatting
* Fix wrong dark theme metabase logo badge color
* Address review: Compress SVG with svgo
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Fix E2E tests
* Update loki snapshots
* Clarify Metabase base colors with comments
---------
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Add more tests (#45628)
* Add static embed question stories
* Add loki snapshots
* Add transparent theme for static dashboard tests
* Add transparent theme tests for static questions
* Assert `background` option in analytics tests
* Remove tests for logic that has been moved
* Update loki snapshots
* Fix failed E2E tests from merging master
---------
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* Refactor EditoTabs
- get rid of options prop
- use named export
* Remove unused data-testid
* Remove redundant id and aria-labelledby
* Remove redundant props spread
* Bring back data-testid in use
- Thanks VSCode for randomly showing me search results or not...
:message(format"The name of this %s should end with `!` because it contains calls to non thread safe form `%s`."
:message(format"The name of this %s should end with `!` because it contains calls to non thread safe form `%s`. [:metabase/test-helpers-use-non-thread-safe-functions]"
(error!form(format"destructive functions like %s are not allowed inside a ^:parallel test or test fixture. If this should be allowed, add it to the whitelist in .clj-kondo/hooks/clojure/test.clj"
(error!form(format"destructive functions like %s are not allowed inside a ^:parallel test or test fixture. If this should be allowed, add it to the whitelist in the Kondo config file [:metabase/validate-deftest]"
qualified-symbol)))))
(walk[form]
(fform)
@@ -135,7 +28,7 @@
(defn- deftest-check-parallel
"1. Check if test is marked ^:parallel / ^:synchronized correctly
2. Make sure disallowed forms are not used in ^:parallel tests"
[{[_test-name&body]:children, :as_node}]
[{[_test-name&body]:children, :as_node}config]
(let [test-metadata(:metatest-name)
metadata-sexprs(map hooks/sexprtest-metadata)
combined-metadata(transduce
@@ -152,9 +45,9 @@
(hooks/reg-finding!(assoc (meta test-name)
:message"Test should not be marked both ^:parallel and ^:synchronized"
:type:metabase/validate-deftest)))
;; only when the custom `:metabase/deftest-not-marked-parallel` is enabled: complain if tests are not explicitly
;; marked `^:parallel` or `^:synchronized`. This is mostly to encourage people to mark everything `^:parallel` in
;; places like `metabase.lib` tests unless there is a really good reason not to.
;; only when the custom `:metabase/deftest-not-marked-parallel-or-synchronized` is enabled: complain if tests are
;; not explicitly marked `^:parallel` or `^:synchronized`. This is mostly to encourage people to mark everything
;; `^:parallel` in places like `metabase.lib` tests unless there is a really good reason not to.
while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}' > /dev/null; do
if ! kill -0 $(cat metabase_pid) 2>/dev/null; then
cat metabase.log
echo "Metabase process has exited. Check that your migration changes work on an instance that has been previously initialized on your PR's target branch."
@${githubUsername} You have modified embedding SDK code. Please make sure the PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style.
Here are all the supported types that will be shown in the changelog:
- \`feat\`
- \`fix\`
- \`perf\`
These types \`docs\`, \`style\`, \`refactor\`, \`test\`, \`build\`, and \`ci\` are also encouraged for non-changelog related tasks.
Please also make sure to include \`sdk\` scope, otherwise, the changelog will not include this task.
comment='@${{ github.event.pull_request.user.login }} You have modified embedding SDK code. Please make sure the PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style.
Here are all the supported types that will be shown in the changelog:
- `feat`
- `fix`
- `perf`
These types `docs`, `style`, `refactor`, `test`, `build`, and `ci` are also encouraged for non-changelog related tasks.
Please also make sure to include `sdk` scope, otherwise, the changelog will not include this task.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.