Repository: atlas Updated Branches: refs/heads/branch-0.8 96e29e804 -> 0dae3e8e3
ATLAS-2451: UI to list tables in a HBase namespace similar to tables listing for Hive DB Signed-off-by: Madhan Neethiraj <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0dae3e8e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0dae3e8e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0dae3e8e Branch: refs/heads/branch-0.8 Commit: 0dae3e8e3a8973f938a91e8ea1f9e51bbc3bdf4b Parents: 96e29e8 Author: pratik24mac <[email protected]> Authored: Mon Feb 19 11:40:31 2018 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Wed Feb 21 20:28:43 2018 -0800 ---------------------------------------------------------------------- .../views/detail_page/DetailPageLayoutView.js | 4 +- .../js/views/profile/ProfileLayoutView.js | 8 +- .../js/views/search/SearchResultLayoutView.js | 90 ++++++++++---------- 3 files changed, 53 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/0dae3e8e/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js index b73bb5e..2910f51 100644 --- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js +++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js @@ -192,8 +192,8 @@ define(['require', this.renderAuditTableLayoutView(obj); this.renderTagTableLayoutView(obj); this.renderTermTableLayoutView(_.extend({}, obj, { term: true })); - if (collectionJSON && (!_.isUndefined(collectionJSON.attributes['profileData']) || collectionJSON.typeName === "hive_db")) { - if (collectionJSON.typeName === "hive_db") { + if (collectionJSON && (!_.isUndefined(collectionJSON.attributes['profileData']) || collectionJSON.typeName === "hive_db" || collectionJSON.typeName === "hbase_namespace")) { + if (collectionJSON.typeName === "hive_db" || collectionJSON.typeName === "hbase_namespace") { this.$('.profileTab a').text("Tables") } this.$('.profileTab').show(); http://git-wip-us.apache.org/repos/asf/atlas/blob/0dae3e8e/dashboardv2/public/js/views/profile/ProfileLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/profile/ProfileLayoutView.js b/dashboardv2/public/js/views/profile/ProfileLayoutView.js index 79cf3a5..d807f41 100644 --- a/dashboardv2/public/js/views/profile/ProfileLayoutView.js +++ b/dashboardv2/public/js/views/profile/ProfileLayoutView.js @@ -58,7 +58,7 @@ define(['require', */ initialize: function(options) { _.extend(this, _.pick(options, 'profileData', 'guid', 'value', 'typeName', 'entityDetail', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection')); - if (this.typeName === "hive_db") { + if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") { this.profileData = { attributes: true }; } }, @@ -67,7 +67,7 @@ define(['require', if (this.profileData) { if (this.typeName === "hive_table") { this.renderProfileTableLayoutView(); - } else if (this.typeName === "hive_db") { + } else if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") { this.renderSearchResultLayoutView(); } else { this.renderProfileColumnLayoutView(); @@ -80,13 +80,15 @@ define(['require', var value = _.extend({}, that.value, { 'guid': that.guid, 'searchType': 'relationship', - 'profileDBView': true + 'profileDBView' : true, + 'typeName': that.typeName }); that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({ 'value': value, 'typeHeaders': that.typeHeaders, 'entityDefCollection': that.entityDefCollection, 'enumDefCollection': that.enumDefCollection, + 'isDisable': true, 'classificationDefCollection': that.classificationDefCollection })); }); http://git-wip-us.apache.org/repos/asf/atlas/blob/0dae3e8e/dashboardv2/public/js/views/search/SearchResultLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js index 18e7a83..d3ad022 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -150,7 +150,7 @@ define(['require', * @constructs */ initialize: function(options) { - _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns')); + _.extend(this, _.pick(options, 'value', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isDisable')); this.entityModel = new VEntity(); this.searchCollection = new VSearchList(); this.limit = 25; @@ -332,7 +332,7 @@ define(['require', } } }, - getColumnOrderWithPosition : function() { + getColumnOrderWithPosition: function() { var that = this; return _.map(that.columnOrder, function(value, key) { return key + "::" + value; @@ -497,10 +497,10 @@ define(['require', this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType); } _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null }); - if (value.profileDBView && value.guid) { + if (value.profileDBView && value.profileDBView && value.guid) { var profileParam = {}; profileParam['guid'] = value.guid; - profileParam['relation'] = '__hive_table.db'; + profileParam['relation'] = value.typeName === 'hive_db' ? '__hive_table.db' : '__hbase_table.namespace'; profileParam['sortBy'] = 'name'; profileParam['sortOrder'] = 'ASCENDING'; _.extend(this.searchCollection.queryParams, profileParam); @@ -524,7 +524,7 @@ define(['require', } else { apiObj.data = null; if (this.value.profileDBView) { - _.extend(this.searchCollection.queryParams,checkBoxValue); + _.extend(this.searchCollection.queryParams, checkBoxValue); } Globals.searchApiCallRef = this.searchCollection.fetch(apiObj); } @@ -575,11 +575,13 @@ define(['require', that.$(".ellipsis .inputAssignTag").hide(); that.renderBreadcrumb(); table.trigger("grid:refresh"); /*Event fire when table rendered*/ - tableDragger(document.querySelector(".colSort")).on('drop', function(from, to, el) { - that.columnOrder = that.getColumnOrder(el.querySelectorAll('th.renderable')); - table.trigger("grid:refresh:update"); - that.triggerUrl(); - }); + if (that.isDisable !== true) { + tableDragger(document.querySelector(".colSort")).on('drop', function(from, to, el) { + that.columnOrder = that.getColumnOrder(el.querySelectorAll('th.renderable')); + table.trigger("grid:refresh:update"); + that.triggerUrl(); + }); + } that.checkTableFetch(); }); }, @@ -781,42 +783,42 @@ define(['require', if (valueObj && valueObj.length) { var firstObj = _.first(valueObj); _.each(_.keys(firstObj), function(key) { - col[key] = { - label: key.capitalize(), - cell: "Html", - editable: false, - sortable: false, - resizeable: true, - orderable: true, - formatter: _.extend({}, Backgrid.CellFormatter.prototype, { - fromRaw: function(rawValue, model) { - var modelObj = model.toJSON(); - if (key == "name") { - var nameHtml = "", - name = modelObj[key]; - if (modelObj.guid) { - nameHtml = '<a title="' + name + '" href="#!/detailPage/' + modelObj.guid + '">' + name + '</a>'; - } else { - nameHtml = '<span title="' + name + '">' + name + '</span>'; - } - if (modelObj.status && Enums.entityStateReadOnly[modelObj.status]) { - nameHtml += '<button type="button" title="Deleted" class="btn btn-action btn-md deleteBtn"><i class="fa fa-trash"></i></button>'; - return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>'; - } - return nameHtml; - } else if (modelObj && !_.isUndefined(modelObj[key])) { - var tempObj = { - 'scope': that, - // 'attributeDefs': - 'valueObject': {}, - 'isTable': false - }; - tempObj.valueObject[key] = modelObj[key]; - return CommonViewFunction.propertyTable(tempObj); + col[key] = { + label: key.capitalize(), + cell: "Html", + editable: false, + sortable: false, + resizeable: true, + orderable: true, + formatter: _.extend({}, Backgrid.CellFormatter.prototype, { + fromRaw: function(rawValue, model) { + var modelObj = model.toJSON(); + if (key == "name") { + var nameHtml = "", + name = modelObj[key]; + if (modelObj.guid) { + nameHtml = '<a title="' + name + '" href="#!/detailPage/' + modelObj.guid + '">' + name + '</a>'; + } else { + nameHtml = '<span title="' + name + '">' + name + '</span>'; } + if (modelObj.status && Enums.entityStateReadOnly[modelObj.status]) { + nameHtml += '<button type="button" title="Deleted" class="btn btn-action btn-md deleteBtn"><i class="fa fa-trash"></i></button>'; + return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>'; + } + return nameHtml; + } else if (modelObj && !_.isUndefined(modelObj[key])) { + var tempObj = { + 'scope': that, + // 'attributeDefs': + 'valueObject': {}, + 'isTable': false + }; + tempObj.valueObject[key] = modelObj[key]; + return CommonViewFunction.propertyTable(tempObj); } - }) - }; + } + }) + }; }); } return this.searchCollection.constructor.getTableCols(col, this.searchCollection);
