You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2016/09/13 05:38:46 UTC

incubator-atlas git commit: ATLAS-1149 Changes to UI to sort the hive table schema based on position attribute of hive_column (Kalyanikashikar via kevalbhatt)

Repository: incubator-atlas
Updated Branches:
  refs/heads/master 8044ca48d -> 5ca1ed3f0


ATLAS-1149 Changes to UI to sort the hive table schema based on position attribute of hive_column (Kalyanikashikar via kevalbhatt)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/5ca1ed3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/5ca1ed3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/5ca1ed3f

Branch: refs/heads/master
Commit: 5ca1ed3f0e1fd3b896a4b7160b960d40864dfd89
Parents: 8044ca4
Author: kevalbhatt <kb...@apache.org>
Authored: Tue Sep 13 11:08:07 2016 +0530
Committer: kevalbhatt <kb...@apache.org>
Committed: Tue Sep 13 11:08:07 2016 +0530

----------------------------------------------------------------------
 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/5ca1ed3f/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/5ca1ed3f/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/5ca1ed3f/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/5ca1ed3f/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index e37e65f..7e3b835 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
 ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
 
 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)