You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pp...@apache.org on 2017/04/04 06:36:42 UTC

ambari git commit: AMBARI-20658.Click of 'NEW JOB' button doesn't create new worksheet tab. (Venkata Sairam via padmapriyanitt)

Repository: ambari
Updated Branches:
  refs/heads/trunk 900070d8e -> 40a206558


AMBARI-20658.Click of 'NEW JOB' button doesn't create new worksheet tab. (Venkata Sairam via padmapriyanitt)


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

Branch: refs/heads/trunk
Commit: 40a2065581b338cb4789521a91c45f6a21a677d1
Parents: 900070d
Author: padmapriyanitt <pa...@gmail.com>
Authored: Tue Apr 4 12:06:36 2017 +0530
Committer: padmapriyanitt <pa...@gmail.com>
Committed: Tue Apr 4 12:06:36 2017 +0530

----------------------------------------------------------------------
 .../hive20/src/main/resources/ui/app/routes/queries/new.js      | 5 ++++-
 .../ui/app/templates/components/top-application-bar.hbs         | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/40a20655/contrib/views/hive20/src/main/resources/ui/app/routes/queries/new.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/new.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/new.js
index b48b8df..76a7439 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/new.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/new.js
@@ -22,10 +22,13 @@ export default Ember.Route.extend({
   beforeModel() {
     let existingWorksheets = this.store.peekAll('worksheet');
     let newWorksheetName = 'worksheet';
-    if(!this.controllerFor("queries").worksheetCount) {
+    if(!this.controllerFor("queries").worksheetCount && !existingWorksheets.get("length")) {
       newWorksheetName = newWorksheetName + 1;
     } else {
       let id = parseInt(this.controllerFor("queries").worksheetCount);
+      if(!id){
+        id = existingWorksheets.get("length")+1;
+      }
       newWorksheetName = newWorksheetName + id;
     }
     let newWorksheetTitle = newWorksheetName.capitalize();

http://git-wip-us.apache.org/repos/asf/ambari/blob/40a20655/contrib/views/hive20/src/main/resources/ui/app/templates/components/top-application-bar.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/top-application-bar.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/top-application-bar.hbs
index f163dca..8cdb779 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/top-application-bar.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/top-application-bar.hbs
@@ -27,7 +27,7 @@
   {{#if (not (or service askPassword))}}
     <span class="pull-right">
       {{#link-to 'queries.new' class="btn btn-sm btn-success"}}{{fa-icon "plus"}} NEW JOB{{/link-to}}
-        {{#link-to 'databases.newtable' class="btn btn-sm btn-success"}}{{fa-icon "plus"}} NEW TABLE{{/link-to}}
+      {{#link-to 'databases.newtable' class="btn btn-sm btn-success"}}{{fa-icon "plus"}} NEW TABLE{{/link-to}}
     </span>
   {{/if}}
 </h3>