Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Dec 27, 2023
  2. Dec 26, 2023
  3. Dec 25, 2023
    • Nicolò Pretto's avatar
      Embedding settings cleanup - Milestone 1 (#37043) · 08d7467f
      Nicolò Pretto authored
      
      * feat: single view for embedding settings regardless of setting status (#36802)
      
      * feat: single view for embedding settings regardless of setting status
      
      * refactor: rename component as now it doesn't container legalese
      
      * rename component and refactor
      
      * remove unused prop type
      
      * test: update e2e
      
      * fix not handling null value
      
      * fix: keep same behaviour for event
      
      * Update frontend/src/metabase/admin/settings/components/widgets/EmbeddingSwitchWidget/EmbeddingSwitchWidget.tsx
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      
      * use target instead of currentTarget
      
      ---------
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      
      * remove deprecated event on embedding settings (#36857)
      
      * feat: Update the UI and copy of the embedding options cards (#36819)
      
      * feat: adds icon and some other small ui change
      
      * update buttons and ui
      
      * update links/buttons for  interactive embed option
      
      * update unit tests
      
      * make e2e pass with the new changes
      
      * make unit test pass
      
      * integration/unit tests for embedding settings
      
      * fix herf -> href :melting_face:
      
      * fix e2e suite
      
      * refactor: splti components in two
      
      * update url as by updaterd product doc
      
      * fix imports
      
      * update width as by design
      
      * fix linting error
      
      * fix copy
      
      * update layout, paddings, fontsize etc
      
      * add upgrade text
      
      * other ui fixes
      
      * last minute copy change
      
      * inline variable in tests to avoid beforeEach
      
      * fix typo
      
      * fix e2e by moving assertion on the correct page
      
      * fix typo in unit
      
      * update link as per product doc
      
      * inlie urls
      
      * only return used parts in setup function
      
      * e2e: update e2e upgrage url
      
      * remove oss version of the interactive embedding settings page (#36938)
      
      * remove oss version of the interactive embedding settings page
      
      * fix redirect logic + add tests
      
      * add key to make react not complain
      
      * merge lists of embedded questions and dashboards to have new heading structure (#36944)
      
      * feat: adds icon and some other small ui change
      
      * update buttons and ui
      
      * update links/buttons for  interactive embed option
      
      * update unit tests
      
      * make e2e pass with the new changes
      
      * make unit test pass
      
      * integration/unit tests for embedding settings
      
      * fix herf -> href :melting_face:
      
      * fix e2e suite
      
      * refactor: splti components in two
      
      * update url as by updaterd product doc
      
      * fix imports
      
      * update width as by design
      
      * fix linting error
      
      * remove oss version of the interactive embedding settings page
      
      * merge lists of embedded questions and dashboards to have new heading structure
      
      * fix redirect logic + add tests
      
      * add key to make react not complain
      
      * use plain strings instead of regex when possible
      
      * remove regex for testids
      
      * fix copy
      
      * update layout, paddings, fontsize etc
      
      * add upgrade text
      
      * other ui fixes
      
      * last minute copy change
      
      * inline variable in tests to avoid beforeEach
      
      * fix typo
      
      * fix e2e by moving assertion on the correct page
      
      * fix typo in unit
      
      * update link as per product doc
      
      * inlie urls
      
      * only return used parts in setup function
      
      * e2e: update e2e upgrage url
      
      * update interactive embedding settings page ui (#36949)
      
      * feat: adds icon and some other small ui change
      
      * update buttons and ui
      
      * update links/buttons for  interactive embed option
      
      * update unit tests
      
      * make e2e pass with the new changes
      
      * make unit test pass
      
      * integration/unit tests for embedding settings
      
      * fix herf -> href :melting_face:
      
      
      
      * fix e2e suite
      
      * refactor: splti components in two
      
      * update url as by updaterd product doc
      
      * fix imports
      
      * update width as by design
      
      * fix linting error
      
      * remove oss version of the interactive embedding settings page
      
      * merge lists of embedded questions and dashboards to have new heading structure
      
      * update interactive embedding settings page ui
      
      * fix redirect logic + add tests
      
      * add key to make react not complain
      
      * use plain strings instead of regex when possible
      
      * remove regex for testids
      
      * fix copy
      
      * update layout, paddings, fontsize etc
      
      * add upgrade text
      
      * other ui fixes
      
      * last minute copy change
      
      * inline variable in tests to avoid beforeEach
      
      * fix typo
      
      * fix e2e by moving assertion on the correct page
      
      * fix typo in unit
      
      * update link as per product doc
      
      * inlie urls
      
      * only return used parts in setup function
      
      * e2e: update e2e upgrage url
      
      * rename test files with correct naming (#37044)
      
      * rename test files with correct naming
      
      * test: fix setup functions and add enterprise suite
      
      * Fix interactive embedding link target
      
      * Update embedding toggle copy
      
      * Use default setting labels
      
      * Fix failed E2E test
      
      ---------
      
      Co-authored-by: default avatarMahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
      Co-authored-by: default avatarDenis Berezin <denis.berezin@metabase.com>
      Co-authored-by: default avatarMahatthana Nomsawadi <mahatthana.n@gmail.com>
      Unverified
      08d7467f
  4. Dec 24, 2023
  5. Dec 22, 2023
  6. Dec 21, 2023
  7. Dec 20, 2023
    • Noah Moss's avatar
    • Noah Moss's avatar
      Unverified
      7305c326
    • Mark Bastian's avatar
      Renamed columns are displayed correctly in downloads (#18572) (#37016) · f8b533c9
      Mark Bastian authored
      * Renamed columns are displayed correctly in downloads (#18572)
      
      When custom viz settings or metadata is applied to questions and models, the downloaded artifact labels do not always mirror what is displayed on the tabular view in Metabase. This happens for several reasons:
      
      - The `:visualization_settings` were not applied to CSV and JSON downloads
      - `update-card-viz-settings` in `metabase.query-processor.middleware.visualization-settings` did not correctly merge keys, resulting in dropped column names in Excel file
      - The logic for reconciling column metadata in a result set and the keys in `:visualization_settings` of a query result is not straightforward
      
      This PR is an attempt to move this consistency in the right direction without fixing all the challenges of field matching as discussed in [this thread](https://metaboat.slack.com/archives/CKZEMT1MJ/p1703091539541279) and [this issue](Duplicated columns in a source query cannot be distinguished #36185) as this sounds like a significant effort.
      
      The following changes were made:
      
      1. Update `metabase.query-processor.middleware.visualization-settings/update-card-viz-settings` to merge field settings, if present, into `column-viz-settings` without introducing new keys, especially ambiguous keys as follows:
      
      ```clojure
      (defn- update-card-viz-settings
        "For each field, fetch its settings from the QP store, convert the settings into the normalized form
        for visualization settings, and then merge in the card-level column settings."
        [column-viz-settings field-ids]
        ;; Retrieve field-level settings
        (let [field-id->settings (reduce
                                   (fn [m field-id]
                                     (let [field-settings      (:settings (lib.metadata/field (qp.store/metadata-provider) field-id))
                                           norm-field-settings (normalize-field-settings field-id field-settings)]
                                       (assoc m field-id norm-field-settings)))
                                   {}
                                   field-ids)]
          ;; For each column viz setting, if there is a match on the field settings, merge it in,
          ;; with the column viz settings being the default in the event of conflicts.
          (reduce-kv
            (fn [coll {field-id ::mb.viz/field-id :as k} column-viz-setting]
              (assoc coll k (merge (get field-id->settings field-id {}) column-viz-setting)))
            {}
            column-viz-settings)))
      ```
      
      The primary difference is rather than merging in new keys as `{::mb.viz/field-id field-id} -> field-settings` this code will merge settings found by field id with any `column-viz-setting` containing that field id as part of its key. The merge prefers `column-viz-settings`.
      
      This should be an improvement over what already exists.
      
      2. Move `column-titles` from `metabase.query-processor.streaming.xlsx` to `metabase.query-processor.streaming.common` and use this common function for CSV and JSON export names.
      
      Note that the lifted `column-titles` has some erroneous logic:
      
      - It relies on column `:name` or `:id` as unique identifiers -- they are not always unique.
      - It expects the `col-settings` key format to be exactly `{::mb.viz/field-id id}` or `{::mb.viz/column-name name}` -- Sometimes these keys have additional keys. One change made to this function is normalizing `col-settings` to conform to the expected format by removing extra keys. While this isn't a perfect solution, it conforms with the intent of what already exists and is an improvement in the majority of cases.
      
      The _right_ thing to do is _probably_ to use `metabase.lib.equality/find-matching-column` to match the column and settings keys, _but_ the `col-settings` keys are in a weird format that isn't really conducive to doing this. I'd rather we make an incremental step forward and try doing this in another effort.
      
      This second change should not make anything that wasn't already problematic worse, while making the general case better.
      
      * Updated `update-card-viz-settings` for unique fields case
      
      When `update-card-viz-settings` is called, sometimes fields have ids that aren't part of the `column-viz-settings` map. For cases where they are part of the viz settings map, they are merged in, potentially more than once. For cases where the field ids aren't found in the column viz settings but do have settings, we add these in as new entries.
      
      * Test for JSON keys
      
      * Fixed broken unit test that had the wrong data shape.
      Unverified
      f8b533c9
    • Oleg Gromov's avatar
      Fix handling signals in cleanup (#37022) · 7a4ebb5a
      Oleg Gromov authored
      Unverified
      7a4ebb5a
    • shaun's avatar
    • adam-james's avatar
      Add dev fn to render dashboards with static-viz renderers (#36451) · e2e6f138
      adam-james authored
      * Add dev fn to render dashboards with static-viz renderers
      
      Run `(dev.render-png/render-dashboard-to-html 1)` to render the dashboard with id 1 to a handy html file.
      
      This file will render each dashcard in the dashboard 3 ways:
       - as a png, like you would see in Slack or in an email body (if it's a chart)
       - as html/svg, like you'd see in the email body (for tables).. might also be helpful to inspect the svg output from
       the graaljs interpreter
       - 10 row table representing what the .csv attachment for the dashcard would look like
      
      Note: to get this branch working properly, there are a couple lines commented out to pass the linter... it's a work in
      progress and will be cleaned up for better use.
      
      Todo:
       - [ ] avoid with-redefs to pass the linter
       - [ ] add a preview endpoint that can be used so that you don't need to run a Clojure repl to get the same result.
      
      * Eliminate with-redefs to allow csv 'render'
      
      * Make a 'preview' ns to power `api/pulse/preview_dashboard/:id`
      
      * Make dev.render-png dashboard preview fns the same as the preview ns
      
      * Dashboard Subscription preview ns now also uses csv attachment code
      
      This change now uses the csv attachment code to include an html table representing what we expect to see from csv exports.
      
      * Add dev fn to render dashboards with static-viz renderers
      
      Run `(dev.render-png/render-dashboard-to-html 1)` to render the dashboard with id 1 to a handy html file.
      
      This file will render each dashcard in the dashboard 3 ways:
       - as a png, like you would see in Slack or in an email body (if it's a chart)
       - as html/svg, like you'd see in the email body (for tables).. might also be helpful to inspect the svg output from
       the graaljs interpreter
       - 10 row table representing what the .csv attachment for the dashcard would look like
      
      Note: to get this branch working properly, there are a couple lines commented out to pass the linter... it's a work in
      progress and will be cleaned up for better use.
      
      Todo:
       - [ ] avoid with-redefs to pass the linter
       - [ ] add a preview endpoint that can be used so that you don't need to run a Clojure repl to get the same result.
      
      * Eliminate with-redefs to allow csv 'render'
      
      * Make a 'preview' ns to power `api/pulse/preview_dashboard/:id`
      
      * Make dev.render-png dashboard preview fns the same as the preview ns
      
      * Dashboard Subscription preview ns now also uses csv attachment code
      
      This change now uses the csv attachment code to include an html table representing what we expect to see from csv exports.
      
      * Collect all element styles into a single style tag to use with the server's nonce
      
      This allows the dashboard_preview endpoint to render properly by gathering all of the element styles into a single
      style tag, which can then be given the server's nonce value so that CSP doesn't strip the style out.
      
      This is useful for the preview endpoint so that we get an accurate picture of what our tables will look like in
      emails, plus it makes the presentation look just a bit more readable.
      
      * dev render_png fns match output used on the endpoint now too.
      
      * Hickory dependency out of dev into regular deps
      Unverified
      e2e6f138
    • Jeff Bruemmer's avatar
      update release list (#37010) · ab5b0673
      Jeff Bruemmer authored
      Unverified
      ab5b0673
    • John Swanson's avatar
      count `:model/User`, not `:core_user` (#36985) · 2191e1fa
      John Swanson authored
      I noticed that this was doing a `(t2/count :core_user ...)` instead of
      `(t2/count :model/User ...)`. I think the only difference is that our
      transforms aren't being run (which is why we needed to pass `:type
      "personal"` instead of `:type :personal`).
      Unverified
      2191e1fa
    • Nemanja Glumac's avatar
    • Anton Kulyk's avatar
      Add `PopoverBackButton` to Metabase UI (#36941) · 658caf51
      Anton Kulyk authored
      * Add `PopoverBackButton`
      
      * Use `PopoverBackButton` in `DatePicker`
      
      * Use `PopoverBackButton` in `FilterPicker`
      Unverified
      658caf51
    • Jeff Bruemmer's avatar
      correct permissions (#36986) · 12829e15
      Jeff Bruemmer authored
      Unverified
      12829e15
Loading