Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Oct 10, 2023
  2. Oct 09, 2023
  3. Oct 08, 2023
  4. Oct 06, 2023
    • Cam Saul's avatar
      Unverified
      d9301a17
    • Alexander Polyankin's avatar
      Mantine Divider (#34392) · e1ebf600
      Alexander Polyankin authored
      Unverified
      e1ebf600
    • Ryan Laurie's avatar
    • Nemanja Glumac's avatar
    • Denis Berezin's avatar
      [33482] Add more unit tests for all implemented drills (#33974) · 8f87659c
      Denis Berezin authored
      * Add more drills tests, unify tests structure, add issues refs
      
      * Add tests for fk-details drill apply
      
      * Tests fixes after merge with master
      
      * Code review fixes
      
      * Comment failing tests after merging with master
      
      * Restore sort drill tests
      Unverified
      8f87659c
    • Emmad Usmani's avatar
      Mantine Switch (#34005) · d9aa16e2
      Emmad Usmani authored
      
      * wip
      
      * Add comma and fix spelling error
      
      * Added some padding and things
      
      * switch control styles
      
      * text styles
      
      * add storybook examples
      
      * Add guidance text
      
      * Add top padding for small switches
      
      * change default size from `sm` to `md`
      
      * fix missing default `size` prop
      
      * fix paddings
      
      * remove label padding if empty
      
      * use `getStylesRef`
      
      ---------
      
      Co-authored-by: default avatarOisin Coveney <oisin@metabase.com>
      Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
      Unverified
      d9aa16e2
    • Cam Saul's avatar
    • Braden Shepherdson's avatar
      Hack to fix webpack serving stale CLJS on browser refresh (#34381) · 682215fd
      Braden Shepherdson authored
      ### Background
      
      CLJS output is not watched by webpack. (Watching it causes full page reloads I can't find a way to stop.)
      CLJS changes are hot reloaded by shadow-cljs separate from webpack.
      
      Changing CLJS code works great: shadow-cljs hot reloads it and it works nicely.
      
      Changing JS code also works: webpack recompiles (including the latest CLJS output), the browser refreshes, and all is
      well.
      
      ### The Problem
      
      If you refresh the browser after you've changed only CLJS code, webpack does not know it must recompile the bundles.
      Therefore it serves up the old bundles, which have now-stale CLJS output in them.
      
      ### The "Solution"
      
      The first time shadow-cljs hot reloads after a CLJS change, a hook in `metabase.util.devtools` registers a
      `beforeunload` handler. This handler sends a request to `http://localhost:8080/webpack-dev-server/invalidate`, forcing
      webpack to recompile the bundles.
      
      That isn't such a terrible hack by itself. The ugly part is that there's a race
      condition between webpack invalidating the bundles and the browser trying to
      load the bundles after the refresh, and sometimes the browser wins (loading the
      stale CLJS). I added a spin-lock, repeatedly checking `performance.now()` until
      500ms have passed, then the handler returns. This small delay gives webpack
      time to mark the bundles invalid and allow the refresh.
      
      I haven't experimented with how long that delay needs to be for this to be
      reliable. Since this handler is only attached after CLJS code has been hot
      reloaded, it will never run for most FE devs.
      
      ### Alternative: Smarter webpack
      
      The best solution would be to make webpack
      - recompile the bundles when the CLJS output changes; but
      - not try to HMR them (which triggers a browser refresh and ruins CLJS hot reloading)
      but I have not found any way to configure this out of the box. I think it would require patching `ReactRefreshPlugin`,
      a nontrivial job. It might also be possible for shadow-cljs to poke webpack after it finishes building, but there's the
      same problem that webpack will want to HMR.
      
      Webpack doesn't support any "lazy" invalidation; as far as I know there's no
      way to say "this bundle is now invalid but don't recompile it until someone
      tries to GET it" or anything like that.
      
      ### Alternative: Block refresh then continue
      
      The `beforeunload` handler could instead work like this:
      - `preventDefault()` on the event, stopping the refresh.
      - `fetch()` the `invalidate` route as above.
      - asynchronously, when that `fetch()` is done and we know webpack has invalidated the bundles, trigger a refresh.
      
      I haven't tried this, since it seems more complicated than the spin-lock. We just need to give the `invalidate` request
      a head start.
      Unverified
      682215fd
    • Case Nelson's avatar
    • Case Nelson's avatar
    • Nemanja Glumac's avatar
      Parameterize E2E matrix (#34431) · ea17aa78
      Nemanja Glumac authored
      Unverified
      ea17aa78
    • Tim Macdonald's avatar
      Minor updates to the developer's guide (#34436) · 009000e5
      Tim Macdonald authored
      
      * Minor updates to the developer's guide
      
      * extra context
      
      ---------
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Unverified
      009000e5
    • Nemanja Glumac's avatar
      Remove and disallow H2 from E2E tests (#34364) · 0f54f772
      Nemanja Glumac authored
      * Make it easy to add SQLite database
      
      * Replace H2 with SQLite in E2E tests
      
      * Remove long unused E2E reproduction
      
      It's been sufficiently covered with backend tests.
      
      * Remove H2 database helper from E2E tests
      Unverified
      0f54f772
    • Kamil Mielnik's avatar
      Show custom warning message when leaving editing dashboard via Cancel button (#34405) · 23453f57
      Kamil Mielnik authored
      * Show a warning modal when clicking "Cancel" in dashboard
      
      * Update dashboard test
      
      * Update question settings test
      
      * Add missing "Edit dashboard" click
      
      * Add tests for leaving dashboard editing via Cancel button
      Unverified
      23453f57
    • Kamil Mielnik's avatar
      Add custom warning message when leaving editing a model (query definition or metadata) (#34316) · d7576fc8
      Kamil Mielnik authored
      * Add model-editing logic to isLocationAllowed in QueryBuilder
      
      * Fix IS_LOCATION_ALLOWED implementation
      
      * Fix typos
      
      * Remove redundant checks and invert logic for better readability
      
      * Add editing queries tests
      
      * Improve test to include reverted form interaction
      
      * Fix existing test case
      
      * Add editing metadata test
      
      * Add editing metadata test (unedited)
      
      * Organize tests
      
      * Add a test for not showing custom warning modal when saving edited query
      
      * Extract slug to TEST_MODEL_CARD_SLUG
      
      * Add a test for not showing custom warning modal when saving edited metadata
      
      * Remove redundant routing
      
      * Add a workaround for test setup
      
      * Add a test for tabs navigation
      
      * Fix failing test
      
      * Extract isNavigationAllowed out of isLocationAllowed
      
      * Extract createMockLocation
      
      * Add isNavigationAllowed test setup and test for new questions
      
      * Add a test case for beforeunload event
      
      * Format code
      
      * Add more tests and organize them
      
      * Add notebook question tests
      
      * Format code
      Unverified
      d7576fc8
    • Kamil Mielnik's avatar
      Add custom warning message when leaving changing Data Model (segments and metrics) (#34398) · d29867e0
      Kamil Mielnik authored
      * Rename component to match the filename
      
      * Fix typo
      
      * Replace useBeforeUnload with LeaveConfirmationModal in SegmentForm
      
      * Replace useBeforeUnload with LeaveConfirmationModal in MetricForm
      
      * Update setup of MetricForm tests to allow testing navigation
      
      * Update setup of SegmentForm tests to allow testing navigation
      
      * Use proper history in MetricForm
      
      * Refactor SegmentForm test setup to be consistent with the one of MetricForm
      
      * Make MetricForm and SegmentForm tests consistent
      
      * Add tests for not showing custom warning
      
      * Add tests for showing custom warning when leaving with unsaved changes
      
      * Extract FORM_URL
      
      * Remove redundant asyncs and awaits
      
      * Rename MetricForm.unit.spec.tsx & SegmentForm.unit.spec.tsx to MetricApp.unit.spec.tsx & SegmentApp.unit.spec.tsx and move them near the components they're testing
      
      * Improve a11y
      
      * Add missing endpoint mocks
      
      * Improve selectors thanks to proper a11y
      
      * Add tests for not showing warning modal when saving changes
      
      * Convert CreateMetricForm to a functional component
      
      * Convert CreateSegmentForm to a functional component
      
      * Convert UpdateMetricFormInner to a functional component
      
      * Convert UpdateSegmentFormInner to a functional component
      
      * Disable LeaveConfirmationModal on scheduled navigation
      
      * Setup metrics & segments POST endpoints
      
      * Properly mock metric and segment creation
      
      * Lift LeaveConfirmationModal from SegmentForm to SegmentApp
      
      * Lift LeaveConfirmationModal from MetricForm to MetricApp
      
      * Sort props
      
      * Get rid of useCallbackEffect usage in MetricApp
      
      * Get rid of useCallbackEffect usage in SegmentApp
      Unverified
      d29867e0
    • Uladzimir Havenchyk's avatar
  5. Oct 05, 2023
  6. Oct 04, 2023
Loading