Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Apr 16, 2024
    • Denis Berezin's avatar
      Embedding SDK - Fix table header styles calculation (#41449) · caac0cb6
      Denis Berezin authored
      * Fix table styles calculation
      
      * Review fixes
      
      * Fix unit tests
      Unverified
      caac0cb6
    • Braden Shepherdson's avatar
      Use cached Malli validators/explainers; make `:fn` schemas cacheable (#39947) · 8c2c556a
      Braden Shepherdson authored
      This improves our Malli performance substantially! Many of our code paths were calling vanilla `malli.core/validate` or `malli.core/explain`; these redo the (possibly expensive) compilation of the schema into a validator or explainer for every call.
      
      We should use the caching versions in `metabase.util.malli.registry` everywhere, and our runtime performance will be much improved.
      
      However when I started using these cached versions, I found that the memory use was growing out of control. Eventually I tracked this down to `:fn` schemas. Functions are only comparable by pointer equality, so they make poor cache keys. `(fn ...)` or `comp` calls in a schema on a `mu/defn` function **get re-created for every call of the `mu/defn`'d function**! That's a big time sink recompiling the schemas if we're *not* caching, and a huge memory sink if we *are* caching!
      
      This PR pulls every such schema I could find out into a `def` so it uses the same closure and is cacheable. I'd like to automate that in some part of the Malli pipeline, or maybe a linter rule, but I haven't found a good way to do it yet.
      
      Part of #39946.
      Unverified
      8c2c556a
    • Nemanja Glumac's avatar
      Re-wire the `Users` entity to use RTK Query under the hood (#41312) · 093308d2
      Nemanja Glumac authored
      * Define the types for the `create` user request
      
      * First draft for the create user API using RTK Query
      
      * Export RTK user API
      
      * Define explicit `create` api for the user entity
      
      * Define `updatePassword` mutation
      
      * Wire users entity `resetPasswordManual` to use RTK under the hood
      
      * Use `updatePassword` mutation
      
      * Wire users list calls
      
      * Remove unused `update_password` from services
      
      * Fix the dispatch used to list users
      
      * Dispatch the action type and the payload
      
      * Wire `deactivateUser` to work with RTK
      
      * Wire `reactivateUser` to work with RTK
      
      * Delete unused entries from `UserApi`
      
      * Convert the reducer to use `switch` statement
      
      * Remove unused user `send_invite` endpoint from FE
      
      * Wire `resetPasswordEmail` in users entity to work with RTK
      
      * Provide cache invalidation for the `userApi`
      
      * Add `provideUserListTags` helper
      
      * Pass `email` as a sole argument
      
      * Throw on `get` a user
      
      This endpoint hasn't been used in a long itme.
      Removed in https://github.com/metabase/metabase/pull/41334/files#diff-241e0afa11f03a0942eb322aa47695e58496379b0b6d42e6e59ecf6a20fe623cL448
      
      * Use RTK Query to `updateUser`
      
      * Fix wrong syntax
      
      * Use RTK Query to `getUser`
      
      It was used by `.load` and `fetch` after all.
      
      * Export `useUpdateUserMutation`
      
      * Refactor `getRecipientsList`
      
      * Fix response type for the `getUser`
      
      * Pass user id as a sole argument instead of in an object
      
      * Fix users entity `get` method
      
      * Fix the user update password form
      
      * Fix unit tests
      
      * Fix deactivate and reactivate query invocations
      
      See e949812.
      
      * Adjust types according to the feedback
      
      * Order utils alphabetically
      
      * Throw on `delete`
      
      * Revert "Fix unit tests"
      
      This reverts commit 2c329e836427010ad08bfd0511eb1a9df4ba95d6.
      
      * Fix FE unit test mocks
      
      * Rename imports to use plural for consistency
      
      * Fix one last remaining FE unit test
      Unverified
      093308d2
  2. Apr 15, 2024
  3. Apr 12, 2024
  4. Apr 11, 2024
  5. Apr 10, 2024
    • dpsutton's avatar
      Fix #39138 again (#40936) · b1e83541
      dpsutton authored
      * Fix #39138 again
      
      Fixes #40934
      
      Got unfixed somehow in #40578. seems like some file renames caught it off guard
      
      But the long and short is that its possible for a persisted model to end
      up in the state "refreshing" (possible an instance restart during
      refreshing). The refreshing job doesn't look for these so they become
      effectively invisible.
      
      Since the job to refresh them will only run one at a time cluster wide,
      any jobs that are in the "refreshing" state when the refresher begins to
      refresh are necessarilly stuck (no one else could currently be
      refreshing them). So we can just add them to the queue of models to
      refresh.
      
      ```clojure
      (jobs/defjob ^{org.quartz.DisallowConcurrentExecution true ;; <----
                     :doc "Refresh persisted tables job"}
        PersistenceRefresh [job-context]
        (refresh-job-fn! job-context))
      ```
      
      * Ensure ee/oss pathways are taken in tests
      
      Annoying little footgun here. CI does not run with an ee token, so in
      order to ensure that test pathway goes through ee version of a
      defenterprise we _must_ use the `mt/with-premium-features
      {:cache-granular-controls}`,  but we also want to ensure that it goes
      through the oss version.
      
      So two options, a `doseq` on both features (empty set and the feature
      that triggers this). But want a test in the enterprise folder as well to
      ensure.
      
      The real trickiness comes from running tests at a repl and CLI. My REPL
      always has an ee token in it. My command line always lacks that as
      well. So want to be explicit about the token features in effect at test
      time.
      
      That's why I'm essentially duplicating tests (ee in ee folder, oss in
      regular pathway)
      Unverified
      b1e83541
    • Cal Herries's avatar
    • Cal Herries's avatar
      Mitigate some redshift flakes (#41191) · 4c00bc49
      Cal Herries authored
      Unverified
      4c00bc49
  6. Apr 08, 2024
    • Cam Saul's avatar
      More Metric => LegacyMetric renaming (#40418) · a8719405
      Cam Saul authored
      * Wow
      
      * Test fix :wrench:
      
      * Fixes
      
      * Actions should use strings for column names (fix :update-row and :create-row normalization)
      
      * MLv2 schema should check against keys for the other query type
      
      * Ok, have I fixed things?
      
      * More fixes :wrench:
      
      * Fix indentation
      
      * Another round of test fixes. :wrench:
      
      * Hopefully the last few test fixes :wrench:
      
      * We need to test normalization for queries that have keyword keys as well.
      
      * Fix Cljs i18n namespaces
      
      * Sort namespaces
      
      * Only test against H2
      
      * Rename `metabase.mbql` to `metabase.legacy-mbql`
      
      * Fix Kondo warnings
      
      * Test fixes :wrench:
      
      * Register MBQL clause schemas and test fixes :wrench:
      
      * Test fixes and PR feedback
      
      * Test fix
      
      * Remove the normalization tests
      
      * Test fixes :wrench:
      
      * Fix kondo
      
      * Fix import
      
      * Another fix :wrench:
      
      * Merge
      
      * FIXES
      
      * Add another missing REQUIRE
      
      * More Metric => LegacyMetric renaming
      
      * metabase.models.metric-important-field => metabase.models.legacy-metric-important-field
      
      * Even more renaming
      
      * More renaming
      
      * Even more fixes.
      
      * More renaming
      
      * Wow, even more renaming!!
      Unverified
      a8719405
    • Alexander Solovyov's avatar
    • Cal Herries's avatar
    • Alexander Solovyov's avatar
      cache invalidation (#40774) · 84642517
      Alexander Solovyov authored
      New endpoint accepts entity and entity ids in form of `database=1&dashboard=2&question=3`. If you don't supply
      `&include=overrides`, then it tries to find configs directly referencing supplied entities and updates their
      `invalidated_at`. If you supply `&include=overrides`, all the referenced cards are
      updated (`report_card.cache_invalidated_at`).
      
      Cache strategies then select the maximum `invalidated_at` in their logic. EE-only.
      
      resolves #40548
      Unverified
      84642517
    • Oisin Coveney's avatar
  7. Apr 06, 2024
  8. Apr 05, 2024
  9. Apr 04, 2024
  10. Apr 03, 2024
    • Raphael Krut-Landau's avatar
      Basic cache admin UI (#39234) · c1f4bff8
      Raphael Krut-Landau authored
      Adds:
      * Performance tab 
      * Data caching settings tab
      * Two-panel strategy editor
      * "Don't cache" strategy
      * "TTL" strategy
      * "Duration" strategy
      * "Use default" option for databases
      * OSS page
      * Unit tests
      
      [Loom](https://www.loom.com/share/b1b173a52be9401588ffb63f718e052a?sid=bed4bdf5-f967-4d93-af55-9b96b6b52730)
      Unverified
      c1f4bff8
    • Uladzimir Havenchyk's avatar
      Do not put js code into page title (#40901) · d12c549a
      Uladzimir Havenchyk authored
      
      * Do not put js code into page title
      
      * Typecheck
      
      * Add e2e test
      
      * Update e2e/test/scenarios/question/document-title.cy.spec.js
      
      Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
      
      ---------
      
      Co-authored-by: default avatarKamil Mielnik <kamil@kamilmielnik.com>
      Unverified
      d12c549a
    • Mahatthana (Kelvin) Nomsawadi's avatar
      [MS2] 1. Analytics (#40681) · af54379a
      Mahatthana (Kelvin) Nomsawadi authored
      * Remove old config + fix typo
      
      * Add new analytics for 4 new illustration settings
      Unverified
      af54379a
    • Cal Herries's avatar
      Unverified
      e5f9d2c4
    • Mahatthana (Kelvin) Nomsawadi's avatar
      [M1] Metabase illustration settings (#40219) · 715174d3
      Mahatthana (Kelvin) Nomsawadi authored
      
      * Add login page illustration (#39299)
      
      * Move Metabot setting to a new place
      
      * Add setting for login page illustration
      
      * fix UI styling
      
      * Fix not able to upload the same file twice
      
      * Update the admin > appearance > conceal metabase copy
      
      * Prepare the component for tests
      
      * Add some unit tests
      
      * Prevent settings not saved sometimes
      
      After setting the value to/from `custom` one of the setting could be
      failed to save, I suspect this happens because the race condition from
      trying to save the setting values relatively at the same time.
      
      * Make unit tests easier to read
      
      * Add all unit test test cases
      
      * Add basic E2E test
      
      * Show fallback icon for broken images
      
      * Make use of the proper component
      
      * Update the comment to affect the reality
      
      * Add an error message when file size is over 2MB
      
      * Show an error message when the file size > 2MB
      
      * Add the error message tests
      
      * Preserve the preview image aspect-ratio
      
      * Detect corrupted images
      
      * Fix failing unit tests
      
      * Address feedback: Type
      
      * Feedback: Create meaningful variables
      
      * Feedback: Make selector API more sensible
      
      * Prevent race condition
      
      Makes sure we save the settings completely before making other actions
      that also change settings otherwise, there could be race conditions.
      
      * Feedback: tighten up a type
      
      * Feedback: Fix inconsistency callback calls
      
      * 2. Add the rest 3 illustration settings (#40487)
      
      * Add the rest 3 illustration settings
      
      * Don't make the X icon feel lonely
      
      * Fix illustration widget saving
      
      * Fix type error
      
      * 3. Update the select UX to match new design (#40491)
      
      * Update the select UX to match new design
      
      * Move info dot next to file upload button
      
      * Simplify IllustrationWidget API
      
      * Update setting title copy
      
      * Clean up test comments
      
      * Feedback: Clarify `any` type
      
      * Feedback: Use shorthand object creation
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      * Feedback: Use global CSS glass instead of inlining values
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      * Feedback: Remove unnecessary curly brackets in JSX
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      ---------
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      
      * 4. Connect illustrations to new setting values (#40139)
      
      * Wire landing page illustration to the setting value
      
      * Wire the unsubscribe page to the setting value
      
      * Prepare no rows error to be wired to the setting value
      
      * Wire no question results illustration to the setting value
      
      * Wire no search results illustration to setting value
      
      * Fix error from fixing conflict
      
      * Fix required unnecsseary prop on Image
      
      * Use Image component
      
      * Link dashboard card no results image to the setting value
      
      * Move the no data results to more a generic directory
      
      * Link collection picker no results image to the setting value
      
      * Make illustrations more accessible
      
      * Fix failed tests
      
      * Test unscribe page illustration + test no illustration
      
      * Add landing page tests
      
      * Simplify Cypress selectors
      
      * Refactor: Rename settings to match the new requirements
      
      No question data -> No Data
      No search results -> No object
      
      These changes are made so, these 2 settings are generic enough to
      include other illustrations later on.
      
      * Add no data illustration test
      
      * Add no object illustration tests
      
      * Fix unsubscribe page background style
      
      * Fix not able to build static viz
      
      * 5. Follow-up on milestone 1 (#40710)
      
      * Update custom background illustration scale behavior
      
      * Remove the need to put an SVG file in static folder
      
      * Fix test from rebasing off master with @testing-library/user-event upgrade
      
      ---------
      
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      Unverified
      715174d3
  11. Apr 02, 2024
  12. Mar 28, 2024
  13. Mar 27, 2024
    • Sloan Sparger's avatar
    • John Swanson's avatar
      Allow group managers to view all people (#40619) · c6dd2765
      John Swanson authored
      Fixes #40328
      
      [Our documentation](https://www.metabase.com/docs/latest/people-and-groups/managing#group-managers) states that:
      
      > Group managers can:
      >
      > - View all people in the Admin settings > People tab.
      
      This fixes enforcement to be aligned with the documentation. This behavior makes sense, because as the docs also state, Group Managers should be allowed to *add* people to the group they manage, which they can only do if they can see those people!
      
      Initially, I also removed a faulty test, which was described as:
      ```
      ;; Non-segmented users are allowed to ask for a list of all of the users in the Metabase instance. Pulse email lists
      ;; are an example usage of this. Segmented users should not have that ability. Instead they should only see
      ;; themselves. This test checks that GET /api/user for a segmented user only returns themselves
      ```
      
      but actually failed to test this in a relevant way (because it was testing the `GET /api/user` endpoint rather than the `GET /api/user/recipients` endpoint). The test had continued to pass only because the user was the only member of the group they managed.
      
      I initially thought this behavior wasn't desired, but as it turns out, it *is* in fact documented behavior to disallow sandboxed users from seeing any email suggestions. Investigating, I found that a bug was allowing sandboxed users to see all users on the `/api/user/recipients` endpoint if the user-visibility setting was set to `:all`.
      
      Thus, the second commit fixes the bug and re-adds the (fixed) test. A sandboxed user now only sees their own user when hitting `/api/user/recipients`.
      Unverified
      c6dd2765
    • Oisin Coveney's avatar
  14. Mar 26, 2024
    • Raphael Krut-Landau's avatar
      Restore Models in Browse data (#40633) · a43261f2
      Raphael Krut-Landau authored
      * Revert "Remove Models from Browse data (#40108)"
      
      This reverts commit 45a2e868.
      
      * Make rtl friendly
      
      * Add 'no description' for blank-description models
      
      * Fix vertical position of collection header toggle
      
      * Move FixedSizeIcon into metabase/ui and increase height of empty state
      
      * Move FixedSizeIcon back into BrowseModels.styled.tsx
      
      * Localize 'No description'
      
      * Add comment
      
      * Fix type issue
      Unverified
      a43261f2
    • Denis Berezin's avatar
      Embedding SDK - integration commit (#40198) · 98f6cd82
      Denis Berezin authored
      * Minimal SDK code
      
      * Fix viz, styles
      
      * Move SDK code to enterprise folder
      
      * Fix files structure
      
      * Clean-up
      
      * Review fixes
      
      * Review fixes
      
      * Review fixes
      
      * Remove elementid
      
      * Reuse some options from main webpack config
      
      * Actualize package.json
      
      * Actualize package.json
      Unverified
      98f6cd82
Loading