Commit 5ca1ed3f by kevalbhatt

ATLAS-1149 Changes to UI to sort the hive table schema based on position…

ATLAS-1149 Changes to UI to sort the hive table schema based on position attribute of hive_column (Kalyanikashikar via kevalbhatt)
parent 8044ca48
......@@ -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
*/
......
......@@ -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);
}
});
......
......@@ -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,
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment