You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2017/02/17 22:56:54 UTC

[16/51] [abbrv] ambari git commit: AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)

AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)

(cherry picked from commit 3f41dbc80fcc1fe2a3620df8df5d1da58c5bb126)

Change-Id: I4d9773d5989f07de16c124e393618eb6a2098f82


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 14d78ab4a42bdeb25426d1837c9b8f7c7d14ce09
Parents: 2fed50c
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Thu Feb 2 12:05:14 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 00:28:57 2017 -0800

----------------------------------------------------------------------
 .../hive20/src/main/resources/ui/app/app.js     |  9 -------
 .../resources/ui/app/components/jobs-browser.js |  4 ----
 .../main/resources/ui/app/controllers/jobs.js   |  7 +++---
 .../src/main/resources/ui/app/routes/jobs.js    | 25 ++++++++++++--------
 .../app/templates/components/jobs-browser.hbs   |  1 +
 .../src/main/resources/ui/config/environment.js |  2 --
 6 files changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js
index 0f83ee5..af4fdc4 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/app.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/app.js
@@ -26,15 +26,6 @@ let App;
 Ember.MODEL_FACTORY_INJECTIONS = true;
 
 App = Ember.Application.extend({
-  // Basic logging, e.g. "Transitioned into 'post'"
-  LOG_TRANSITIONS: false,
-
-  // Extremely detailed logging, highlighting every internal
-  // step made while transitioning into a route, including
-  // `beforeModel`, `model`, and `afterModel` hooks, and
-  // information about redirects and aborted transitions
-  LOG_TRANSITIONS_INTERNAL: false,
-
   modulePrefix: config.modulePrefix,
   podModulePrefix: config.podModulePrefix,
   Resolver

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
index e3b22e9..b0a82b0 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
@@ -39,10 +39,6 @@ export default Ember.Component.extend({
   actions: {
     setDateRange(startDate, endDate) {
       this.sendAction('filterChanged', startDate, endDate);
-    },
-
-    expandJob(jobId) {
-      console.log("Job to be expanded", jobId);
     }
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
index 9ab46f3..2ca4474 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
@@ -26,12 +26,13 @@ export default Ember.Controller.extend({
 
 
   startTimeText: Ember.computed('startTime', function() {
-    return this.get('moment').moment(this.get('startTime')).format('YYYY-MM-DD');
+    let st = typeof(this.get('startTime')) === 'string' ? parseInt(this.get('startTime')) : this.get('startTime');
+    return this.get('moment').moment(st).format('YYYY-MM-DD');
   }),
 
   endTimeText: Ember.computed('endTime', function() {
-    return this.get('moment').moment(this.get('endTime')).format('YYYY-MM-DD');
+    let et = typeof(this.get('endTime')) === 'string' ? parseInt(this.get('endTime')) : this.get('endTime');
+    return this.get('moment').moment(et).format('YYYY-MM-DD');
   })
 
-
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
index a2ebc25..419fd07 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
@@ -34,22 +34,24 @@ export default Ember.Route.extend({
   model(params) {
     let now = this.get('moment').moment();
     if(Ember.isEmpty(params.startTime) || Ember.isEmpty(params.endTime)) {
-      let initialValue = now.clone();
-      params.endTime = now.valueOf();
-      params.startTime = now.subtract('7', 'days').valueOf();
-      this.set('timeInitializedTo', initialValue);
+      let clone = now.clone();
+      params.endTime = now.endOf('day').valueOf();
+      params.startTime = clone.subtract('7', 'days').startOf('day').valueOf();
+      this.set('startInitTo', params.startTime);
+      this.set('endInitTo', params.endTime);
     }
 
     return this.store.query('job', params);
   },
 
   setupController(controller, model) {
-    if(!Ember.isEmpty(this.get('timeInitializedTo'))) {
+    if(!(Ember.isEmpty(this.get('startInitTo')) || Ember.isEmpty(this.get('endInitTo')))) {
 
-      controller.set('endTime', this.get('timeInitializedTo').valueOf());
-      controller.set('startTime', this.get('timeInitializedTo').subtract('7', 'days').valueOf());
+      controller.set('endTime', this.get('endInitTo'));
+      controller.set('startTime', this.get('startInitTo'));
       //unset timeInitializedTo
-      this.set('timeInitializedTo');
+      this.set('endInitTo');
+      this.set('startInitTo');
     }
 
     this._super(...arguments);
@@ -58,9 +60,12 @@ export default Ember.Route.extend({
 
   actions: {
     dateFilterChanged(startTime, endTime) {
-      this.controller.set('startTime', this.get('moment').moment(startTime, 'YYYY-MM-DD').valueOf())
-      this.controller.set('endTime', this.get('moment').moment(endTime, 'YYYY-MM-DD').valueOf())
+      this.controller.set('startTime', this.get('moment').moment(startTime, 'YYYY-MM-DD').startOf('day').valueOf())
+      this.controller.set('endTime', this.get('moment').moment(endTime, 'YYYY-MM-DD').endOf('day').valueOf())
       this.refresh();
+    },
+    hideDatePicker() {
+      console.log("Hiddennnnn");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
index 47b499a..abb4a97 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
@@ -32,6 +32,7 @@
         start=startTime
         end=endTime
         opens="left"
+        autoApply=true
         applyAction=(action "setDateRange")
       }}
     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 42dde20..9efd491 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -34,8 +34,6 @@ module.exports = function(environment) {
     APP: {
       // Here you can pass flags/options to your application instance
       // when it is created
-      LOG_VIEW_LOOKUPS: false,
-      LOG_ACTIVE_GENERATION: false
     }
   };