Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Dec 17, 2024
  2. Dec 13, 2024
  3. Dec 12, 2024
  4. Dec 09, 2024
  5. Dec 05, 2024
    • github-automation-metabase's avatar
      New and improved Examples collection (#50829) (#50968) · 5fd36b24
      github-automation-metabase authored
      
      * fix the script, and add the new edn
      
      * make the migrations run in the proper order
      
      * it works (needs cleanup)
      
      * remove broken binning
      
      - These bins rely on fingerprinting for the custom Age column
      
      - The fingerprinting for that custom column are not properly exported in
      serialization, hence do not get loaded into metabase, causing binning by
      Age to fail.
      
      * cleanup / linting
      
      * cleanup
      
      * update migration test ids to test
      
      * realign test name to check for to see if sample content was created
      
      * remove Product collection + move Examples into root
      
      * update collection_ids for the content too
      
      * remove click behavior for 'Revenue goal for this quarter'
      
      * Apply suggestions from code review
      
      
      
      * for the sample collection is_sample should be true
      
      * Drop CreateInternalUserNoOp
      
      * typo
      
      * update migration comments
      
      * 2 small fixes
      
      * fix data perms for example coll
      
      * add a comment so we don't have 2 blank lines in a row
      
      ---------
      
      Co-authored-by: default avatarbryan <bryan.maass@gmail.com>
      Co-authored-by: default avatarChris Truter <crisptrutski@users.noreply.github.com>
      5fd36b24
  6. Dec 03, 2024
    • github-automation-metabase's avatar
      Onboarding checklist - misc. follow ups (#50579) (#50812) · 22373dcd
      github-automation-metabase authored
      
      * Fix the help link
      
      * Update data stack image
      
      * Fix the link appearance
      
      Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
      22373dcd
    • github-automation-metabase's avatar
      fix(sdk): introduce `.mb-wrapper` to scope down our css (#50466) (#50791) · d8adb559
      github-automation-metabase authored
      
      * add tests for css rules not scoped to the sdk
      
      * fix(sdk): adds mb-wrapper class and scope css to it
      
      * fix typo
      
      * add .mb-wrapper to the body on storybook
      diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
      index 52a0d45125d..a4b3a86f4a5 100644
      --- a/.storybook/preview.tsx
      +++ b/.storybook/preview.tsx
      @@ -42,15 +42,20 @@ const globalStyles = css`
       export const decorators = isEmbeddingSDK
         ? [] // No decorators for Embedding SDK stories, as we want to simulate real use cases
         : [
      -      renderStory => (
      -        <EmotionCacheProvider>
      -          <ThemeProvider>
      -            <Global styles={globalStyles} />
      -            <CssVariables />
      -            {renderStory()}
      -          </ThemeProvider>
      -        </EmotionCacheProvider>
      -      ),
      +      renderStory => {
      +        if (!document.body.classList.contains("mb-wrapper")) {
      +          document.body.classList.add("mb-wrapper");
      +        }
      +        return (
      +          <EmotionCacheProvider>
      +            <ThemeProvider>
      +              <Global styles={globalStyles} />
      +              <CssVariables />
      +              {renderStory()}
      +            </ThemeProvider>
      +          </EmotionCacheProvider>
      +        );
      +      },
           ];
      
       function CssVariables() {
      
      Co-authored-by: default avatarNicolò Pretto <info@npretto.com>
      d8adb559
  7. Nov 26, 2024
  8. Nov 22, 2024
    • Kamil Mielnik's avatar
      [Epic] Show columns from all stages in the dashboard filters (#47167) · 66948709
      Kamil Mielnik authored
      
      * FE - Allow to use in dashboard filters both pre- and post- last aggregation columns (#46670)
      
      * Extract getFilterStageIndexes
      
      * Update comment
      
      * Include 2 last stages in filterable columns in getParameterColumns
      
      * Move getJoinQueryHelpers to test-helpers
      
      * Add basic query creation
      
      * Add breakout columns
      
      * Make tableName optional
      
      * Implement 1-stage test, refactor assertions
      
      * Rename
      
      * Move filter utils up
      
      * Use getGroupItems and appendStageIfAggregated in getFilterableColums
      
      * Introduce Lib.filterGroups
      
      * Revert "Introduce Lib.filterGroups"
      
      This reverts commit 5f8b2d09.
      
      * Don't reuse getGroupItems or appendStageIfAggregated
      
      * Move getFilterStageIndexes out of Lib
      
      * Format code
      
      * Revert types move
      
      * Revert functions move
      
      * Improve diff
      
      * Group dashcard mapping options
      
      * Adjust existing getParameterColumns usages (except unit tests)
      
      * Remove redundant call
      
      * Fix filtering
      
      * Update unit tests
      
      * Format code, remove TODO
      
      * Add stage index assertions
      
      * Add model test for 1-stage query
      
      * Add partial boilerplate for 2-stage query
      
      * Add a 2-stage case
      
      * Add a 2-stage case for model
      
      * Update unit test
      
      * Fix click behavior mapping
      
      * Remove duplicated functions
      
      * Remove complex return type
      
      * Move appendStageIfAggregated and getFilterStageIndexes to metabase-lib/filter.ts
      
      * Re-group columns based on stage index instead of using ML-returned references for comparison
      
      * Add new options to dimension types
      
      * Use the new stage-number option
      
      * Rename appendStageIfSummarized to ensureFilterStage and add explanatory comment
      
      * Remove duplicated ensureFilterStage after merge
      
      * FE - e2e - Cover dashboard filters with tests (#46958)
      
      * Extract getFilterStageIndexes
      
      * Update comment
      
      * Include 2 last stages in filterable columns in getParameterColumns
      
      * Move getJoinQueryHelpers to test-helpers
      
      * Add basic query creation
      
      * Add breakout columns
      
      * Make tableName optional
      
      * Implement 1-stage test, refactor assertions
      
      * Rename
      
      * Move filter utils up
      
      * Use getGroupItems and appendStageIfAggregated in getFilterableColums
      
      * Introduce Lib.filterGroups
      
      * Revert "Introduce Lib.filterGroups"
      
      This reverts commit 5f8b2d09.
      
      * Don't reuse getGroupItems or appendStageIfAggregated
      
      * Move getFilterStageIndexes out of Lib
      
      * Format code
      
      * Revert types move
      
      * Revert functions move
      
      * Improve diff
      
      * Group dashcard mapping options
      
      * Adjust existing getParameterColumns usages (except unit tests)
      
      * Remove redundant call
      
      * Fix filtering
      
      * Update unit tests
      
      * Format code, remove TODO
      
      * Add stage index assertions
      
      * Add model test for 1-stage query
      
      * Add partial boilerplate for 2-stage query
      
      * Add a 2-stage case
      
      * Add a 2-stage case for model
      
      * Update unit test
      
      * Fix click behavior mapping
      
      * Remove duplicated functions
      
      * Remove complex return type
      
      * Remove unused @ts-expect-error directive
      - use createQuestionAndDashboard helper instead of command
      - sort imports
      
      * Add boilerplate for query stages test suite
      
      * Add createDashboard
      
      * Try out the new function
      
      * Organize code
      
      * Add descriptions
      
      * Move visitDashboard call out of createDashboard
      
      * Move appendStageIfAggregated and getFilterStageIndexes to metabase-lib/filter.ts
      
      * Re-group columns based on stage index instead of using ML-returned references for comparison
      
      * Add boilerplate for base questions
      
      * Add assertions for mapping options
      
      * Simplify verifyDashcardMappingOptions interface
      
      * Add assertions for all types of parameters
      
      * Update test name
      
      * Format code
      
      * Add new options to dimension types
      
      * Use the new stage-number option
      
      * Add Q2 creation
      
      * Introduce helper constants
      
      * Rename appendStageIfSummarized to ensureFilterStage and add explanatory comment
      
      * Add cases for models
      
      * Extract subroutines
      
      * Add Q3
      
      * Extract createQ2Query and createQ3Query
      
      * Extract createQ1uery, remove createM1
      
      * Optimize verifyPopoverMappingOptions
      
      * Add more assertions
      
      * Add model assertions
      
      * Add tooltip assertion
      
      * Break large functions down
      
      * Restructure tests to prevent memory-related crashes
      
      * Refactor
      
      * Update comment
      
      * Update comment
      
      * Remove createQ1
      
      * Remove createQ2, createQ3
      
      * Refactor
      
      * Refactor
      
      * Comment out failing assertions
      
      * Add Q3 assertions
      
      * Add Q3 assertions
      
      * Add comment
      
      * Introduce createAndVisitDashboardWithQueryMatrix
      
      * Add Q4
      
      * Fix assertions
      
      * Add repro tags
      
      * Add comment
      
      * De-hardcode indexes
      
      * Add Q5-Q8
      
      * Rename
      
      * Add Q5
      
      * Add Q6
      
      * Add Q7 & Q8
      
      * Add Q9
      
      * Fix structure
      
      * Reuse Lib.ensureFilterStage
      
      * Fix unit of time parameters
      
      * Support explicit and implicit stage numbers for temporal-unit params
      
      * Extend test with temporal unit parameter with stage number
      
      * Update unit tests
      
      * Let stage-path handle nil (default) stage-number
      
      ---------
      
      Co-authored-by: default avatarTamás Benkő <tamas@metabase.com>
      
      * Allow filtering on columns from all stages in dashboards (#48254)
      
      * Allow filtering on columns from all stages in dashboards
      
      * Update tests
      
      * Clean up
      
      * Update unit tests
      
      * Distinguish multiple "Summaries" column groups in dashboard filter mapping (#48261)
      
      * Allow filtering on columns from all stages in dashboards
      
      * Update tests
      
      * Clean up
      
      * Update unit tests
      
      * Distinguish multiple "Summaries" column groups
      
      * Fix imports
      
      * Remove redundant attribute
      
      * Update import
      
      * Allow filter params targeting native stages (#48379)
      
      * Move filters on nested native stages to parent stage in expand-mbql-params
      
      Similar to the existing handling in move-join-condition-to-source-query.
      
      This fixes filter params that directly target a native stage with a non-negative :stage-number, e.g. when applying
      dashboard filters to a card where the card query is native.
      
      Fixes #48258
      
      * Add test for filter params explicitly targeting nested native queries
      
      * FE - e2e - Cover dashboard drills with tests (#48289)
      
      * Allow filtering on columns from all stages in dashboards
      
      * Update tests
      
      * Clean up
      
      * Update unit tests
      
      * Distinguish multiple "Summaries" column groups
      
      * Fix imports
      
      * Remove redundant attribute
      
      * Fix type
      
      * Add a test
      
      * Add a test
      
      * Reduce flakiness
      
      * Fix race conditions with last_used_param_values
      - see https://metaboat.slack.com/archives/C010L1Z4F9S/p1727947712609579
      
      * Add a temporary workaround
      
      * Fix name
      
      * Fix applying parameters in Question
      
      * Revert "Fix type"
      
      This reverts commit 67f6778d.
      
      * Rename and reorder tests
      
      * Add more tests
      
      * Update tests to avoid hitting https://github.com/metabase/metabase/issues/46774
      
      * Add Q8 tests and fix tests for Q9
      
      * Update assertions
      
      * Update assertions because of https://github.com/metabase/metabase/issues/48339
      
      * Improve test names
      
      * Add test
      
      * Skip failing test
      
      * Add more tests
      
      * Add test
      
      * Remove redundant code
      
      * Remove invalid cases
      
      * Add test
      
      * Add tests
      
      * Add more assertions
      
      * Add more assertions
      
      * Add assertions
      
      * Add assertions
      
      * Use helper functions
      
      * Use helper functions
      
      * Nest helpers consistently throughout the file
      
      * Decrease flakiness
      
      * Revert "Add a temporary workaround"
      
      This reverts commit 48ed8770.
      
      * Add a temporary workaround
      
      * Add tests
      
      * Add assertions
      
      * Add tests
      
      * Update unit tests
      
      * Make temporary workaround safer
      
      * Add TODOs to github links
      
      * Extract a function to improve readability
      
      * Simplify getParametersMappedToDashcard
      
      * Fix failing tests by calling Lib.ensureFilterStage in the correct place and properly identifying the originalQuestion so that Question.prototype.isDirtyComparedTo returns expected result
      
      * Remove redundant code
      
      * Quick dirty fix to run in CI
      
      * Format code
      
      * Format code
      
      * Update unit tests
      
      * Fix test setup
      
      * Revert "Remove redundant code"
      
      This reverts commit 35b47a10.
      
      * Use Lib.areLegacyQueriesEqual
      
      * Create a new e2e test group: dashboard-filters-2 (#48610)
      
      * Allow filtering on columns from all stages in dashboards
      
      * Update tests
      
      * Clean up
      
      * Update unit tests
      
      * Distinguish multiple "Summaries" column groups
      
      * Fix imports
      
      * Remove redundant attribute
      
      * Fix type
      
      * Add a test
      
      * Add a test
      
      * Reduce flakiness
      
      * Fix race conditions with last_used_param_values
      - see https://metaboat.slack.com/archives/C010L1Z4F9S/p1727947712609579
      
      * Add a temporary workaround
      
      * Fix name
      
      * Fix applying parameters in Question
      
      * Revert "Fix type"
      
      This reverts commit 67f6778d.
      
      * Rename and reorder tests
      
      * Add more tests
      
      * Update tests to avoid hitting https://github.com/metabase/metabase/issues/46774
      
      * Add Q8 tests and fix tests for Q9
      
      * Update assertions
      
      * Update assertions because of https://github.com/metabase/metabase/issues/48339
      
      
      
      * Improve test names
      
      * Add test
      
      * Skip failing test
      
      * Add more tests
      
      * Add test
      
      * Remove redundant code
      
      * Remove invalid cases
      
      * Add test
      
      * Add tests
      
      * Add more assertions
      
      * Add more assertions
      
      * Add assertions
      
      * Add assertions
      
      * Use helper functions
      
      * Use helper functions
      
      * Nest helpers consistently throughout the file
      
      * Decrease flakiness
      
      * Revert "Add a temporary workaround"
      
      This reverts commit 48ed8770.
      
      * Add a temporary workaround
      
      * Add tests
      
      * Add assertions
      
      * Add tests
      
      * Update unit tests
      
      * Make temporary workaround safer
      
      * Add TODOs to github links
      
      * Extract a function to improve readability
      
      * Simplify getParametersMappedToDashcard
      
      * Fix failing tests by calling Lib.ensureFilterStage in the correct place and properly identifying the originalQuestion so that Question.prototype.isDirtyComparedTo returns expected result
      
      * Remove redundant code
      
      * Quick dirty fix to run in CI
      
      * Format code
      
      * Format code
      
      * Update unit tests
      
      * Fix test setup
      
      * Create a new e2e test group because the old one was timing out in CI
      
      * Add the group to GH action
      
      * Revert "Remove redundant code"
      
      This reverts commit 35b47a10.
      
      * Use Lib.areLegacyQueriesEqual
      
      * FE - e2e - Cover combination of unit of time parameter + non-last-stage filters with tests (#48726)
      
      * Add JSDoc for entityPickerModalItem
      
      * Add addToDashboard parameter to saveQuestion
      
      * Add JSDoc for saveQuestion
      
      * Fix import
      
      * Add a test reproducing the bug
      
      * Try to fix unit of time parameters
      
      * Fix wrong stage-index for temporal unit parameters on composed ad hoc questions
      
      * Fix ad-hoc question naming when there is an empty extra filter stage
      
      * Fix unit tests
      
      * FE - Do not add extra filtering stage for pivot tables (#48975)
      
      * Avoid using Lib.ensureFilterStage for pivoted questions
      
      * Fix unit test setup
      
      * Add tests for pivot tables
      
      * Optimize tests
      
      * Test filter modal
      
      * Revert redundant changes
      
      * [WIP] Dashboard filter columns be fixes (#48906)
      
      * Revert "Add a temporary workaround"
      
      This reverts commit 4ea37487.
      
      * Fix some of the issues and unskip some of the E2E tests
      
      * Acknowledge that metrics are transparent
      
      * Fix breakouts by the same column with different temporal-units
      
      * Use non-negative stageIndex for temporal unit parameters
      
      * Add stage if there is an explicit reference to stage after the last
      
      Instead of duplicating the ensure-filter-stage logic, just check if there is a parameter referencing the filter
      stage (which is always one after the last in the query). If there is such a reference, add that stage.
      
      ---------
      
      Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
      
      * Require only breakouts when adding new stage in ensure-filter-stage (#49067)
      
      * Only require breakouts when adding new stage in ensure-filter-stage
      
      Previously, this function required both breakouts and aggregations.
      
      Closes #48339
      
      * Update e2e tests after changes to Lib.ensureFilterStage
      
      This resolves all-but-one of the TODOs related to #49339
      
      Related to #49022
      
      * Implementing parameter_mappings migration (#49256)
      
      * FE - e2e - Update tests after `Lib.ensureFilterStage` changes (#49222)
      
      * Unskip #19744 repro
      
      * Remove sanity checks
      
      * Update comment
      
      * Fix typo
      
      * Remove invalid test
      
      * Ignore pivoted "table" viz and and inline Question.prototype.isPivoted
      
      * Remove test for pivoted table
      
      * FE - e2e - Click behavior (#49239)
      
      * Unskip #19744 repro
      
      * Remove sanity checks
      
      * Update comment
      
      * Fix typo
      
      * Remove invalid test
      
      * Ignore pivoted "table" viz and and inline Question.prototype.isPivoted
      
      * Remove test for pivoted table
      
      * Add a test
      
      * Disable columns from non-last stage in click behavior
      
      * Finish the test
      
      * Refactor
      
      * FE - e2e - Cover public & embedded dashboards with tests  (#49280)
      
      * Add test for public dashboard
      
      * Add test for embedded dashboard
      
      * Add comment
      
      * Add test for 2nd stage column
      
      * Add test for 2nd stage aggregation column
      
      * Add test for 2nd stage breakout column
      
      * Add assertions for models
      
      * Handle no auto-pivoting of ad-hoc questions from drill thrus
      
      ---------
      
      Co-authored-by: default avatarAlexander Polyankin <alexander.polyankin@metabase.com>
      
      * Add missing test setup
      
      * Address some review comments (#49429)
      
      * FE - Show columns from all stages in click behavior (target question)  (#48828)
      
      * Add JSDoc for entityPickerModalItem
      
      * Add addToDashboard parameter to saveQuestion
      
      * Add JSDoc for saveQuestion
      
      * Fix import
      
      * Add a test reproducing the bug
      
      * Try to fix unit of time parameters
      
      * Fix wrong stage-index for temporal unit parameters on composed ad hoc questions
      
      * Fix ad-hoc question naming when there is an empty extra filter stage
      
      * Fix unit tests
      
      * Fix non-unique keys
      
      * Add stage-number to click behavior dimension target
      
      * Call Lib.ensureFilteringStage in click behavior
      
      * Use describeEE because click behavior tests use setTokenFeatures("all")
      
      * Stop testing implementation details
      
      * Stop testing implementation details
      
      * Stop testing implementation details
      
      * Modernize test and make it less flaky
      
      * Address flake source
      
      * Fix SAMPLE_DB_ID
      
      * Unskip repro for #19744
      
      * Add a test
      
      * Update test name
      
      * Introduce verifyNotebookQuery
      
      * Use verifyNotebookQuery
      
      * Use verifyNotebookQuery
      
      * Move verifyNotebookQuery to helpers
      
      * Assert items count in verifyNotebookQuery
      
      * Extract helper functions
      
      * Rename helpers
      
      * Refactor
      
      * Consistent comments
      
      * Extract verifyVizTypeIsLine
      
      * Add scrollIntoView calls for extra safety
      
      * Add TODO
      
      * Use verifyNotebookQuery
      
      * Make stages optional
      
      * Add createMultiStageQuery
      
      * Remove redundant scrollIntoView calls
      - We don't need them because the assertions are not using "be.visible"
      
      * Improve test setup
      
      * Add more assertions
      
      * Add more assertions
      
      * Add basic join support to verifyNotebookJoins
      
      * Unnest code
      
      * Implement join assertions
      
      * Implement expressions and sort assertions
      
      * Simplify code
      
      * Add commented-out assertions
      
      * Yes, it is correct
      - it's stageIndex which sourceColumn comes from in sourceQuery
      
      * Conditionally apply filter stage
      
      * Allow mapping to all stages in click behavior
      
      * Remove redundant argument
      
      * Simplify diff
      
      * Simplify diff
      
      * Update test setup
      
      * Remove TODO related to metabase#49282
      - Closes #49282
      
      * Support fetching param values on filter stage (#50120)
      
      * Support fetching param values on filter stage
      
      Fixes #48613
      
      * Fix temporal-unit-parameters
      
      * Enrich dimension targets in click_behavior with stage-numbers (#49911)
      
      * Enrich dimension targets in click_behavior with stage-numbers
      
      Fixes #49110
      
      * Add missing stage-number
      
      * Remove changeSynchronousBatchUpdateSetting references
      
      * Update assertions to include time bucket
      
      * Use mbql.u/legacy-last-stage-number in metabase.query-processor.card
      
      ---------
      
      Co-authored-by: default avatarTamás Benkő <tamas@metabase.com>
      Co-authored-by: default avatarappleby <86076+appleby@users.noreply.github.com>
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Co-authored-by: default avatarAlexander Polyankin <alexander.polyankin@metabase.com>
      66948709
  9. Nov 21, 2024
    • John Swanson's avatar
      Fix broken migration on MySQL 8.0.17 (#50350) · 401d7dbc
      John Swanson authored
      On MySQL 8.0.17, the following is prohibited:
      
      ```
      WITH RECURSIVE MyRecursiveCTE (...) AS
      (
        SELECT ... FROM bar UNION ALL
        SELECT ... FROM bar JOIN MyRecursiveCTE ON ...
      )
      ```
      
      Instead, you need to do:
      
      ```
      WITH RECURSIVE MyRecursiveCTE (...) AS
      (
        SELECT ... FROM bar UNION ALL
        SELECT ... FROM MyRecursiveCTE JOIN bar ON ...
      )
      ```
      
      Basically, just putting the CTE on the left vs. the right side of the
      join (which is exactly equivalent under the hood) fixes the issue.
      
      I can't actually find any documentation of this change, but it seems
      that sometime between MySQL 8.0.17 and MySQL 8.0.33, MySQL started
      allowing this, perhaps just an optimization where it now notices the
      equivalence and does the right thing.
      
      I originally tested this on what I believed was the oldest version of
      MySQL we supported, but didn't read carefully enough. We recommend
      8.0.33 or higher here:
      
      https://www.metabase.com/docs/latest/databases/connections/mysql
      
      But that's not for the AppDB - for that, we recommend 8.0.17 or higher.
      401d7dbc
  10. Nov 18, 2024
  11. Nov 11, 2024
  12. Oct 28, 2024
    • Nemanja Glumac's avatar
      Better Onboarding: Introduce "Admin onboarding checklist" (#48898) · b35755f9
      Nemanja Glumac authored
      * Add new route
      
      * Add the navigation link
      
      * Guard the route
      
      * Add first pass of the page structure
      
      * Add the bottom section
      
      * Add placeholder dummy YT videos
      
      * Add images
      
      * Track checklist being opened
      
      * Track checklist item expanded
      
      * Track checklist item CTA clicked
      
      * PoC: Stop the video on accordion change
      
      * Use actual onboarding videos
      
      * Fix missing unique `key` prop
      
      * Final content tweaks
      
      * Override the accordion styles defined in the `theme`
      
      * Use predefined t-shirt sizes where possible
      
      * Update copy
      
      * Conditionally display the example dashboard CTA
      
      * Add very basic unit test coverage
      
      * Show onboarding link to new instances only
      
      * Remember the last position in the onboarding
      
      * Fix the mock settings types
      
      * Scroll last opened item into view
      
      * Properly display docs links
      
      * Another accordion style override
      
      * Add tests for the Onboarding page contents
      
      * Add E2E Snowplow tests
      
      * Conditionally display xray item contents based on settings
      
      * Split tests
      
      * Make sure items scroll into view when expanded
      
      * Do not show example question CTA if example dashboard doesn't exist
      
      * Allow YT videos to play in fullscreen
      
      * Add comments about the example question
      
      * Update rules for when we show the onboarding nav link
      
      * Test the conditional documentation links display
      
      * Reduce E2E test flakiness
      b35755f9
  13. Oct 25, 2024
  14. Oct 24, 2024
  15. Oct 23, 2024
    • Nicolò Pretto's avatar
      embedding homepage v2 (#49027) · 5d81bdc4
      Nicolò Pretto authored
      * ui implementation of new emb homepage, tests will come later
      
      * change padding of the last card to be consistent with the top one
      
      * update beta badge spacing
      
      * update tests
      
      * fix stories type error
      
      * use quick-start for url
      
      * update HomeContent tests
      
      * update events + related e2e
      
      * Update frontend/src/metabase/home/components/EmbedHomepage/StaticEmbedContent.tsx
      5d81bdc4
  16. Oct 22, 2024
  17. Oct 16, 2024
  18. Oct 15, 2024
    • Raphael Krut-Landau's avatar
    • adam-james's avatar
      Incremental Pivot Processing for Exports (#46995) · 8d52a03f
      adam-james authored
      
      * Incremental Pivot Processing for Exports
      
      WIP
      
      Fixes pivot exports for CSV and xlsx.
      
      The CSV export should use less memory by incrementally building up the data structure and aggregating necessary row
      data right away, so the memory overhead becomes only as large as the total pivot result.
      
      In cases where the pivot rows/cols do combine into many many columns and rows, this can still be a large set of data,
      but it should behave much better now in most cases.
      
      The Excel export is a little more straightforward: create the export rows in the same fashion, streaming one row at a
      time, and just post-process the sheet to add the pivot table in one shot at the end.
      
      * WIP adding row totals.
      
      * aggregate totals as rows are added
      
      Row, column, section, and grand totals are all aggregated as each row is added.
      This means the final step of building pivot output becomes just an exercise of lookups/arrangement, no further
      aggregation is needed.
      
      * CSV pivot works per-row, export respects formatting
      
      This is a big step forward; we don't need to hold the entire dataset in memory, we instead aggregate a row's data into
      the pivot datastructure, which only holds onto:
      
      - unique values for each pivot-row in a sorted set
      - unique values for each pivot-col in a sorted set
      - grand total for each measure N values, where N is number of measures, ususally 1 or 2
      - row totals for each combination of each pivot-row * N measures
      - col totals for each combination of each pivot-col * N measures
      - totals for each 'section', determined by unique values of first pivot-row * N measures
      - values for each measure in every 'cell'; Row Combos * Col Combos * N Measures
      
      So, there can still be a decent amount of data to store; but it will never hold onto all of the 'raw rows' from the
      dataset.
      
      We can never completely guarantee that Row Combos * Col Combos * N Measures remains small, but two things let us move
      forward anyway:
      
      - there's now visible feedback in the app that the download is running (or if it's failed)
      - Pivot table utility diminishes rapidly with huge output anyway; users still need to curate/set up their data
      - effectively to improve the table's utility, so we can assume that a slow-to-download pivot table is also slow to
      - use/less effective, and will likely be something the user doesn't want (as often).
      
      * some test fixes
      
      * now, if we export 'raw pivot rows', they don't show pivot-grouping
      
      and they also don't include the 'extra' rows for totals/subtotals/grand totals (any row with pivot-grouping > 0).
      
      This means that now the non-pivot version of a pivot table export will match what a user sees if they change the viz
      to a regular table.
      
      * remove old test
      
      * re-incorporate some changes from master
      
      * fix csv for non-pivots due to oversight in my changes
      
      This is just a temporary change, I think I should clean up this bit of the code a little, I can probably make it a
      little more readable and use some cleaner logic regarding if the rows are 'raw pivot rows' or not.
      
      * start moving format_rows to POST bod, add pivot_results too
      
      There's still wiring work to do, but this starts to add format_rows and pivot_results to POST body for the various API
      endpoints. Also modify tests to improve coverage/consistency across downloads and alerts/subscriptions.
      
      The tests will not pass on this commit, but fixes will be incoming
      
      * native pivot tables in xlsx
      
      * add precondition to pass migration linter
      
      * try to get migrations fixed
      
      * pasing pivot-results through api and attachments
      
      * fix tests for format_rows in BODY vs query param
      
      * tests!
      
      * might have the tests all fixed now
      
      * the pivoted export now respects col/row totals settings
      
      * add test coverage for public questions and dashboards
      
      * col and row totals work as expected
      
      * build-pivot refactor for clarity
      
      * docstring change + tiny refactor in helper fn
      
      * see if dashcard download works with format_rows
      
      * csv pivot handles nil values
      
      * pass format_rows and pivot_results in :params not :body
      
      * fix some other tests
      
      * pivot-grouping col filtered out of xlsx
      
      * pivot-grouping-col removed for all rows
      
      * configurable pivot exports and attachments (#47880)
      
      * exports fe
      
      * specs
      
      * ui
      
      * specs
      
      * format/unformatted now works for xlsx
      
      * format test changes for xlsx formatting
      
      * embedding endpoints accept pivot_results
      
      * cljfmt and eslint fix
      
      * empty
      
      * embedding test should have formatting defaulted to true
      
      * embed test fixes
      
      * Use `Chip` for export settings widget
      
      * downloads e2e test fix
      
      * fix public download limit test
      
      * public card download defaults
      
      * fix public download defaults in some tests
      
      * Fix visual test
      
      ---------
      
      Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@users.noreply.github.com>
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      8d52a03f
  19. Oct 14, 2024
    • Ngoc Khuat's avatar
      [Notification] Migrate emails (#48392) · a1d8face
      Ngoc Khuat authored
      * [Notification] Migrate user invited email (#48215)
      
      * [Notification] Migrate alert create email (#48292)
      
      * [Notification] Migrate slack token error email (#48333)
      a1d8face
  20. Oct 10, 2024
    • Ngoc Khuat's avatar
      [Notification] System event notification (#47857) · fc43d3cd
      Ngoc Khuat authored
      * [Notification] Notification and subscription (#47707)
      
      * [Notification] Notification and subscription (#47707)
      
      * [Notification] Handlers + recipients (#47759)
      
      * [Notification] Channel template table and model (#47782)
      
      * [Notification] Render system event emails (#47859)
      
      * [Notification] Strict type for channel template and notification recipient (#47910)
      
      * [Notification] Event hydration (#47953)
      
      * [Notification] Send asynchronously (#48200)
      fc43d3cd
  21. Oct 08, 2024
  22. Oct 03, 2024
  23. Sep 30, 2024
  24. Sep 11, 2024
    • John Swanson's avatar
      Fix some minor collections issues (#47472) · 0c4a3f8a
      John Swanson authored
      * Fix some minor collections issues
      
      - explicitly provide access to the trash to all users, in the same way
      we provide access to personal collections. Due to migration order, we
      don't necessarily have a permissions row with the correct `perm_type`,
      `perm_value`, and `collection_id` for the Trash collection. That's ok -
      we don't actually move things to the Trash, so there isn't any
      item where `collection_id=$trash.id` - but this may affect things like
      effective ancestors for children of the trash. Let's be explicit about
      the permissions that users have.
      
      - replace a case where we manually calculated effective location and
      then got the parent_id with just hydrating `:effective_parent`. This is
      more efficient.
      
      - replace the simple hydration method for `effective-location-path` with
      a batched hydration method that fetches `visible-collection-ids` *once*
      and then uses it to figure out the effective location path for each
      collection passed.
      0c4a3f8a
  25. Sep 09, 2024
    • Romeo Van Snick's avatar
      Browse metrics page (#47277) · d566fae9
      Romeo Van Snick authored
      
      * Add custom image for empty metrics
      
      * Add useFetchMetrics helper
      
      * Copy browse models page to metrics page
      
      * Add route for browse metrics page
      
      * Add useHasMetrics hook
      
      * Add link to browse metrics page to the sidebar
      
      * Simplify MetricsTable component
      
      * Render description markdown in table too
      
      * Add unit tests for browse metrics page
      
      * Remove custom padding
      
      * Fix line height of markdown cell
      
      * Add e2e tests for browse page
      
      * Fix metrics sorting
      
      * Fix types
      
      * Fix column widths and cell padding
      
      * Typo
      
      Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
      
      * Remove name check
      
      * Simplify alphabet
      
      * Remove resetSnowplow
      
      * Use helper to get metric in table
      
      * Use MouseEvent from React directly
      
      * Use --mb-color-icon-primary
      
      * Test ellipsification of description
      
      * Simplify useHasMetrics
      
      * Move useHasMetrics MainNavBar
      
      * Merge sortMetrics and sortModels into sortCards
      
      * Fix metric default description
      
      * Extract SidebarSkeleton to a separate component
      
      * Test sorting via Collection too
      
      * Use ModelTableRow to fix cursor
      
      * Share more components between ModelsTable and MetricsTable
      
      * Use the same simplified structure in ModelsTable as for MetricsTable
      
      * Render block-level elements as inline so ellipsis detection works
      
      * Pick better testid for metric name
      
      * Remove delay
      
      * Avoid type specificty error in sortCards
      
      * Add test for not opening in new tab
      
      * Remove useFetchMetrics defaults
      
      * Fix unit test import
      
      * Test meta-click with cypress
      
      * Add comment on inline markdown elements
      
      * Use model-name test id
      
      * Use correct colors for icon
      
      * Remove delay from browse models page too
      
      * Make meta key in test platform-dependent
      
      * Fix hover color on metrics table
      
      * Add focus styling for celss in the models and metrics table
      
      * Use MarkdownPreview for table cells
      
      * Define --mb-color-icon-primary
      
      * Make the collection link take up the whole height of the cell
      
      * Remove tabIndex from table rows
      
      * Rename ModelsTable.module.css to BrowseTable.module.css
      
      * Rename CardsTable to BrowseTable
      
      * Remove single module.css class in favor of styled components
      
      * Allow customising allowed elements
      
      * Allow forcing all markdown on one line
      
      * Render bold and italics in markdown descriptions and move content onto one line
      
      * Fix legacy tooltip in test
      
      * Make sure getValueForSorting returns a string
      
      * Remove empty file
      
      * Remove icon for metrics in the table
      
      * Remove else statement.
      
      Co-authored-by: default avatarUladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
      
      * Remove async findBy where possible
      
      * Add github issue link for TODO item
      
      * Disambiguate between getMetricDescription type
      
      * Be explicit with sortModelOrMetric
      
      ---------
      
      Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
      Co-authored-by: default avatarUladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
      d566fae9
  26. Sep 04, 2024
  27. Sep 03, 2024
  28. Aug 30, 2024
    • 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>
      d897f201
  29. Aug 29, 2024
    • bryan's avatar
      Realign migration ids (#47367) · 05c2fb22
      bryan authored
      * move migration in release to match master
      
      * add column if not exists
      05c2fb22
    • 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
      592360c9
    • Luiz Arakaki's avatar
      Update instance_analytics for 50 major release (#47323) · bbe366ea
      Luiz Arakaki authored
      This updates the instance analytics YAMLs:
      - v50.22
      - fixes several fk-target-field-id references
      bbe366ea
    • John Swanson's avatar
      Fixup backported migrations (#47398) · b0d9bc53
      John Swanson authored
      These migrations will be backported to v49.
      
      Three changes:
      
      - update IDs/locations of the migrations to v49 vs v51
      
      - add one preCondition (when adding the foreign key constraint)
      
      - add `onFail: MARK_RAN` to the index preconditions. I forgot this
      before, so it blows up when the precondition doesn't hold.
      b0d9bc53
    • dpsutton's avatar
      Increase log level to INFO from error (#47397) · 3f8317ad
      dpsutton authored
      * Increase log level to INFO from error
      
      Closes #47396
      
      logs before:
      ```
      2024-08-29 08:37:03,836 INFO db.liquibase :: Checking if Database has unrun migrations...
      2024-08-29 08:37:04,045 INFO db.liquibase :: Database has unrun migrations. Checking if migration lock is taken...
      2024-08-29 08:37:04,047 INFO db.liquibase :: No migration lock found.
      2024-08-29 08:37:04,047 INFO db.liquibase :: Migration lock acquired.
      2024-08-29 08:37:04,167 INFO db.liquibase :: Running 83 migrations ...
      ```
      
      logs after:
      
      ```
      2024-08-29 08:39:45,019 INFO db.liquibase :: Running 83 migrations ...
      ...
      2024-08-29 08:39:45,166 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:00::calherries ran successfully in 0ms
      2024-08-29 08:39:45,182 INFO liquibase.changelog :: Columns is_defective_duplicate(boolean) added to metabase_field
      2024-08-29 08:39:45,182 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:01::calherries ran successfully in 14ms
      2024-08-29 08:39:45,199 INFO liquibase.changelog :: Custom SQL executed
      2024-08-29 08:39:45,200 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:02::calherries ran successfully in 16ms
      2024-08-29 08:39:45,202 INFO liquibase.changelog :: Foreign key fk_field_parent_ref_field_id dropped
      2024-08-29 08:39:45,202 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:03::calherries ran successfully in 1ms
      2024-08-29 08:39:45,204 INFO liquibase.changelog :: Foreign key constraint added to metabase_field (parent_id)
      2024-08-29 08:39:45,205 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:04::calherries ran successfully in 2ms
      ...
      ```
      
      * empty commit to bump CI
      3f8317ad
    • Ngoc Khuat's avatar
      Fix failed to backfill cache config due to number overflow (#47390) · 9adbbb9a
      Ngoc Khuat authored
      
      * handle cache config overflowed
      
      * fix root too
      
      * do not comment out test
      
      * make cljfmt happy
      
      ---------
      
      Co-authored-by: default avatarAlexander Solovyov <alexander@solovyov.net>
      9adbbb9a
    • Ryan Laurie's avatar
      Add Malay Language Support (#47138) · 9fdc1f9f
      Ryan Laurie authored
      9fdc1f9f
  30. Aug 26, 2024
Loading