Commit f54325f1 by Keval Bhatt

ATLAS-1147 UI: column name doesn't show up in schema tab for hive table…

ATLAS-1147 UI: column name doesn't show up in schema tab for hive table (Kalyanikashikar via kevalbhatt)
parent e817b214
...@@ -98,6 +98,7 @@ define(['require', ...@@ -98,6 +98,7 @@ define(['require',
includePagination: true, includePagination: true,
includePageSize: false, includePageSize: false,
includeFooterRecords: true, includeFooterRecords: true,
includeOrderAbleColumns: true,
gridOpts: { gridOpts: {
className: "table table-hover backgrid table-quickMenu", className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!' emptyText: 'No records found!'
...@@ -177,12 +178,29 @@ define(['require', ...@@ -177,12 +178,29 @@ define(['require',
sortKey: "position", sortKey: "position",
comparator: function(item) { comparator: function(item) {
return item.get(this.sortKey) || 999; return item.get(this.sortKey) || 999;
},
setPositions: function() {
_.each(this.models, function(model, index) {
if (model.get('name') == "name") {
model.set("position", 2, { silent: true });
model.set("label", "Name");
} else if (model.get('name') == "description") {
model.set("position", 3, { silent: true });
model.set("label", "Description");
} else if (model.get('name') == "owner") {
model.set("position", 4, { silent: true });
model.set("label", "Owner");
}
});
return this;
} }
}); });
var columns = new columnCollection(that.getSchemaTableColumns()); var columns = new columnCollection(that.getSchemaTableColumns());
columns.setPositions().sort();
that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, { that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent, globalVent: that.globalVent,
columns: columns columns: columns,
includeOrderAbleColumns: true
}))); })));
that.$('.multiSelectTerm').hide(); that.$('.multiSelectTerm').hide();
that.$('.multiSelectTag').hide(); that.$('.multiSelectTag').hide();
...@@ -199,86 +217,126 @@ define(['require', ...@@ -199,86 +217,126 @@ define(['require',
}); });
}, },
getSchemaTableColumns: function() { getSchemaTableColumns: function() {
var that = this; var that = this,
var col = {}; col = {},
if (this.schemaCollection.keyList) { nameCheck = false,
_.each(this.schemaCollection.keyList, function(obj, key) { modelJSON = this.schemaCollection.toJSON()[0];
col[obj.name] = { for (var i = 0; i < this.schemaCollection.models.length; i++) {
cell: "Html", var model = this.schemaCollection.models[i];
editable: false, if (model && (model.get('name') || model.get('qualifiedName'))) {
sortable: false, nameCheck = true;
orderable: true, }
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { }
fromRaw: function(rawValue, model) { if (nameCheck === true) {
if (model) { col['name'] = {
if (!_.isArray(rawValue) && _.isObject(rawValue)) { label: "Name",
if (rawValue.id) { cell: "html",
return '<div><a href="#!/detailPage/' + rawValue.id + '">' + rawValue.$typeName$ + '</a></div>'; editable: false,
} else { sortable: false,
return rawValue.$typeName$; className: "searchTableName",
} formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
} else if (_.isArray(rawValue)) { fromRaw: function(rawValue, model) {
var links = ""; var nameHtml = "";
_.each(rawValue, function(val, key) { if (rawValue === undefined) {
if (val.id) { if (model.get('qualifiedName')) {
links += '<div><a href="#!/detailPage/' + val.id + '">' + val.$typeName$ + '</a></div>'; rawValue = model.get('qualifiedName');
} else if (model.get('$id$') && model.get('$id$').qualifiedName) {
rawValue = model.get('$id$').qualifiedName;
} else {
return "";
}
}
if (model.get('$id$') && model.get('$id$').id) {
nameHtml = '<a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a>';
} else {
nameHtml = '<a>' + rawValue + '</a>';
}
if (model.get('$id$') && model.get('$id$').state && Globals.entityStateReadOnly[model.get('$id$').state]) {
nameHtml += '<button title="Deleted" class="btn btn-atlasAction btn-atlas deleteBtn"><i class="fa fa-trash"></i></button>';
return '<div class="readOnly readOnlyLink">' + nameHtml + '</div>';
} else {
return nameHtml;
}
}
})
};
};
_.keys(modelJSON).map(function(key) {
if (key.indexOf("$") == -1) {
if (!(key === "qualifiedName" || key === "name")) {
col[key] = {
cell: "Html",
editable: false,
sortable: false,
orderable: true,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
if (model) {
if (!_.isArray(rawValue) && _.isObject(rawValue)) {
if (rawValue.id) {
return '<div><a href="#!/detailPage/' + rawValue.id + '">' + rawValue.$typeName$ + '</a></div>';
} else { } else {
links += '<div>' + val.$typeName$ + '</div>'; return rawValue.$typeName$;
} }
}); } else if (_.isArray(rawValue)) {
return links; var links = "";
_.each(rawValue, function(val, key) {
} else if (model.get('$id$') && model.get('$id$').id && model.get('name') == rawValue) { if (val.id) {
return '<div><a href="#!/detailPage/' + model.get('$id$').id + '">' + rawValue + '</a></div>'; links += '<div><a href="#!/detailPage/' + val.id + '">' + val.$typeName$ + '</a></div>';
} else {
links += '<div>' + val.$typeName$ + '</div>';
}
});
return links;
} else {
return rawValue;
}
} else { } else {
return rawValue; return rawValue;
} }
} else {
return rawValue;
} }
})
} };
}) }
}; }
}); });
col['Check'] = { col['Check'] = {
name: "selected", name: "selected",
label: "", label: "",
cell: "select-row", cell: "select-row",
headerCell: "select-all", headerCell: "select-all",
position: 1 position: 1
}; };
col['tag'] = { col['tag'] = {
label: "Tags", label: "Tags",
cell: "Html",
editable: false,
sortable: false,
className: 'searchTag',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return CommonViewFunction.tagForTable(model);
}
})
};
if (Globals.taxonomy) {
col['terms'] = {
label: "Terms",
cell: "Html", cell: "Html",
editable: false, editable: false,
sortable: false, sortable: false,
className: 'searchTag', orderable: true,
className: 'searchTerm',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) { fromRaw: function(rawValue, model) {
return CommonViewFunction.tagForTable(model); var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema");
if (returnObject.object) {
that.bradCrumbList.push(returnObject.object);
}
return returnObject.html;
} }
}) })
}; };
if (Globals.taxonomy) {
col['terms'] = {
label: "Terms",
cell: "Html",
editable: false,
sortable: false,
orderable: true,
className: 'searchTerm',
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var returnObject = CommonViewFunction.termTableBreadcrumbMaker(model, "schema");
if (returnObject.object) {
that.bradCrumbList.push(returnObject.object);
}
return returnObject.html;
}
})
};
}
} }
return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection); return this.schemaCollection.constructor.getTableCols(col, this.schemaCollection);
}, },
......
...@@ -10,6 +10,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ...@@ -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) ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES: ALL CHANGES:
ATLAS-1147 UI: column name doesn't show up in schema tab for hive table (Kalyanikashikar via kevalbhatt)
ATLAS-772 Ordering of columns is not maintained in schema query response, where as hive table entity response maintains the ordering (sarath.kum4r@gmail.com via kevalbhatt) ATLAS-772 Ordering of columns is not maintained in schema query response, where as hive table entity response maintains the ordering (sarath.kum4r@gmail.com via kevalbhatt)
ATLAS-1140 All the tag's attributes are not seen while applying a tag to entity (kevalbhatt) ATLAS-1140 All the tag's attributes are not seen while applying a tag to entity (kevalbhatt)
ATLAS-1141 UI-Issue - Tag with spaces, when searched, then it is wrongly set in search textbox. (Kalyanikashikar via kevalbhatt) ATLAS-1141 UI-Issue - Tag with spaces, when searched, then it is wrongly set in search textbox. (Kalyanikashikar 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