Commit 545afb53 by Deep Singh Committed by kevalbhatt

ATLAS-3964: Atlas UI displayes large numbers incorrectly

Signed-off-by: 's avatarkevalbhatt <kbhatt@apache.org>
parent d4a50aad
......@@ -110,7 +110,8 @@ module.exports = function(grunt) {
'table-dragger.js': { 'table-dragger/dist': 'table-dragger' },
'jstree.min.js': { 'jstree/dist': 'jstree' },
'jquery.steps.min.js': { 'jquery-steps/build': 'jquery-steps' },
'dropzone-amd-module.js': { 'dropzone/dist': "dropzone/js" }
'dropzone-amd-module.js': { 'dropzone/dist': "dropzone/js" },
'lossless-json.js': { 'lossless-json/dist': 'lossless-json' }
}
},
......@@ -178,7 +179,8 @@ module.exports = function(grunt) {
],
'LICENSE.md': [{ 'backbone.babysitter': 'backbone-babysitter' },
{ 'backbone.wreqr': 'backbone-wreqr' },
{ 'nvd3': 'nvd3/' }
{ 'nvd3': 'nvd3/' },
{ 'lossless-json': 'lossless-json' }
],
'license.txt': [{ 'backbone.marionette': 'backbone-marionette' }],
'license': [{ 'table-dragger': 'table-dragger' }],
......
......@@ -2104,6 +2104,11 @@
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true
},
"lossless-json": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-1.0.4.tgz",
"integrity": "sha512-zEkWwELMSQQISdtOF44vk0bRJhN/PJ93qcgJLcodizQjxrJKdFrq2H1+Xv5QDe7v3dTYYbBI5hOsh4a9l0B2Ow=="
},
"loud-rejection": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
......
......@@ -52,7 +52,8 @@
"requirejs-text": "2.0.15",
"select2": "4.0.3",
"table-dragger": "1.0.2",
"underscore": "1.8.3"
"underscore": "1.8.3",
"lossless-json": "1.0.4"
},
"devDependencies": {
"grunt": "1.0.4",
......
......@@ -181,7 +181,8 @@ require.config({
'table-dragger': 'libs/table-dragger/table-dragger',
'jstree': 'libs/jstree/jstree.min',
'jquery-steps': 'libs/jquery-steps/jquery.steps.min',
'dropzone': 'libs/dropzone/js/dropzone-amd-module'
'dropzone': 'libs/dropzone/js/dropzone-amd-module',
'lossless-json': 'libs/lossless-json/lossless-json'
},
/**
......
......@@ -16,7 +16,7 @@
* limitations under the License.
*/
define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jquery-placeholder'], function(require, Utils) {
define(['require', 'utils/Utils', 'lossless-json', 'marionette', 'backgrid', 'asBreadcrumbs', 'jquery-placeholder'], function(require, Utils, LosslessJSON) {
'use strict';
Backbone.$.ajaxSetup({
......@@ -42,7 +42,16 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
if (options.cust_error) {
options.cust_error(that, response);
}
}
},
converters: _.extend($.ajaxSettings.converters, {
"text json": function(data) {
try {
return LosslessJSON.parse(data, function(k, v) { return (v.isLosslessNumber) ? v.value : v });
} catch (err) {
return $.parseJSON(data);
}
}
})
})
]);
}
......
......@@ -110,7 +110,8 @@ module.exports = function(grunt) {
'table-dragger.js': { 'table-dragger/dist': 'table-dragger' },
'jstree.min.js': { 'jstree/dist': 'jstree' },
'jquery.steps.min.js': { 'jquery-steps/build': 'jquery-steps' },
'dropzone-amd-module.js': { 'dropzone/dist': "dropzone/js" }
'dropzone-amd-module.js': { 'dropzone/dist': "dropzone/js" },
'lossless-json.js': { 'lossless-json/dist': 'lossless-json' }
}
},
......@@ -184,7 +185,8 @@ module.exports = function(grunt) {
],
'LICENSE.md': [{ 'backbone.babysitter': 'backbone-babysitter' },
{ 'backbone.wreqr': 'backbone-wreqr' },
{ 'nvd3': 'nvd3/' }
{ 'nvd3': 'nvd3/' },
{ 'lossless-json': 'lossless-json' }
],
'license.txt': [{ 'backbone.marionette': 'backbone-marionette' }],
'license': [{ 'table-dragger': 'table-dragger' }],
......
......@@ -2112,6 +2112,11 @@
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true
},
"lossless-json": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/lossless-json/-/lossless-json-1.0.4.tgz",
"integrity": "sha512-zEkWwELMSQQISdtOF44vk0bRJhN/PJ93qcgJLcodizQjxrJKdFrq2H1+Xv5QDe7v3dTYYbBI5hOsh4a9l0B2Ow=="
},
"loud-rejection": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
......
......@@ -53,7 +53,8 @@
"requirejs-text": "2.0.15",
"select2": "4.0.3",
"table-dragger": "1.0.2",
"underscore": "1.8.3"
"underscore": "1.8.3",
"lossless-json": "1.0.4"
},
"devDependencies": {
"grunt": "1.0.4",
......
......@@ -210,7 +210,8 @@ require.config({
'table-dragger': 'libs/table-dragger/table-dragger',
'jstree': 'libs/jstree/jstree.min',
'jquery-steps': 'libs/jquery-steps/jquery.steps.min',
'dropzone': 'libs/dropzone/js/dropzone-amd-module'
'dropzone': 'libs/dropzone/js/dropzone-amd-module',
'lossless-json': 'libs/lossless-json/lossless-json'
},
/**
......
......@@ -16,7 +16,7 @@
* limitations under the License.
*/
define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jquery-placeholder'], function(require, Utils) {
define(['require', 'utils/Utils', 'lossless-json', 'marionette', 'backgrid', 'asBreadcrumbs', 'jquery-placeholder'], function(require, Utils, LosslessJSON) {
'use strict';
Backbone.$.ajaxSetup({
......@@ -42,7 +42,16 @@ define(['require', 'utils/Utils', 'marionette', 'backgrid', 'asBreadcrumbs', 'jq
if (options.cust_error) {
options.cust_error(that, response);
}
}
},
converters: _.extend($.ajaxSettings.converters, {
"text json": function(data) {
try {
return LosslessJSON.parse(data, function(k, v) { return (v.isLosslessNumber) ? v.value : v });
} catch (err) {
return $.parseJSON(data);
}
}
})
})
]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment