superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kri...@apache.org
Subject [incubator-superset] branch master updated: Add more format shims (#6709)
Date Thu, 17 Jan 2019 07:31:49 GMT
This is an automated email from the ASF dual-hosted git repository.

kristw 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 9c7b98a  Add more format shims (#6709)
9c7b98a is described below

commit 9c7b98a27ab6eec1f69237e1818165c7a89495bf
Author: Krist Wongsuphasawat <krist.wongz@gmail.com>
AuthorDate: Wed Jan 16 23:31:43 2019 -0800

    Add more format shims (#6709)
    
    * add more shims
    * update package-lock.json
---
 superset/assets/package-lock.json            | 10 +++++-----
 superset/assets/src/setup/setupFormatters.js | 28 +++++++++++++++++++++-------
 2 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/superset/assets/package-lock.json b/superset/assets/package-lock.json
index 9c84301..5a1ce42 100644
--- a/superset/assets/package-lock.json
+++ b/superset/assets/package-lock.json
@@ -9245,7 +9245,7 @@
     },
     "globby": {
       "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
+      "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
       "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
       "dev": true,
       "requires": {
@@ -9676,7 +9676,7 @@
     },
     "http-proxy-middleware": {
       "version": "0.18.0",
-      "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",
+      "resolved": "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz",
       "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==",
       "dev": true,
       "requires": {
@@ -9762,7 +9762,7 @@
             },
             "is-accessor-descriptor": {
               "version": "0.1.6",
-              "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+              "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
               "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
               "dev": true,
               "requires": {
@@ -9782,7 +9782,7 @@
             },
             "is-data-descriptor": {
               "version": "0.1.4",
-              "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+              "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
               "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
               "dev": true,
               "requires": {
@@ -14087,7 +14087,7 @@
       "dependencies": {
         "async": {
           "version": "1.5.2",
-          "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+          "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz",
           "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
           "dev": true
         }
diff --git a/superset/assets/src/setup/setupFormatters.js b/superset/assets/src/setup/setupFormatters.js
index 40db248..c9346ac 100644
--- a/superset/assets/src/setup/setupFormatters.js
+++ b/superset/assets/src/setup/setupFormatters.js
@@ -27,21 +27,35 @@ export default function setupFormatters() {
     .setDefaultKey(defaultNumberFormatter.id)
     // Add shims for format strings that are deprecated or common typos.
     // Temporary solution until performing a db migration to fix this.
-    .registerValue('+,', getNumberFormatter(NumberFormats.INTEGER_CHANGE))
     .registerValue(',0', getNumberFormatter(',.4~f'))
+    .registerValue('null', getNumberFormatter(',.4~f'))
+    .registerValue('%', getNumberFormatter('.0%'))
     .registerValue('.', getNumberFormatter('.4~f'))
+    .registerValue(',f', getNumberFormatter(',d'))
+    .registerValue(',r', getNumberFormatter(',.4f'))
+    .registerValue('0f', getNumberFormatter(',d'))
     .registerValue(',#', getNumberFormatter(',.4~f'))
-    .registerValue(',2f', getNumberFormatter(',.4~f'))
-    .registerValue(',g', getNumberFormatter(',.4~f'))
-    .registerValue('int', getNumberFormatter(NumberFormats.INTEGER))
+    .registerValue('$,f', getNumberFormatter('$,d'))
+    .registerValue('0%', getNumberFormatter('.0%'))
+    .registerValue('f', getNumberFormatter(',d'))
     .registerValue(',.', getNumberFormatter(',.4~f'))
-    .registerValue('.0%f', getNumberFormatter('.1%'))
     .registerValue('.1%f', getNumberFormatter('.1%'))
+    .registerValue('1%', getNumberFormatter('.0%'))
+    .registerValue('3%', getNumberFormatter('.0%'))
+    .registerValue(',%', getNumberFormatter(',.0%'))
     .registerValue('.r', getNumberFormatter('.4~f'))
+    .registerValue('$,.0', getNumberFormatter('$,d'))
+    .registerValue('$,.1', getNumberFormatter('$,.1~f'))
     .registerValue(',0s', getNumberFormatter(',.4~f'))
     .registerValue('%%%', getNumberFormatter('.0%'))
-    .registerValue(',0f', getNumberFormatter(',.4~f'))
-    .registerValue(',1', getNumberFormatter(',.4~f'))
+    .registerValue(',0f', getNumberFormatter(',d'))
+    .registerValue('+,%', getNumberFormatter('+,.0%'))
+    .registerValue('$f', getNumberFormatter('$,d'))
+    .registerValue('+,', getNumberFormatter(NumberFormats.INTEGER_CHANGE))
+    .registerValue(',2f', getNumberFormatter(',.4~f'))
+    .registerValue(',g', getNumberFormatter(',.4~f'))
+    .registerValue('int', getNumberFormatter(NumberFormats.INTEGER))
+    .registerValue('.0%f', getNumberFormatter('.1%'))
     .registerValue('$,0', getNumberFormatter('$,.4f'))
     .registerValue('$,0f', getNumberFormatter('$,.4f'))
     .registerValue('$,.f', getNumberFormatter('$,.4f'));


Mime
View raw message