ATLAS-1149 Changes to UI to sort the hive table schema based on position attribute of hive_column (Kalyanikashikar via kevalbhatt)
(cherry picked from commit 5ca1ed3f0e1fd3b896a4b7160b960d40864dfd89) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/8404ac2e Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/8404ac2e Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/8404ac2e Branch: refs/heads/0.7-incubating Commit: 8404ac2e74ee83a70b7bee6c729eb78cd17ffcb4 Parents: d0d0f82 Author: kevalbhatt <[email protected]> Authored: Tue Sep 13 11:08:07 2016 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Thu Dec 22 15:29:26 2016 -0800 ---------------------------------------------------------------------- dashboardv2/public/js/collection/BaseCollection.js | 13 ++++++++++++- .../js/views/entity/EntityDetailTableLayoutView.js | 6 +++++- dashboardv2/public/js/views/schema/SchemaLayoutView.js | 3 ++- release-log.txt | 1 + 4 files changed, 20 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8404ac2e/dashboardv2/public/js/collection/BaseCollection.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/collection/BaseCollection.js b/dashboardv2/public/js/collection/BaseCollection.js index b039e30..1f3faba 100644 --- a/dashboardv2/public/js/collection/BaseCollection.js +++ b/dashboardv2/public/js/collection/BaseCollection.js @@ -33,7 +33,9 @@ define(['require', * @constructs */ - initialize: function() {}, + initialize: function() { + this.sort_key = 'id'; + }, bindErrorEvents: function() { this.bind("error", Utils.defaultErrorHandler); }, @@ -47,6 +49,15 @@ define(['require', }, ajaxStart: function(model, ajaxObj, collectionObj) {}, ajaxComplete: function(model, ajaxObj, collectionObj) {}, + comparator: function(key, value) { + key = key.get(this.sort_key); + value = value.get(this.sort_key); + return key > value ? 1 : key < value ? -1 : 0; + }, + sortByKey: function(sortKey) { + this.sort_key = sortKey; + this.sort(); + }, /** * state required for the PageableCollection */ http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8404ac2e/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js index cc67d01..316411d 100644 --- a/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js +++ b/dashboardv2/public/js/views/entity/EntityDetailTableLayoutView.js @@ -58,7 +58,11 @@ define(['require', entityTableGenerate: function() { var that = this, valueObject = this.collectionObject[0].values, - table = CommonViewFunction.propertyTable(valueObject, this); + valueSorted = _.sortBy(valueObject.columns, function(val) { + return val.values.position + }); + valueObject.columns = valueSorted; + var table = CommonViewFunction.propertyTable(valueObject, this); that.ui.detailValue.append(table); } }); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8404ac2e/dashboardv2/public/js/views/schema/SchemaLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/schema/SchemaLayoutView.js b/dashboardv2/public/js/views/schema/SchemaLayoutView.js index dc19619..a1bf839 100644 --- a/dashboardv2/public/js/views/schema/SchemaLayoutView.js +++ b/dashboardv2/public/js/views/schema/SchemaLayoutView.js @@ -163,6 +163,7 @@ define(['require', this.$('.fontLoader').show(); this.schemaCollection.fetch({ success: function() { + that.schemaCollection.sortByKey('position'); that.renderTableLayoutView(); $('.schemaTable').show(); that.$('.fontLoader').hide(); @@ -263,7 +264,7 @@ define(['require', }; _.keys(modelJSON).map(function(key) { if (key.indexOf("$") == -1) { - if (!(key === "qualifiedName" || key === "name")) { + if (!(key === "qualifiedName" || key === "name" || key === "position")) { col[key] = { cell: "Html", editable: false, http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/8404ac2e/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 4a888c7..65ce2aa 100644 --- a/release-log.txt +++ b/release-log.txt @@ -31,6 +31,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ALL CHANGES: +ATLAS-1149 Changes to UI to sort the hive table schema based on "position" attribute of hive_column (Kalyanikashikar via kevalbhatt) ATLAS-1162 Register shutdown hooks with Hadoop's ShutdownHookManager, instead of directly with Java Runtime (mneethiraj via sumasai) ATLAS-1098 Atlas allows creation of tag with name "isa" which causes exceptions during search (apoorvnaik via kevalbhatt) ATLAS-1160 Update Atlas hive hook to read configuration from atlas-application.properties instead of hive-site.xml (mneethiraj via kevalbhatt)
