* add basic typescript configuration
* convert a tiny hook use-debounced-value to typescript
* allow any for now?
* update terser and static viz configs
* adjust config
* change extension of QuestionActivityTimeline from jsx to js to match jest config
* adjust config
* skip failing tests
* Fix missing question method in unit tests (#18314)
* review fix
* fix
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
* Enable repro
* Move saved questions virtual DB id to own file
* Add saved question helpers
* Add test-id to Metabase logo component
* Extend repro test to cover archived items handling
* Handle saved question actions in schema entity
* Handle saved question actions in table entity
* Fix moved file import
* Fix Cypress can't find logo in EE (whitelabeling)
* Fix saved questions order
* Fix saved questions included in database tables
Change implementation of docsUrl to handle RC suffixes for EE versions
Change the regex used to test the tag to detect any OSS or EE version, including (possibly) an arbitrary suffix after the major and minor parts, and normalize to the major OSS equivalent version instead. If the suffix, OTOH, is `-SNAPSHOT` (ignoring case), then the doc tag will be `latest`, on the theory that this is as local development build.
v0.41.0 => v0.41
v1.41.1 => v0.41
v1.41.2-RC1 => v0.41
v1.42.0-SNAPSHOT => latest
Adding unit tests for all cases
Update behavior so that -SNAPSHOT suffix points to "latest"
Previous PRs for error cards page were laser focused on getting everything to work, as opposed to actually conforming to spec. This one gets it closer to spec, although product wants reloading animations which are not there yet. To wit,
- Indicates to end user what the current running state is. Given the many orders of magnitude in DB query run times I think something robust and non-ephemeral is necessary here (looking at some sort of expanded QE model) but Maz suggested expedient method and I took it
- No more left nav on the table page
- Page heading for table page
- Independent scroll-x behavior on the table
- Styling for the error section on the table page
- Select-all component. Note that the interaction behavior with pagination is fiddly. (but less fiddly now that it's all based on card id's instead of row numbers)
- Coalescing default behavior for Our Analytics collection (default collection) and null number of dashboards
Rename error name to error content search
Remove the `driver/format-custom-field-name` implementation for :snowflake, which was causing the problem and appears to be no longer needed anyway
Add test for this scenario to `metabase.query-processor-test.expression-aggregations-test`
* Update Link component's code style
* Add disabled style to Link
* Disable "Save" button when can't run query
* Animate Link color and opacity changes
Cache TTL is defined in the nice new column things as per hour. The actual cache wanted it in seconds. There wasn't a conversion hours->secs before, which was the underlying illusion that gave rise to #18160 - with a properly set cache ttl the cache works fine. But the cache ttl's weren't getting set to proper values because of that lack of unit conversion. So here's the conversion, hours->secs.
* Make webpack output closer to webpack 4 and fix whitelabelling
* Fix recently-viewed.cy.spec.js
Not sure why it's started failing with this PR, but adding wait for text.
When all the necessary data hasn't been fetched you can find yourself in
stuck in a loop between the invalid state checks in DataSelector's
componentDidUpdate method and the skipSteps method.
1. there seems to always be a single schema (the "Everything Else"
schema) available on instantiation
2. the skipSteps method auto-selects this schema when no other schemas
exist
3. there's some pre-existing logic to avoid getting in this loop by
checking the is_saved_questions property of the database in the
selectedSchema. However, for whatever reason this property doesn't
exist until AFTER we've fetched some things.
The fix is checking a property that is guaranteed to exist, the ID for
the "Everything Else" database
NODE_ENV interferes with other tools (e.g. `yarn` won't pull
devDependencies). Since what we need is only a flag indicating Webpack
to bundle for production vs developement, invent our own env.
This also solves the mystery of unable to call `yarn build` in the build
script `bin/build-mb/src/build.clj`.
* move logic in dashboard selectors to meta/Dashboard
* rmv usage of syncQueryParamsWithURL
* add syncQueryParamsWithURL logic to meta/Parameters.js
* Fix public questions
* fix dashboards
* fix query builder
* don't normalize when value is empty string
* rmv unused setMultipleParameterValues fn
* replace selector logic with meta/Dashboard fn
* filter out nil fields
we need to do more work before we can properly use
fields from nested questions when parsing parameter values.
* add field to dash parameter so we can correctly type nested native query fields
* fix tests
* code style tweaks per review
- a56b640 broke Percy workflow on master and introduced a major inconvenience for developers who wish to run Cypress locally. In both cases, it's required to have all supported QA DB docker images running at all times. Otherwise, the Cypress snapshot creation phase breaks.
This PR:
- uses the existing ENV var to conditionally skip qa db snapshots
- this doesn't affect CircleCI workflow - it merely makes life easier for developers running Cypress locally and for a Percy workflow that runs on GitHub Actions (where we still don't have QA docker images available)
Add `escape-alias` multimethod to `sql.qp` to handle translating an alias (whether for a field or expression) into something supported by the driver in quesion
Add default impl that is essentially identity
Marking `sql.qp/field->alias` as deprecated, and changing its default implementation to invoke the new `sql.qp/escape-alias` on the field's `:name` (with the intention of removing it in a future release, since individual driver won't need to override this, so much as they'll need to override `escape-alias` itself).
Override `sql.qp/escape-alias` method for both BigQuery drivers to run through the same `->valid-field-identifier` function already defined for this purpose
Add test for a custom expression with weird characters
* Create `postgres-12` snapshot
* Use `postgres-12` snapshot in tests
* Relocate postgres `add` spec
* Relocate postgres `sandboxes` spec
* Relocate postgres `native` spec
This actually didn't have anything to do with the native questions.
We simply used native editor because it was easier to reproduce the issue.
* Relocate postgres `permissions` spec
* Relocate postgres `query` spec
* Relocate postgres `custom-column` spec
* Remove postgres from `metabase-db`
There is a problem when there are no card ids for a userland query (so not all userland queries are non-adhoc queries: they can be adhoc), where viewlog needs a card id so it chokes. Just adds a check so it doesn't even try to emit a viewlog, since the auditing is for non-adhoc queries only.
Check feature flag on backend /graph PUT API for block permission
Check for the `:advanced-permissions` flag in `update-db-permissions!`, when a `:schemas` `:block` entry is present in the graph
Set feature flag in tests when using API
Add new test to ensure failure in the case that feature flag is missing
Overall purpose of PR is to add row drill-ins to the tools to fix broken questions, so you can take a look-see into what the broken questions are.
A tiny nit thing wasn't caught by CI and broke master. This was because there's a CI cache. I can confirm that this didn't hit the CI cache and the other thing that broke isn't breaking anymore
- `TEXT` in Redshift is equivalent to `VARCHAR(256)`, use
`VARCHAR(1024)` instead
- Unskip all tests skipped on Redshift due to sample dataset issue
- Add explicit `:order-by` to `join-source-queries-with-joins-test`
to make it pass in Redshift as Redshift does not preserve order
after join (like a lot of other distributed query engines)
- Add `VACUUM` and `ANALYZE` call after INSERT to improve performance
from maz in slack:
Should not remove verification:
- Moving to another collection
- Pinning/unpinning
- Adding/removing an alert on the question
- Turning sharing on the question on/off
Should remove verification:
- Editing the query
- Editing the visualization or viz settings
- Editing the title or description
This really just identifies when not to remove verification, otherwise
does remove verification. Alerts are not related to questions through
the api so no worries there. Everything else is just excluding
attributes from the diff calculation.
In tests, went perhaps a bit haywire with the macrolet, allowing to
define macros inline rather than farther away from the call site. Used
twice:
- once to optionally add in moderation review into the with-temp. This
macro is handy to ensure we always have a fresh state of card and don't
have leftover changes or verifications. Has to be a macro since i want
to dynamically change whether there are verifications in the with-temp*
vector binding
- a way to more easily reduce repetition when asserting something is
verified, do an action, and assert it is still verified
Cache controls all landed but is lacking in the audit capacity wanted for in the notion doc. This PR adds that audit capability and by the by changes the ViewLog model in order to be able to deliver on the question of whether ViewLogs were cache hits or not.
Details page for tools to fix broken questions. Also the PR ran long enough that nemanja found some bugs in the details page. Does not include any loading overlay or anything to indicate that reloads are happening, which is for 41.1 I guess
Fix BigQuery Percentile and Median expressions not using correct backtick quoting
Ensure the identifier components are quoted by reifying `ToSql` for the `APPROX_QUANTILES` expression
Add test to ensure query is created properly
Mark `:percentile-aggregations` as being supported in the new driver
This is a combination of 2 issues:
1) pt got renamed to pt_BR in x.39.x but the old
"pt" value may still be stored in the database
2) when making a release, an unclean build
directory may be used containing old "pt"
resource which gets leaked into the release build
1) is fixed by adding a function to treat "pt" as "pt_BR"
to support users who were on "pt" since pre-x.39.
(This is done by finding the closest fallback locale)
2) is fixed by emptying the folder before generating locales
so any old locales are deleted.
Fixes#16690
`query->native` works by having `nativef` throws an exception
which causes `mbql->native` to set native query to `nil` which
then cause the rest of the execution to be skipped.
However, because the existing code skips overriding the native
query for queries already native, the execution is not skipped.
This causes bad performance for nested native question because
`query->native` is called for the sub-query which causes the
sub-query to be executed on its own, potentially without any
limit or filtering.
Because we can't fully implement all the driver deprecation UX in time for release 41, we will adjust the language to allow flexibility for when to actually start the deprecation clock
Add test for ordering when nils are present
Adding test to ensure that we can handle a column containing nils in an ORDER BY clause
Adding `format-name` override for `bigquery-cloud-sdk` to convert dash to underscore in test table names
Adding comment showing IDs of each row in the daily-bird-counts.edn file
Format last column as int to make Oracle happy
Add impls for `presto` and `presto-jdbc` `sorts-nil-first?` as false
Make the `sorts-nil-first?` multimethod accept a base type in order to return an answer
Vertica, at least, has a different answer for different types; see:
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/AnalyzingData/Optimizations/NULLPlacementByAnalyticFunctions.htm#2
Updating Vertica implementation to consider the `base-type` as per its documentation
Updating all invocations of `sorts-nil-first?` in tests to pass the relevant base type
Support query cancellation in new BigQuery driver
Remove now unused 60 second timeout
Remove a bunch of unneeded code (`with-finished-response`) from the legacy driver
Add support for canceling query, which stops pagination of results
Add test to confirm pagination stops upon cancellation
Add test to confirm that max rows enforcement via middleware prevents unnecessary pages from being fetched
* Add initial e2e test for erroring questions
* Add repro for #18050
* Add repro for #18048
* Add test section with that contains broken questions
* Improve test and add another scenario
* added check for borderless buttons when setting compact padding
* fix my own silly regression
* added visual tests for run button regressions
* added minWidth to percy snapshot
* shoudl have read the docs
* Sync VIEWPORT_WIDTH and percy snapshot width
* add template tag fields as dependent metadata for native queries
* check for a field_id property added by getValueAndFieldIdPopulatedParametersFromCard
* Add NativeQuery dependentMetadata unit test
* add test for loadMetadataForQuery
* Formatting
return a format string so it can be used over multiple rows. The rules
for formatting are quite annoying because there are defaults that are
assumed rather than present. IE, if you set a column as currency it
doesn't set the number style sometimes and defaults to USD without that
being in the settings. In the future would be far preferable to always
create a fully fleshed map of defaults rather than inferring them in
random places.
* appease our doc string supervisor
* Include column information for formatting numbers
really important for requiring two decimal places by default on doubles
and none on integers. Its close to correct ignoring it and using
"#,###.##" and this leaves non decimal places on integers and allows
only up to two on doubles, but things like 31.10 will format as 31.1 and
that is improper
* Remove unneeded metabase.test
* Update tests with nil column
* Get global viz settings in middleware, pass entire to formatting
Passing the entire viz settings to the formatting stuff makes the
calling code much simpler and the places where we merge global settings,
possibly get currency settings, etc, just in one place. We already had
the col information there so just use it.
* Remove public settings now that we get it from the metadata
* Check for existing result set when displaying
"Showing [X] rows" instead of the max limit
* added cypress test
* broke up nested ternary operators in QuestionRowCount
We added cache control fields for dashboard and database and actually use it for cards: presumably EE folks want to audit that stuff. Here is the addition of those fields to the table views.
In `getTableClickedObjectRowData`, we try to get the
original row of the data from the rowIndex but because
the rowIndex of the pivoted table and the original table
does not necessarily match, we get the wrong data.
This commit fixes it by storing a mapping between
pivoted (row, col) and the original row number and using
that to determine which row to use for the data.
Fixes#17920
When loading dashboard filters, the default value is in `:default`
not in `:value`. In the field filter code path, the default is
copied to `:value`. Fix the issue by calling the same code for
non-field filters too.
Fixes#15705
* Move email->domain and email-in-domain? util functions to metabase.util
* Improve the error handling for with-temp a little more.
* Extra error context for with-temporary-setting-values
* Improve Setting docstring forms validation: handle aliased forms like `i18n/deferred-tru`
* Fix missing :require
* For sparklines, check that viz type is line
this actually goes to fix waterfalls. They would match these
requirements but the viz type of waterfall would give results that would
dip out of the viewport. Fallback to table rendering
* Prevent waterfall rendering as sparkline
* please run that cancelled test again, GitHub®
Add separate catch clause for BigQueryException, to `execute-bigquery`, which conveniently includes a property to indicate whether it's retryable, and add that to the ex-data map
Add test that confirms a retryable exception is, in fact, retried
* Test join's setDimension methods can remove dimensions
* Specify temporal-unit for Join unit tests data
* Ensure join dimensions' temporal units are the same
* Display dimension's temporal unit on Join UI
* Add E2E test for join fields temporal units
* Select temporal units for join dimensions
* Sync parent and join dimensions temporal units
* Refactor Join dimension setters
* Update subdimension check
* Update overwrite check
* fix reverting dashboard with card deletion
`delete-dashboard-card!` expects the :dashboard_id
parameter to be defined.
* fix frontend issues related to dashboard reverts
1) fix the dashboard not being reloaded to the
reverted version after revert
2) fix the history list being reloaded to include
the latest change
* Rename dashboard details edit action
* Use render props at dashboard edit form
* Add enterprise caching plugin
* Move dashboard entity forms to own file
* Make FormField's margin configurable
* Pass custom style to FormField
* Use null as a default cacheTTLFormField value
* Add tests for DashboardDetailsModal
* Add cache_ttl field to DashboardDetailsModal
* Add tests for CreateDashboardModal
* Test cache_ttl is invisible when creating a dashboard
* Remove not used mocks
* Add tests for EditQuestionInfoModal
* Move question entity forms to own file
* Add cache_ttl field to EditQuestionInfoModal
* Test cache_ttl is invisible when creating a question
* Extract CacheTTLField component
* Don't show cache field if caching is disabled
* Fix typo
* Update cache_ttl field look
* Revert "Pass custom style to FormField"
This reverts commit 3944ca8ff1dcad478f0f1c3a1973f454447c88c1.
* Revert "Make FormField's margin configurable"
This reverts commit ca7dc434532038da736012147f6889e6cc01ec11.
* Fix CacheTTLField width
* Add descriptionPosition prop to FormField
* Add DatabaseCacheTTLField
* Show cache_ttl field on database form
* Use 24h as a default database cache TTL field value
* Fallback to database cache_ttl in question form
* Remove console.log
* Fix request body assertion for CreateDashboardModal
* Fix request body assertions for EditQuestionModal
* Fix request body assertions for DashboardDetailsModal
* Fix cache_ttl not included in `PUT /api/card/:id`
* Use simple for for EditQuestionInfoModal
* Refactor how unit tests mock caching settings
* Add dashboard caching EE test
* Add question caching EE test
* Add caching e2e test for database add/edit
* Remove debug stuff
* Add error state to CacheTTLField
* Fix DB cache field reverts to default value on 0
* Validate cache_ttl field
* Add getQuestionsImplicitCacheTTL helper
* Remove redundant tests
* Remove not used import
* Nomalize `cache_ttl: 0` to null
* Fix duplicated card update request
* Add QuestionCacheTTLField component
* Add test-id to Radio's option names
* Use a new cache TTL field for questions
* Check setting cache_ttl to null in E2E tests
* Style question cache TTL field
* Add dashboard ID to query request body
* Extend `duration` formatting helper to support hours
* Fix default caching duration display
* Fix tests
* Fix old dashboard edit action title
* Fix missing translations
* Add prop types to EditQuestionInfoModal
* Remove `test.todo`
* Simplify `getQuestionsImplicitCacheTTL`
* Use `space` style helper
* Add `key` prop to `jt`
* Move time coverting utils to lib/time
* Hide caching field label if just showing the input
* Fix unit tests
* Fix flacky E2E test
* Add hover style for "More options" control
* Fix missing translation
* Use placeholder for cache inputs
* Fix E2E tests to use cache field's placeholder
* Feature flag for caching UI
* invalidate revision entities when questions/dashboards updated/deleted
* you can't update a revision
* add a cy test to cover revision cache clearing
* let's be a little looser with revision text
* Add subscription-allowed-domains allow list Setting
* Move email->domain and email-in-domain? util functions to metabase.util
* Fix missing require
* Test fix 🔧
* Remove useless namespace
* Make subscription-allowed-domains a :string Setting rather than :csv
The locale list sent to the UI is formatted "pt-BR" but
when it is saved to the database, we re-format the locale to
"pt_BR", thus on next load, the UI cannot match the saved locale
with the locale list.
Fix the issue by using normalized value (e.g. "pt_BR") in the
available locale list.
Fixes#15657, fixes#16654
The ttag library expect the plural array to be exactly the size as
the number of plural forms defined in the header.
If we remove empty plural, the array will have the wrong size and
the library will crash when the trying to use the non-existent
plural.
By leaving the empty string there, the ttag library will correctly
detect it and use the English version for the missing variant.
This does not affect the backend because the backend does not
support plurals.
Fixes#16323
* Add new Settings (placeholders) for the new 0.41.0+ premium features
* Code cleanup
* Add new features to the `:premium-features` Setting (for FE consumption)
* Fix busted ns declarations
* combine sidebar state for various dashboard sidebars
* replace hideClickBehaviorSidebar action with closeSidebar
* move sidebar name strings to a constants file
* add some tests
added the viz-settings parsing middleware to static viz. Column settings are
spec'd for regular columns and by name, but we forgot expressions apparently.
* Add test ID for notebook's action buttons
* Add repro for #17712
* Use `Join.clean` in join step's clean callback
* Always show a remove icon
* Fix referencing an empty dimension
* Improve Join's validity check
* Don't cleanup incomplete join sections
* Fix structured query tests
* Don't use MBQL field literals in notebook tests
https://github.com/metabase/metabase/issues/14824
* Delete user pulse/alert/dashboard subscription subscriptions when they get archived
* Automatically archive Pulses when last subscription is deleted (#17812)
* Automatically archive Pulse when its last subscription is deleted
* Test fix 🔧
* Fix occasionally-failing rotate-encryption-key!-test
* Update pulse_test.clj
Add parameter handling for BigDecimal that checks whether the value is in range for BIGNUMERIC or BIGDECIMAL and sets accordingly
Updating parameter test to hit both these cases
Modifying test code/macros to support a with-table semantic for testing the decimal types via a temp table
Writing new test to confirm that all numeric types are synced correctly and can be queried for
* Basic skeleton of front-end dependencies analyzer
* Parse enterprise/frontend
* Handle good ol' require
* For sanity, bail out immediately when encountering a parse errr
* Split into commands (currently returning JSON)
* Filter dependents from stdin
* Track down all dependents, including the indirect/transitive ones
* Fix filtering not including the enterprise
* Map a directory to its index.js, if it exists
* Refactor common functions
* Matrix and count dependents
This was a miserable grind in the old BQ syntax but a happy fun time in the new BQ syntax, basically just turning it on and squashing a bunch of test bugs.
One test bug to note especially is that the underscore-transformed set of bird scarcity data for the bird scarcity tests is actually necessary, because BQ will hit you with a complaint about underscores even if you successfully and correctly quote the table names.
* Pass along date formatting
* extract and rename some things
* Number formatting
* Update tests
* Improve test validation of svg labels
* Clean up tests
* Move static-viz interface file to custom file
* let users disable attachments with questions checked
* use more declarative assertions in unit tests
* use aria-label over testid
* translate aria label
OpenAM SAMLResponse contains "\r\n" every 76 characters
leading our SAML code to think it's not base64-encoded.
Fix by relaxing our valid base64 check to ignore all spaces.
Fixes#15567
* expression editor: allow clearing help text with Escape key
Move the code to clear help text to "clearSuggestions" method
allowing the Escape key to also be used to close the help popup.
* expression editor: don't show error on window unfocus
* expression editor: allow clicking on "Learn more"
Clicking on the "Lean more" link removes the focus
from the input box, causing the help dialog to get
hidden and become unclickable.
Fix by cancelling the mouse down event causing the
input box to maintain the focus.
Fixes#17548
* add cypress test
* Run percy (sanity check) visual tests in CircleCI
* Update path for visual tests
* Make `--folder` flag optional
* visual tests docs
Co-authored-by: Alexander Lesnenko <alxnddr@users.noreply.github.com>
* Fix the chain filter functions with nil FieldValues (fix#17659)
* Reorganize test a bit.
* Simplify test
* More simplification
* Test fix 🔧
* Test fix part 2
* [ci nocache]
* No Clojure core classes please
* Don't try to make paths absolute twice. Build scripts should handle keyword args like ':driver'
* parse-as-keyword should return keywords as is
* Test fix 🔧
* Test fix 🔧
* Test fix part 2
* Collapse small donut slices into a single "Other" category
* Locale aware decimal formatting
A followup PR will add all of the formatting options for scalars and
smart scalars so this function is largely temporary and will be
subsumed into a namespace that knows about all formatting options.
* empty with no cache [ci nocache]
Since the Webpack and Babel upgrades, this shouldn't be needed any more. In the past, we had to explicitly resolve to the specific version of Cypress. Now it resolves to this version by default.
The node_modules folder was being persisted in the first step (checkout) as it's doing the building of the static viz package. This had an impact in the fe-deps step, so wiping the folder and doing a clean install should make the trick
* update sqlite-jdbc to 3.36.0.1
The new version includes arm64 binaries and allows Cypress,
which uses SQLite, to run on Apple Silicon.
* Improve date/time handling in SQLite
* Fix setting Block permissions in the permissions/graph API endpoints
* Revert changes to .dir-locals
* Perms graph: don't validate DB :schemas + :native unless both are present.
* PR feedback
* Ensure that data_readers functions are included in tests
`clj -X:dev:test :only metabase.pulse.render.js-svg-test` uses the
`#t` data reader, which passes the value to
`metabase.util.date-2/parse` but this function hasn't been evaluated
yet and it errors
```shell
% clj -X:dev:test :only metabase.pulse.render.js-svg-test
Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/11.0.11.hs-adpt
Running tests in metabase.pulse.render.js-svg-test
Syntax error reading source at (metabase/pulse/render/js_svg_test.clj:71:27).
Attempting to call unbound fn: #'metabase.util.date-2/parse
```
* Throw an error if resource is not found when loading sources
```shell
ERROR in metabase.pulse.render.js-svg-test/categorical-donut-test (js_engine.clj:37)
Uncaught exception, not in assertion.
clojure.lang.ExceptionInfo: Javascript resource not found: frontend_client/app/dist/lib-static-viz.bundle.js
source: "frontend_client/app/dist/lib-static-viz.bundle.js"
metabase.pulse.render.js-engine/load-resource js_engine.clj: 37
metabase.pulse.render.js-svg/load-viz-bundle js_svg.clj: 94
metabase.pulse.render.js-svg/static-viz-context js_svg.clj: 100
metabase.pulse.render.js-svg/fn js_svg.clj: 106
...
clojure.core/deref core.clj: 2324
metabase.pulse.render.js-svg/timelineseries-line js_svg.clj: 167
metabase.pulse.render.js-svg-test/fn/fn js_svg_test.clj: 75
metabase.pulse.render.js-svg-test/fn js_svg_test.clj: 74
clojure.test/test-var/fn test.clj: 717
clojure.test/test-var test.clj: 717
metabase.test-runner/run-test test_runner.clj: 107
...
```
```shell
ERROR in metabase.pulse.render.js-svg-test/categorical-donut-test (Objects.java:221)
Uncaught exception, not in assertion.
java.lang.NullPointerException:
java.util.Objects.requireNonNull Objects.java: 221
org.graalvm.polyglot.Source$Builder.<init> Source.java: 725
org.graalvm.polyglot.Source.newBuilder Source.java: 546
metabase.pulse.render.js-engine/load-resource js_engine.clj: 34
metabase.pulse.render.js-svg/load-viz-bundle js_svg.clj: 94
metabase.pulse.render.js-svg/static-viz-context js_svg.clj: 100
metabase.pulse.render.js-svg/fn js_svg.clj: 106
```
* Sort effects namespace
* Turn dataset_query into structured data in search results
* sort scoring test ns
* Fixup tests
we are no longer returning string results. The cards in the test have
empty queries, which the model turns into {} but normalization removes
empty clauses and returns nil. The tests would be too annoying to hook
this up to work properly and this functionality is tested in other
places.
* Unskip repro for #15959
* Update repro test
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
* Invalidate the pulse if it contains no recipients
Switch statement was returning `true`, resulting in falsely "valid" pulse
in the case there were no recipients but the schedule was set to month.
This commit fixes that.
* Move all conditions before the switch statement
* Enable repro for #17657
* Guard against the error that causes the white screen
* Add another repro for #17657
* Fix typo in the test name
* Fix typo in the unrelated comment
With the code being instrumented for code coverage, and another
additional time to analyze + send the code coverage to codecov.io,
the typical execution runs awfully close to the 10-min limit.
Hence, add some extra room.
* Randomize BigQuery test view names
Use tu/random-name instead of a name based on the output of gensym
* Add extra prefix for legacy BigQuery driver created databases
* Update legacy BigQuery driver to have unique name for transient datasets
For those datasets created and destroyed by the legacy BigQuery driver QP tests, add an additional prefix so that it doesn't conflict with the new BigQuery driver tests
* Rename file to make it more specific
* Extract dashboard sql filters into separate folder and CI group
* Add short descriptions to dashboard filters repros
* Extract dashboard sql filters helpers (data objects)
* slightly split existing search components
* add recent views list
* fix recent items moving when reopened
* extract TablePath component
* Add e2e specs for recents
* add specs
* add in table view logs so we get recent table looks
* review fixes
* use display_name for tables in recents list
* display name
* add loader threshold, return only 5 recents
Co-authored-by: Howon Lee <hlee.howon@gmail.com>
* Add test for required and default values set on dashboard SQL field filters
* Add test for required and default values set on dashboard SQL simple filter
* Outline for login troubleshooting guide
* Update docs/troubleshooting-guide/cant-log-in.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-log-in.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Importing material
* Prosifying
* Updates based on feedback
* Another update to login troubleshooting
* Fixing typo
* One more update
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Improve driver deprecation UX
Reworking the DriverWarning component to be able to change the engine itself by firing the event (so that the "go to older/newer version" links actually work)
Some styling fixes to match Figma mockup
Remove all grid-styled usage
Remove all styling (except class names) from DriverWarning jsx file, move to the styled-component
Implement db-ids-with-deprecated-drivers API endpoint for fetching DB IDs using deprecated drivers
Add some plugin test init code to properly handle the test legacy/new drivers
Adding test for new API
Adding new entry in `MetabaseApi` frontend component for new API method
* Determine MB project root directory relative to source directory of build scripts
* Support calling build-driver! as a -X fn, and support dirs outside of modules/drivers
* Support loading 3rd-party driver manifest files at (dev) launch
* Fix log4j not working on latest version of CIDER (unrelated)
* Fix dissoc
* project-root-directory is supposed to be a string
* ⛔ B L O C K ⚠ permissions ✅
* Fix test failure in OSS since EE namespace doesn't exist.
* Remove unused var
* Oops, uncomment a commented-out test
* Clean up the new perms documentation a bit
* Include the results base type as the cols effective type
previously was merged the effective type from the col which caused
issues with dates when selecting a particular temporal unit, ie month.
Queries like this return months as integers so the base and effective
types are :type/Integer, and something somewhere else is responsible
for the unit conversion of `1` to January (or feb, months get weird i
think)
```clojure
;; after
{:description "The date and time an order was submitted.",
:unit :month-of-year,
:name "CREATED_AT",
:field_ref [:field 4 {:temporal-unit :month-of-year}],
:effective_type :type/Integer, ;; we have the proper effective type
:display_name "Created At",
:base_type :type/Integer}
;; before:
{:description "The date and time an order was submitted.",
:unit :month-of-year,
:name "CREATED_AT",
:field_ref [:field 4 {:temporal-unit :month-of-year}],
:effective_type :type/DateTime, ;; included effective type from db
:display_name "Created At",
:base_type :type/Integer}
```
* tests
* Driver tests
* Ignore effective/base types in breakout tests
sparksql is weird and its totally unrelated to the file under test
* Use correct options for datetimes that are projected to month, etc
When aggregating by a datetime column, you can choose a unit: month,
hour-of-day, week, etc. You often (always?) end up with an
integer. Previously the base_type was (inexplicably) :type/Integer and
the effective_type was :type/DateTime which really just didn't make
sense. The ideal solution is :type/DateTime as the base_type and
:type/Integer as the effective_type. But this breaks the frontend as
it expects to treat these columns in a special way. But it expected
them to report as date columns.
I've changed it only here. I thought about making isDate understand
the `column.unit` attribute and recognize that these are in fact
dates, but that seems wrong. These are integers that are special
cases. It seems that the contexts that need to talk about dates should
understand integers in a special way than all date code needs to be
aware that integers might flow through.
This might mean extra work but ultimately feels better as the correct
solution.
* unit is not default
* Move JoinStep's NotebookCell down to JoinClause
* Break JoinClause into two NotebookCells
* Update labels
* Use `space` helper function
* Simplify conditional statement
* Fix not translated string
* Add Kerberos support to Presto JDBC Driver
Adding Kerberos properties as DB details properties
Refactoring utility methods for dealing with additional options
Adding test for Kerb properties -> connection string
Adding GitHub action to run integration test
Start to move logic for capturing necessary files to new script, and calling that from mba run
Adjust settings in `metabase.test.data.presto-jdbc` to capture test parameters
Fix counting on grouped aggregated field
Adding QP test
Reworking the BigQuery version of the :breakout to more closely match the structure of the standard sql.qp version
* add PermissionSelect component
* add PermissionSidebar component
* add PermissionTable component
* add PermissionEditor component
* add useLeaveConfirmation hook
* add selectors for the collections permissions page
* add selectors for the data permissions pages
* add confirmation creators to use in selectors
* sandboxing permissions modal: redirect to parent route when closed
* Add PermissionsPageLayout component
* Adjust CollectionPermissionsModal to use new permissions UI
* Add CollectionPermissionsPage
* Add data permissions pages
* Adjust collection permissions modal route
* Adjust permissions routes according new pages structure
* update permissions actions, reducers
* adjust sandboxing
* remove old permissions code
* support admin colorScheme in Radio
* support admin colorScheme in TextInput
* support admin colorScheme in Tree
* update permissions specs
* fix data permissions url typo
* fix sandboxing
* add search debounce to permission pages
* exclude schemas from search, make it flat
* fix permissions for databases without schemas
* fix copy for native queries permissions, show table display_name instead of raw name
* fix before leave warning shown when change collections
* permissions sidebar: make database name clickable
* fix string groupIds lead to bugs in permissions editor
* fix disabling table permissions shows all tables permission disabled
* fix permissions copy
* fix permissions disabled tooltips copy
* fix, add specs
* fix permissions edit bar button colors, fix breadcrumbs on schemaless dbs
* fix official collection color, make sidebar tree scrollable
* fix scroll in permissions modal
* fix breadcrumbs
* change table icon
* create helpers for entity ids and permissions url creation
* remove hardcoded colors
* make confirmations an array
* store confirmAction in state
* add ModalRoute specs
* fix propTypes, typo
* build permission pages urls with helpers
* revert switching from ref to state for confirm action function due to react invokes it on a render
* move mapStateToProps to the top of the files
* add visual specs
* add more specs
* fix edit sandbox access action
* add cypress spec for sandboxing
Mongo custom expressions now are turned on for mongo 5.0 and after only. One idiosyncrasy is that we don't really support the BSON ID format at all in our typesystem despite having it in there, but both of my attempts to get them to work with the native mongo pipeline commands bounced because they really aren't strings, they're BSON ID's. We do rely on the pipeline commands heavily which is the reason for the version requirement.
This requires unfortunately an additional layer of indirection, however
I believe it's super cheap and it shouldn't impact execution speed.
In the mean time, many other predicates (isFoo etc) which rely on isa()
will be correctly type-inferred, which gives a huge win for editing and
debugging purposes.
I'm not sure we can fix this. We need the graal compiler which doesn't
appear to be jdk 8 compatible but I can't actually find javadocs for
it. Its not clear from
https://github.com/oracle/graaljs/blob/master/docs/user/RunOnJDK.md
how you can actually run it.
I tried adding the graal compiler but that seems to assume you are in
a graal vm and fails not finding a class.
To get a list of all the options available for a context's engine,
```clojure
(doto 'metabase.pulse.render.js-engine require in-ns)
(map (comp (juxt :name :help) bean)
(.getOptions (.getEngine (context))))
```
I've done some profiling
```clojure
(dotimes [_ 5]
(time
(do (let [rows [["apples" 2]
["bananas" 3]]
colors {"apples" "red" "bananas" "yellow"}]
(js-svg/categorical-donut rows colors))
nil)))
"Elapsed time: 210.32659 msecs"
"Elapsed time: 193.211736 msecs"
"Elapsed time: 190.97775 msecs"
"Elapsed time: 195.843254 msecs"
"Elapsed time: 188.077405 msecs"
nil
```
For interpreted and in another language, this doesn't seem the end of
the world.
And adding more quantities
```clojure
(letfn [(rand-string [] (str/join "-" (repeatedly 4 #(rand-nth ["banana" "horse" "battery" "cloak"]))))]
(dotimes [_ 5]
(let [rows (repeatedly 20 (fn [] [(rand-string) (rand-int 100)]))
colors (zipmap (map first rows) (cycle ["red" "green" "blue" "yellow"]))]
(time
(js-svg/categorical-donut rows colors)))))
"Elapsed time: 288.659887 msecs"
"Elapsed time: 334.733071 msecs"
"Elapsed time: 317.369294 msecs"
"Elapsed time: 272.084918 msecs"
"Elapsed time: 272.7203 msecs"
nil
```
For a timeline line chart, rendering one datapoint per day for a whole
year:
```clojure
(dotimes [_ 5]
(let [dates (take 365 (iterate #(.plusDays % 1) #t "2020"))
rows (map (fn [d] [d (rand-int 200)]) dates)
labels {:left "count" :bottom "year"}]
(time
(js-svg/timelineseries-line rows labels))))
"Elapsed time: 569.691124 msecs"
"Elapsed time: 544.415676 msecs"
"Elapsed time: 539.131092 msecs"
"Elapsed time: 492.60486 msecs"
"Elapsed time: 523.765691 msecs"
nil
```
* Troubleshooting guide for filters.
After conversation with @flamber, split this into one guide for simple filters and one for linked filters. The explanation at the top of the second page may still need some work...
* Updating filter troubleshooting
* Troubleshooting when you can't see the tables you should.
* Why is my dashboard slow?
* Troubleshooting: can't send email
* Adding @flamber's batch script-style guide
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
* Fixing first item
* Addressing feedback
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-send-email.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Adding flamber's comment
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Splitting entry
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Troubleshooting timezones
* Reformatting the filter troubleshooting guides
* Partial update to troubleshooting filters
* specify sql questions
* link
* update relative links
* more link fixes
* still more links
* specify dashboard filters
* fix typo
* Italicizing one more word
* Unifying all troubleshooting guides so far
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/cant-see-tables.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Incorporating suggestion
* Update docs/troubleshooting-guide/my-dashboard-is-slow.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/my-dashboard-is-slow.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/my-dashboard-is-slow.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/my-dashboard-is-slow.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Update docs/troubleshooting-guide/my-dashboard-is-slow.md
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
* Another small fix
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
* Fix serialization dump error when there are no collections
Update `select-collections` to correctly handle the case where there are no collections
Adding new test that removes all collections, then ensures that dump works with no errors
* Fix serialization load error into empty/blank target DB
Rethrowing exception in cmd when overall load fails
Add test to ensure that a dump containing a user can be loaded into a blank target app DB successfully
Adding a few missing bindings to the `with-temp-empty-app-db` code to set the connection vars under metabase.db.connection
In upsert, add hooks for a :pre-insert-fn and :post-insert-fn to be invoked for new entity instances created by the upsert process, since whether an entity will be an insert or update isn't necessarily known by the load process (only by upsert once identity-condition is checked for each)
In load, setting the pre and post insert functions for a User instance to initialize :password with a random value, and to generate and send a password reset email to the newly inserted user's email, respectively
NOTE: this post insert fn (to send a password reset email for newly inserted users) is NOT hooked up for User as of x.41 release, since it is considered a bugfix, but this can be enabled in a future release)
Adding new defs for the magic permission group names to make those easier to override from tests that might need to (such as the one added for this commit)
* Fix serialization objects being incorrectly updated on skip
Remove `maybe-fixup-card-template-ids!`, which was forcing mode :update, since the existing retry logic should cover what it was trying to do
Update Card and Metric models to delete any Dependency instances for which they are the `:model_id` (to make serialization tests after other tests created temporary Card/Dependency pairs)
Adding missing assertions for Dependency serialization
* Serialization: Fix reload entity logic
Now that the `:mode` is always respected instead of being ignored sometimes, we need to update our "second pass" reload functions to always make the mode `:update` on the second pass, or else that entity would just be skipped, which is bad
Also updated the test to use `:mode` `:skip` from the beginning to be more stringent
* refactor/move parameter object transformations to one place
* use hasParameterValue in place of nil check
* remove enableDefaultParameters arg since it is unused
New BigQuery Driver
Create new :bigquery-cloud-sdk driver using the google-cloud-bigquery library instead, and whose source is adapted from the :bigquery driver
https://cloud.google.com/bigquery/docs/reference/libraries
Marking existing :bigquery driver as deprecated, and superseded-by the new one (bigquery-cloud-sdk)
Update new driver and query processor code to use newer Google SDK
Switch test data loading over to use new API
Add project-id connection property to override the value from the service account JSON, and use it as part of qualified names in the query processor if set
Updating google driver so its libraries are compatible with the newer ones used in BigQuery
Update date bucketing tests to skip :bigquery-cloud-sdk (new driver) where :bigquery is skipped
Update `with-bigquery-fks` to take in the driver, since there are now multiple ones
Adding test to confirm that overriding project-id for a public BQ project works (sync and query)
Fixing a bunch of whitespace alignment errors in tests
* Add tooltips to authority level configs
* Use tooltips for CollectionAuthorityLevelIcon
* Pass tooltips to getCollectionIcon result
* Display tooltip in CollectionHeader
* Display tooltip in collections sidebar
* Display tooltip on the homepage
* Display tooltip in ItemPicker
* Accept icon props as a TreeNode's icon prop value
* Display tooltip in saved question picker
* Accept icon props as a SelectListItem's icon prop value
* Display tooltip in dashboard's question picker
* Add "Belongs to an Official collection" tooltip
* Fix prop-types errors
* Add tests for CollectionAuthorityLevelIcon
* Add tests for isRegularCollection
* Fix search results collection icons
* Show "Official Collection" label in search results
* Don't show tooltips for official collections in search
* Fix ItemPicker's prop type
* Add basic test for ItemPicker
* Test read-only collections are not displayed
* Add test IDs to ItemPicker
* Refresh Redux store in each ItemPicker's test
* Test opening a nested collection
* Test default breadcrumbs state
* Fix ItemPicker's header test ID
* Test ItemPicker read-only items visibility
* Add test for onChange prop
* Test navigating back from an open collection
* Test personal collections are grouped in ItemPicker
* Assert number of ItemPicker items
* Test getCollectionIcon in EE
* Add a workaround for tooltip offsets
* Add describe block for CollectionsList tests
* Make CollectionsList test shorter
* Test collection types on CollectionList
* Fix SearchResult's info
* Add SearchResult tests
* Use isRegularCollection for AuthorityLevelIcon
* Refactor and dry up `question` custom Cypress commands
* Example of `loadMetadata` custom option in action
* Example of `visitQuestion` custom option in action
* Annotate functions using JSDoc
* Help avoid the .lein-env gotchas
* Learn to spell @camsaul
* Revert the .gitignore change -- too D A N G E R O U S
* Fix version numbers (thanks @jeff303)
* Change of plans. get-string (etc) only return default if it matches the type
* Better docstrings
* More tests & rework the validate-default-value logic a bit.
* Fix lint error
* Add an additional test for GET /api/setting
* Consolidate exception-chain util functions
* Email error message humanization improvements
* More tests for util ex-chain
* Clean up email error handling and add lots of extra tests
* Fix docstring indentation
* Even more email tests
* Test fixes 🔧
* Update Cypress test again
* Code cleanup
* Backend SVG rendering proof of concept [ci skip]
* Update cssbox to 5.0.0
* Render bar, line, and pie charts in js to svg
sparkline is now done in js, bar is now recognized and done in js, new
:categorical/donut as well
* Remove api route for render
* pass along render-type, not hardcoded to :inline
* Move bar chart above sparkline and remove line check
In order to introduce the bar chart type need it above the sparkline
check since it is otherwise the same except for display property of
the card. But lots of tests assume that this will get hit with a nil
display type set in testing so remove checking for `:line` allows all
the testing cases to hit the right type
* Fix tests now that bar graphs aren't html but images
* Include attachments for bar charts
* Move over to in-tree bundle
* Force everything [ci noskip]
trying to ensure that the built jar includes the newer
"resources/frontend_client/app/dist/lib-static-viz.bundle.js"
* Run `yarn build-static-viz` in backend-deps in CI
this js file is now a hard dependency of the backend so it fits in
this tsk. All such things that depend on the backend sources will need
it. Makes me think perhaps we want a checked in version but i'm not
sure yet.
* Look on classpath not filesystem for js bundle [ci noskip]
* Move yarn build-static-viz into the checkout step
* License information for antlr4-runtime
* create attachment for categorical donuts
* add ordinal legend to donuts (#17177)
* set widths of html image and svg image to 1200
* Revert "add ordinal legend to donuts (#17177)"
This reverts commit 1eb81d2ebf.
* Helper functions to render html easily
* readme in dev
* readme ensure that static viz bundle exists
* Cleanup ns after removing proxy
* Donut chart colors and legend (#17251)
* use external color map for fill per dimension
* Add support new color legend for donut
* Ensure text doesn't appear as link
entire thing is actually the body of a link tag for emails but we want
a decent text color rather than a default link color
* use chart colors from https://stats.metabase.com/_internal/colors
* Make checkers happy
- remove unused imports
- add a docstring
- don't shadow fn with a local
* cleanup ns import
* Remove reflective call
* Cleanup ns on correct branch
Co-authored-by: dan sutton <dan@dpsutton.com>
* X-axis: just use (approx) 5 ticks to avoid overlapping labels (#17287)
* increase gap between arcs (#17271)
* Set rendering hints on html->image
* ignore width for now and make them larger
* Ns deprecation and some cleanup
* make namespace checker happy
* Simple tests for detecting chart type
* Rename from poc
* Tests for scalar/smartscalar
* cleanup js svg namespace a bit
* Tests of svg engine
* ns sorting after renaming
* Unify our two different js engine usages
settled on the js context. Has typed returns `(.asString ^Value ...)`
instead of perhaps capturing std out?
https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Value.html
Context is a bit more friendly for getting source into it. One
downside is that the invocable bit isn't quite as nice. The old way
would return a java.util.functionFunction but the difference is
(.apply function (object-array args))
vs
(.execute fn-ref (object-array args))
* Don't io/resource the io/resource
* js engine tests
* Ns cleanup in js-svg
type hints in the js-engine ns mean we don't need as many classes from
polyglot here
* Include percentages in rendered donut charts
* Testing for percentages
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
Co-authored-by: Ariya Hidayat <ariya@metabase.com>
* Backend SVG rendering proof of concept [ci skip]
* Update cssbox to 5.0.0
* Render bar, line, and pie charts in js to svg
sparkline is now done in js, bar is now recognized and done in js, new
:categorical/donut as well
* Remove api route for render
* pass along render-type, not hardcoded to :inline
* Move bar chart above sparkline and remove line check
In order to introduce the bar chart type need it above the sparkline
check since it is otherwise the same except for display property of
the card. But lots of tests assume that this will get hit with a nil
display type set in testing so remove checking for `:line` allows all
the testing cases to hit the right type
* Fix tests now that bar graphs aren't html but images
* Include attachments for bar charts
* Move over to in-tree bundle
* Force everything [ci noskip]
trying to ensure that the built jar includes the newer
"resources/frontend_client/app/dist/lib-static-viz.bundle.js"
* Run `yarn build-static-viz` in backend-deps in CI
this js file is now a hard dependency of the backend so it fits in
this tsk. All such things that depend on the backend sources will need
it. Makes me think perhaps we want a checked in version but i'm not
sure yet.
* Look on classpath not filesystem for js bundle [ci noskip]
* Move yarn build-static-viz into the checkout step
* License information for antlr4-runtime
* create attachment for categorical donuts
* add ordinal legend to donuts (#17177)
* set widths of html image and svg image to 1200
* Revert "add ordinal legend to donuts (#17177)"
This reverts commit 1eb81d2ebf.
* Helper functions to render html easily
* readme in dev
* readme ensure that static viz bundle exists
* Cleanup ns after removing proxy
* Donut chart colors and legend (#17251)
* use external color map for fill per dimension
* Add support new color legend for donut
* Ensure text doesn't appear as link
entire thing is actually the body of a link tag for emails but we want
a decent text color rather than a default link color
* use chart colors from https://stats.metabase.com/_internal/colors
* Make checkers happy
- remove unused imports
- add a docstring
- don't shadow fn with a local
* cleanup ns import
* Remove reflective call
* Cleanup ns on correct branch
Co-authored-by: dan sutton <dan@dpsutton.com>
* X-axis: just use (approx) 5 ticks to avoid overlapping labels (#17287)
* increase gap between arcs (#17271)
* Set rendering hints on html->image
* ignore width for now and make them larger
* Ns deprecation and some cleanup
* make namespace checker happy
* Simple tests for detecting chart type
* Rename from poc
* Tests for scalar/smartscalar
* cleanup js svg namespace a bit
* Tests of svg engine
* ns sorting after renaming
* Unify our two different js engine usages
settled on the js context. Has typed returns `(.asString ^Value ...)`
instead of perhaps capturing std out?
https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Value.html
Context is a bit more friendly for getting source into it. One
downside is that the invocable bit isn't quite as nice. The old way
would return a java.util.functionFunction but the difference is
(.apply function (object-array args))
vs
(.execute fn-ref (object-array args))
* Don't io/resource the io/resource
* js engine tests
* Ns cleanup in js-svg
type hints in the js-engine ns mean we don't need as many classes from
polyglot here
* add custom labels
* clean up margin
* Include labels in backend
* alignment
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Ariya Hidayat <ariya@metabase.com>
* Backend SVG rendering proof of concept [ci skip]
* Update cssbox to 5.0.0
* Render bar, line, and pie charts in js to svg
sparkline is now done in js, bar is now recognized and done in js, new
:categorical/donut as well
* Remove api route for render
* pass along render-type, not hardcoded to :inline
* Move bar chart above sparkline and remove line check
In order to introduce the bar chart type need it above the sparkline
check since it is otherwise the same except for display property of
the card. But lots of tests assume that this will get hit with a nil
display type set in testing so remove checking for `:line` allows all
the testing cases to hit the right type
* Fix tests now that bar graphs aren't html but images
* Include attachments for bar charts
* Move over to in-tree bundle
* Force everything [ci noskip]
trying to ensure that the built jar includes the newer
"resources/frontend_client/app/dist/lib-static-viz.bundle.js"
* Run `yarn build-static-viz` in backend-deps in CI
this js file is now a hard dependency of the backend so it fits in
this tsk. All such things that depend on the backend sources will need
it. Makes me think perhaps we want a checked in version but i'm not
sure yet.
* Look on classpath not filesystem for js bundle [ci noskip]
* Move yarn build-static-viz into the checkout step
* License information for antlr4-runtime
* create attachment for categorical donuts
* add ordinal legend to donuts (#17177)
* set widths of html image and svg image to 1200
* Revert "add ordinal legend to donuts (#17177)"
This reverts commit 1eb81d2ebf.
* Helper functions to render html easily
* readme in dev
* readme ensure that static viz bundle exists
* Cleanup ns after removing proxy
* Donut chart colors and legend (#17251)
* use external color map for fill per dimension
* Add support new color legend for donut
* Ensure text doesn't appear as link
entire thing is actually the body of a link tag for emails but we want
a decent text color rather than a default link color
* use chart colors from https://stats.metabase.com/_internal/colors
* Make checkers happy
- remove unused imports
- add a docstring
- don't shadow fn with a local
* cleanup ns import
* Remove reflective call
* Cleanup ns on correct branch
Co-authored-by: dan sutton <dan@dpsutton.com>
* X-axis: just use (approx) 5 ticks to avoid overlapping labels (#17287)
* increase gap between arcs (#17271)
* Set rendering hints on html->image
* ignore width for now and make them larger
* Ns deprecation and some cleanup
* make namespace checker happy
* Simple tests for detecting chart type
* Rename from poc
* Tests for scalar/smartscalar
* cleanup js svg namespace a bit
* Tests of svg engine
* ns sorting after renaming
* Unify our two different js engine usages
settled on the js context. Has typed returns `(.asString ^Value ...)`
instead of perhaps capturing std out?
https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Value.html
Context is a bit more friendly for getting source into it. One
downside is that the invocable bit isn't quite as nice. The old way
would return a java.util.functionFunction but the difference is
(.apply function (object-array args))
vs
(.execute fn-ref (object-array args))
* Don't io/resource the io/resource
* js engine tests
* Ns cleanup in js-svg
type hints in the js-engine ns mean we don't need as many classes from
polyglot here
* Cleanup of text, ns docstrings, alignment
* Fix fill->fill-opacity with parsed doc, not regex
* Make a single helper that loads a static viz bundle context
* Docstrings and make private in js-svg
* Sort imported classes in js-svg
* Make width passed down through rendering aparatus
- svgs are always rendered at 1200 for quality
- slack images of html are rendered at 1200 so that they can be zoomed
in in the ui but slack automatically scales down
- email sends html and the full svg but includes img width tags so
that is handled appropriately
* docstring
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
Co-authored-by: Ariya Hidayat <ariya@metabase.com>
* upgrade to @percy/cypress 3.x
@percy/cypress 2.x uses deprecated @percy/agent which includes
an old version of puppeteer. The old version of puppeteer causes
`yarn` command to fail on M1 macOS environment.
Upgrade to @percy/cypress 3.x removes the dependency and thus
solves the issue.
The upgrade was done by running `npx @percy/migrate`.
* remove percy healthcheck task
This no longer exists in 3.x, see
https://github.com/percy/percy-cypress/blob/master/README.md#upgrading
* remove deprecated percy/exec-action
and moved `percy exec` to the correct command
* run 'yarn install' before running percy
Consult any of these keys when trying to determine the "name" portion of the c3p0 data: :db :dbname :sid :catalog
Update existing `c3p0-datasource-name-test` to more robustly check the different portions of the c3p0 dataSourceName
* add moderation events to question timeline
* tweak the height of the DrawerSection header
* replace history modal & control drawer state via redux
* add/fix cy tests
* fix banner unit tests
* prevent leakage of 'null' moderation icon
* rename styled component
* add tests / rmv redundant fn
* remove should('exist') from moderation cy tests
* refactor to make biz logic of a null mod status clearer
* add selector unit test
* Group Badge's icon props into a single `icon` prop
* Allow overwriting Badge's hover color
* Fix CollectionBadge hover for official items
* Fix CollectionBadge size for official items
* Fix QuestionDataSource badge
* Use iconPropTypes in Badge
* Make CollectionBadge icon code more compact
Previously the multifunction for supporting features was always implemented as a trivial true function. However, for mongo we need an actual version number, so here we go
* Move sync executor to bespoke namespace
* Refingerprint fields on type change
* Check if can connect in refingerprint-field!
* docstring update
* Cleanup tests a bit
* Error handling
* Table field values endpoint on sync.concurrent executor
* ns sort api field
* ns cleanup
* Namespace for extensions to clojure.test
if you do a subselection of tests, you might not get the `schema=`
defmethods and then your tests won't compile. Ns docstring to keep the
namespace simple and targeted to global effects. we don't want to load
models and do extra work, just install some test utilities that aren't
ever required directly
* Add aliases
clojure.test had been refer :all
* require the effects in metabase.test.util as well
Namespace cleaner got a bit too aggressive
stupid ns
* Poke github actions empty commit
* Add the whitespace linter
* Fix whitespace linter errors [except for one file]
* Add a line that will intentionally break stuff to verify the linter is working.
* Ok, remove the line that caused the linter to fail.
* Use latest version of the linter
* Fix missing newline
* Include and bump moderation status in search results
* Include limit 1 and order by for moderation review latests
backend does work to ensure there is an invariant that there is 1
most_recent true entry and all the rest are most_recent false. But if
there's some bug this invariant is violated we don't want to blow up
with multiple rows returned in these queries.
* Verification scoring is enterprise now
* wip moving moderation review to enterprise
still need to delete the old non-moved file
* add moderation icon to search results
* update names of icon props in SavedQuestionHeaderButton
* move moderation cypress tests, add test for search results
* Move moderation review api and test to enterprise
* fix props for getVerifiedIcon call
* add moderation status icon to collections
* add/improve moderation cypress tests
Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
Since it needs to grab the built JAR anyway, it's faster to obtain the
version.properties from the JAR.
This shaves off approx. 1 minute from Percy CI run.
There's no point of processing files via ESLint loader when building
for production. If there's any linting issue at all, it should be
caught with a different CI run.
This shave off >2 minutes from Uberjar build (front-end step).
Development/hot-reload isn't affected at all.
- Make all specific problems H2-level headings.
- Create a `doc-toc` div at the top for the table of contents.
- Don't use `learn-doc` because we may want to style/show this one independently.
- Link to all problem headings.
Note: can't use metadata in a page header because our CI tools splat their own headers into these pages, so anything we add becomes part of the page body.
Adding new cache to `metabase.driver.sql-jdbc.connection` that tracks the DB details hash values per DB id
Checking if the non-empty hash value of DB details changed in `db->pooled-connection-spec` in order to invalidate an existing pool
Adding test that redefines the log fn to assert that the pool is invalidated on hash change
It's redundant since the job explicitly installs the proper version in
the previous step, and also running that prematurely pulls a bunch of
JARs from Maven Central.
This should shave 20 seconds from the CI runs.
* Bump some more backend dependencies
* Add license info for com.sun.activation/jakarta.activation
* Fix reflection warnings
* Revert bump of MariaDB for now
Remove the `driver/can-connect?` implementation and move the `select-keys` logic instead to the existing place in `sql-jdbc.conn/connection-details->spec`
Update test to also include the `:let-user-control-scheduling` details entry
* Fix JUnit output not correctly stripping ANSI color codes
* Remove find-tests profiling log message
* 1-arg arity of metabase.test-runner/run
* Fix bug with metabase.test-runner/find-tests with a single test name
* Fix location of share icon
* Update 12-public-links.md
Differentiate between dashboard and question sharing
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
* remove moderation reviews hydration
* Restore hydration of moderation_reviews and handle correctly
nested hydration is (i think) positional. So if you get something
handed to you you must return something in that position. Prevoiusly
was removing nils and then returning a smaller collection of hydrated
items (cards here). But this meant input might look like this
[card1 nil card2] and return [card1 card2] and in the nested hierarchy
things didn't get matched up correctly.
In the real world application it might look like this:
```clojure
{:ordered-cards
[{:card-id 1}
{:card-id nil
:viz-settings {info-for text-card}}
{:card-id 2}]}
```
And the nil card comes into this function and we return them in a
strange manner things get wonky
* Remove `project.clj` from Percy workflows
* Replace `project.clj` with `deps.edn` in `build-for-test` script
* Update reference to the `project.clj` in the comment
We're playing this whackamole because we added the middleware to universally sorta stomp on any `limit` or `offset` params, and they got stomped on. Which, in turn, led to my PR to make the default not limited. Which, in turn, led to the other issue this PR solves which makes the search things we relied upon to not have a limit, have a limit.
* Add some dox
* Rename test-runner & cloverage -> metabase.test-runner & metabase.cloverage-runner
* Move JUnit-related test runner code to separate namespace
* Bespoke JUnit-output code
* Delete unused .lein-classpath file
* Do JUnit writes in a cached thread pool
* Add failing test to make sure JUnit output works as expected...
* Move bad-test to metabase.bad-test so the FAILING tests actually run
* FASTER TEST LOADING 🏎️
* Test CircleCI :system-out
* Final cleanup (hopefully)
* Sort some namespaces; allow initializing :plugins when namespaces get loaded for now.
* Need those [[tags]] in docstrings
* Fix bad docstring
* rmv old bucm icons and remove verified fill color
* add moderation action section to sidebar
* add moderation review icon to the saved question header button
* hide moderation section when is not a moderator
* add UI for ModerationReviewBanner
* Backend for moderation-review
- create table moderation_review. Same as before but also has a
"most_recent" boolean flag for the most recent moderation for easy
lookup
- POST /moderation-review/ . Status can be "verified" or nil
- must be an admin to post
- No PUT or edit route yet. Not sure if this is even
necessary. _MAYBE_ to edit the text, but certainly not for the
status, ids, etc. If there's to be history, let's build some history
- Ensure we never have more than 10 reviews. Adding a new review will
delete the older ones, mark all old ones as not `most_recent`, and
add the newest one as `most_recent true`
- Ensure the card actually exists before creating the mod review
- Since admin only at this time, don't need to check moderate
permission or view permission
- When hydrating ensure reviews are ordered by id desc. Should mimic
the created_at desc
* fix moderation review banner tooltip offset
* disable verification button when already verified
* rmv iconOnly prop because it seems to do nothing
* update getLatestModerationReview to rely on most_recent boolean
* Return 400 on invalid status to post /moderation-review
the schema was using keywords on the left hand side rather than the
symbols. Required a change to the docstring generator, when it made a
docstring for enums, it would call (sort (:vs enum)) and need to
string em.
* Add ModerationReview model to models.clj and copy infra
* hydrate moderation reviews on cards
* clean up + wire up to BE + ensure mod buttons don't show for normal users
* rmv unused moderation redux logic from QuestionDetailsSidebarPanel
* finish writing unit tests for FE
* ensure getIconForReview returns an object
* enable/disable verify button tooltip when unverified/verified
* add e2e tests
* fix tests
* styling tweaks
* more styling on moderationReviewBanner
* add function for abbreviated timestamp
* increase fontsize of timestamp back to 12
* fix tooltip offset
* ensure custom locale is separate from 'en' and not used for other languages
* Deletion moderation reviews when deleting cards
i had actually thought this was a much larger problem. But it turns
out we almost never delete cards (thanks comment!). And so we won't
really generate a lot of garbage.
I was worried that since we aren't using actual foreign keys but just
`moderated_item_type "card"` and `moderated_item_id 2` we would have
deleted cards with these moderation reviews but that is not the case
as the cards aren't deleted.
* hide verify disabled button when a question is verified
* update test to use queryByTestId
* Hydrate moderation reviews on cards on ordered cards
* Handle mysql's lack of offset functionality
mysql cannot handle just a `offset` clause, it also needs a limit
clause grammar from
https://dev.mysql.com/doc/refman/8.0/en/select.html:
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
select id, name from metabase_field offset 5; -- errors
select id, name from metabase_field limit 2 offset 5; -- works
Since our numbers are so small here there is no worry and just do the
offset in memory rather than jump through hoops for different dbs.
* Batch hydrate moderation reviews
* Don't let /api/user/:userId failure conceal moderation banner
* fix moderation cy tests
* work around possible bug in toucan hydration
dashboards hydrate ordered cards
(hydrate [:ordered_cards [:card :moderation_reviews] :series])
Ordered_cards are dashboard_cards which have an optional card_id. But
toucan hydration doesn't filter out the nils as they go down. It seems
toucan returns a nil card, and then when hydrating the
moderation_review, passes the collection of all "cards" including the
nil ones into the hydration function for moderation_reviews
This feels like a bug to me
* Cleanup moderation warnings
* Docstring in moderation review
* include hoisted moderated_status on cards in collections api
* Expect unverified in test 🔧
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: alxnddr <alxnddr@gmail.com>
* Handle mutation of vizSetting column when syncing columns of a native question
When calling Question's _syncNativeQuerySettings method we need to treat
existing, mutated columns as invalid so that they are filtered out and a
new column takes the existing column's place.
The function we use to find valid columns, findColumnIndexForColumnSetting,
will return true if it finds a matching field_ref OR a matching name, so we
also need to check the addedColumns array we just created in order to remove
any columns from vizSettings that also exist there, since we combine the two
at the end of this method.
* add unit tests for _syncNativeQuerySettings
Updating schema connection property to have proper display name
Updating display name for database to be "Schema"
Fixing `driver/can-connect?` impl in `presto_jdbc.clj` to actually use the correct driver, and dissoc `:engine` before calling the `sql-jdbc.conn` method
Adding test for the `test-database-connection` method, which is what led to the error from the UI
Only build currently active drivers
Update `all-drivers` fn so that it only "finds" drivers that have either a `project.clj` or `deps.edn` file (i.e. some build file), and ignores the directory otherwise. This is to deal with cached artifacts hanging around between builds in a shared executor type environment (ex: CircleCI), where even though the checkout won't bring in some driver directory that doesn't exist on the target branch, some other files (such as `pom.xml` or a `target` directory), might still be hanging around
* Update babel dependencies to latest
* Remove some old babel dependencies
The dependencies in this commit include dependencies that have been
renamed, such as babel-cli which is now @babel/cli. It also includes
dependencies that have been replaced, such as babel-preset-stage-0 and
its ilk, which have been replaced with @babel/preset-env.
* Remove babel-register dependency
This is referenced in our webpack.config.js file. I don't think we need
Babel in our Node envionment, but I could be wrong, so leaving this as a
separate commit.
* Remove @babel/standalone and dependent code
We're using @babel/standalone to support the writing of JSX in our
internal-only ScratchApp editor. Unfortunately, this dependency is
large--1.5mb not gzipped--and our current build does not intelligently
split bundles, meaning our users our burdened by the size of this
dependency whenever they must redownload the Metabase JS bundle.
I'm removing it. We should still be able to write JS in the ScratchApp,
but JSX no longer.
* Add @babel/node to dev deps
Needed by a cypress command
* Add browserslist config
Babel's preset-env dep needs this config to determine how to transform
our JavaScript. By default I believe it ends up defaulting to
"defaults."
"defaults" is equivalent to the following rules:
> 0.5%, last 2 versions, Firefox ESR, not dead
A comma between rules represents a UNION operator.
Per
https://www.metabase.com/docs/latest/faq/general/supported-browsers.html
we have deprecated IE 11 so I am including that explicitly in our
browserslist.
* Update babelrc plugins and presets
- Replaced presets with preset-env and preset-react
- Updated the names of some plugins, like transform-decorators-legacy,
which is now @babel/plugin-proposal-decorators with an explicit
"legacy: true" passed in the config.
- Removed add-react-displayname because it is included in preset-react
- Removed transform-builtin-extend because it is included in preset-env*
- Removed syntax-trailing-function-commas because it is supported by
all browsers we support
* note: There is a "loose" config option for handling the extension of builtin
classes. We may need it, but I am not sure.
* Update babel cli args
Replace -q with --quiet because -q no longer exists
* Fix circular dep in auth.js by making it async
Our app unfortunately contains MANY circular dependencies. Some, like
this one, caused problems when the app instantiates because the
"refreshCurrentUser" method is undefined when auth.js is initially run.
While we should in the future avoid having circular deps in the first
place, making them run async by requiring the dep and function run-time
fixes this particular issue.
* Fix circular dependency in metabase/redux/requests.js
The handleActions and createAction methods imported from
"metabase/lib/redux" are actually just methods from the "redux-actions"
dependency... so importing those methods directly from that dep fixes
this circular dependency problem.
* Remove references to global.services and exports in metabase/services
This line breaks the build. Git blame says the line is 5 years old, and
I wouldn't expect such code to be used with how our app now requires
deps.
* Fix MBQLArrayClause problem caused by Array extension
* Explicitly pass args from flatMap to function via anonymous cb
I think the old Array.prototype.flatMap prototype must've had different
args. They are now "currentValue, index, array" so when we passed it
"enumeratePaths" as a callback, the second arg of enumeratePaths gets
set to a number. This breaks the logic of enumeratePaths because it is a
recursive function that depends on that second arg getting initialized
as an empty array by default.
* Remove code that spreads non-iterable value in array
New Babel is stricter about handling this sort of code that doesn't
match the JS spec. You can't spread an undefined value inside of an
iterator.
* Update jest and babel-jest to latest
Updating Babel breaks our unit tests. Updating nothing causes every test
to fail due to a Babel version mismatch. Updating only babel-jest causes
the following error:
TypeError: Jest: a transform must export a `process` function
There may be a way around updating Jest, but updating it does not appear
to be too difficult.
* Set the testEnvironment to jsdom
This was the default testEnvironment in our old version of jest. At some
point the default was changed to node.
* Remove unfinished "pending" unit tests
I'm unfamiliar with this pending function, but the function no longer
exists, causing the tests to fail.
* don't pass async callback to describe
* Update name of runTimersToTime to advanceTimersByTime
* Fix incorrectly nested unit test
* mock SVGElement.prototype.getBBox method
* Don't return values in describe callback
* Move variable declaration to above usage
* Fix prettier error
* Upgrade `documentation` library to the latest version (13.x.x)
This library was the only one left that was still using Babel 6.
* Return an MBQLClause instance after using Array methods
* remove 'not IE 11' from browserslist
* Remove mock that breaks unit test
Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
* Fix some Eastwood failures
* Fix a lot of Eastwood errors now that it runs against test namespaces [ci skip]
* Run Eastwood against test namespaces [WIP]
* Bump Eastwood version to fix some errors in Eastwood itself
* Fix another lint warning
* Fix test failure
* More test fixes 🔧
* Fix all the warnings!
* Test fix 🔧
* Bump Eastwood GH action timeout to 20 minutes (!)
* Add getCollectionIcon function
* Add isRegularCollection function
* Display official badge in collections sidebar
* Don't dim official badge icon in collections sidebar
* Show root collection icon
* Use `CollectionsList.Icon` for "All personal collections"
* Fix CollectionBadge icon color
* Display official collection badge in search results
* Test official badge displayed correctly in sidebar
* Test official badge is shown throughout the app
* Show official badge icon in SavedQuestionPicker
* Use existing isPersonalCollection utility
* Show official badge icon in QuestionPicker
* Show official badge icon in CollectionPicker
* Minor CollectionIcon refactoring
* Use function declaration for isRegularCollection
* Add editCollection test helper
* Add changeCollectionTypeTo helper
* Remove duplicated assertions
* Add helper to create official collection
* Add testOfficialBadgeInSearch helper
* Add badge icon
* Add empty PLUGIN_FORM_WIDGETS
* Add empty PLUGIN_COLLECTIONS
* Extract `getWidgetComponent` from FormWidget
* Allow adding EE-only form widgets
* Add `authority_level` field to collections
* Fix SegmentedControl's `value` prop-type
* Specify icon sizes for SegmentedControl's options
* Add FormCollectionAuthorityLevel form widget
* Add `PLUGIN_COLLECTION_COMPONENTS`
* Add CollectionAuthorityLevelIcon
* Move ToggleMobileSidebarIcon out of PageHeading
* Display official badge on collection page
* Add authority level to collections plugin
* Rename `AUTHORITY_LEVELS` to `EE_AUTHORITY_LEVELS`
* Patch collections plugin with EE authority levels
* Fix authority level value for new collection form
* Add `cy.createCollection` command
* Add `describeWithoutToken` Cypress helper
* Test user can manage collection authority level
* Test collection types available only in EE
* Run prettier
* Keep regular collection opts in AUTHORITY_LEVEL
* Fix test comment
* Translate collection type names
* Avoid aliasing regular authority level
* Minor fixes to performance troubleshooting guide
* Update docs/troubleshooting-guide/performance.md
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
* Fixing a few small issues with the performance troubleshooting guide.
* Another fix to performance troubleshooting
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
* Improve prop-types, move to the top of the file
* Make FormField a functional component
* Simplify default props assignment
* Remove redundant comparisons
* Add InputContainer component
* Extract ALL_DOT_CHARS regexp for form field id
* Simplify Label
* Extract rootClassNames
* Fix formFieldId
* Fix FormField prop type
* add question details sidebar (code from bucm)
update some cy tests
rmv moderation-related code
rmv padding on description
merge history button logic into label
lint fix
update some clicks in cy tests
update styles to use styled-components
fix more cy tests
rmv unused component
rmv unused reference
rmv unused prop
remove styling code that is no longer necessary
rmv extraneous space
fix translation
rmv added util class
move styled component to own file
* add revision util tests
* rmv some unneeded question panel styling
* move files into query_builder directory
* rearrange stuff in file
* ClampedDescription unit test
* add QuestionActionButtons unit tests
* add SavedQuestionHeaderButton test
* add QuestionActivityTimeline tests
* tweak/improve props/propTypes
* fix cy test referencing question description
* fix revision history cy test
* Question sidebar visual polish (#16942)
* style tweaks
* restyle Revert button
* add a little breadcrumb spacing
* make LastEditInfoLabel use Badge instead of TextButton
* bring back TextButton
* Revision History => History
* fix activity timeline unit test
* rmv unused styled components
Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
* hide 'add a description' button when read only
* update permissions cy tests
* update ClampedDescription unit test
* use size enum instead of boolean
* move export to bottom of file
* move modal magic strings to a constants file
* clobber all qb state when reloading
* Fix reversion cy tests
Co-authored-by: Maz Ameli <maz@metabase.com>
Implement JDBC based Presto driver
Adding new Presto JDBC driver using the PrestoDB JDBC driver from `https://github.com/prestodb/presto`
Marking the old Presto driver as being `superseded-by` the new one
Pulling out common Presto code into new presto-common driver (modeled after the relationship between, ex: `googleanalytics` and `google)`
Putting common QP/HoneySQL logic into the new (abstract) :presto-common driver
Updating :presto driver to extend from the new common driver and only adding HTTP/REST API related methods
Adding implementation of Presto JDBC driver, named :presto-jdbc, extending from :presto-common and :sql-jdbc
Using com.facebook.presto/presto-jdbc as underlying JDBC driver dependency (since this is explicitly for Presto clusters, as opposed to Trino)
Adapting code from the existing Presto driver where appropriate
Adding new dependency-satisfied? implementation for :env-var, to allow for a plugin to require an env var be set, and making the Presto JDBC driver depend on that (specifically: `mb-enable-presto-jdbc-driver`)
Adding CircleCI configuration to run against the newer Presto (0.254) Docker image
Adding explicit ordering in a few tests where it was missing
Fixing presto-type->base-type (timestamps were being synced as :type/Time because the regex pattern was wrong)
Add tx/format-name test implementation for :presto-jdbc to lowercase table name
Make modified test Oracle friendly
Fixing bug parsing the `[:zone :time]` case within `metabase.util.date-2.parse/parse-with-formatter`; the offset is nil so it can't be passed directly in this case, so use the `standard-offset` fn (which was moved from `date-2` to `common` to get a standard offset for that zone
Fixing more test failures by adding explicit ordering
Changing sync to check whether the driver supports foreign keys before attempting to sync those (since drivers might throw an exception if attempting to check)
Moving some common test dataset functionality between :presto and :presto-jdbc to a new test.data ns for :presto-common
Adding HoneySQL form for :count-where, since we have to explicitly give a higher precision Decimal in order for Presto to not reduce the precision in results
Put limit within subquery for `expression-using-aggregation-test` (since ordering from subquery is not guaranteed in Presto)
Adding impls for ->prepared-substitution to handle substitutions for native query params
Adding HoneySQL impls for `mod` (to do as "mod(x,y)" and `timestamp` (since it's a function with no parens to invoke) functions
Adding various `sql.qp/date` impls that use the `AT TIME ZONE` operator to account for report tz, and make bucketing tests happy
# Backend changes
Introducing new `superseded-by` property to plugin manifest YAML, which will indicate the driver that is to eventually replace this one (and will drive UI/UX behavior). If a driver declares this property, then it's considered to be deprecated in favor of the specified one.
Adding top level `test_modules` directory (with the same structure as modules) for the sole purpose of module/plugin testing of YAML files, which will not be included with the driver build
Updating `driver-plugin-manifest` to look for the new `test_modules` directory in addition to `modules`, when loading the driver manifest
# Frontend changes
Calculate `supersededBy` and supersedes maps from the "superseded-by" property for each engine
Change the options for the engine field to use a function to dynamically show the legacy driver if allowed by rules (either the new driver is selected, or the legacy driver was already selected for an existing DB, or the driver is not superseded by anything)
Add new `DriverWarning` component to show these warnings based on supersede status
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Remove regionid from plugin YAML file
Add new driver multimethod to `normalize db-details`, and implementing to handle this particular "migration" within Snowflake
Adding hook from database model post-select to invoke the new multi
Adding test
Update visualization_settings.cljc to handle the table.columns submap
Update dump and load to handle :visualization_settings on a Card (basically identically to how they are handled for a DashboardCard)
Updating test to have a card include :visualization_settings and ensure they fields are properly handled
Updating visualization_settings test case to incorporate table.columns as well as :show_mini_bar (under ::column_settings)
* Update Webpack to the latest version (5.37.0)
* Update `webpack-dev-server` to the latest version (3.11.2)
* Install `webpack-cli`
* Replace `CommonsChunkPlugin` with `splitCunks`
* Remove `NamedModulesPlugin`
* Remove `UnusedFilesWebpackPlugin`
* Replace `extract-text-webpack-plugin` with `mini-css-extract-plugin`
* Upgrade `html-webpack-plugin` to the latest version (5.3.1)
* Upgrade `html-webpack-harddisk-plugin` to the latest version (2.0.0)
* Remove `banner-webpack-plugin`
* Replace deprecated `[hash]` in the config
* Add `mode` to the config
* Upgrade `file-loader` to the latest version (6.2.0)
* Don't include polyfills for `path` and `crypto`
* Remove `uglifyjs-webpack-plugin` and use terser instead
* Workaround CLJS_GLOBAL needs top-level `process` object
* yarn add node-polyfill-webpack-plugin
* Use some polyfills
Apparently, the polyfill for crypto is still necessary since the front-end
code isn't migrated yet to the browser's native Crypto API
(https://www.w3.org/TR/WebCryptoAPI/)
See also https://www.npmjs.com/package/node-polyfill-webpack-plugin
* Admin smoke test: fix getting the empty DB path
* Onboarding setup test: fix getting the empty DB path
* Replace file-loader with type: "asset/resource"
See https://webpack.js.org/guides/asset-modules/
* upgrade react-markdown (#16934)
* Use large CI resource since webpack consumes a lot of memory [ci nocache]
https://circleci.com/docs/2.0/configuration-reference/#resourceclass
* Tidy up `NODE_ENV` references
* Remove Webpack `DefinePlugin`
Co-authored-by: Ariya Hidayat <ariya@metabase.com>
Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
Co-authored-by: Alexander Lesnenko <alxnddr@users.noreply.github.com>
* Add icons-only mode to SegmentedControl
* Add `fullWidth` mode to SegmentedControl
* Use SegmentedControl at SchedulePicker
* Use SegmentedControl at EmailAttachmentPicker
* Use SegmentedControl at ChartNestedSettingSeries
* Replace ChartSettingButtonGroup with SegmentedControl
* Remove ButtonGroup component
* Don't show labels for some viz settings
* Increase SegmentedControl's click area
* Add `inactiveColor` prop to SegmentedControl
* Fix icons-only SegmentedControl padding
This is for easier troubleshooting (rerun from failed, separated
recording) since those tests are quite hard to run smoothly with Circle
CI.
Also, move away from using the API (/api/setting/application-colors)
and just use the color picker from the UI to choose invididual custom color.
* offset is a reserved word in mariadb as of 10.6
- https://mariadb.com/kb/en/reserved-words/
- https://github.com/MariaDB/server/commit/299b935320
I think it is related to https://jira.mariadb.org/browse/MDEV-23908
"Implement SELECT ... OFFSET ... FETCH ..."
* Handle new names for utf8 in mariadb
https://mariadb.com/kb/en/unicode/
- utf8: Until MariaDB 10.5, this was a UTF-8 encoding using one to
three bytes per character. Basic Latin letters, numbers and
punctuation use one byte. European and Middle East letters mostly fit
into 2 bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No
supplementary characters are stored. From MariaDB 10.6, utf8 is an
alias for utf8mb3, but this can changed to ut8mb4 by changing the
default value of the old_mode system variable.
- utf8mb3: UTF-8 encoding using one to three bytes per
character. Basic Latin letters, numbers and punctuation use one
byte. European and Middle East letters mostly fit into 2
bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No
supplementary characters are stored. Until MariaDB 10.5, this was an
alias for utf8. From MariaDB 10.6, utf8 is by default an alias for
utf8mb3, but this can changed to ut8mb4 by changing the default value
of the old_mode system variable.
Update Oracle driver to set the v$session.program property on the connection, which appears in the PROGRAM column of the v$session table
Update tests accordingly
* Fix Card async-metadata running query even when metadata can be determined programatically
* Update another test
* Adjust affected repros by waiting for the metadata to load (#17068)
* Wait for the `result_metadata` to load
* Reduce the number of bins for the faster execution
* Update repro for #12568
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
* Extract repro for #15279 into a separate file
* Extract repro for #15689 into a separate file
* Extract repro for #15695 into a separate file
* Extract repro for #15119 into a separate file
* Extract repro for #12614 into a separate file
* Extract repro for #12720 into a separate file
* Extract repro for #6660 into a separate file
* Extract repro for #16103 into a separate file
* Extract repro for #13150 into a separate file
* Move existing tests related to the dashboard filters into a new folder
* Create new CI group `dashboard-filters`
This group already takes close to 10 minutes to finish.
We need to have an additional extended coverage for dashboard filters and for query builder filters.
It doesn't make sense to keep them all together under the `filters` CI group because that group on its own could take more than half an hour to finish.
* Add `createNativeQuestionAndDashboard` Cypress custom command
* Apply custom command to the existing test as an example
* Add sane defaults for the dashboard card size
* Apply custom command to 16181 reproduction
I thought (and assured dpsutton, lol) that the default behavior of the pagination spliced in was just not paginating, if there wasn't a limit passed in. Unfortunately, it appears that I tested this on the endpoint without pagination spliced in... so the default behavior isn't that way, it paginates if you don't pass in stuff.
So rip it out of the DB endpoint (only) for now and put it back in when we paginate
Authored-by: Howon Lee <hlee.howon@gmail.com>
* Add `addFilterToDashboard` Cypress custom command (#16964)
* Apply custom command to a few tests as an example
* #16918 Repro: Pulse fails when question has date field with "Month of Year" (#16921)
* Scroll to selected collection and question in the saved question picker
* fixup! Scroll to selected collection and question in the saved question picker
Co-authored-by: Alexander Lesnenko <alxnddr@users.noreply.github.com>
* Handle long collection item titles
* Fix EntityItemMenu's margin-left
* Remove `span` attribute from cols
* Fix "name" column is too close to "type"
* Fix "last edit" columns width
* Hide "last-edit" column at medium breakpoint
* Add test IDs for visualization buttons
* Add `runNativeQuery` helper to e2e-misc-helpers
* Add repro for #16914
* Don't sync native query columns if it failed
* Fix `table.columns: []` treated as "all hidden"
* Remove email quotations which could be deemed controversial. Address part of #11155
* Trigger deploy
Co-authored-by: Bruno Bergher <me@brunobergher.comexport>
The console messages (mostly about React warning on deprecated methods)
are useful when debugging a running application but they are atrocious,
extremely noisy, and barely useful when running the unit tests.
In the CI, those console messages drown the more useful PASS/FAIL status
of each individual test.
* Disable react/prop-types for .info files
* Refactor Checkbox
* Refactor StackedCheckBox
* Add a comment about Checkbox colors
* Remove not used prop
* Don't show outline for focused unchecked checkbox
* Pass custom Checkbox label element
* Refactor EmailAttachmentPicker to use label
* Refactor FieldsPicker to use label
* Refactor FilterOptions to use label
* Refactor DisplayOptionsPane to use label
* Refactor ScratchApp to use label
* Refactor AddSeriesModal to use label
* Add "danger" color to colors
* Refactor DeleteModalWithConfirm to use label
* Add label usage examples for CheckBox
* Add label usage examples for StackedCheckBox
* Add disabled state to CheckBox
* Add disabled state to StackedCheckBox
* Fix label prop-types
* Add space between examples
* Fix StackedCheckBox layout
* Add. StackedCheckBox label
* Fix disabled state for StackedCheckBox
* Migrate FieldsPicker to use label
* Migrate EmailAttachmentPicker to use label
* Add .styled files for checkbox components
* Fix e2e tests
* Fix `uncheckedColor` passed to HTML elements
* Revert eslint overwrite for .info files
* Display focus outline
* Fix home page our analytics section not showing collections
* increase limit for root collection children and pinned dashboards that are loaded on the home page
* fix Saved questions string translation
* fix Everything else folder is not showing items in the saved question picker for other languages
* translate query builder header
* Fix saved questions db on the client side
* i18n on "Saved Questions"
Co-authored-by: dan sutton <dan@dpsutton.com>
* adjust saved question picker layout
* fix saved question picker does not work with collection names that have a colon
* unskip repro
* make saved question picker usable on the mobile device
We defriendlified but the migration running in the first place is not happening for some users. Investigating but it's better just to be safe on this front
* Extract repro for #12228 into a separate file
* Extract repro for #15444 into a separate file
* Extract repro for #15460 into a separate file
* Extract repro for #15700 into a separate file
* Extract repro for #15981 into a separate file
* Extract repro for #16739 into a separate file
* Extract repro for #13961 into a separate file
* Extract repro for #14145 into a separate file
* Extract repro for #12581 into a separate file
* Extract repro for #14302 into a separate file
* Extract repro for #15163 into a separate file
* Extract repro for #11580 into a separate file
* Extract repro for #11480 into a separate file
* Extract repro for #9357 into a separate file
* Add basic segmented control component
* Specify segmented control's selected option color
* Update SegmentedControl's padding
* Use `PropTypes.node` instead of a bunch of types
* Remove `aria-selected` from CSS
* Extract SQL field filter helpers
* Apply field filter helper filters to the `sql-field-filter-string.cy.spec.js`
* Apply field filter helper filters to the `sql-field-filter-number.cy.spec.js`
* Apply field filter helper filters to the `sql-field-filter-date.cy.spec.js`
* hide other personal collections folder when no other users
* expand collections on click but disallow to select all personal collections, show all empty collections
* Move `browse` spec to the "Onboarding" directory
* Reorganize `search` specs
- Rename stray "seach" to "search-pagination" and move it to the new "search" directory under "onboarding"
- Rename existing "search" to "search-typeahead" and move it to the new "search" directory under "onboarding"
- Move old "seach" spec to the new "search" directory under "onboarding"
name:Restore cached uberjar built in previous step
<<:*CacheKeyUberjar
- steps:<< parameters.before-steps >>
# Make both `test-files` and `source-folder` parameters optional. Translates to: if `parameter` => run associated flag (`--spec` and `--folder`, respectively)
This project is to build the Metabase jar. It can be called standalone and is also called from the release project when creating releases.
## License Information
We create license information for all of our dependencies, both frontend and backend, and package them in our jar.
Tests will run in CI that we have license information for all dependencies. If you see these failing, an easy way to get a report of dependencies without license information can be obtained by running
You can check the overrides file (resources/overrides.edn) and add the license information there, or perhaps improve the license discovery mechanism in the code.
com.google.guava/guava{:mvn/version"30.1.1-jre"}; dep for BigQuery, Spark, and GA. Require here rather than letting different dep versions stomp on each other — see comments on #9697
hiccup/hiccup{:mvn/version"1.0.5"}; HTML templating
honeysql/honeysql{:mvn/version"1.0.461"; Transform Clojure data structures to SQL
:exclusions[org.clojure/clojurescript]}
instaparse/instaparse{:mvn/version"1.4.10"}; Make your own parser
io.forward/yaml{:mvn/version"1.0.9"; Clojure wrapper for YAML library SnakeYAML. Don't upgrade yet, new version doesn't support Java 8 (see https://github.com/owainlewis/yaml/issues/37)
:exclusions[org.clojure/clojure
org.flatland/ordered
org.yaml/snakeyaml]}
javax.xml.bind/jaxb-api{:mvn/version"2.4.0-b180830.0359"}; add the `javax.xml.bind` classes which we're still using but were removed in Java 11
joda-time/joda-time{:mvn/version"2.10.10"}
kixi/stats{:mvn/version"0.4.4"; Various statistic measures implemented as transducers
org.bouncycastle/bcpkix-jdk15on{:mvn/version"1.69"}; Bouncy Castle crypto library -- explicit version of BC specified to resolve illegal reflective access errors
org.slf4j/slf4j-api{:mvn/version"1.7.32"}; abstraction for logging frameworks -- allows end user to plug in desired logging framework at deployment time
org.tcrawley/dynapath{:mvn/version"1.1.0"}; Dynamically add Jars (e.g. Oracle or Vertica) to classpath
org.threeten/threeten-extra{:mvn/version"1.7.0"}; extra Java 8 java.time classes like DayOfMonth and Quarter
org.yaml/snakeyaml{:mvn/version"1.29"}; YAML parser (required by liquibase)
Has some helper functions to help out with rendering debugging.
In this namespace, you can run `(help)` to get a bit of help. It's principle usage right now is to render and debug the svg images.
### NOTE!
You must build the js bundle used to create the svgs with visx. Run `yarn build-static-viz` to ensure that this bundle is created and the file `resources/frontend_client/app/dist/lib-static-viz.bundle.js` exists
Have a problem and need help? Start with our troubleshooting guide.
## Metabase reference guides
## In-depth Guides
Documentation guides for the Metabase application.
#### [Users Guide](users-guide/start.md)
This is the go-to guide on asking questions and sharing answers using Metabase. You'll learn in depth about how questions are expressed, how to chart answers, as well as how to share questions and create dashboards.
### [Users Guide][users-guide]
#### [Admin Guide](administration-guide/start.md)
This guide is for advanced users and those who will be setting up and maintaining a Metabase installation. You'll learn how to set the instance up, how to configure common settings, how to manage user accounts, and how to add databases.
How to ask questions, how to visualize answers, as well as how to share questions and create dashboards.
This guide contains more detailed information about how to install Metabase for production use. It covers topics like SSL termination, deploying via Docker Containers vs. Jars, as well as the tradeoffs involved.
### [Admin Guide][admin-guide]
## Enterprise Edition
How to set up Metabase, configure common settings, manage accounts and permissions, and add databases.
#### [Enterprise Features Guide](./enterprise-guide/start.md)
Here’s where to go for help using the features included in the Enterprise Edition of Metabase.
### [Operations Guide][operations-guide]
## For Developers
Learn how to install Metabase for production use. The guide covers topics like SSL termination, deploying via Docker Containers vs. JAR files, as well as the tradeoffs involved.
#### [Developers Guide](developers-guide.md)
This guide covers how to contribute back to the Metabase open source project. It includes setting up a development environment, running tests, and the contribution and product process Metabase follows.
In the main navigation bar, click on the **gears** icon in the top right, and select **Admin**.

Once in the Admin section, select the **Databases** tab from the navigation bar at the top of the screen. You’ll see a list of your connected databases (if any). To connect a database to Metabase, click **Add database** and follow the connection instructions for your database.
Although connection details differ database to database, in general you'll need to get connection info from your database admin, usually some combination of hostname (sometimes called endpoint), port, database username and password, and the name of the database.
@@ -36,6 +36,12 @@ Right now, the only special role someone can have is Admin. The only difference
To make someone an admin, click on the Groups dropdown and click the check mark next to the Administrators group.
### Unsubscribe from all subscriptions / alerts
This action will delete any dashboard subscriptions or alerts the person has created, and remove them as a recipient from any other subscriptions or alerts.
This action doesn't affect email distribution lists that are managed outside of Metabase.
### Adding people to Groups
Adding people to groups allows you to assign [data access](05-setting-permissions.md) and [collection permissions](06-collections.md) to them. To add someone to one or more groups, just click the Groups dropdown and click the checkboxes next to the group(s) you want to add the person to.
There are always going to be sensitive bits of information in your databases and tables, and thankfully Metabase provides a simple way to ensure that people on your team only see the data they’re supposed to.
### How permissions work in Metabase
## How permissions work in Metabase
Metabase uses a group-based approach to set permissions and restrictions on your databases and tables. At a high level, to set up permissions in your Metabase instance you’ll need to create one or more groups, add members to those groups, and then choose what level of database and SQL access those groups should have.
Metabase uses a group-based approach to set permissions. At a high-level, you can set permissions on two things: data and collections. **Data permissions** are about defining what raw data groups are allowed to use when creating new questions (i.e., self-service analytics). **Collection permissions** determine what existing dashboards and questions groups can see. On some plans, you can also sandbox data, which "filters" what data people can see when they view a particular questions, such as limiting the rows or columns they can see.
A user can be a member of multiple groups, and if one of the groups they’re in has access to a particular database or table, but another group they’re a member of does not, then they **will** have access to that database.
You can set permissions on:
In addition to setting permissions on your databases and tables, you can also [set access permissions on the collections](06-collections.md) where your dashboards, questions, and pulses are saved. Collection permissions can be set and edited from the collection itself, or the Admin Panel.
- [Databases connected to Metabase][data-permissions]
- [Tables and schemas in those databases][table-permissions]
- [Rows and columns of a table][data-sandboxing] (only on some plans)
- [Collections of questions and dashboards][collections]
### Groups
For plans that include [SQL Snippet Folders][sql-snippet-folders], you can also set permissions on those folders.
To view and manage your groups, go to the Admin Panel, click on the People section, and then click on Groups from the side menu.
To determine who has access to what, you’ll need to create one or more groups, choose which level of access that group has to different databases, collections, and so on, then add people to that group.
### Key points regarding permissions
Some key things to keep in mind when thinking about permissions in Metabase:
- Permissions are granted to groups, not people.
- People can be in more than one group.
- If a person is in multiple groups, they will have the most permissive access granted to them across all of their groups. For example, if they are part of three groups, and two of those groups don't have permissions to a database, but the third group they're in can query that database, then that person will have access to that database.
## Groups
To view and manage your groups, go to the __Admin Panel__ > __People__, and then click on __Groups__ from the side menu.

#### Special default groups
### Special default groups
You’ll notice that you already have two default groups: Administrators and All Users. These are special groups that can’t be removed.
Every Metabase has two default groups: Administrators and All Users. These are special groups that can’t be removed.
You’ll also see that you’re a member of the **Administrators** group — that’s why you were able to go to the Admin Panel in the first place. So, to make someone an admin of Metabase you just need to add them to this group. Metabase admins can log into the Admin Panel and make changes there, and they always have unrestricted access to all data that you have in your Metabase instance. So be careful who you add to the Administrator group!
#### Administrators
You’re a member of the **Administrators** group — that’s why you were able to go to the Admin Panel in the first place. To make someone an admin of Metabase, you just need to add them to this group. Metabase admins can log into the Admin Panel and make changes there, and they always have unrestricted access to all data that you have in your Metabase instance. So be careful who you add to the Administrator group!
#### All users
The **All Users** group is another special one. Every Metabase user is always a member of this group, though they can also be a member of as many other groups as you want. We recommend using the All Users group as a way to set default access levels for new Metabase users. If you have [Google single sign-on](10-single-sign-on.md) enabled, new users who join that way will be automatically added to the All Users group.
#### An important note on the All Users group
As we mentioned above, a person is given the _most permissive_ setting she has for a given database/schema/table across _all_ groups she's in. Because of that, it's important that your All Users group should never have _greater_ access for an item than a group for which you're trying to restrict access — otherwise the more permissive setting will win out. This goes for both data access as well as [collection permission](06-collections.md) settings.
As we mentioned above, a user is given the _most permissive_ setting she has for a given database/schema/table across _all_ groups she is in. Because of that, it is important that your All Users group should never have _greater_ access for an item than a group for which you're trying to restrict access — otherwise the more permissive setting will win out. This goes for both data access as well as [collection permission](06-collections.md) settings.
### Managing groups
If you’ve set up the [Slack integration](09-setting-up-slack.md) and enabled [Metabot](../users-guide/11-metabot.md), you’ll also see a special **Metabot** group, which will allow you to restrict which questions your users will be able to access in Slack via Metabot.
#### Creating a group and adding people to it
#### Managing groups
From the Groups section, click the `Add a group` button to create a new group. We recommend creating groups that correspond to the teams your company or organization has, such as Human Resources, Engineering, Finance, etc. Click the X icon to the right of a group in the list to remove it (remember, you can’t remove the special default groups). By default, newly created groups don’t have access to anything.
From the Admin > Groups tab, click the **Add a group** button to create a new group. We recommend creating groups that correspond to the teams your company or organization has, such as Human Resources, Engineering, Finance, and so on. By default, newly created groups don’t have access to anything.
Click into a group and then click `Add members` to add users to that group. Click on the X on the right side of a group member to remove them from that group. You can also add and remove users from groups from the People list using the dropdown in the Groups column.
### Permissions view
#### Removing a group
Now that you have some groups, you’ll want to control their data access by going to the `Permissions` section of the Admin Panel. You’ll see an interactive table that displays all of your databases and all of your groups, and the level of access your groups have for each database.
To remove a group, click the X icon to the right of a group in the list to remove it (remember, you can’t remove the special default groups).

## Further reading
You can click on any cell in the table to change a group’s access level. When you’re done making your changes, just click the `save changes` button in the top-right, and you’ll see a confirmation dialog summarizing the changes.
At the database level, there are two different kinds of access you can set: data access, and SQL (or native query) access.
#### Data access
- **Unrestricted access:** can access data from all tables (within all namespaces/schemas, if your database uses those), including any tables that might get added to this database in the future.
- **Limited access:** can only access the tables that you explicitly select within namespaces/schemas you explicitly select. If a new table gets added to this database in the future, access to it will not automatically be given. Saved questions based on tables the user doesn’t have access to won’t show up in the list of saved questions, dashboard cards based on those questions won’t appear, and they won’t be able to ask new questions about those tables. If every card on a dashboard is hidden for a user, then that dashboard won’t be shown to them in the dashboard list.
- **No access:** can’t see anything based on data contained in this database. Won’t see saved questions based on tables contained in this database, and won’t be able to ask new questions about those tables.
#### SQL (or native query) access
- **Write raw queries:** can write new SQL/native queries using the SQL editor. This access level requires the group to additionally have Unrestricted data access for the database in question, since SQL queries can circumvent table-level permissions.
- **No access**: can't view, write, or edit SQL/native queries. Users will still be able to view the results of questions created from SQL/native queries, but not the code itself. They also won't see the "View the SQL" button when composing custom questions in the notebook editor.
If you select `Limit access` for one of your databases, your view will change to show the contents of that database. If the database utilizes namespaces or schemas, you’ll see a list of all the schemas in the database, and the level of data access each group has for them. Similarly, if you select `Limit access` on one of your schemas, you’ll drill down a level and see all the tables within it. From these views, you can navigate back by using the breadcrumb links in the top-left, and you can always drill down into a database or schema using the link under its name in the left column.
Data access levels for schemas follows the same pattern as for databases:
- **Unrestricted access:** can access all tables in this schema, including any tables that might get added in the future.
- **Limited access:** can only access the tables that you explicitly select.
- **No access:** can’t access any tables in this schema.
Lastly, data access levels for tables are almost exactly the same as well:
- **Unrestricted access:** can ask questions about this table and see saved questions and dashboard cards using this table.
- **No access:** can’t ask questions about this table or see saved questions or dashboard cards using this table.
_Note: you’ll notice that tables don’t have the option for limited access. If you need to set column-level or row-level data permissions, check out the [data sandboxing](https://www.metabase.com/docs/latest/enterprise-guide/data-sandboxes.html) feature of the [Enterprise Edition](https://www.metabase.com/enterprise/)._
For more, check out our [Guide to data permissions](https://www.metabase.com/learn/organization/organization/data-permissions.html).
### A note about Pulses
Pulses act a bit differently with regard to permissions. When a user creates a new Pulse, they will only have the option to include saved questions that they have permission to view. Note, however, that they are not prevented from emailing that Pulse to anyone, or posting that Pulse to a Slack channel (if you have Slack integration set up), regardless of the recipients’ permissions. Unlike dashboards, where individual cards are blocked based on a user’s permissions, a Pulse will always render all of its cards.
Checkout our track on [Permissions][permissions] in Learn Metabase.
---
## Next: collections
## Next: Data permissions
Metabase lets you create and set permissions on collections of dashboards and questions. [Learn how](06-collections.md).
Metabase lets you [set permissions on databases and their tables][data-permissions].
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.