Commit b8a5d4d6 by Hemanth Yamijala

ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes…

ATLAS-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18 via yhemanth)
parent 83d05397
......@@ -95,3 +95,9 @@
.select2-container--default.select2-container--focus .select2-selection--multiple {
border-color: #8fa5b1 !important;
}
.backgrid {
td {
white-space: normal;
}
}
......@@ -20,17 +20,4 @@
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
<table class="table table-quickMenu">
<thead>
<tr>
<th class="tagTermheading">Tag</th>
<th>Attributes</th>
<th>Tools</th>
</tr>
</thead>
<tbody data-id="detailValue">
</tbody>
</table>
<div class="noTags" style="display:none">
No tags to display
</div>
<div id="r_tagTermTableLayoutView"></div>
\ No newline at end of file
......@@ -62,7 +62,7 @@ define(['require',
collection: this.entityCollection,
includeFilter: false,
includePagination: true,
includePageSize: true,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-hover backgrid table-quickMenu",
......
......@@ -112,22 +112,7 @@ define(['require',
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'vent', 'id'));
this.key = 'branchDetail';
//this.updateValue();
this.bindEvents();
this.commonTableOptions = {
collection: this.collection,
includeFilter: false,
includePagination: false,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-striped table-condensed backgrid table-quickMenu",
emptyText: 'No records found!'
},
filterOpts: {},
paginatorOpts: {}
};
},
bindEvents: function() {
var that = this;
......@@ -170,14 +155,6 @@ define(['require',
onRender: function() {
var that = this;
this.ui.editBox.hide();
/* this.ui.appendList.on('click', 'div', function(e) {
if (e.target.nodeName == "INPUT") {
return false;
}
that.ui.addTagtext.hide();
that.ui.addTagPlus.show();
that.saveTagFromList($(this));
});*/
},
fetchCollection: function() {
this.collection.fetch({ reset: true });
......
......@@ -75,10 +75,10 @@ define(['require',
collection: this.schemaCollection,
includeFilter: false,
includePagination: true,
includePageSize: true,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-striped table-condensed backgrid table-quickMenu",
className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!'
},
filterOpts: {},
......@@ -111,10 +111,7 @@ define(['require',
var cols = new Backgrid.Columns(that.getSchemaTableColumns());
that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent,
columns: cols,
gridOpts: {
className: "table table-quickMenu",
},
columns: cols
})));
});
},
......
......@@ -20,8 +20,9 @@ define(['require',
'backbone',
'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl',
'utils/CommonViewFunction',
'utils/Utils'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils) {
'utils/Utils',
'collection/VTagList'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList) {
'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
......@@ -32,7 +33,9 @@ define(['require',
template: TagDetailTableLayoutView_tmpl,
/** Layout sub regions */
regions: {},
regions: {
RTagTermTableLayoutView: "#r_tagTermTableLayoutView"
},
/** ui selector cache */
ui: {
......@@ -52,68 +55,110 @@ define(['require',
return events;
},
/**
* intialize a new EntityDetailTableLayoutView Layout
* intialize a new TagDetailTableLayoutView Layout
* @constructs
*/
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'guid', 'term'));
this.collectionObject = this.collection.toJSON();
this.tagTermCollection = new VTagList();
var tagorterm = _.toArray(this.collectionObject[0].traits),
tagTermList = [],
that = this;
_.each(tagorterm, function(object) {
if (that.term) {
var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
if (checkTagOrTerm.term) {
tagTermList.push(object);
}
} else {
var checkTagOrTerm = Utils.checkTagOrTerm(object.typeName);
if (!checkTagOrTerm.term) {
tagTermList.push(object);
}
}
});
this.tagTermCollection.set(tagTermList);
this.commonTableOptions = {
collection: this.tagTermCollection,
includeFilter: false,
includePagination: true,
includePageSize: false,
includeFooterRecords: true,
gridOpts: {
className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!'
},
filterOpts: {},
paginatorOpts: {}
};
},
bindEvents: function() {},
onRender: function() {
this.tagTableGenerate();
if (this.term) {
this.$('.tagTermheading').text('Terms');
} else {
this.$('.tagTermheading').text('Tags');
this.renderTableLayoutView();
},
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
var cols = new Backgrid.Columns(that.getSchemaTableColumns());
that.RTagTermTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent,
columns: cols
})));
});
},
getSchemaTableColumns: function() {
var that = this;
var col = {};
return this.tagTermCollection.constructor.getTableCols({
TagorTerm: {
label: (this.term) ? "Terms" : "Tags",
cell: "String",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return model.get('typeName');
}
})
},
tagTableGenerate: function() {
var that = this,
table = "",
valueObject = this.collectionObject[0].traits;
if (_.isEmpty(valueObject)) {
this.showNoTagorTermMessage()
} else {
this.$(".noTags").hide();
_.keys(valueObject).map(function(key) {
var keyValue = valueObject[key];
var tagValue = 'NA';
if (_.isObject(keyValue)) {
//tagValue = "";
if (!_.isEmpty(keyValue.values)) {
Attributes: {
label: "Attributes",
cell: "html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
var values = model.get('values'),
tagValue = 'NA';
if (!_.isEmpty(values)) {
var stringArr = [];
tagValue = "";
_.each(keyValue.values, function(val, key) {
_.each(values, function(val, key) {
var attrName = "<span>" + key + ":" + val + "</span>";
stringArr.push(attrName);
});
tagValue += stringArr.join(", ");
}
var name = Utils.checkTagOrTerm(keyValue.typeName);
if (that.term && name.term) {
table += '<tr><td>' + keyValue.typeName + '</td><td>' + tagValue + '</td><td>' + '<a href="javascript:void(0)"><i class="fa fa-trash" data-id="delete" data-name="' + keyValue.typeName + '"></i></a></tr>';
return tagValue;
}
if (!that.term && !name.term) {
table += '<tr><td>' + keyValue.typeName + '</td><td>' + tagValue + '</td><td>' + '<a href="javascript:void(0)"><i class="fa fa-trash" data-id="delete" data-name="' + keyValue.typeName + '"></i></a></tr>';
})
},
tool: {
label: "Tool",
cell: "html",
editable: false,
sortable: false,
formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
fromRaw: function(rawValue, model) {
return '<a href="javascript:void(0)"><i class="fa fa-trash" data-id="delete" data-name="' + model.get('typeName') + '"></i></a>'
}
})
},
} else {}
});
if (table.length == 0) {
this.showNoTagorTermMessage();
}
that.ui.detailValue.append(table);
}
},
showNoTagorTermMessage: function() {
if (this.term) {
this.$(".noTags").text(' No terms to display').show();
} else {
this.$(".noTags").text(' No tags to display').show();
}
this.tagTermCollection);
},
addModalView: function(e) {
var that = this;
......
......@@ -22,6 +22,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-846 Atlas UI : Add Pagination to Tags and Terms tabs of asset detailes page (kevalbhatt18 via yhemanth)
ATLAS-503 Lock exceptions occurring due to concurrent updates to backend stores (yhemanth)
ATLAS-766 Atlas policy file does not honour standard hash as comment format ( saqeeb.s via sumasai )
ATLAS-843 Atlas UI: Feature to search terms in left navigation. (Kalyanikashikar via sumasai)
......
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