ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-5321. Job js-error (alexantonenko)
Date Wed, 02 Apr 2014 16:07:11 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk cc048cf0f -> 08206fb2a


AMBARI-5321. Job js-error (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/08206fb2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/08206fb2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/08206fb2

Branch: refs/heads/trunk
Commit: 08206fb2a073886fded9f0adb5273f4e88eb0767
Parents: cc048cf
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Apr 2 19:04:39 2014 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Wed Apr 2 19:04:58 2014 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/jobs_mapper.js | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/08206fb2/ambari-web/app/mappers/jobs_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/jobs_mapper.js b/ambari-web/app/mappers/jobs_mapper.js
index 7873bc3..9e9896b 100644
--- a/ambari-web/app/mappers/jobs_mapper.js
+++ b/ambari-web/app/mappers/jobs_mapper.js
@@ -17,6 +17,13 @@
  */
 
 var App = require('app');
+var fillEmptyValues = function(self, obj) {
+  $.each(self.config, function(field, value) {
+    if (obj[value].length == 0) {
+      obj[value].push({x: 0, y: 0});
+    };
+  });
+};
 
 App.jobsMapper = App.QuickDataMapper.create({
   model:App.Job,
@@ -72,6 +79,7 @@ App.jobTimeLineMapper = App.QuickDataMapper.create({
       d.reverse();
       job.set(field, d);
     });
+    fillEmptyValues(this, job);
   },
 
   coordinatesModify: function(data) {
@@ -110,6 +118,7 @@ App.taskTimeLineMapper = App.QuickDataMapper.create({
     $.each(parseResult, function (field, value) {
       job.set(field, value);
     });
+    fillEmptyValues(this, job);
   }
 });
 


Mime
View raw message