Skip to content
Snippets Groups Projects
  • metabase-bot[bot]'s avatar
    aea2cb22
    Add per viz-type card template sizes in x-rays (#38836) (#38884) · aea2cb22
    metabase-bot[bot] authored
    * Add per viz-type card template sizes in x-rays
    
    Previously, any card without a size (width or height) set in their yaml definition was set to a default of `default-card-width` or `default-card-width`, respectively. This PR adds a map of default and min dimensions per viz type (the `:display`) key and fills that in for each template. The template is merged into this result, keeping anything that already existed in the yaml file.
    
    Before merging this we should consider if we want to use the min values and where this data should be stored. It is currently in `metabase.automagic-dashboards.dashboard-templates`, but was lifted from [sizes.ts](https://github.com/metabase/metabase/blob/master/frontend/src/metabase/visualizations/shared/utils/sizes.ts
    
    ).
    
    * Moving card sizing constants to cljc
    
    The default card sizes were found in `sizes.ts` and were duplicated into `metabase.automagic-dashboards.dashboard-templates`. This PR consolidates those changes into `metabase.shared.automagic-dashboards.constants`.
    
    Note that @kulyk and @JesseSDevaney might want to consider further consolidation of dashboard related constants into this namespace.
    
    * Incorporating Feedback
    
    Changes
    - Explicitly defined two constants in the shared file that are clj and js friendly
    - Set case to CARD_SIZE_DEFAULTS_JSON
    - Updated `metabase.automagic-dashboards.dashboard-templates/set-default-card-dimensions` to use a helper
    
    * Update src/metabase/shared/automagic_dashboards/constants.cljc
    
    
    
    * Updating ns name per Jesse
    
    ---------
    
    Co-authored-by: default avatarMark Bastian <markbastian@gmail.com>
    Co-authored-by: default avatarJesse Devaney <22608765+JesseSDevaney@users.noreply.github.com>
    Add per viz-type card template sizes in x-rays (#38836) (#38884)
    metabase-bot[bot] authored
    * Add per viz-type card template sizes in x-rays
    
    Previously, any card without a size (width or height) set in their yaml definition was set to a default of `default-card-width` or `default-card-width`, respectively. This PR adds a map of default and min dimensions per viz type (the `:display`) key and fills that in for each template. The template is merged into this result, keeping anything that already existed in the yaml file.
    
    Before merging this we should consider if we want to use the min values and where this data should be stored. It is currently in `metabase.automagic-dashboards.dashboard-templates`, but was lifted from [sizes.ts](https://github.com/metabase/metabase/blob/master/frontend/src/metabase/visualizations/shared/utils/sizes.ts
    
    ).
    
    * Moving card sizing constants to cljc
    
    The default card sizes were found in `sizes.ts` and were duplicated into `metabase.automagic-dashboards.dashboard-templates`. This PR consolidates those changes into `metabase.shared.automagic-dashboards.constants`.
    
    Note that @kulyk and @JesseSDevaney might want to consider further consolidation of dashboard related constants into this namespace.
    
    * Incorporating Feedback
    
    Changes
    - Explicitly defined two constants in the shared file that are clj and js friendly
    - Set case to CARD_SIZE_DEFAULTS_JSON
    - Updated `metabase.automagic-dashboards.dashboard-templates/set-default-card-dimensions` to use a helper
    
    * Update src/metabase/shared/automagic_dashboards/constants.cljc
    
    
    
    * Updating ns name per Jesse
    
    ---------
    
    Co-authored-by: default avatarMark Bastian <markbastian@gmail.com>
    Co-authored-by: default avatarJesse Devaney <22608765+JesseSDevaney@users.noreply.github.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.