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 @@ ...@@ -95,3 +95,9 @@
.select2-container--default.select2-container--focus .select2-selection--multiple { .select2-container--default.select2-container--focus .select2-selection--multiple {
border-color: #8fa5b1 !important; border-color: #8fa5b1 !important;
} }
.backgrid {
td {
white-space: normal;
}
}
...@@ -20,17 +20,4 @@ ...@@ -20,17 +20,4 @@
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<table class="table table-quickMenu"> <div id="r_tagTermTableLayoutView"></div>
<thead> \ No newline at end of file
<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>
...@@ -62,7 +62,7 @@ define(['require', ...@@ -62,7 +62,7 @@ define(['require',
collection: this.entityCollection, collection: this.entityCollection,
includeFilter: false, includeFilter: false,
includePagination: true, includePagination: true,
includePageSize: true, includePageSize: false,
includeFooterRecords: true, includeFooterRecords: true,
gridOpts: { gridOpts: {
className: "table table-hover backgrid table-quickMenu", className: "table table-hover backgrid table-quickMenu",
......
...@@ -112,22 +112,7 @@ define(['require', ...@@ -112,22 +112,7 @@ define(['require',
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'vent', 'id')); _.extend(this, _.pick(options, 'globalVent', 'collection', 'vent', 'id'));
this.key = 'branchDetail';
//this.updateValue();
this.bindEvents(); 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() { bindEvents: function() {
var that = this; var that = this;
...@@ -170,14 +155,6 @@ define(['require', ...@@ -170,14 +155,6 @@ define(['require',
onRender: function() { onRender: function() {
var that = this; var that = this;
this.ui.editBox.hide(); 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() { fetchCollection: function() {
this.collection.fetch({ reset: true }); this.collection.fetch({ reset: true });
......
...@@ -75,10 +75,10 @@ define(['require', ...@@ -75,10 +75,10 @@ define(['require',
collection: this.schemaCollection, collection: this.schemaCollection,
includeFilter: false, includeFilter: false,
includePagination: true, includePagination: true,
includePageSize: true, includePageSize: false,
includeFooterRecords: true, includeFooterRecords: true,
gridOpts: { gridOpts: {
className: "table table-striped table-condensed backgrid table-quickMenu", className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!' emptyText: 'No records found!'
}, },
filterOpts: {}, filterOpts: {},
...@@ -111,10 +111,7 @@ define(['require', ...@@ -111,10 +111,7 @@ define(['require',
var cols = new Backgrid.Columns(that.getSchemaTableColumns()); var cols = new Backgrid.Columns(that.getSchemaTableColumns());
that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, { that.RTagLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent, globalVent: that.globalVent,
columns: cols, columns: cols
gridOpts: {
className: "table table-quickMenu",
},
}))); })));
}); });
}, },
......
...@@ -20,8 +20,9 @@ define(['require', ...@@ -20,8 +20,9 @@ define(['require',
'backbone', 'backbone',
'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl', 'hbs!tmpl/tag/TagDetailTableLayoutView_tmpl',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'utils/Utils' 'utils/Utils',
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils) { 'collection/VTagList'
], function(require, Backbone, TagDetailTableLayoutView_tmpl, CommonViewFunction, Utils, VTagList) {
'use strict'; 'use strict';
var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( var TagDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -32,7 +33,9 @@ define(['require', ...@@ -32,7 +33,9 @@ define(['require',
template: TagDetailTableLayoutView_tmpl, template: TagDetailTableLayoutView_tmpl,
/** Layout sub regions */ /** Layout sub regions */
regions: {}, regions: {
RTagTermTableLayoutView: "#r_tagTermTableLayoutView"
},
/** ui selector cache */ /** ui selector cache */
ui: { ui: {
...@@ -52,68 +55,110 @@ define(['require', ...@@ -52,68 +55,110 @@ define(['require',
return events; return events;
}, },
/** /**
* intialize a new EntityDetailTableLayoutView Layout * intialize a new TagDetailTableLayoutView Layout
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'collection', 'guid', 'term')); _.extend(this, _.pick(options, 'globalVent', 'collection', 'guid', 'term'));
this.collectionObject = this.collection.toJSON(); 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() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
this.tagTableGenerate(); this.renderTableLayoutView();
if (this.term) {
this.$('.tagTermheading').text('Terms');
} else {
this.$('.tagTermheading').text('Tags');
}
}, },
tagTableGenerate: function() { renderTableLayoutView: function() {
var that = this, var that = this;
table = "", require(['utils/TableLayout'], function(TableLayout) {
valueObject = this.collectionObject[0].traits; var cols = new Backgrid.Columns(that.getSchemaTableColumns());
if (_.isEmpty(valueObject)) { that.RTagTermTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
this.showNoTagorTermMessage() globalVent: that.globalVent,
} else { columns: cols
this.$(".noTags").hide(); })));
_.keys(valueObject).map(function(key) { });
var keyValue = valueObject[key]; },
var tagValue = 'NA'; getSchemaTableColumns: function() {
if (_.isObject(keyValue)) { var that = this;
//tagValue = ""; var col = {};
if (!_.isEmpty(keyValue.values)) {
var stringArr = [];
tagValue = "";
_.each(keyValue.values, function(val, key) {
var attrName = "<span>" + key + ":" + val + "</span>"; return this.tagTermCollection.constructor.getTableCols({
stringArr.push(attrName); TagorTerm: {
}); label: (this.term) ? "Terms" : "Tags",
tagValue += stringArr.join(", "); cell: "String",
} editable: false,
var name = Utils.checkTagOrTerm(keyValue.typeName); sortable: false,
if (that.term && name.term) { formatter: _.extend({}, Backgrid.CellFormatter.prototype, {
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>'; fromRaw: function(rawValue, model) {
} return model.get('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>'; })
} },
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(values, function(val, key) {
var attrName = "<span>" + key + ":" + val + "</span>";
stringArr.push(attrName);
});
tagValue += stringArr.join(", ");
}
return tagValue;
}
})
},
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 {} },
}); this.tagTermCollection);
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();
}
}, },
addModalView: function(e) { addModalView: function(e) {
var that = this; var that = this;
......
...@@ -22,6 +22,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ...@@ -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) ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES: 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-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-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) 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