Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Sep 24, 2024
  2. Sep 13, 2024
  3. Sep 12, 2024
  4. Sep 10, 2024
  5. Sep 09, 2024
  6. Aug 30, 2024
    • Ryan Laurie's avatar
      Remove `MetabaseSettings.docsUrl()` (#47433) · 30b08dd1
      Ryan Laurie authored
      * add useDocsUrl hook and update lint rule
      
      * remove all uses of MetabaseSettings.docsUrl
      
      * update tests
      
      * revert non-docsurl change
      Unverified
      30b08dd1
    • Raphael Krut-Landau's avatar
    • Ngoc Khuat's avatar
      [notification] webhook for alert (#45201) · d897f201
      Ngoc Khuat authored
      
      * [notification] New method: `channel/can-connect?` (#44955)
      
      * [notification] Channel APIs (#45207)
      
      * [notification] namespaced channel type (#45527)
      
      * [Notification] Render alert for http channel (#45545)
      
      * [notification] Add channel description (#45840)
      
      * [notification] update API to enable http channels for alert (#45839)
      
      * [Notification] Remove channel details for users without write perms (#46034)
      
      * [Notification] Serdes channel (#46031)
      
      * [Notification] Update http details schema (#45960)
      
      * [Notification] Deactivate channels will delete PulseChannel (#46115)
      
      * [Notification] audit log for channel create and update (#46113)
      
      * [Notification] Disallow undefined key for http channel details (#46712)
      
      * [Notification] Handle channel name conflicts (#46818)
      
      * Webhooks Admin Section (#46194)
      
      * [notification] Fix test pulse endpoint does not work properly for http channels (#46474) (#47050)
      
      * [Notification] Fix unable to update multiple channels per type (#47111)
      
      * [Notification] Record Task History when pulse sends channel message (#46218)
      
      * Enabling Webhook Alerts (#47022)
      
      * [Notification] fix cyclic deps (#47379)
      
      * [notification] channel serdes spec (#47386)
      
      Co-authored-by: default avatarNick Fitzpatrick <nick@metabase.com>
      Unverified
      d897f201
  7. Aug 29, 2024
    • Nick Fitzpatrick's avatar
      Query validator FE (#47098) · b7349ec5
      Nick Fitzpatrick authored
      * Query Validator FE
      
      * collection path, unit tests
      
      * wrapping feature with token flag
      
      * updating util function, adding row type
      
      * updating session_test.clj
      
      * type adjustment
      
      * fixing other table sorting
      
      * Empty state, clean up utils
      
      * unit test adjustment
      
      * e2e adjustment
      Unverified
      b7349ec5
    • 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
  8. Aug 27, 2024
  9. Aug 23, 2024
  10. Aug 22, 2024
  11. Aug 20, 2024
  12. Aug 19, 2024
    • bryan's avatar
      Add no-access table-level and schema-level permission (#46542) · 2bbcf745
      bryan authored
      
      * allow `:blocked` to be saved for table level perms
      
      * Adds 2 tests for table level blocked permission settings
      
      - N.B. these are NOT ENFORCED YET
      
      * update test that asserted we cannot set block on tables (we can)
      
      * WIP: Pairing on making perms checking less wild
      
      * cleanup, update docs, and add a test for view-data perm only
      
      - Added a test where we have data permissions, but not create query, and
        I think it is failing when we have create query and blocked data
        permissions.
      - renamed some functions from check-x -> has-x? since they return a
        value instead of throwing now
      
      * Revert "WIP: Pairing on making perms checking less wild"
      
      Keep the same behavior, but stick with the saner flow control
      
      This reverts commit 63bcb5b4.
      
      * update docs
      
      * update test to be passing
      
      - TODO: make sure it's correct w.r.t. perm settings
      
      * Allow schema level blocked setting in permgraph
      
      * remove invalid test cases
      
      - continue to have a forcing function to test newly added perms
      
      * conform function output
      
      * ensure a single blocked table blocks native queries to its DB
      
      * update error message
      
      - we now catch this error in `metabase.models.query.permissions/has-perm-for-query?`
      
      * we now check for data permissions to process query for card
      
      * add more explanation to what we are testing
      
      - to help see why it fails on CI and passes locally
      
      * remove excess `def`
      
      * Add test for table-level data X collection perms
      
      - update test found to be in-error
      
      * update param values qp permission check style
      
      * set view-data and create-query explicitly
      
      * set viewdata and createquery explicitly in qp test
      
      * Respond to review comments (which fixes a case)
      
      * setting a table to blocked: leave other tables the same
      
      * [Permissions] Add "No access" schema/table permission (#46509)
      
      * first pass
      
      * refactors downgrading native permission logic and updates calculation so that "No access" downgrades native permissions to "No"
      
      * stub for permissions help info on table block
      
      * modal changes wip, updates downgrading create queries permissions to all happen at a single call site
      
      * clean up, sandboxing modal copy changes, removes rekoke/limit access modal changes to make the diff smaller and move code to a seperate PR
      
      * updates permissions help section to contain the final copy
      
      * sandboxing copy fix and remove modal that was dropped from requirements
      
      * adds blocked at the schema level, updates no access copy to blocked, updates permissions help section to contain new blocked and schema level changes
      
      * fixes failed unit and e2e tests after sandboxing copy changes
      
      * improve the block e2e test to include table blocking
      
      * fixes failing blocked test, fixes other schemas create queries permissions getting correct with one schema was droped to blocked view data access, fixes a bug that prevents the save bar from going away when all permissions for group are set to the default values
      
      * clean up
      
      * remove color changes
      
      * prevents parent being set to blocked preventing edits for children entities
      
      * add new hasPermissionValueInSubgraph fn, adds modal to warn users we have to upgrade the view data permissions when they upgrade create queries permissions when a child entity is set to blocked
      
      * adds test coverage for new modal
      
      * removes unused function, adds new updateEntityPermission fn to help consolidate some logic elsewhere
      
      * unit test fix and type fix
      
      * most pr feedback
      
      * updates the confirmation modal copy when changing a parent entity that contains a child with blocked permissions and/or sandboxed children, adds test coverage for that, adds test coverage for permission view data column not appearing in oss
      
      * type fix
      
      * [Permissions] Add e2e test coverage for blocked permissions enforcements (#46663)
      
      * adds test coverage for enforcement of blocked permissions
      
      * moves tests around based on pr feedback
      
      * copy changes
      
      * adds fix to make sure that blocked permissions are not removed from sibling tables that have the create queries permissions upgraded (#46854)
      
      * Fix table name lookup for dbs w/ 1 schema per db
      
      * add test for blank schema identifiers
      
      * Refine sandboxed user perms for query builder access (#46939)
      
      * Refine sandboxed user perms for query builder access
      
      - Limit create-queries permissions to unblocked tables only
      - Check user permissions for each table before granting query builder access
      - Prevent querying of blocked joined tables from query builder for sandboxed users
      
      * Adjust permissions for sandboxed users
      
      - Grant view-data permissions only for unblocked tables
      - Revert create-queries permissions to all tables in sandbox
      - Remove unnecessary intermediate variable
      
      * when sandboxing we no longer grant unrestricted view perms for blocked tables
      
      * Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj
      
      remove blank line
      
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      
      * - make coalesce-test exhaustive (except for sandbox)
      
      * Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj
      
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      
      * t2/select ... -> database/table-id->database-id
      
      * update comment
      
      * [Permissions] Prevent "Granular" option in DB View Data options from changing permissions to unrestricted (#46976)
      
      * fix
      
      * adds back most of the code and limits it to only happen with impersonations, updates test to handle differing logic between the two flows
      
      * removes test that is not longer needed
      
      * more sandbox join table perms tests
      
      ---------
      
      Co-authored-by: default avatarJohn Swanson <john.swanson@metabase.com>
      Co-authored-by: default avatarSloan Sparger <sloansparger@users.noreply.github.com>
      Co-authored-by: default avatarSloan Sparger <sloansparger@gmail.com>
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      Unverified
      2bbcf745
    • Nemanja Glumac's avatar
      tech: Remove the last GoogleAnalytics tracking bits and references (#46980) · 2899046d
      Nemanja Glumac authored
      * Remove simple references to `trackStructEvent`
      
      * Remove `withAnalytics` entities helper
      
      * Remove `trackLoginSSO`
      
      * Remove auth trackers
      
      * Remove permissions trackers
      
      * Remove performance trackers
      
      * Remove settings trackers
      
      * Remove pulse trackers
      
      * Remove undo trackers
      
      * Remove click actions trackers
      
      * Remove `trackStructEvent`
      
      * Remove GoogleAnalytics from the server security middleware
      
      * Remove GoogleAnalytics from Kondo config
      
      * Fix type failures
      
      * Revert "Remove GoogleAnalytics from Kondo config"
      
      This reverts commit 363557c4.
      Unverified
      2899046d
    • Ryan Laurie's avatar
      Remove unnecessary calls to `/api/collection` (#46752) · c78b46d6
      Ryan Laurie authored
      * use ee api to find custom reports collection
      
      * remove deprecated hook
      
      * fix race condition
      
      * add unit tests
      
      * fix circular dependency
      
      * fix unit tests
      
      * another plugin strategy
      Unverified
      c78b46d6
  13. Aug 14, 2024
  14. Aug 12, 2024
  15. Aug 09, 2024
  16. Aug 06, 2024
  17. Aug 02, 2024
    • Sloan Sparger's avatar
    • Sloan Sparger's avatar
      [Auto Clean-up] Clean-up modal (#44512) · 1d277035
      Sloan Sparger authored
      
      * wip
      
      * moves code to enterprise folder, adds enterprise guards, updates conditionals as to when to show the feature
      
      * impls filter date logic, improves styling, mocks out real endpoint with collection items endpoint, updates table with isLink boolean rath
      er than using custom item renderer, removes dead code
      
      * use the actual url for stale
      
      * so many things... updated design, custom table component, polish, misc. refactors, more correct api typing
      
      * updates to pagination component and reverts some now unused changes to the base items table
      
      * impls pr feedback
      
      * fixes
      
      * fixes failing unit test
      
      * completes pr feedback from raffi
      
      * implements second round of feedback from raffi
      
      * adds tests and couple of small fixes / feedback
      
      * migrate clean up action to enterprise plugin and fix related e2e test, also skip the collection items count query when we do not need the value
      
      * finish main base case e2e test
      
      * clean up helper code for manual testing and add OSS test to make sure feature is not available in OSS
      
      * better handling of min-height on smaller screens
      
      * adds internal undo notification for bulk archiving in the clean up modal
      
      * reset pagination when items are archived/unarchived to keep users from getting stuck on a page beyond the current view
      
      * pr feedback
      
      * further cleanup
      
      * unit test fix
      
      * fixes issue where archiving all items in the modal and then undoing does not result in the stale items list getting refetched
      
      ---------
      
      Co-authored-by: default avatarJohn Swanson <john.swanson@metabase.com>
      Unverified
      1d277035
    • Ryan Laurie's avatar
      Properly handle SMTP Settings environment variables (#46302) · 1c7de429
      Ryan Laurie authored
      * properly handle SMTP environment variables
      
      * disable clear button when set by env var
      
      * allow the SMTP form to validate with any combination of environment variables
      
      * add unit tests for SMTP connection form
      
      * BONUS: fix console error for jt keys
      
      * fix types
      Unverified
      1c7de429
  18. Jul 31, 2024
  19. Jul 25, 2024
  20. Jul 23, 2024
  21. Jul 19, 2024
  22. Jul 16, 2024
    • Nicolò Pretto's avatar
      Embed pdf export - MS2 (#44463) · f4d1d873
      Nicolò Pretto authored
      
      * add pdf export button to static embed and public sharing (#43743)
      
      * add export button to embed frame, it works on static embed and public sharing
      
      * move css around to make dashcard border show up on static/public embed pdf exports
      the library we use to render an html node to an image doesn't seem to support box shadow
      the original fix was done in ParametersAndCardsContainer, but that component is not used in the static/public embeds
      
      * fix types
      
      * fix night theme pdf export
      - use padding for the title instead of starting to draw the image from 60px, to keep the bg color
      - change the css to also apply the bg-color to the first child of the EmbedFrame, to make it work when exporting to pdfs, where the EmbedFrame is not part of the exported dom
      
      * refactor: exportTabAsPdfButtonText function
      
      * give a default to the filename, even though it should always be there
      
      * exportTabAsPdfButtonText -> getExportTabAsPdfButtonText
      
      * introduce .WithThemeBackground to not have a css rule too much generic
      
      * feat: adds endpoint to download results of a dashcard part of a public dashboard (#44156)
      
      * Flag to hide download buttons (#44206)
      
      * pass down downloadsEnabled to hide downloads buttons in public and embedded questions or dashcards
      
      * Update frontend/src/metabase/dashboard/components/DashCard/DashCardMenu/DashCardMenu.tsx
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      
      * PLUGIN_DOWNLOADS_ENABLED -> PLUGIN_RESOURCE_DOWNLOADS
      
      * adds comment to areDownloadsEnabled function to explain what it does
      
      ---------
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      
      * logic to handle downloads url parameter (#44363)
      
      * minimal support for downloads url parameter
      
      * updates StaticEmbedSetupPane test to epxect downloads=false instead of hide_download_button=true
      
      * fix prettier mistakes
      
      * tmp fix to the tests until we have the new analytics events
      
      * fix eslint issues
      
      * update embedding snippets e2e
      
      * update embedding questions e2e
      
      * try to clean up the mess of downloads/downloadsEnabled
      
      * adds `hasPremiumFeature` check to the plugin, adds unit test for the logic
      
      * adds TODOS for analytics
      
      * unit tests for downloads flag (#45178)
      
      * fix download pdf button not showing up when titled=false and there's only one tab
      
      * unit tests for downloads flag on dashboards and questions
      
      * adds test about the container id, not sure if we should keep it
      
      * adds a comment to explain why we enable premium features in the tests
      
      * move downloadsEnabled outside of the Boolean cast as it's already a boolean
      
      * E2E tests for public/static downloads (#45240)
      
      * wip e2e tests
      
      * make downloadUtils ts friendly
      
      * assertNotEmpty function
      
      * adds tests for public questions
      
      * e2e tests for static embed downloads
      
      * publicUid -> publicUuid
      
      * fix assertNotEmpty
      
      * fix parameter not renamed
      
      * Apply suggestions from code review
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      * remove duplicated test
      
      * fix another typo i forgot to rename
      
      * fix another rename issue
      
      * convert e2e-downloads-helpers to ts
      
      * refactor: put method calculation in getEndpoint function
      
      * adds note to downloadUtils
      
      ---------
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      * Update e2e/test/scenarios/embedding/embedding-snippets.cy.spec.js
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      
      * change requires to import to reflect that we changed to export the source code in downloadUtils
      
      * makes downloadsEnabled prop more consistent across components
      
      * colocate downloadsEnabled with hideDownloadButton in embed-display-options
      
      * defaults displayOptions.downloads to true to simplify logic
      
      * remove unused queryString parameter in tests setup function
      
      * reword TODO
      
      * Revert "defaults displayOptions.downloads to true to simplify logic"
      
      This reverts commit aebf4cf3cf3528deefb9c40dfc48d2f39a278b97.
      
      * fix png export when on dark theme (public/embed) not having the dark … (#45497)
      
      * fix png export when on dark theme (public/embed) not having the dark background
      
      * move the border-radius fix for the dashcard export to saveChartImage
      
      * remove comments
      
      ---------
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      Unverified
      f4d1d873
  23. Jul 15, 2024
  24. Jul 05, 2024
Loading