-
- Downloads
Static Viz Formatting (#17957)
* Formatting return a format string so it can be used over multiple rows. The rules for formatting are quite annoying because there are defaults that are assumed rather than present. IE, if you set a column as currency it doesn't set the number style sometimes and defaults to USD without that being in the settings. In the future would be far preferable to always create a fully fleshed map of defaults rather than inferring them in random places. * appease our doc string supervisor * Include column information for formatting numbers really important for requiring two decimal places by default on doubles and none on integers. Its close to correct ignoring it and using "#,###.##" and this leaves non decimal places on integers and allows only up to two on doubles, but things like 31.10 will format as 31.1 and that is improper * Remove unneeded metabase.test * Update tests with nil column * Get global viz settings in middleware, pass entire to formatting Passing the entire viz settings to the formatting stuff makes the calling code much simpler and the places where we merge global settings, possibly get currency settings, etc, just in one place. We already had the col information there so just use it. * Remove public settings now that we get it from the metadata
Showing
- src/metabase/pulse/render/body.clj 51 additions, 24 deletionssrc/metabase/pulse/render/body.clj
- src/metabase/pulse/render/common.clj 58 additions, 3 deletionssrc/metabase/pulse/render/common.clj
- src/metabase/query_processor/middleware/visualization_settings.clj 8 additions, 2 deletions...ase/query_processor/middleware/visualization_settings.clj
- test/metabase/pulse/render/common_test.clj 77 additions, 0 deletionstest/metabase/pulse/render/common_test.clj
- test/metabase/query_processor/middleware/visualization_settings_test.clj 22 additions, 5 deletions...uery_processor/middleware/visualization_settings_test.clj
test/metabase/pulse/render/common_test.clj
0 → 100644
Please register or sign in to comment