chore: revert bignumber.js patch for charts and reapply the original bignumber.js change to SQL editor in an opt-in fashion (#7210)

* revert: bignumber patch to prevent rendering regression in charts

* Revert "Fix rendering regression from the introduction of bignumber (#6937)"

* fix: consume the bignumber.js reversion -- apply the bignumber conversion in `actions/sqlLab.js` where it is needed (aka opt into bignumber.js).

* Revert "Fix deck.gl form data (#6953)" b/c formData now returns snake_cased properties for deck vizzes.
This commit is contained in:
Christine Chambers
2019-04-03 11:19:56 -07:00
committed by GitHub
parent 200efacc36
commit 8e14807b2a
20 changed files with 359 additions and 410 deletions

View File

@@ -17,6 +17,7 @@
* under the License.
*/
import shortid from 'shortid';
import JSONbig from 'json-bigint';
import { t } from '@superset-ui/translation';
import { SupersetClient } from '@superset-ui/connection';
@@ -128,9 +129,11 @@ export function fetchQueryResults(query) {
return SupersetClient.get({
endpoint: `/superset/results/${query.resultsKey}/`,
parseMethod: 'text',
})
.then(({ json = {} }) => {
dispatch(querySuccess(query, json));
.then(({ text = '{}' }) => {
const bigIntJson = JSONbig.parse(text);
dispatch(querySuccess(query, bigIntJson));
})
.catch(response =>
getClientErrorObject(response).then((error) => {
@@ -164,10 +167,12 @@ export function runQuery(query) {
endpoint: `/superset/sql_json/${window.location.search}`,
postPayload,
stringify: false,
parseMethod: 'text',
})
.then(({ json }) => {
.then(({ text = '{}' }) => {
if (!query.runAsync) {
dispatch(querySuccess(query, json));
const bigIntJson = JSONbig.parse(text);
dispatch(querySuccess(query, bigIntJson));
}
})
.catch(response =>