This is an automated email from the ASF dual-hosted git repository.

erikrit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7b33d54  fix: change number format to original value to "~g" (#9608)
7b33d54 is described below

commit 7b33d5457ba2e8bdf56a1469003a64a2217594ca
Author: Jesse Yang <jesse.y...@airbnb.com>
AuthorDate: Wed Apr 22 10:07:37 2020 -0700

    fix: change number format to original value to "~g" (#9608)
    
    Originally it uses " ", which do give the original value, but will
    not work when the `getNumberFormatter` in `superset-ui/number-format`
    is called for the second time. Because the format will successfully
    register as "" [1], but cannot be obtained again via `registry.get()`[2].
    
    [1]: 
https://github.com/apache-superset/superset-ui/blob/44ad062dd02d080362dac28782c0327cc9fa3445/packages/superset-ui-number-format/src/NumberFormatterRegistry.ts#L30
    [2]: 
https://github.com/apache-superset/superset-ui/blob/dc804b7a707e0cb8c29fc129bfff2c9aa143fd62/packages/superset-ui-core/src/models/RegistryWithDefaultKey.ts#L36
---
 superset-frontend/src/explore/controls.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset-frontend/src/explore/controls.jsx 
b/superset-frontend/src/explore/controls.jsx
index 055410a..6306928 100644
--- a/superset-frontend/src/explore/controls.jsx
+++ b/superset-frontend/src/explore/controls.jsx
@@ -83,7 +83,7 @@ export const PRIMARY_COLOR = { r: 0, g: 122, b: 135, a: 1 };
 // input choices & options
 export const D3_FORMAT_OPTIONS = [
   ['SMART_NUMBER', 'Adaptative formating'],
-  [' ', 'Original value'],
+  ['~g', 'Original value'],
   [',d', ',d (12345.432 => 12,345)'],
   ['.1s', '.1s (12345.432 => 10k)'],
   ['.3s', '.3s (12345.432 => 12.3k)'],

Reply via email to