Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Oct 23, 2024
  2. Oct 22, 2024
    • Romeo Van Snick's avatar
      Show "view-only" badge when the question is not editable (#48791) · 0cf6d56e
      Romeo Van Snick authored
      * Fix reference in deprecation notice
      
      * Add lock_filled icon
      
      * Add view-only tag to the question header for questions with hidden source tables
      
      * Simplify the useHasHiddenSourceTables helper
      
      * Add typings to useHasHiddenSourceTables
      
      * Show 'view-only' badge when the question is not editable
      
      * Set up card endpoints
      
      * Add test for hidden tables
      
      * Add e2e test for View-only tag
      
      * Add visibilityType to TableDisplayInfo
      
      * Use unfiltered table display info to determine which tables are hidden
      
      * Rename util to hooks
      
      * Use rem for border-radius
      
      * Sign in in beforeEach
      
      * Add tests for more visibility types
      
      * Fix unit tests
      
      * Remove empty file
      
      * Add test for unavailable cards
      
      * Remove unnecessary card endpoint
      
      * Add unit test for inaccessible card
      
      * Move ViewOnlyTag to it's own file
      
      * Add more unit tests for ViewOnly tag
      
      * Use MBQL to create queryies where possible
      Unverified
      0cf6d56e
  3. Oct 14, 2024
  4. Oct 08, 2024
  5. Oct 01, 2024
  6. Sep 24, 2024
  7. Sep 12, 2024
  8. Sep 05, 2024
  9. Aug 29, 2024
    • Dennis Schridde's avatar
      Hide attached DWH database details (#47247) · 592360c9
      Dennis Schridde authored
      == Goal ==
      
      Hide attached DWH database details from anyone incl. admins:
      * Do not show them in the UI
      * Do not permit to change them
      * Do not serialize them
      
      The aim is that customers cannot gain access to (parts of) credentials,
      and they cannot break a feature they are paying for by changing
      connection details.
      
      == Implementation ==
      
      The Metabase backend already contains provisions in the implementation
      of `metabase.models.interface/to-json` for `:model/Database` to hide the
      `details` of the database in HTTP responses, if the user lacks write
      permission on the database.  We utilize this by adding an
      `is_attached_dwh` column to the `database` table and rejecting
      `metabase.models.interface/can-write?` when this flag is enabled.  In
      the "admin" UI, we show a replacement text instead of the edit form when
      the flag is set.  (It might be correct to show this whenever `details`
      is absent.  See below for possible follow-up work.)
      
      However, several sections of the frontend code expected the `details`
      field to always be present.  In order to make `details` optional, as the
      backend seems to handle it, we fix the respective code to treat this
      case in the way that appears appropriate in the context.
      
      Database details are already generally excluded from H2 dump snapshots
      (see `metabase.cmd.copy/*copy-h2-database-details*`), thus nothing
      changes there.
      
      == How to test ==
      
      === New behaviour ===
      
      Setting the `is_attached_dwh` field hides the database details:
      
      1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
         - In addition to the fields you would normally set, also set
           `is_attached_dwh: true`.
         - This also works when adding this flag to a database that previously
           did not have this flag set.
      2. Start your Metabase instance.
      3. Verify the database shows up in the "admin" section
         (`/admin/databases`).
      4. Verify that clicking the database to see its details only reveals
         "This database cannot be modified."
      5. Verify that responses from the backend do not include a `details`
         field for this database.
      
      === Original behaviour ===
      
      Behaviour without setting the `is_attached_dwh` field is unchanged:
      
      1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
         - Only set the fields you would normally set.  Do not set
           `is_attached_dwh` (or set it to `false`).
      2. Start your Metabase instance.
      3. Verify the database shows up in the "admin" section
         (`/admin/databases`).
      4. Verify that clicking the database to see its details only reveal the
         regular edit form, showing connection fields like `host`, `user`,
         etc. with the values you configured.
      
      == How this will be rolled out ==
      
      1. Upgrade existing Metabase Cloud instances with data warehouse to a
         Metabase version that supports `is_attached_dwh`.
      2. Set `is_attached_dwh` in the database section of the config file for
         Metabase Cloud instances with a data warehouse.
      
      == Possible follow-up work ==
      
      In https://github.com/metabase/metabase/issues/25715, absent
      `database.details` was identified as a bug.  Since then, `details` was
      made `NOT NULL` in the application database, so this bug can no longer
      occur.  However, today backend responses can be missing the `details`
      field, if the current user lacks write permission to the database
      setting (see above).  Fully re-evaluating the fix to #25715 in this
      context is outside the scope of this PR.
      
      Closes: https://github.com/metabase/harbormaster/issues/5051
      Unverified
      592360c9
  10. Aug 27, 2024
  11. Aug 26, 2024
  12. Aug 21, 2024
    • Ryan Laurie's avatar
      Create Question and Dashboard Sharing Menu (#46593) · 3964d71e
      Ryan Laurie authored
      * QuestionAlertWidget to FC + TS
      
      * update e2e tests
      
      * use regular alert for unsubscribes
      
      * Create Question and Dashboard Sharing Menu
      
      * Handle some edge cases
      
      * top notch unit tests
      
      * more testing and tweaking
      
      * fix imports
      
      * more tests
      
      * add alerts to question sharing menu
      
      * add tests for alerts
      
      * update e2e tests
      
      * use Oisin's toolbarbutton
      
      * fix rebase
      
      * prompt to save before sharing questions
      
      * show prompt to set up notification channels
      
      * fix import
      
      * update tests and hide on notebook screen
      
      * fixes
      
      * clean up pulse types
      
      * update e2e tests
      
      * fix a bunch more tests
      
      * more e2e test fixes
      
      * maybe green now? :fingers_crossed:
      
      * last one :pleading_face:
      
      * design updates
      
      * make channel setup modal nicer
      
      * simpler component props
      
      * lint fix
      
      * lint fixes
      Unverified
      3964d71e
    • Alexander Polyankin's avatar
  13. Aug 20, 2024
  14. Aug 13, 2024
  15. Aug 12, 2024
  16. Aug 08, 2024
    • Kamil Mielnik's avatar
      FE - Cover Unit of Time in `getParameterColumns` with tests (#46529) · 4957660c
      Kamil Mielnik authored
      * Add test boilerplate
      
      * Rename test and add assertions
      
      * Add broken test for models
      
      * Add unit of time tests
      
      * Deduplicate code
      
      * Add date parameter tests
      
      * Add test for multiple stages
      
      * Fix model test setup and refactor getColumnsInfos
      
      * Remove redundant assertions
      
      * Format codee
      
      * Extract createQuestion and createModel
      
      * Add unit of time model tests
      
      * Add test for model
      
      * Extract constants
      
      * Add a warning
      
      * Build dataset queries with mbql
      
      * Introduce queryOrders
      
      * Revert redundant change
      
      * Improve Question creation
      Unverified
      4957660c
  17. Aug 06, 2024
  18. Aug 05, 2024
    • Kamil Mielnik's avatar
      Update "Clear" and "Reset" buttons (#46050) · 35d9a817
      Kamil Mielnik authored
      * Refactor dashboard helpers to TypeScript
      
      * Reuse existing helper
      
      * Refactor cy.createQuestionAndDashboard to a function helper
      - there was no good place to put it, so I also created new helpers/api directory
      - and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there
      
      * Merge TS command definitions into a single file
      
      * Export types
      
      * Make dashboardDetails optional
      
      * Export StructuredQuestionDetails
      
      * Remove duplicated function
      
      * Extract createNativeQuestion to separate file
      - 1 exported helper per file, no exceptions!
      
      * Reuse const
      
      * Add test for unit of time parameters
      
      * Improve assertions
      
      * Extract createDashboardWithParameters
      
      * Add tests for time parameters
      
      * Fix hardcoded parameter_mappings ids
      
      * Format code
      
      * Extract checkButtonVisible
      
      * Improve test names
      
      * Add tests for location parameters
      
      * Reuse const
      
      * Update test name
      
      * Add WidgetStatusButton
      
      * Add unit tests for WidgetStatusButton
      
      * Rename handler
      
      * Remove redundant assertions
      
      * Add iconSize prop
      
      * Fix styling
      
      * Replace WidgetStatusIcon with WidgetStatusButton
      - Remove WidgetStatusIcon
      
      * Fix tooltip issue
      
      * Fix tooltip for good
      
      * Use default compact button size
      
      * Prevent overflow
      
      * Fix alignment issues in parameter sidebar
      - Remove iconSize prop
      - Simplify StatusConfig
      
      * Update padding in Unit of Time input to make it consistent with other inputs in dashboard parameter sidebar
      
      * Update unit tests
      
      * Rename WidgetStatusButton to WidgetStatus
      
      * Explicitly specify what is a button
      
      * Update helpers in tests
      
      * Update when buttons are displayed according to the new spec, update tests
      
      * Simplify label
      
      * Remove utils
      
      * Adjust padding
      
      * Update reset icon
      
      * Make the button gray when color is undesired
      
      * Remove old definitions
      
      * Add missing export
      
      * Remove unused type
      
      * Add test for location (single value)
      
      * Add test for id (single value)
      
      * Add more assertions
      
      * Add test for id (multiple values)
      
      * Improve name
      
      * Add tests for number (single and multi value)
      
      * Add tests for text (single and multi value)
      
      * Rename file
      
      * Update comment
      
      * Update test name
      
      * Use unique ids
      
      * Use new color name
      
      * Add a test for chevron icons alignment
      
      * Lift className up
      
      * Make types more specific
      
      * Sort attributes
      
      * Revert "Make types more specific"
      
      This reverts commit 2e6994b5.
      
      * Revert "Use new color name"
      
      This reverts commit 2cc68df6.
      
      * Remove TODO
      
      * Introduce editFilter util, refactor chevron assertions to work with any number of chevrons
      
      * Connect label to the default value input in ParameterSettings
      
      * Add a whitespace in the default value label when required "(required)" is shown
      
      * Add parameter sidebar tests for unit of time
      
      * Add parameter sidebar tests for date filters
      
      * Extract checkParameterSidebarDefaultValue
      
      * Add parameter sidebar tests for location - single values
      
      * Add parameter sidebar tests for location - multiple values
      
      * Use constants for test case names
      
      * Add parameter sidebar tests for id parameters - single values
      
      * Add parameter sidebar tests for id parameters - multi values
      
      * Add parameter sidebar tests for number parameters - single values
      
      * Add parameter sidebar tests for number parameters - multi values
      
      * Add parameter sidebar tests for text parameters - single values
      
      * Add parameter sidebar tests for text parameters - multi values
      
      * Extract checkDashboardFilters
      
      * Use checkDashboardFilters in time parameters
      
      * Use checkParameterSidebarDefaultValue in checkDashboardFilters
      
      * Use checkDashboardFilters everywhere
      
      * Sort helpers
      
      * Rename checkDashboardFilters to checkDashboardParameters
      
      * Rename checkOnlyOneButtonVisible to checkStatusIcon
      
      * Add test suite for sql filters, coverage for text filter - single value
      
      * Add a whitespace in the default value label when required "(required)" is shown - SQL filters
      - Similar to 930dd3a5
      
      * Add test suite for sql filters, coverage for number filters
      
      * Add test for sql filters - date
      
      * Remove unused things, rename placeholder to labelOrPlaceholder
      
      * Apply label only to 1 input
      
      * Add test for sql filters - field parameters
      
      * Fix date tests
      
      * Make all sql filters tests work
      
      * Add assertions for required without default in text filters
      
      * Add assertions for required without default in date filters
      
      * Add assertions for required without default in field filters
      
      * Allow clearing required SQL filters without default value
      
      * Add a test to ensure comma-separated numeric values work
      
      * Update unit test
      
      * Update helper
      
      * Update e2e tests
      
      * Use != null and == null checks with defaultValue instead of just checking if its truthy/falsy
      
      * Run `yarn test-visual:loki` and then `yarn loki approve`
      - see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
      
      * Use parameterHasNoDisplayValue to account for empty strings
      
      * Run `yarn test-visual:loki` and then `yarn loki approve` after merging master
      - see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
      
      * Run `yarn test-visual:loki` and then `yarn loki approve`
      - see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
      
      * Run `yarn test-visual:loki` and then `yarn loki approve`
      - see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
      Unverified
      35d9a817
    • Romeo Van Snick's avatar
      Custom labels for number parameter (#44230) · 019fb467
      Romeo Van Snick authored
      * Make number also have custom parameter values
      
      * Render the correct label in the dropdown for number inputs
      
      * Mock paramter values endpoint in number input test
      
      * Add test for custom labels on number input
      
      * Fix number input test
      
      * Allow entering comma separated values using labels
      
      * Only show custom labels in popover
      
      * Use getLabel and getValue helpers to avoid indexing confusion
      
      * Remove calls to parameter endpoints for number input
      
      * Do not parse the value from the label
      
      * Add support for number parameters in the source picker modal
      
      * Filter number values
      
      * Add e2e test for number parameters with custom source
      
      * Remove card option for number parameters
      
      * Set the correct initial value for number parameters without fields
      
      * Do not render number parameter as search box when it is a list
      
      * Fix e2e tests for number lists
      
      * Remove e2e tests for card source dashboard filters
      
      * Add tests for native filter custom source
      
      * Show the dropdown when picking the default value for number parameters
      
      * Clear values_source_config when changing parameter type
      
      * Restore a parameters' values_source_config when changing the parameter type back
      
      * Clear and restore values_source_config for template tags when chaning type
      
      * Add e2e test for restoring of template tag sources_value_config
      
      * Add e2e test for clear and restore of static-list for dashboard parameters
      
      * Fix input type for numbers
      
      * Fix broken test
      
      * Display labels for ParameterValuePicker too
      
      * Clear and restore values_source_type when changing parameter type
      
      * Clear and restore values_source_type for tag parameters
      
      * Clear and restore values_query_type when changing parameter type
      
      * Clear and restore value_query_type for parameters tags
      
      * Update tests to test for reset to also apply to values_source_config and values_query_type
      Unverified
      019fb467
  19. Jul 29, 2024
  20. Jul 26, 2024
  21. Jul 22, 2024
    • Uladzimir Havenchyk's avatar
      replace babel-loader with swc-loader (#45843) · e02589a3
      Uladzimir Havenchyk authored
      - babel is kept to transpile fonts file as swc emotion plugin doesn't handle our case correctly. I didn't find a root cause of wrong behaviour, but the safe past is to keep using babel + emotion plugin for one file and all others can be transpiled with swc
      - react fast-refresh now handled by swc
      - swc-loader can't read browserslist config from package.json, so we had to manually specify supported browsers in webpack
      Unverified
      e02589a3
  22. Jul 19, 2024
    • Alexander Polyankin's avatar
      Remove can_run_adhoc_query (#45847) · aa4be30e
      Alexander Polyankin authored
      
      * Remove can_run_adhoc_query from the FE
      
      * Remove can_run_adhoc_query from the FE
      
      * Disable can_run_adhoc_query on dashboard
      
      Was impacting performance on dashboard load. Timings locally for me:
      
      get dash: 3178 -> 199
      get metadata: 3604 -> 1002
      
      So dashboard went from 6 seconds to load to 1 second.
      
      * Fixup test from disabling can_run_adhoc_query
      
      ---------
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Unverified
      aa4be30e
    • lbrdnk's avatar
      Remove `:foreign-keys` feature or convert to `:metadata/key-constraints` where appropriate (#44894) · 9c708c21
      lbrdnk authored
      
      * Post sync hook stub for implicit joins testing stub
      
      * Add join alias to field lvalues to enable sorting on joined fields
      
      * Disable :foreign-keys on Mongo
      
      * Require :left-join support for implicit joins instead of :foreign-keys
      
      * Update implicit joins tests
      
      * Adjust sync-fields-test
      
      * Update implicit joins feature check test
      
      * Transform post-sync-hook to normal function
      
      * Add foreign key relationships only for dbmses without :foreign-keys feature
      
      * Update test to handle Oracle correctly
      
      * Split convoluted fn
      
      * Avoid unnecessary computations for datasets with no fks
      
      * Update docstring
      
      * Fix driver usage
      
      * Transform :foreign-keys to :metadata/key-constraints in test data loading code
      
      * Update sync_test.clj
      
      * Update driver_test.clj
      
      * Update moviedb.clj
      
      * Update dataset_definition_test.clj
      
      * Update fetch_metadata.clj
      
      * Update fields_test.clj
      
      * Update driver.clj
      
      * Update driver/sql.clj
      
      * Set sql driver join support to true for all joins
      
      Deriving drivers are expected to set to false where applicable.
      
      * Update sqllite.clj
      
      * Remove foreign-keys from spark
      
      * Remove :foreign-keys from presto
      
      * Remove :foreign-keys from Athena
      
      * Remove foreign-keys from big query
      
      Reading docs it seems fk inference should be ok. Let's see the test results. Act based on that.
      
      * Update test_metadata.cljc
      
      * Set key-constraints to false for bigquery
      
      * Add foreign keys to sqlite manually until sync is fixed
      
      * Return driver require to Athena
      
      * Correct typo
      
      * Add naive primary key heuristic
      
      * Update pk fk logic to handle name components correctly
      
      * Add alias escaping to presto
      
      * Add ordering to test
      
      * Add order by to test
      
      * Update test
      
      * Remove use of rewrite-fields-to-force-using-column-aliases in order by fields
      
      * Add exception to alias forcing
      
      * Different approach to exception from alias forcing
      
      * Alternative approach for prefixing idents in bigq
      
      * All seelcted fields by desired alias
      
      * Rewrite only fields not from this source table
      
      * Update test
      
      * Enable breakout-on-fk-field-test for :left-join drivers
      
      * Add feature comment
      
      * Explicit joins tests foreign-keys removal
      
      * Update nested_queries_test.clj
      
      * Update remapping tests
      
      * Update tests
      
      * Update tests to handle sqlite results format
      
      * Disable metadata/key-constraints on sqlite during tests until
      
      * Address remarks
      
      * Remove mt/with-mock-fks-for-drivers-without-fk-constraints
      
      * Update bigquery test
      
      * Update tests
      
      * Adjust row level restrictions
      
      * Add parameterized-sql feature
      
      * Update comment
      
      * Update leftovers
      
      * Order keys
      
      * Remove foreign keys from frontend
      
      * Fix FE unit
      
      * Update driver changelog
      
      * Address review remark
      
      * Update test/metabase/query_processor/test_util.clj
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Update docs/developers-guide/driver-changelog.md
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Update docs/developers-guide/driver-changelog.md
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Update modules/drivers/bigquery-cloud-sdk/src/metabase/driver/bigquery_cloud_sdk/query_processor.clj
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Update docs/developers-guide/driver-changelog.md
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Update test
      
      * Update comment and reduce expression
      
      * Update comment
      
      * Address remarks
      
      * Fix merge
      
      ---------
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Unverified
      9c708c21
  23. Jul 17, 2024
  24. Jul 16, 2024
  25. Jul 09, 2024
  26. Jul 05, 2024
  27. Jul 04, 2024
  28. Jul 02, 2024
  29. Jun 28, 2024
  30. Jun 27, 2024
Loading