Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Oct 06, 2023
    • 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>
      d9aa16e2
    • 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
      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
      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
      d29867e0
    • Uladzimir Havenchyk's avatar
  2. Oct 05, 2023
  3. Oct 04, 2023
  4. Oct 03, 2023
    • Ibe Dwi's avatar
      Add color to `ExpandButton` when moving collection (#33846) · bdbbb61d
      Ibe Dwi authored
      * fix: add ExpandButton color on parent's hover
      
      * fix: icon's color by canSelect, remove !important
      
      * feat: update expand button style on canSelect props
      
      * fix: icon button color when hovered
      bdbbb61d
    • Kamil Mielnik's avatar
      Add custom warning message when leaving creating/editing a DB connection (#34272) · 124a6a3d
      Kamil Mielnik authored
      * Use LeaveConfirmationModal in QueryBuilder
      
      * Add isLocationAllowed prop to LeaveConfirmationModal
      
      * Do not route-block running modified native question
      
      * Fix typo
      
      * Introduce explanatory variables
      
      * Move updating URL during question creation to QueryBuilder
      
      * Schedule navigation to after re-render so that LeaveConfirmationModal prop has a chance to update
      
      * Add a test for unsaved changes warning
      
      * Introduce useCallbackEffect
      
      * Refactor QueryBuilder to use useCallbackEffect
      
      * Refactor ActionCreator to use useCallbackEffect
      
      * Fix useCallbackEffect typing
      
      * Move onSubmit out of the scheduled callback to reduce probability of race conditions
      
      * Add comments explaining useCallbackEffect usage
      
      * Improve JSDocs
      
      * Add a test for running modified question
      
      * Update button query to more accessible one
      
      * Add a test for saving a modified question
      
      * Update test names
      
      * Add a test for leaving with no changes
      
      * Remove isDirty-related no-change assertions, as isDirty flag does not work reliably
      - Question.prototype.isDirtyComparedTo would return true because edited "question"
        would have extra "description: null" attribute and no "name" compared to
        "originalQuestion" (see "getIsDirty")
      
      * Move useCallbackEffect to its own directory
      
      * Add test setup for useCallbackEffect
      
      * Add a test case for scheduling
      
      * Add a test for scheduling callback effect
      
      * Do not disable navigation in models
      - this is a temporary condition until #33793 is implemented
      
      * Remove redundant _.noop
      
      * Rename isScheduled to isCallbackScheduled
      
      * Replace useBeforeUnload with LeaveConfirmationModal in DatabaseEditApp
      
      * Refactor DatabaseEditApp.unit.spec.js to TypeScript
      
      * Add initialRoute param, return history & add /home route
      
      * Add a test case for showing the unsaved changes modal
      
      * Add a test case for not showing the unsaved changes modal
      
      * Format code
      
      * Extend a test case to assert isDirty being properly computed
      
      * Remove redundant route
      
      * Remove redundant code
      
      * Add a test for custom warning modal when saving edited question as a new one
      
      * Redirect to databases page on database creation in component so that isDirty flag can re-compute on re-render
      
      * Fix mocks setup
      
      * Remove redundant withRouter usage
      
      * Use waitFor + expect + not.toBeInDocument instead waitForElementToBeRemoved
      
      * Add a test case for creating new database connection
      
      * Remove redundant promise
      124a6a3d
    • Cal Herries's avatar
    • Nemanja Glumac's avatar
      92312aba
  5. Oct 02, 2023
    • Braden Shepherdson's avatar
      Enable ClojureScript REPL and hot reloading of CLJS code (#34007) · 8e298158
      Braden Shepherdson authored
      This also moves the CLJS output out of `frontend/src/cljs{,_release}` to
      `target/cljs_{dev,release}`. If that causes problems for FE tooling I
      don't know about, it could be moved back.
      
      Hot reloading:
      CLJS changes are hot-reloaded into the running app by Shadow CLJS - no
      action is needed. Note that the UI will not refresh; you usually have to
      click around so the updated MLv2 code gets executed.
      
      Usage of the CLJS REPL:
      - Open the browser (you should see `shadow-cljs: #N ready!` in console)
      - Connect to nrepl on 50655
      - "Select" the `:app` build;
          - https://shadow-cljs.github.io/docs/UsersGuide.html#_editor_integration
          - Conjure: `:ConjureShadowSelect app`
          - Plain REPL: Eval in CLJ mode `(shadow/repl :app)`
      - Consider running `yarn build-hot:cljs` and `yarn build-hot:js` in
        separate terminals; then when `yarn build-hot:js` crashes you don't
        have to reconnect your REPL.
      - The REPL works beautifully, even loading files outside the :entries
        of the shadow-cljs build like tests!
      
      "Stale" error in browser:
      - This can happen if the webpack bundle is created before the CLJS is
        done building.
      - If you ran `yarn build-hot:cljs` and `:js` separately, let `:cljs`
        finish compiling first.
      - If you see this otherwise: (a) contact Braden so it can be fixed; and
        (b) either restart `build-hot:js` or force webpack to rebuild by
        hitting http://localhost:8080/webpack-dev-server/invalidate
      
      Yarn commands:
      `dev`, `dev-ee`, `build-hot`, and `build-static-viz:watch` all now wait
      for the CLJS build to be complete by watching for files to be generated.
      They should work the same from a user's POV.
      
      (Since the webpack build no longer watches the CLJS output,
      it won't notice the changes and immediately rebuild after the first
      build. This avoids errors on the clean build, or "stale build" messages
      in the app from Shadow CLJS.)
      
      Fixes #32674.
      8e298158
    • Uladzimir Havenchyk's avatar
    • Alexander Polyankin's avatar
    • Anton Kulyk's avatar
      Clean up join E2E tests (#34253) · c0d707e3
      Anton Kulyk authored
      * Add `dashboardGrid` E2E helper
      
      * Add test ID for x-ray dashboard header
      
      * Extract 14793 repro to its own file
      
      * Extract 15578 repro to its own file
      
      * Remove duplicate 17968 repro
      
      * Clean up 17968 repro
      
      * Clean up test
      
      * Clean up test
      
      * Clean up test
      
      * Clean up test
      
      * Clean up test
      
      * Clean up test
      
      * Sort imports
      
      * Use shared helpers for join tests
      
      * Extract 12928 repro to its own file
      
      * Minor renames
      
      * Fix `join` e2e helper
      
      * Fix `assertQueryBuilderRowCount` for count > 1000
      
      * Make table check optional in `assertJoinValid`
      
      * Clean up test
      
      * Fix `join` helper
      
      * Fix 17968 test
      
      * Fix 30058 and 32075 tests
      
      * Reduce flakiness?
      c0d707e3
    • Uladzimir Havenchyk's avatar
    • Kamil Mielnik's avatar
      Add custom warning message when leaving editing an existing SQL question (#34084) · f7bf0234
      Kamil Mielnik authored
      * Use LeaveConfirmationModal in QueryBuilder
      
      * Add isLocationAllowed prop to LeaveConfirmationModal
      
      * Do not route-block running modified native question
      
      * Fix typo
      
      * Introduce explanatory variables
      
      * Move updating URL during question creation to QueryBuilder
      
      * Schedule navigation to after re-render so that LeaveConfirmationModal prop has a chance to update
      
      * Add a test for unsaved changes warning
      
      * Introduce useCallbackEffect
      
      * Refactor QueryBuilder to use useCallbackEffect
      
      * Refactor ActionCreator to use useCallbackEffect
      
      * Fix useCallbackEffect typing
      
      * Move onSubmit out of the scheduled callback to reduce probability of race conditions
      
      * Add comments explaining useCallbackEffect usage
      
      * Improve JSDocs
      
      * Add a test for running modified question
      
      * Update button query to more accessible one
      
      * Add a test for saving a modified question
      
      * Update test names
      
      * Add a test for leaving with no changes
      
      * Remove isDirty-related no-change assertions, as isDirty flag does not work reliably
      - Question.prototype.isDirtyComparedTo would return true because edited "question"
        would have extra "description: null" attribute and no "name" compared to
        "originalQuestion" (see "getIsDirty")
      
      * Move useCallbackEffect to its own directory
      
      * Add test setup for useCallbackEffect
      
      * Add a test case for scheduling
      
      * Add a test for scheduling callback effect
      
      * Do not disable navigation in models
      - this is a temporary condition until #33793 is implemented
      
      * Remove redundant _.noop
      
      * Rename isScheduled to isCallbackScheduled
      
      * Remove redundant route
      
      * Remove redundant code
      
      * Add a test for custom warning modal when saving edited question as a new one
      f7bf0234
    • Anton Kulyk's avatar
      Migrate notebook's data step to MLv2 (#34256) · bca9d35f
      Anton Kulyk authored
      * Add `displayInfo` types for cards and tables
      
      * Add TypeScript wrapper for `withDifferentTable`
      
      * Move fields tests under their own `describe`
      
      * Clean up the fields picker
      
      * Add extra test coverage
      
      * Fix missing import
      
      * Fix type
      
      * Migrate `DataStep` to MLv2 (mostly)
      
      * Fix creating a new query
      bca9d35f
  6. Sep 29, 2023
    • Denis Berezin's avatar
      Fix flaky ActionViz unit tests (#34250) · 6e5b6a7b
      Denis Berezin authored
      6e5b6a7b
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Fix overlapping x-tick labels on static viz timeseries charts (#33707) · 70355597
      Mahatthana (Kelvin) Nomsawadi authored
      
      * Fix overlapping x-tick labels on static viz timeseries charts
      
      * Address review: make the condition easier to understand + fix failed cases
      
      * Update frontend/src/metabase/static-viz/components/XYChart/utils/ticks.ts
      
      Co-authored-by: default avatarJesse Devaney <22608765+JesseSDevaney@users.noreply.github.com>
      
      * Add a comment to explain why we have to fix timeseries ticks
      
      ---------
      
      Co-authored-by: default avatarJesse Devaney <22608765+JesseSDevaney@users.noreply.github.com>
      70355597
    • Kamil Mielnik's avatar
      Add custom warning message when leaving creating/editing a query action in... · 5c2279d4
      Kamil Mielnik authored
      Add custom warning message when leaving creating/editing a query action in model details page (#34192)
      
      * Replace useBeforeUnload with LeaveConfirmationModal in ActionCreator
      
      * Take action name and action settings changes into account when computing isDirty
      
      * Improve action name change detection
      
      * Rename handleFormSettingsChange to patchFormSettings
      
      * Rename handleActionChange to patchAction
      
      * Introduce a way to sync initial action state after creation/update
      
      * Sync initial action state after creation/update
      
      * Add a hack for re-rendering
      
      * Revert "fixing" isDirty flag
      
      * Replace delay hack with an effect
      
      * Improve ActionCreatorModal setup
      - use actual component, not the mock
      - move waiting for spinner outside of setup, as it is initialRoute-dependent
      - ensure history object is always present
      - add missing setupDatabaseEndpoints call
      
      * Add a test for showing custom unsaved changes warning modal
      
      * Update default mock query action's visualization_settings
      
      * Add a test for not showing custom unsaved changes warning modal
      
      * Fix isDirty flag evaluation
      
      * Group similar tests
      
      * Add tests for creating new action
      
      * Remove redundant spread
      
      * Use local action
      
      * Fix typo
      
      * Add a test for updating an action
      
      * Add a test for creating an action
      
      * Fix a flake
      
      * Add missing router in tests setup
      
      * Enable LeaveConfirmationModal only in ActionCreatorModal with a dedicated route
      - see action-related edge cases in https://github.com/metabase/metabase/issues/34114
      
      * Fix flaking test by waiting for modal to close
      
      * Make assertion consistent
      
      * Fix flaky unit tests
      
      * Refactor isDirty computation
      
      * Add a way to skip unsaved changes warning when submitting the modal
      
      * Remove setAction
      
      * Bring back old logic
      
      * Undo rename
      
      * Update comment
      
      * Update comment
      
      * Add areActionsEqual to deal with redundant "value" attribute of action parameter
      
      * Omit "hasVariableTemplateTagTarget", compute visualization settings diff based on form state
      
      * Revert unnecessary change
      
      * Revert unnecessary change
      
      * Rename getActionCrudParameters to getCleanParameters
      
      * Revert unnecessary change
      
      * Revert unnecessary change
      
      * Simplify isDirty computation with Question.prototype.isDirtyComparedTo
      
      * Revert leftover code
      
      * Remove duplicated assertion
      
      * Update test to detect correctness of isDirty flag when user reverts changes
      5c2279d4
  7. Sep 28, 2023
  8. Sep 27, 2023
  9. Sep 26, 2023
  10. Sep 25, 2023
Loading