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/aeb6707f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aeb6707f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aeb6707f Branch: refs/heads/branch-3.0-perf Commit: aeb6707f61ae441e77ac443a9f3ce2e81fb208fb Parents: caf6a25 Author: padmapriyanitt <[email protected]> Authored: Tue Apr 4 12:06:36 2017 +0530 Committer: Andrew Onishuk <[email protected]> Committed: Thu Apr 6 12:32:56 2017 +0300 ---------------------------------------------------------------------- .../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/aeb6707f/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/aeb6707f/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>
