Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E8708200C41 for ; Thu, 9 Mar 2017 17:39:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E7283160B84; Thu, 9 Mar 2017 16:39:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E6D46160B5F for ; Thu, 9 Mar 2017 17:39:32 +0100 (CET) Received: (qmail 4661 invoked by uid 500); 9 Mar 2017 16:39:31 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 3619 invoked by uid 99); 9 Mar 2017 16:39:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 16:39:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C53F0DF9AF; Thu, 9 Mar 2017 16:39:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: oleewere@apache.org To: commits@ambari.apache.org Date: Thu, 09 Mar 2017 16:39:49 -0000 Message-Id: In-Reply-To: <89e11229f30c401f85abf06d78317c4b@git.apache.org> References: <89e11229f30c401f85abf06d78317c4b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/50] [abbrv] ambari git commit: AMBARI-20339. JS Lint warning removal (pallavkul) archived-at: Thu, 09 Mar 2017 16:39:37 -0000 AMBARI-20339. JS Lint warning removal (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3bc3d686 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3bc3d686 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3bc3d686 Branch: refs/heads/branch-dev-logsearch Commit: 3bc3d6861a634c775a87881ab4eda67d06b676bc Parents: 225edb9 Author: pallavkul Authored: Tue Mar 7 20:36:25 2017 +0530 Committer: pallavkul Committed: Tue Mar 7 20:37:49 2017 +0530 ---------------------------------------------------------------------- .../hive20/src/main/resources/ui/.jshintrc | 2 + .../resources/ui/app/adapters/file-resource.js | 1 - .../resources/ui/app/adapters/hdfs-viewer.js | 1 + .../src/main/resources/ui/app/adapters/job.js | 5 +- .../src/main/resources/ui/app/adapters/query.js | 5 +- .../resources/ui/app/adapters/saved-query.js | 1 - .../resources/ui/app/adapters/table-info.js | 2 +- .../src/main/resources/ui/app/adapters/table.js | 2 +- .../src/main/resources/ui/app/adapters/udf.js | 8 --- .../resources/ui/app/adapters/upload-table.js | 4 +- .../resources/ui/app/components/create-table.js | 2 +- .../resources/ui/app/components/edit-table.js | 6 +- .../ui/app/components/export-result.js | 2 +- .../ui/app/components/fileresource-item.js | 5 +- .../resources/ui/app/components/job-item.js | 1 + .../resources/ui/app/components/list-filter.js | 2 +- .../ui/app/components/notification-message.js | 4 +- .../resources/ui/app/components/query-editor.js | 2 +- .../ui/app/components/query-result-table.js | 9 ++- .../app/components/table-advanced-settings.js | 4 +- .../resources/ui/app/components/udf-item.js | 7 +-- .../main/resources/ui/app/components/udf-new.js | 2 +- .../ui/app/components/validated-text-field.js | 2 +- .../ui/app/components/visual-explain.js | 2 +- .../main/resources/ui/app/configs/datatypes.js | 2 +- .../ui/app/controllers/service-check.js | 8 +-- .../resources/ui/app/helpers/extract-value.js | 2 +- .../ui/app/helpers/format-column-size.js | 2 +- .../resources/ui/app/models/table-property.js | 2 +- .../hive20/src/main/resources/ui/app/router.js | 2 +- .../app/routes/databases/database/tables/new.js | 2 +- .../databases/database/tables/table/edit.js | 1 + .../databases/database/tables/upload-table.js | 58 +++++++++++++------- .../src/main/resources/ui/app/routes/jobs.js | 6 +- .../resources/ui/app/routes/queries/query.js | 17 +++--- .../ui/app/routes/queries/query/log.js | 4 +- .../resources/ui/app/routes/savedqueries.js | 4 +- .../main/resources/ui/app/routes/settings.js | 6 +- .../src/main/resources/ui/app/routes/udfs.js | 2 +- .../src/main/resources/ui/app/services/jobs.js | 6 +- .../src/main/resources/ui/app/services/query.js | 12 ++-- .../resources/ui/app/services/saved-queries.js | 14 ++--- .../resources/ui/app/services/service-check.js | 2 +- .../resources/ui/app/services/stats-service.js | 6 +- .../ui/app/services/table-operations.js | 22 ++++---- .../src/main/resources/ui/app/services/udf.js | 25 +++------ .../components/table-advanced-settings.hbs | 8 --- .../ui/app/utils/hive-explainer/enhancer.js | 2 +- .../app/utils/hive-explainer/renderer-force.js | 21 +++---- .../ui/app/utils/hive-explainer/renderer.js | 34 +++++++----- .../ui/app/utils/hive-explainer/transformer.js | 10 ++-- 51 files changed, 176 insertions(+), 185 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/.jshintrc ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/.jshintrc b/contrib/views/hive20/src/main/resources/ui/.jshintrc index d421faa..8cedd57 100644 --- a/contrib/views/hive20/src/main/resources/ui/.jshintrc +++ b/contrib/views/hive20/src/main/resources/ui/.jshintrc @@ -2,6 +2,8 @@ "predef": [ "document", "window", + "d3", + "CodeMirror", "-Promise" ], "browser": true, http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/file-resource.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/file-resource.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/file-resource.js index a25adc7..7f6ab80 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/file-resource.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/file-resource.js @@ -16,7 +16,6 @@ * limitations under the License. */ -import Ember from 'ember'; import ApplicationAdapter from './application'; export default ApplicationAdapter.extend({ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/hdfs-viewer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/hdfs-viewer.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/hdfs-viewer.js index dcd52b8..2e727d1 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/hdfs-viewer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/hdfs-viewer.js @@ -16,6 +16,7 @@ * limitations under the License. */ +import Ember from 'ember'; import ApplicationAdapter from './application'; export default ApplicationAdapter.extend({ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/job.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/job.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/job.js index 7559e9c..e40c0ba 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/job.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/job.js @@ -16,6 +16,7 @@ * limitations under the License. */ +import Ember from 'ember'; import ApplicationAdapter from './application'; export default ApplicationAdapter.extend({ @@ -45,7 +46,7 @@ export default ApplicationAdapter.extend({ }, (error) => { reject(error); }); - }) + }); }, @@ -58,7 +59,7 @@ export default ApplicationAdapter.extend({ if (response.status.toLowerCase() !== "TERMINATED".toLowerCase()) { Ember.run.later( () => { this.pollSaveToHDFS(response) - .then((data) => { resolve(data)}, (error) => { + .then((data) => { resolve(data); }, (error) => { reject(error); }); }, 2000); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/query.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/query.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/query.js index 4913fe2..6640f82 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/query.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/query.js @@ -16,7 +16,6 @@ * limitations under the License. */ -import Ember from 'ember'; import ApplicationAdapter from './application'; export default ApplicationAdapter.extend({ @@ -38,7 +37,7 @@ export default ApplicationAdapter.extend({ url = this.buildURL() + jobId + '/results'; } - return this.ajax(url, 'GET') + return this.ajax(url, 'GET'); }, getVisualExplainJson(jobId){ @@ -49,7 +48,7 @@ export default ApplicationAdapter.extend({ retrieveQueryLog(logFile){ let url = ''; url = this.buildURL().replace('/jobs','') + 'files' + logFile; - return this.ajax(url, 'GET') + return this.ajax(url, 'GET'); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js index a25adc7..7f6ab80 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/saved-query.js @@ -16,7 +16,6 @@ * limitations under the License. */ -import Ember from 'ember'; import ApplicationAdapter from './application'; export default ApplicationAdapter.extend({ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/table-info.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table-info.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table-info.js index 46e7591..66bab88 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table-info.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table-info.js @@ -23,7 +23,7 @@ export default DDLAdapter.extend({ buildURL(modelName, id, snapshot, requestType, query) { // Check if the query is to find all tables for a particular database - if(Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { + if(Ember.isEmpty(id) && (requestType === 'query' || requestType === 'queryRecord')) { let dbId = query.databaseId; let tableName = query.tableName; let origFindAllUrl = this._super(...arguments); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js index e133419..85e34b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js @@ -22,7 +22,7 @@ import DDLAdapter from './ddl'; export default DDLAdapter.extend({ buildURL(modelName, id, snapshot, requestType, query) { // Check if the query is to find all tables for a particular database - if (Ember.isEmpty(id) && (requestType === 'query' || requestType == 'queryRecord')) { + if (Ember.isEmpty(id) && (requestType === 'query' || requestType === 'queryRecord')) { let dbId = query.databaseId; let tableName = query.tableName; let origFindAllUrl = this._super(...arguments); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/udf.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/udf.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/udf.js index c929de7..af8f46f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/udf.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/udf.js @@ -26,14 +26,6 @@ export default ApplicationAdapter.extend({ buildURL(){ return this._super(...arguments).replace('/resources',''); - }, - - fileResourceURL(){ - this.buildURL()+ '/fileResources'; - }, - - udfURL(){ - this.buildURL()+ '/udfs'; } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js index 3bfe15b..eea9f59 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js @@ -83,11 +83,11 @@ export default ApplicationAdapter.extend({ previewFromHDFS : function(previewFromHdfsData){ console.log("preview from hdfs with info : ", previewFromHdfsData); - return this.doPost("previewFromHdfs",previewFromHdfsData) + return this.doPost("previewFromHdfs",previewFromHdfsData); }, uploadFromHDFS : function(uploadFromHdfsData){ console.log("upload from hdfs with info : ", uploadFromHdfsData); - return this.doPost("uploadFromHDFS",uploadFromHdfsData) + return this.doPost("uploadFromHDFS",uploadFromHdfsData); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js index 670ebd7..322aab5 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js @@ -35,7 +35,7 @@ export default Ember.Component.extend({ didReceiveAttrs() { this.get('tabs').setEach('active', false); - let firstTab = this.get('tabs.firstObject') + let firstTab = this.get('tabs.firstObject'); firstTab.set('active', true); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/edit-table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/edit-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/edit-table.js index 439dbcf..b42f6fb 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/edit-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/edit-table.js @@ -63,7 +63,7 @@ export default Ember.Component.extend({ _transformColumns() { let columns = []; columns.pushObjects(this.get('table.columns').map((item) => { - return this._getColumnEntry(item, false, this._isClustered(this.get('table'), item.name)) + return this._getColumnEntry(item, false, this._isClustered(this.get('table'), item.name)); })); if (!Ember.isEmpty(this.get('table.partitionInfo'))) { @@ -113,7 +113,7 @@ export default Ember.Component.extend({ editing: false, newProperty: false }); - }) + }); } else { return []; } @@ -135,7 +135,7 @@ export default Ember.Component.extend({ // Find if already clustered, then set number of buckets if (!Ember.isEmpty(tableInfo.get('storageInfo.bucketCols'))) { - settings.numBuckets = parseInt(tableInfo.get('storageInfo.numBuckets')) + settings.numBuckets = parseInt(tableInfo.get('storageInfo.numBuckets')); this.set('shouldAddBuckets', true); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/export-result.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/export-result.js b/contrib/views/hive20/src/main/resources/ui/app/components/export-result.js index 517da1e..f84e2b5 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/export-result.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/export-result.js @@ -43,7 +43,7 @@ export default Ember.Component.extend({ actions: { confirm() { - let pathName = $("input.path-name").val(); + let pathName = Ember.$("input.path-name").val(); this.sendAction('confirm', this.get('jobId'), pathName); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/fileresource-item.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/fileresource-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/fileresource-item.js index 12cfb5b..27f5e07 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/fileresource-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/fileresource-item.js @@ -34,13 +34,12 @@ export default Ember.Component.extend({ this.set('fileResourceId', fileResourceId); - var self = this; if(this.get('expanded')) { this.set('expanded', false); } else { this.set('expanded', true); - let allUdfs = this.get('store').findAll('udf').then((data) => { + this.get('store').findAll('udf').then((data) => { let selectedUdfList = []; data.forEach(x => { let localFileResource = { @@ -59,8 +58,6 @@ export default Ember.Component.extend({ }); } - - }, createQuery(udfName, udfClassname, fileResourceName, fileResourcePath){ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js index 8a6d318..42a3411 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js @@ -34,6 +34,7 @@ export default Ember.Component.extend({ this.set('queryFile', queryFile); this.set('valueLoading', false); }).catch((err) => { + console.log('err', err); this.set('valueLoading', false); }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js index db0b5c0..dd51e78 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js @@ -31,7 +31,7 @@ export default Ember.Component.extend({ filteredItems: Ember.computed('filterText', 'items.@each', function() { return this.get('items').filter((item) => { let filterText = this.get('caseInsensitive') ? this.get('filterText').toLowerCase() : this.get('filterText'); - let itemName = this.get('caseInsensitive') ? item.get('name').toLowerCase() : item.get('name') + let itemName = this.get('caseInsensitive') ? item.get('name').toLowerCase() : item.get('name'); return itemName.indexOf(filterText) !== -1; }); }), http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js index 339e095..ea5b5ef 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/notification-message.js @@ -24,7 +24,7 @@ export default Ember.Component.extend({ }), displayBody: Ember.computed('notification', function() { - return !(Ember.isBlank(this.get('notification.responseMessage')) - && Ember.isBlank(this.get('notification.trace'))); + return !(Ember.isBlank(this.get('notification.responseMessage')) && + Ember.isBlank(this.get('notification.trace'))); }) }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js index c033e42..b582351 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js @@ -94,7 +94,7 @@ export default Ember.Component.extend({ if (editor.getValue() !== query) { if(isFinalExplainQuery){ - editor.setValue(editorQuery || '') + editor.setValue(editorQuery || ''); }else { editor.setValue(query || ''); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js index a2eb349..be5c43a 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js @@ -31,12 +31,11 @@ export default Ember.Component.extend({ columnFilterDebounced: Ember.observer('columnFilterText', function() { Ember.run.debounce(this, () => { - this.set('columnFilter', this.get('columnFilterText')) + this.set('columnFilter', this.get('columnFilterText')); }, 500); }), columns: Ember.computed('queryResult', function() { - let queryResult = this.get('queryResult'); let columnArr =[]; this.get('queryResult').schema.forEach(function(column){ @@ -56,11 +55,11 @@ export default Ember.Component.extend({ let rowArr = [], self = this; if(self.get('columns').length > 0) { - self.get('queryResult').rows.forEach(function(row, rowindex){ + self.get('queryResult').rows.forEach(function(row){ var mylocalObject = {}; self.get('columns').forEach(function(column, index){ mylocalObject[self.get('columns')[index].valuePath] = row[index]; - }) + }); rowArr.push(mylocalObject); }); return rowArr; @@ -90,7 +89,7 @@ export default Ember.Component.extend({ }, onColumnClick(column) { - //console.log('I am in onColumnClick'); + console.log('column',column); }, goNextPage(payloadTitle){ this.sendAction('goNextPage', payloadTitle); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js index 5e58cd8..a7b8e3b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js @@ -125,11 +125,11 @@ export default Ember.Component.extend({ }, toggleFileFormat() { - this.toggleProperty('showFileFormatInput') + this.toggleProperty('showFileFormatInput'); }, toggleRowFormat() { - this.toggleProperty('showRowFormatInput') + this.toggleProperty('showRowFormatInput'); }, fileFormatSelected(format) { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/udf-item.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/udf-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/udf-item.js index 9e11550..44f56e5 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/udf-item.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/udf-item.js @@ -37,7 +37,6 @@ export default Ember.Component.extend({ actions: { toggleExpandUdf(fileResourceId) { - var self = this; if(this.get('expanded')) { this.set('expanded', false); } else { @@ -120,11 +119,11 @@ export default Ember.Component.extend({ removeUdf(){ let self = this; this.get('store').find('udf', this.get('udfId')).then(function(resultUdf) { - resultUdf.destroyRecord().then(function(data) { + resultUdf.destroyRecord().then(function() { self.send('cancelUdf'); self.sendAction('refreshUdfList'); }, function(response) { - console.log('UDF NOT deleted'); + console.log('UDF NOT deleted', response); }); return false; }); @@ -135,7 +134,7 @@ export default Ember.Component.extend({ }, handleResourceChange(filter){ - if(filter.action == "addNewFileResource"){ + if(filter.action === "addNewFileResource"){ this.get('controller').set('isAddingNewFileResource', true); this.set('selectedFileResource',null); }else { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/udf-new.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/udf-new.js b/contrib/views/hive20/src/main/resources/ui/app/components/udf-new.js index 285ef07..26658ad 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/udf-new.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/udf-new.js @@ -25,7 +25,7 @@ export default Ember.Component.extend({ actions:{ handleFileResourceChange(filter){ - this.sendAction('handleFileResourceChange', filter) + this.sendAction('handleFileResourceChange', filter); }, cancelSaveUDf(){ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js b/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js index 2379a15..0cbe0f6 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js @@ -45,7 +45,7 @@ export default Ember.Component.extend({ var regExp = new RegExp(regStr, "g"); if (this.get("inputValue")) { var arr = this.get("inputValue").match(regExp); - if (arr != null && arr.length == 1) { + if (arr != null && arr.length === 1) { this.setValid(); } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js index 8f216d1..fd450cc 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/visual-explain.js @@ -47,7 +47,7 @@ export default Ember.Component.extend({ }, - click(event){ + click(){ if(this.get('explainDetailData') === '' || this.get('draggable').get('zoom') ){ return; } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js b/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js index 0d07ce2..0ae9616 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js +++ b/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js @@ -31,4 +31,4 @@ export default [ {label: "DECIMAL", hasPrecision: true, hasScale: true}, {label: "VARCHAR", hasPrecision: true, hasScale: false}, {label: "CHAR", hasPrecision: true, hasScale: false}, -] +]; http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/controllers/service-check.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/service-check.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/service-check.js index 8a621db..10552ea 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/controllers/service-check.js +++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/service-check.js @@ -31,10 +31,10 @@ export default Ember.Controller.extend({ }), hasError: Ember.computed('hdfsError', 'userHomeError', 'atsError', 'hiveError', function() { - return !(Ember.isEmpty(this.get('hdfsError')) - && Ember.isEmpty(this.get('userHomeError')) - && Ember.isEmpty(this.get('atsError')) - && Ember.isEmpty(this.get('hiveError'))); + return !(Ember.isEmpty(this.get('hdfsError')) && + Ember.isEmpty(this.get('userHomeError')) && + Ember.isEmpty(this.get('atsError')) && + Ember.isEmpty(this.get('hiveError'))); }), transitioner: Ember.observer('serviceCheck.transitionToApplication', function() { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js index 76b3dee..1fa4cb9 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/extract-value.js @@ -18,7 +18,7 @@ import Ember from 'ember'; -export function extractValue(params,/*, hash*/) { +export function extractValue(params /*, hash*/) { let map = params[0]; let key = params[1]; return map[key]; http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js index a24f797..511a917 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js +++ b/contrib/views/hive20/src/main/resources/ui/app/helpers/format-column-size.js @@ -26,7 +26,7 @@ export function formatColumnSize(params/*, hash*/) { } let sizeString = '( '; if (precision) { - sizeString = `${sizeString}${precision}` + sizeString = `${sizeString}${precision}`; } if (scale) { sizeString = `${sizeString}, ${scale}`; http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/models/table-property.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/table-property.js b/contrib/views/hive20/src/main/resources/ui/app/models/table-property.js index 751f55c..f79023a 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/models/table-property.js +++ b/contrib/views/hive20/src/main/resources/ui/app/models/table-property.js @@ -51,4 +51,4 @@ export default Ember.Object.extend({ return this.get('errors.length') === 0; } -}) +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/router.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/router.js b/contrib/views/hive20/src/main/resources/ui/app/router.js index 250f945..d5d876d 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/router.js +++ b/contrib/views/hive20/src/main/resources/ui/app/router.js @@ -55,7 +55,7 @@ Router.map(function() { this.route('ddl'); this.route('stats'); this.route('auth'); - }) + }); }); }); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js index b29d863..533dd61 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js @@ -81,7 +81,7 @@ export default Ember.Route.extend(UILoggerMixin, { }, toggleCSVFormat: function() { console.log("inside new route toggleCSVFormat"); - this.toggleProperty('showCSVFormatInput') + this.toggleProperty('showCSVFormatInput'); }, create(settings) { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js index 2fa61b4..085c326 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/edit.js @@ -16,6 +16,7 @@ * limitations under the License. */ +import Ember from 'ember'; import TableMetaRouter from './table-meta-router'; import tabs from '../../../../../configs/edit-table-tabs'; import UILoggerMixin from '../../../../../mixins/ui-logger'; http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js index e4c543b..e6b71fe 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js @@ -51,8 +51,9 @@ export default NewTable.extend(UILoggerMixin, { showCSVFormatInput: false, uploadProgressInfo : Ember.computed("uploadProgressInfos.[]",function(){ var info = ""; - for( var i = 0 ; i < this.get('uploadProgressInfos').length ; i++) + for( var i = 0 ; i < this.get('uploadProgressInfos').length ; i++) { info += this.get('uploadProgressInfos').objectAt(i); + } return new Ember.Handlebars.SafeString(info); }), @@ -87,8 +88,9 @@ export default NewTable.extend(UILoggerMixin, { var text = ""; var possible = "abcdefghijklmnopqrstuvwxyz"; - for (var i = 0; i < 30; i++) + for (var i = 0; i < 30; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); + } return text; }, @@ -100,10 +102,10 @@ export default NewTable.extend(UILoggerMixin, { fetchJobPromise.then(function (data) { var job = JSON.parse(JSON.stringify(data)); var status = job.status; - if (status == constants.statuses.succeeded ) { + if (status === constants.statuses.succeeded ) { console.log("resolving waitForJobStatus with : " , status); resolve(job); - } else if (status == constants.statuses.canceled || status == constants.statuses.closed || status == constants.statuses.error) { + } else if (status === constants.statuses.canceled || status === constants.statuses.closed || status === constants.statuses.error) { console.log("rejecting waitForJobStatus with : " + status); reject(new Error(job.statusMessage)); } else { @@ -115,7 +117,7 @@ export default NewTable.extend(UILoggerMixin, { }, function (error) { console.log("rejecting waitForJobStatus with : " + error); reject(error); - }) + }); }, uploadForPreview: function (sourceObject) { @@ -184,7 +186,7 @@ export default NewTable.extend(UILoggerMixin, { waitForGeneratingPreview: function () { console.log("waitForGeneratingPreview"); this.showUploadModal(); - this.pushUploadProgressInfos(this.formatMessage('hive.messages.generatingPreview')) + this.pushUploadProgressInfos(this.formatMessage('hive.messages.generatingPreview')); }, previewTable: function (data) { @@ -211,7 +213,7 @@ export default NewTable.extend(UILoggerMixin, { name: column.name, type: datatypes.findBy("label", column.type), editing: true - }) + }); }, onGeneratePreviewSuccess: function (data) { console.log("onGeneratePreviewSuccess"); @@ -396,7 +398,7 @@ export default NewTable.extend(UILoggerMixin, { return self.rollBackActualTableCreation(); },function(err){ return self.rollBackActualTableCreation(); - }) + }); }, onUploadingFileFailure: function (error) { @@ -490,10 +492,14 @@ export default NewTable.extend(UILoggerMixin, { this.setError(this.formatMessage('hive.messages.manuallyDeleteTable',{databaseName:this.get('databaseName'), tableName: this.get("tempTableName")})); }, validateHDFSPath: function (hdfsPath) { - if (null == hdfsPath || hdfsPath == "") throw new Error(this.translate('hive.errors.emptyHdfsPath')); + if (null === hdfsPath || hdfsPath === "") { + throw new Error(this.translate('hive.errors.emptyHdfsPath')); + } var hdfsRegex = new RegExp(this.get("HDFS_PATH_REGEX"), "g"); var mArr = hdfsPath.match(hdfsRegex); - if (mArr == null || mArr.length != 1) throw new Error(this.translate('hive.errors.illegalHdfPath', {"hdfsPath": hdfsPath} )); + if (mArr === null || mArr.length !== 1) { + throw new Error(this.translate('hive.errors.illegalHdfPath', {"hdfsPath": hdfsPath} )); + } }, createTableAndUploadFile: function (tableData) { let databaseModel = this.controllerFor('databases.database').get('model'); @@ -606,24 +612,36 @@ export default NewTable.extend(UILoggerMixin, { }, validateInput: function (headers,tableName,databaseName,isFirstRowHeader) { // throw exception if invalid. - if(!headers || headers.length == 0) throw new Error(this.translate('hive.errors.emptyHeaders')); + if(!headers || headers.length === 0) { + throw new Error(this.translate('hive.errors.emptyHeaders')); + } var regex = new RegExp(this.get("COLUMN_NAME_REGEX"),"g"); headers.forEach(function(column,index){ - if( !column ) throw new Error(this.translate('hive.errors.emptyColumnName')); + if( !column ) { + throw new Error(this.translate('hive.errors.emptyColumnName')); + } var matchArr = column.name.match(regex); - if(matchArr == null || matchArr.length != 1 ) throw new Error(this.translate('hive.errors.illegalColumnName',{ columnName : column.name, index : (index + 1)})); + if(matchArr === null || matchArr.length !== 1 ) { + throw new Error(this.translate('hive.errors.illegalColumnName',{ columnName : column.name, index : (index + 1)})); + } },this); - if(!tableName) throw new Error(this.translate('hive.errors.emptyTableName', {tableNameField : this.translate('hive.ui.tableName')})); + if(!tableName) { + throw new Error(this.translate('hive.errors.emptyTableName', {tableNameField : this.translate('hive.ui.tableName')})); + } var tableRegex = new RegExp(this.get("TABLE_NAME_REGEX"),"g"); var mArr = tableName.match(tableRegex); - if(mArr == null || mArr.length != 1 ) throw new Error(this.translate('hive.errors.illegalTableName', {tableNameField:this.translate('hive.ui.tableName'),tableName:tableName}) ); + if(mArr === null || mArr.length !== 1 ) { + throw new Error(this.translate('hive.errors.illegalTableName', {tableNameField:this.translate('hive.ui.tableName'),tableName:tableName}) ); + } - if(!databaseName) throw new Error(this.translate('hive.errors.emptyDatabase', {database:this.translate('hive.words.database')})); + if(!databaseName) { + throw new Error(this.translate('hive.errors.emptyDatabase', {database:this.translate('hive.words.database')})); + } - if (null == isFirstRowHeader || typeof isFirstRowHeader === 'undefined') { //this can be true or false. so explicitly checking for null/ undefined. + if (null === isFirstRowHeader || typeof isFirstRowHeader === 'undefined') { //this can be true or false. so explicitly checking for null/ undefined. throw new Error(this.translate('hive.errors.emptyIsFirstRow', {isFirstRowHeaderField:this.translate('hive.ui.isFirstRowHeader')})); } }, @@ -689,8 +707,8 @@ export default NewTable.extend(UILoggerMixin, { validateInputs: function(tableData){ let tableMeta = tableData.get("tableMeta"); let containsEndlines = tableData.get("fileFormatInfo.containsEndlines"); - if(containsEndlines == true && tableMeta.settings && tableMeta.settings.fileFormat - && tableMeta.settings.fileFormat.type && tableMeta.settings.fileFormat.type === "TEXTFILE"){ + if(containsEndlines === true && tableMeta.settings && tableMeta.settings.fileFormat && + tableMeta.settings.fileFormat.type && tableMeta.settings.fileFormat.type === "TEXTFILE"){ throw new Error(`Cannot support endlines in fields when the File Format is TEXTFILE. Please uncheck '${this.translate('hive.ui.csvFormatParams.containsEndlines')}'`); } }, @@ -701,7 +719,7 @@ export default NewTable.extend(UILoggerMixin, { this.clearFields(); this.set('previewObject', previewObject); - return this.generatePreview(previewObject) + return this.generatePreview(previewObject); }, uploadTable: function (tableData) { console.log("tableData", tableData); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/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 c27c74d..3e88ac6 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 @@ -44,7 +44,7 @@ export default Ember.Route.extend({ return this.store.query('job', params); }, - setupController(controller, model) { + setupController(controller) { if(!(Ember.isEmpty(this.get('startInitTo')) || Ember.isEmpty(this.get('endInitTo')))) { controller.set('endTime', this.get('endInitTo')); @@ -60,8 +60,8 @@ export default Ember.Route.extend({ actions: { dateFilterChanged(startTime, endTime) { - 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.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(); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js index e1ab620..08af7d4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query.js @@ -93,7 +93,7 @@ export default Ember.Route.extend(UILoggerMixin, { 'dbname': selectedDb , 'tables': this.store.query('table', {databaseId: selectedDb}), 'isSelected': true - }) + }); selectedMultiDb.pushObject(selectedDb); } @@ -208,7 +208,7 @@ export default Ember.Route.extend(UILoggerMixin, { 'tables':self.store.query('table', {databaseId: db}), 'isSelected': (index === 0) ? true :false } - ) + ); selectedMultiDb.pushObject(db); }); @@ -224,7 +224,6 @@ export default Ember.Route.extend(UILoggerMixin, { }, showTables(db){ - let self = this; Ember.$('#' + db).toggle(); this.get('controller.model').set('selectedDb', db); }, @@ -267,11 +266,13 @@ export default Ember.Route.extend(UILoggerMixin, { if (isVisualExplainQuery) { queryInput = ""; let queries = this.get('controller').get('currentQuery').split(";").filter(function (query) { - if (query && query.trim()) return true; + if (query && query.trim()) { + return true; + } }); for (let i = 0; i < queries.length; i++) { - if (i == queries.length - 1) { + if (i === queries.length - 1) { if(queries[i].toLowerCase().startsWith("explain formatted ")){ queryInput += queries[i] + ";"; } else{ @@ -398,7 +399,7 @@ export default Ember.Route.extend(UILoggerMixin, { } else { self.get('controller.model').set('visualExplainJson', null); - if( self.paramsFor('queries.query').worksheetId && (self.paramsFor('queries.query').worksheetId.toLowerCase() == payloadTitle)){ + if( self.paramsFor('queries.query').worksheetId && (self.paramsFor('queries.query').worksheetId.toLowerCase() === payloadTitle)){ self.transitionTo('queries.query.loading'); Ember.run.later(() => { @@ -572,7 +573,7 @@ export default Ember.Route.extend(UILoggerMixin, { saveWorksheetModal(){ console.log('I am in saveWorksheetModal'); - let newTitle = $('#worksheet-title').val(); + let newTitle = Ember.$('#worksheet-title').val(); let currentQuery = this.get('controller.model').get('query'); let selectedDb = this.get('controller.model').get('selectedDb'); @@ -652,7 +653,7 @@ export default Ember.Route.extend(UILoggerMixin, { }, adjustPanelSize(){ - let isFullHeight = ($(window).height() ==(parseInt(Ember.$('.ember-light-table').css('height'), 10)) ) || false; + let isFullHeight = (Ember.$(window).height() ===(parseInt(Ember.$('.ember-light-table').css('height'), 10)) ) || false; if(!isFullHeight){ Ember.$('.ember-light-table').css('height', '100vh'); }else { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/log.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/log.js b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/log.js index 52f8dcc..2226680 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/log.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/queries/query/log.js @@ -60,7 +60,7 @@ export default Ember.Route.extend({ fetchLogs(model){ let logFile = model.get('logFile'); - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('query').retrieveQueryLog(logFile).then(function(data) { resolve(data.file.fileContent); }, function(error){ @@ -70,7 +70,7 @@ export default Ember.Route.extend({ }, jobStatus(jobId){ - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('jobs').waitForJobStatus(jobId).then(function(status) { resolve(status); }, function(error){ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js b/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js index f3b27c8..e896348 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/savedqueries.js @@ -48,7 +48,7 @@ export default Ember.Route.extend(UILoggerMixin, { record.destroyRecord().then(function(data) { self.send('deleteSavedQueryDeclined'); self.send('refreshSavedQueryList'); - }) + }); }, (error) => { console.log('error', error); }); @@ -70,7 +70,7 @@ export default Ember.Route.extend(UILoggerMixin, { }); this.get('controller').set('savedQuerylist',savedQueryList); - }) + }); }, deleteSavedQueryDeclined(){ http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js index f45881b..5cd92c4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/settings.js @@ -70,15 +70,15 @@ export default Ember.Route.extend(UILoggerMixin, { } }, err => { this.get('logger').danger(`Failed to delete setting with key: '${setting.get('key')}`, this.extractError(err)); - }) + }); }, updateAction(newSetting) { newSetting.save().then(data => { data.set('editMode', false); }, error => { - this.get('logger').danger(`Failed to update setting with key: '${setting.get('key')}`, this.extractError(error)); - }) + this.get('logger').danger(`Failed to update setting with key: '${newSetting.get('key')}`, this.extractError(error)); + }); }, cancelAction(newSetting) { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/routes/udfs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/udfs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/udfs.js index fdb2cad..138e85f 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/routes/udfs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/routes/udfs.js @@ -64,7 +64,7 @@ export default Ember.Route.extend({ this.controllerFor('udfs').set('udflist',udfList); this.transitionTo('udfs'); - }) + }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js index fe1b596..36abf49 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js @@ -40,7 +40,7 @@ export default Ember.Service.extend({ } resolve(status); } else if (status === 'error') { - reject(status) + reject(status); } else { resolve(this.waitForJobToComplete(jobId, after, fetchDummyResult)); } @@ -65,7 +65,7 @@ export default Ember.Service.extend({ stopJob : function(jobId) { return this.get('store').findRecord('job', jobId) - .then(job => job.destroyRecord()) + .then(job => job.destroyRecord()); }, _fetchDummyResult(jobId) { @@ -73,6 +73,6 @@ export default Ember.Service.extend({ }, getJob: function (jobId) { - return this.get('store').findRecord('job', jobId, {reload: true}) + return this.get('store').findRecord('job', jobId, {reload: true}); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/query.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/query.js b/contrib/views/hive20/src/main/resources/ui/app/services/query.js index 6860f4d..3c76d35 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/query.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/query.js @@ -23,7 +23,7 @@ export default Ember.Service.extend({ store: Ember.inject.service(), createJob(payload){ - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('store').adapterFor('query').createJob(payload).then(function(data) { resolve(data); }, function(err) { @@ -32,8 +32,7 @@ export default Ember.Service.extend({ }); }, getJob(jobId, firstCall){ - let self = this; - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('store').adapterFor('query').getJob(jobId, firstCall).then(function(data) { resolve(data); }, function(err) { @@ -47,13 +46,11 @@ export default Ember.Service.extend({ }, downloadAsCsv(jobId, path){ - let self = this; return this.get('store').adapterFor('job').downloadAsCsv(jobId, path); }, retrieveQueryLog(logFile){ - let self = this; - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('store').adapterFor('query').retrieveQueryLog(logFile).then(function(data) { resolve(data); }, function(err) { @@ -63,8 +60,7 @@ export default Ember.Service.extend({ }, getVisualExplainJson(jobId){ - let self = this; - return new Promise( (resolve, reject) => { + return new Ember.RSVP.Promise( (resolve, reject) => { this.get('store').adapterFor('query').getVisualExplainJson(jobId).then(function(data) { resolve(data); }, function(err) { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js b/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js index 2752375..4b4b29e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/saved-queries.js @@ -24,40 +24,40 @@ export default Ember.Service.extend({ getAllQueries(){ let url = this.get('store').adapterFor('saved-query').buildURL(); - return $.ajax(url, 'GET') + return Ember.$.ajax(url, 'GET'); }, saveQuery(payload){ - return $.ajax({ + return Ember.$.ajax({ type: "POST", url: this.get('store').adapterFor('saved-query').buildURL() + '/savedQueries/', data: JSON.stringify({savedQuery: payload}) , contentType:"application/json; charset=utf-8", dataType:"json", headers: {'X-Requested-By': 'ambari'} - }) + }); }, deleteSaveQuery(id){ let deletURL = this.get('store').adapterFor('saved-query').buildURL()+ '/savedQueries/' + id; - return $.ajax({ + return Ember.$.ajax({ type: "DELETE", url: deletURL, contentType:"application/json; charset=utf-8", dataType:"json", headers: {'X-Requested-By': 'ambari'} - }) + }); }, fetchSavedQuery(path) { let url = this.get('store').adapterFor('application').buildURL()+ '/files/' + encodeURIComponent(path); - return $.ajax({ + return Ember.$.ajax({ type: "GET", url: url, headers: {'X-Requested-By': 'ambari'} - }) + }); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/service-check.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/service-check.js b/contrib/views/hive20/src/main/resources/ui/app/services/service-check.js index 608cafe..a5a4755 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/service-check.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/service-check.js @@ -104,7 +104,7 @@ export default Ember.Service.extend({ this.set(statusVar, STATUS.errored); let finalData = (typeof errorFn === 'function') ? errorFn(err) : err; reject(finalData); - }) + }); }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/stats-service.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/stats-service.js b/contrib/views/hive20/src/main/resources/ui/app/services/stats-service.js index bb3ed3e..620bf9b 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/stats-service.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/stats-service.js @@ -34,7 +34,7 @@ export default Ember.Service.extend({ store: Ember.inject.service(), generateStatistics(databaseName, tableName, withColumns = false) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('table').analyseTable(databaseName, tableName, withColumns).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); @@ -45,7 +45,7 @@ export default Ember.Service.extend({ }, generateColumnStatistics(databaseName, tableName, columnName) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('table').generateColumnStats(databaseName, tableName, columnName).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); @@ -56,7 +56,7 @@ export default Ember.Service.extend({ }, waitForStatsGenerationToComplete(job, fetchDummyResult = true) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('jobs').waitForJobToComplete(job.get('id'), 5 * 1000, fetchDummyResult).then((data) => { resolve(job); }, (err) => { http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js index 2071317..c8de356 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js @@ -59,7 +59,7 @@ export default Ember.Service.extend({ detailedInfo: detailedInfo, storageInfo: storageInfo }); - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('table').editTable(tableInfo).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); @@ -77,40 +77,40 @@ export default Ember.Service.extend({ }, (err) => { reject(err); }); - }) + }); }, renameTable(databaseName, newTableName, oldTableName ) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('table').renameTable(databaseName, newTableName, oldTableName).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); }, (err) => { reject(err); }); - }) + }); }, deleteDatabase(database) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('database').deleteDatabase(database.get('name')).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); }, (err) => { reject(err); }); - }) + }); }, createDatabase(database) { - return new Promise((resolve, reject) => { + return new Ember.RSVP.Promise((resolve, reject) => { this.get('store').adapterFor('database').createDatabase(database).then((data) => { this.get('store').pushPayload(data); resolve(this.get('store').peekRecord('job', data.job.id)); }, (err) => { reject(err); }); - }) + }); }, waitForJobToComplete(jobId, after) { @@ -123,7 +123,7 @@ export default Ember.Service.extend({ this._fetchDummyResult(jobId); resolve(); } else if (status === 'error') { - reject() + reject(); } else { resolve(this.waitForJobToComplete(jobId, after)); } @@ -215,7 +215,7 @@ export default Ember.Service.extend({ comment: column.get('comment'), precision: column.get('precision'), scale: column.get('scale') - } + }; }); }, @@ -227,7 +227,7 @@ export default Ember.Service.extend({ comment: column.get('comment'), precision: column.get('precision'), scale: column.get('scale') - } + }; }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/services/udf.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/udf.js b/contrib/views/hive20/src/main/resources/ui/app/services/udf.js index 915e3d0..bc9b349 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/services/udf.js +++ b/contrib/views/hive20/src/main/resources/ui/app/services/udf.js @@ -23,54 +23,43 @@ export default Ember.Service.extend({ store: Ember.inject.service(), getAllUdfs(){ - return $.ajax('/udfs', 'GET'); + return Ember.$.ajax('/udfs', 'GET'); }, getFileResource(fileResourceId){ - - - return this.get('store').findRecord('file-resource',fileResourceId); - //return this.get('store').queryRecord('file-resource', { 'fileResource': fileResourceId }) - - //let url = '/fileResources/' + fileResourceId; - //return $.ajax( url , 'GET'); - - }, savefileResource(payload){ - return $.ajax({ + return Ember.$.ajax({ type: "POST", - //url: this.get('store').adapterFor('udf').fileResourceURL(), url: '/fileResources', data: JSON.stringify({fileResource: payload}) , contentType:"application/json; charset=utf-8", headers: {'X-Requested-By': 'ambari'} - }) + }); }, saveUdf(payload){ - return $.ajax({ + return Ember.$.ajax({ type: "POST", - //url: this.get('store').adapterFor('udf').udfURL(), url: '/udfs', data: JSON.stringify({udf: payload}) , contentType:"application/json; charset=utf-8", headers: {'X-Requested-By': 'ambari'} - }) + }); }, deleteUdf(udfId){ let deletURL = '/udfs/' + udfId; - return $.ajax({ + return Ember.$.ajax({ type: "DELETE", url: deletURL, contentType:"application/json; charset=utf-8", dataType:"json", headers: {'X-Requested-By': 'ambari'} - }) + }); } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs index da1c0b4..7bcb939 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-advanced-settings.hbs @@ -68,15 +68,7 @@
{{input type="text" class="form-control" value=settings.location}}
- - {{#if showDirectoryViewer}} - {{hdfs-viewer-modal - showSelectedPath=true - close="closeHdfsModal" - selected="hdfsPathSelected" - }} - {{/if}} {{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/enhancer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/enhancer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/enhancer.js index a99b82e..b5cc2d4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/enhancer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/enhancer.js @@ -31,7 +31,7 @@ function doEnhanceNode(node) { function uuid() { return 'operator-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { - const r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); + const r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8); return v.toString(16); }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer-force.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer-force.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer-force.js index a73d1b2..1e4b9ee 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer-force.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer-force.js @@ -70,7 +70,7 @@ export default function doRender(data, selector, onRequestDetail) { .attr('data-operator', d => d._operator) .attr('class', d => `operator__box operator__box--${d._operator.toString().replace(/[ ]/g, '_')}`) .attr('height', d => d._operator === 'Fetch Operator' ? 150 : 55) - .attr('width', 140) + .attr('width', 140); nodes .append('foreignObject') @@ -202,9 +202,9 @@ function getOperatorIcon(operator) { case 'Filter Operator': return 'fa-filter'; case 'Dynamic Partitioning Event Operator': - return 'fa-columns' + return 'fa-columns'; case 'Map Join Operator': - return 'fa-code-fork' + return 'fa-code-fork'; case 'Limit': case 'Group By Operator': case 'Select Operator': @@ -218,7 +218,7 @@ function getOperatorIcon(operator) { function getIcon (type, subtype) { switch(type) { case 'join': - return 'fa-code-fork' + return 'fa-code-fork'; case 'vectorization': case 'job': return; @@ -231,7 +231,8 @@ function getIcon (type, subtype) { case 'select': return 'fa-table'; } -}; +} + function abbreviate(value) { let newValue = value; if (value >= 1000) { @@ -239,11 +240,11 @@ function abbreviate(value) { const suffixNum = Math.floor(("" + value).length / 3); let shortValue = ''; for (var precision = 2; precision >= 1; precision--) { - shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); + shortValue = parseFloat( (suffixNum !== 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); const dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,''); if (dotLessShortValue.length <= 2) { break; } } - if (shortValue % 1 != 0) { + if (shortValue % 1 !== 0) { const shortNum = shortValue.toFixed(1); } newValue = shortValue+suffixes[suffixNum]; @@ -269,7 +270,7 @@ function reset(zoom, svg, container) { const height = Math.max(...bounds.map(cBound => cBound.bottom)) - top; const midX = left + width / 2; const midY = top + height / 2; - if (width == 0 || height == 0){ + if (width === 0 || height === 0){ // nothing to fit return; } @@ -302,9 +303,9 @@ function getConnectionPath(pSource, pTarget) { const offsetY = 0; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { - return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { - return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n`; } }, ''); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js index 1f6ba3c..b36d7b4 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/renderer.js @@ -16,6 +16,9 @@ * limitations under the License. */ + +import Ember from 'ember'; + export default function doRender(data, selector, onRequestDetail, draggable) { const width = '1570', height = '800'; @@ -117,7 +120,7 @@ function recurseC(children, onRequestDetail) { .attr('data-operator', d => d._operator) .attr('class', d => `operator__box operator__box--${d._operator.toString().replace(/[ ]/g, '_')}`) .attr('height', d => d._operator === 'Fetch Operator' ? 150 : 55) - .attr('width', 140) + .attr('width', 140); children .append('foreignObject') @@ -204,9 +207,9 @@ function getOperatorIcon(operator) { case 'Filter Operator': return 'fa-filter'; case 'Dynamic Partitioning Event Operator': - return 'fa-columns' + return 'fa-columns'; case 'Map Join Operator': - return 'fa-code-fork' + return 'fa-code-fork'; case 'Limit': case 'Group By Operator': case 'Select Operator': @@ -220,7 +223,7 @@ function getOperatorIcon(operator) { function getIcon (type, subtype) { switch(type) { case 'join': - return 'fa-code-fork' + return 'fa-code-fork'; case 'vectorization': case 'job': return; @@ -233,7 +236,8 @@ function getIcon (type, subtype) { case 'select': return 'fa-table'; } -}; +} + function abbreviate(value) { let newValue = value; if (value >= 1000) { @@ -241,11 +245,11 @@ function abbreviate(value) { const suffixNum = Math.floor(("" + value).length / 3); let shortValue = ''; for (var precision = 2; precision >= 1; precision--) { - shortValue = parseFloat( (suffixNum != 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); + shortValue = parseFloat( (suffixNum !== 0 ? (value / Math.pow(1000,suffixNum) ) : value).toPrecision(precision)); const dotLessShortValue = (shortValue + '').replace(/[^a-zA-Z 0-9]+/g,''); if (dotLessShortValue.length <= 2) { break; } } - if (shortValue % 1 != 0) { + if (shortValue % 1 !== 0) { const shortNum = shortValue.toFixed(1); } newValue = shortValue+suffixes[suffixNum]; @@ -271,7 +275,7 @@ function reset(zoom, svg, container) { const height = Math.max(...bounds.map(cBound => cBound.bottom)) - top; const midX = left + width / 2; const midY = top + height / 2; - if (width == 0 || height == 0){ + if (width === 0 || height === 0){ // nothing to fit return; } @@ -291,10 +295,10 @@ function getConnectionPathFF(connector, svg, container) { const target = container.select(`#${connector._target._uuid}`).node(); const rSource = d3.select(source).data()[0]; const rTarget = d3.select(target).data()[0]; - const rSourceVertex = d3.select($(source).closest('.vertex').get(0)).data()[0]; - const rTargetVertex = d3.select($(target).closest('.vertex').get(0)).data()[0]; + const rSourceVertex = d3.select(Ember.$(source).closest('.vertex').get(0)).data()[0]; + const rTargetVertex = d3.select(Ember.$(target).closest('.vertex').get(0)).data()[0]; - const offsetBox = $(container.node()).children('.vertex').get(0).getBoundingClientRect(); + const offsetBox = Ember.$(container.node()).children('.vertex').get(0).getBoundingClientRect(); const pSource = { @@ -322,9 +326,9 @@ function getConnectionPathFF(connector, svg, container) { const offsetY = svg.node().getBoundingClientRect().top; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { - return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { - return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n`; } }, ''); } @@ -361,9 +365,9 @@ function getConnectionPath(connector, svg, container){ const offsetY = svg.node().getBoundingClientRect().top; return path.reduce((accumulator, cPoint, index) => { if(index === 0) { - return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `M ${cPoint.x}, ${cPoint.y - offsetY}\n`; } else { - return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n` + return accumulator + `L ${cPoint.x}, ${cPoint.y - offsetY}\n`; } }, ''); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3bc3d686/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js index 4a7df10..d88de98 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js +++ b/contrib/views/hive20/src/main/resources/ui/app/utils/hive-explainer/transformer.js @@ -79,14 +79,14 @@ function doGetChildrenWithIndexX(children, cIndex) { return children.map(cChild => Object.assign({}, cChild, { _indexX: cIndex, _children: doGetChildrenWithIndexX(cChild._children, cIndex + 1) - })) + })); } function doGetChildrenWithIndexY(children, cIndex) { return children.map((cChild, index) => Object.assign({}, cChild, { _indexY: cIndex + index, _children: doGetChildrenWithIndexY(cChild._children, cIndex + index) - })) + })); } function getTezPlan(data) { @@ -133,7 +133,7 @@ function getEdgesWithFetch(tezEdges, vertices) { .filter(cEdge => tezEdges.every(tcEdge => cEdge._target !== tcEdge._source)) .map(cRootEdge => cRootEdge._target); - const uniqueRootKeys = [...new Set(rootKeys)] + const uniqueRootKeys = [...new Set(rootKeys)]; const fetchVertex = vertices.find(cVertex => cVertex._vertex === 'Fetch'); @@ -180,7 +180,7 @@ function getFetchVertex(plan) { _operator: 'Fetch Operator', _children: [] }) - ] + ]; } return vertex; @@ -436,7 +436,7 @@ function getConnections(vertices, edges) { _source: cOperator, _target: targetOperator, }); - }) + }); }); return connections;