Repository: ambari
Updated Branches:
  refs/heads/trunk f0f3eab6b -> d29b5b292


AMBARI-18045. Pig view - Pig script creation fails. (gauravn7)


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

Branch: refs/heads/trunk
Commit: d29b5b292823d50b10490a49a692d32dd011f1a0
Parents: f0f3eab
Author: Gaurav Nagar <[email protected]>
Authored: Wed Aug 10 17:25:27 2016 +0530
Committer: Gaurav Nagar <[email protected]>
Committed: Wed Aug 10 17:25:27 2016 +0530

----------------------------------------------------------------------
 .../src/main/resources/ui/pig-web/app/initialize.js  | 15 +++++++++++++++
 .../resources/ui/pig-web/app/models/pig_script.js    |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d29b5b29/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
index abd72f1..38ee093 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/initialize.js
@@ -64,6 +64,21 @@ App.IsodateTransform = DS.Transform.extend({
   },
   serialize: function (deserialized) {
     if (deserialized) {
+      return moment(deserialized).format('x');
+    }
+    return deserialized;
+  }
+});
+
+App.ScriptdateTransform = DS.Transform.extend({
+  deserialize: function (serialized) {
+    if (serialized) {
+      return moment(serialized).toDate();
+    }
+    return serialized;
+  },
+  serialize: function (deserialized) {
+    if (deserialized) {
       return moment(deserialized).utc().format('YYYY-MM-DDTHH:mm:ss') + 'Z';
     }
     return deserialized;

http://git-wip-us.apache.org/repos/asf/ambari/blob/d29b5b29/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
----------------------------------------------------------------------
diff --git 
a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js 
b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
index 641180f..54abb75 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/models/pig_script.js
@@ -21,7 +21,7 @@ var App = require('app');
 App.Script = DS.Model.extend({
   title:DS.attr('string'),
   pigScript:DS.belongsTo('file', { async: true }),
-  dateCreated:DS.attr('isodate', { defaultValue: moment()}),
+  dateCreated:DS.attr('scriptdate', { defaultValue: moment()}),
   templetonArguments:DS.attr('string'),
   pythonScript:DS.attr('string'),
   owner:DS.attr('string'),

Reply via email to