Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 01, 2024
  2. Jul 31, 2024
    • John Swanson's avatar
      Some improvements to the REST API for query field validation (#46024) · c4196d99
      John Swanson authored
      * Allow filtering on collection
      
      * Add `effective_ancestors` to collection data
      
      Note: I removed the `qv=` comparator. I think it'.s better to be more explicit
      about what exactly we're asserting. In particular, I hadn't updated the
      `:count` when we were filtering on collection type, so the count was
      still the total for *every* collection even though the results were being
      restricted by the collection. However the `qv=-data` function was still
      reporting that everything was OK, because it was accounting for other
      data from the App DB by just asserting that the count we'd specified was
      lower than the actual count. I'd argue it's better for tests to fail
      locally because I have garbage in my app DB (which I can clean up) than
      succeed when they really shouldn't.
      
      * Consolidate effective ancestors
      
      For the Search API, we're currently returning slightly different
      ancestors:
      
      - it never has the Root Collection, and
      
      - the ancestors don't have a `personal_owner_id`
      
      We could change the API (and maybe will soon - it seems pretty
      unexpected to have `effective_ancestors` sometimes act one way and
      sometimes act another) but for now we can just reshape things to look
      the same as they did before, while using the same code under the hood.
      c4196d99
    • Noah Moss's avatar
      d55b6a31
    • Emmad Usmani's avatar
      migrate pie chart to echarts (#43555) · 4ec1fd88
      Emmad Usmani authored
      
      * echarts pie
      
      * setup rendering pipeline for static pie chart (#43547)
      
      * setup rendering pipeline for static pie chart
      
      * remove more donut code from BE
      
      * compute viz settings for static pie chart (#43548)
      
      * compute viz settings for static pie chart
      
      * create chartModel for pie chart (#43549)
      
      * create chartModel for pie chart
      
      * render static pie chart (#43550)
      
      * render static pie chart
      
      * render static pie chart legend (#43551)
      
      * disable animation
      
      * alter static-viz pie chart be tests to account for echarts-impl
      
      The old implementation had a different implementation for legends, separate from the 'categorical/donut' js
      render. Echarts nicely combines the legend into the pie render, so we don't need to worry about that stuff anymore.
      
      Instead, I've written a simple set of assertions on the echarts pie implementation now.
      
      * Get rid of this test that was attempting to use old code path
      
      * echarts pie
      
      * One last spot where we don't need old pie stuff anymore.
      
      * add loki specs
      
      * save snapshots
      
      * fix small slices disappearing
      
      * update snapshots
      
      * add repro story for exteremely small slice
      
      * add snapshot
      
      * fix rounded total
      
      * fix percent formatting in legend
      
      * fix date dimension formatting
      
      * fix binned and relative date dimension labels on legend
      
      * add specs and snapshots for null and unaggregated dimensions
      
      * hide overlaping labels on chart
      
      * fix null dimension color
      
      * show error when metric column has a negative value
      
      * move legend to botom
      
      * make dot margin smaller
      
      * add columns to legend
      
      * sort legend vertically
      
      * dont use grid if only one row for legend
      
      * never hide legend in static viz
      
      * fix empty column culling
      
      * show single legend item
      
      * add long dimension name story
      
      * fix long dimension name in legend
      
      * right justify percentages in legend
      
      * remove negative error and re-add stories
      
      * handle negative values
      
      * create chart definition for dynamic pie chart
      
      * render chart with responsiveness
      
      * add comment for borderWidth calculation
      
      * center legend
      
      * fix legend centering
      
      * add story for missing currency formatting
      
      * fix missing currency formatting
      
      * fix graalvm crashing
      
      * fix column settings computation
      
      * add another currency formatting repro
      
      * fix wrong order of col settings computations
      
      * convert colors to hex
      
      * fix colors missing from viz settings
      
      * temp todo comment
      
      * fix colors in dynamic viz
      
      * update snapshots
      
      * fix crashing due to invalid dimension/metric setting
      
      * fix chart crashing for boolean dimension with labels on chart
      
      * add repro
      
      * fix regression in label formatting
      
      * fix labels on small slices
      
      * update specs
      
      * emphasis state for slice hover
      
      * recreate old label hiding logic
      
      * include height measurement in getIsLabelVisible
      
      * move d3 slices to chart model
      
      * fix labels on static viz
      
      * wip basic hover state and tooltip
      
      * fix emphasis style getting stuck by memoizing everything
      
      * update total display value
      
      * fix stuck emphasis by setting notMerge to false for pie only
      
      * handle other slice in tooltip
      
      * fix bugs in total graphic
      
      * use OTHER_SLICE_KEY const in static viz legend
      
      * implement legend and connect to hover state
      
      * implement click actions
      
      * fix slice not clickable
      
      * handle all zero slices
      
      * add repro
      
      * update specs
      
      * update pie_chart.cy.spec.js
      
      * update chart_drill.cy.spec.js
      
      * add repro for single column legend
      
      * use minimum 2 legend columns
      
      * fix legend text overlap
      
      * use more margin for single row legend
      
      * update specs
      
      * add repro for 28568
      
      * add repro for 38424
      
      * fix percent label not showing on large slices
      
      * hide total text when chart is small
      
      * replace comment about animations
      
      * show warning for mixed positive and negative values
      
      * delete old chart files
      
      * fix type errors
      
      * update d3 import
      
      * update specs
      
      * remove branch from uberjar.yml
      
      * dont put single slice into other
      
      * fix lint errors and pie render test
      
      * update more d3 imports
      
      * remove unused settings
      
      * revert preview-card-width change
      
      * remove unused import
      
      * remove majorWidth option from formatting
      
      * use debounceLeading refresh mode in ChartWithLegend
      
      * remove TOTAL_GRAPHIC_OPTION constant
      
      * delete unit test for pie chart
      
      * fix failing test by doing set comparison instead
      
      * fix typo in comment
      
      * remove SUNBURST_SERIES_OPTION constant
      
      * fix lint by removing unused eslint-disable
      
      * move default color computation to getValue
      
      * fix static pie test to show that we will always render the legend
      
      * update pie border color for night mode and embedding
      
      * fix styles for embedding case and add stories
      
      * skip embedding stories
      
      ---------
      
      Co-authored-by: default avatarAdam James <adam.vermeer2@gmail.com>
      4ec1fd88
    • Alexander Solovyov's avatar
  3. Jul 30, 2024
  4. Jul 29, 2024
  5. Jul 26, 2024
  6. Jul 25, 2024
    • adam-james's avatar
      Some Email/Attachment Improvements and Fixes (#45691) · 7efce7df
      adam-james authored
      * fix conditional formatting color lookup with correct col names
      
      The column names for color lookup are expected to be the same as the :name key of each column, and applying column
      formatting broke this lookup. This fixes it.
      
      * move overflow-x into pulse body div to exlude card title from scroll
      
      * add a test for conditional formatting w/ a hidden row.
      
      This still fails at the moment, working on a fix yet.
      
      * apply conditional formatting in static viz even when col is hidden
      
      Conditional formatting that depends on a hidden column was not being rendered in the static viz, but now we pass all
      columns into the color selector fn, thus when rendering the table with the ordered/hidden columns, all other columns
      will still use their appropriate conditional formatting
      
      * I missed a linter warning
      
      * fix tab rendering
      
      * fix test
      
      * fix up tests with some better structural searching
      7efce7df
    • metamben's avatar
      Add Azure managed identity support (#46011) · 84f932b5
      metamben authored
      
      Add Azure managed identity support 
      
      ---------
      
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      84f932b5
    • bryan's avatar
      Saving SDK data for embedding statistics (#45954) · 2febfbb4
      bryan authored
      * Adds a middleware that sets 2 dynamic vars
      
      - These vars will be used to insert context for embedding analytics
      
      * migration adding embedding_client and embedding_version to qe and vl tables
      
      * clarify function api
      
      * headers come in -> dynamic vars -> written to db
      
      When the vars are set we insert their values into query execution and
      query_log under embedding_client and embedding_version.
      
      * update update migrations
      
      * add predconditions to migrations
      
      * fix tablenames + dataset_test
      
      * Code Review responses
      
      - remove commented out requires
      - clarify test for merge-count-maps
      2febfbb4
    • John Swanson's avatar
      Lock down the trash collection more (#45866) · 72e9b9a4
      John Swanson authored
      * Lock down the trash collection more
      
      Oops. I was very thorough in checking that you couldn't modify the
      trash collection in the sense of moving things to or from it. I missed
      the most obvious thing: actually modifying the trash collection itself.
      So if someone wanted, they could change the name of the Trash to
      "Definitely Not the Trash".
      
      * Remove the Trash Collection from serialization
      
      Serialization tests were failing due to the previous change, but this
      got me thinking, and I realized that serializing the Trash collection is
      completely unnecessary. We want to create it programatically on
      startup (which we are) and then nothing should change it afterwards.
      72e9b9a4
    • bryan's avatar
      Use the new private defn (#46013) · d9961ef0
      bryan authored
      
      * add mu/defn-
      
      * use new built-in mu/defn-
      
      * mu/defn- preserves metadata
      
      ---------
      
      Co-authored-by: default avatarNoah Moss <noahbmoss@gmail.com>
      Co-authored-by: default avatarNoah Moss <32746338+noahmoss@users.noreply.github.com>
      d9961ef0
    • Noah Moss's avatar
      Make the sandbox cleanup logic more robust, and reorganize some perms code for... · 5741b9fe
      Noah Moss authored
      Make the sandbox cleanup logic more robust, and reorganize some perms code for better testing (#46102)
      
      5741b9fe
    • adam-james's avatar
      Number formatter Reports correct Decimal places for negative Numbers (#46104) · 19118993
      adam-james authored
      * Number formatter Reports correct Decimal places for negative Numbers
      
      Fixes #41640
      
      Prior to this, the number formatter would get the incorrect number of decimal places for negative numbers.
      
      The way the decimal places count is derived works as follows:
      
       - convert number to a string
       - split the string on the separator (decimal, comma, whatever the instance has set)
       - destructure that split into [int decimal]
       - count decimal to get the number of decimals.
      
      That all works for positive numbers, but for negative numbers, the regex was just splitting on 'not digits', so we got
      an extra group due to the leading negative sign. This would incorrectly destructure  the 'int' part of the number into
      the count, thus we would always get 1 instead of the correct value.
      
      This fixes it by just taking last instead of destructuring.
      
      * correct comparison to always use abs value in conditonal check
      
      * tiny incorrectness in the test
      19118993
  7. Jul 24, 2024
    • Alexander Polyankin's avatar
    • Alexander Polyankin's avatar
      3f704461
    • adam-james's avatar
      Embedding Parameter Values set in Tokens work properly when `nil` or empty list (#45771) · f257598e
      adam-james authored
      * Embedding Parameter Values set in Tokens work properly when `nil` or empty list
      
      Fixes: #40292
      
      If a locked parameter's value is set to `nil` or `[]` in the embedding JWT, we want to treat this as 'no value has
      been set' on that filter, but we should still run the query as normal. Likewise, any linked filters should still
      properly derive their values from the unfiltered values of the filter to which they are linked.
      
      * when a parameter's value is nil or empty seq, don't include it
      
      This is a partial solution as I still need to find the place that's still erroring on the empty list case in terms of
      the linked parameter's values.
      
      * Treat empty list like `nil` for the token param
      
      When you're using a filter in the App, it makes intuitive sense that when you've not selected anything from a filter's
      drop down list (or entered any text, etc.), then the filter is effectively not applied.
      
      For token params, we should behave similarly; `nil` and `[]` can both be accepted, and signal that the user intends
      for that filter to basically NOT apply.
      
      This also means we should not pass the constraint to the linked filters, since it errors, but even if it worked, it
      would return 0 results, making it impossible to properly apply the linked filter at all.
      
      So, this change causes empty lists to be treated as nil, AND will remove any parameters with `nil` as a value before
      being passed to the query processor, which results in the proper behaviour of not having constraints on the linked
      filter, and having the 'parent' filter not filtering anything.
      
      * Embed preview should always use params from the token
      
      In making a screenshot, I discovered a slight bug in previews, where if the embed had been previously published, it
      could pull embedding params from the db that don't match the settings on screen. So, always pull the settings from the
      token, which updates as the user is making changes in the Preview Embed UI.
      
      * for previews, merge the embedding params sources instead
      
      * alter 'nil' behaviour to work just as if the key doesn't exist
      
      * fix one spot where I was passing maps into set functions
      
      * Adjust tests to check for consistent behaviour in dash/qstn embeds
      
      * fix an e2e test
      
      * fix up last 2 failing e2e tests
      
      * add the test case of a locked param having no value set in token
      
      * some further e2e changes
      f257598e
    • Chris Truter's avatar
    • Ngoc Khuat's avatar
  8. Jul 23, 2024
Loading