Commit fa9fbbd7 by Shwetha GS

ATLAS-847 UI: Audit versioning does not paginate details from Atlas server…

ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)
parent 079ce35e
......@@ -148,3 +148,24 @@
-o-transition: ease-in .1s ease-out;
transition: ease-in .1s ease-out;
}
.pager {
margin: 0px;
li {
>button {
display: inline-block;
padding: 5px 14px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 15px;
color: $color_jungle_green_approx;
}
>button,
>span {
&:hover {
background-color: $color_jungle_green_approx;
color: $white;
}
}
}
}
......@@ -292,8 +292,8 @@ form-control .tagInpput {
}
.inputAssignTag {
display: inline-block;
padding: 2px 0px;
display: block;
padding: 2px 5px;
border: 1px $action_gray solid;
color: $action_gray;
font-size: 14px;
......@@ -303,13 +303,12 @@ form-control .tagInpput {
float: left;
cursor: pointer;
background-color: $white;
width: 100px;
white-space: nowrap;
i.fa {
position: relative;
right: -5px;
cursor: pointer;
}
// i.fa {
// position: relative;
// right: -5px;
// cursor: pointer;
// }
&:hover {
color: $color_dark_grey_approx;
background-color: $color_mercury_approx;
......
......@@ -14,4 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div id="r_auditTableLayoutView"></div>
<div class="position-relative">
<div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i>
</div>
</div>
<div class="auditTable">
<div id="r_auditTableLayoutView"></div>
<ul class="pager">
<li>
<button data-id="previousAuditData">Previous</button>
</li>
<li>
<button data-id="nextAuditData">Next</button>
</li>
</ul>
</div>
......@@ -14,5 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"> Assign Term</i></a>
<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"></i> Assign Term</a>
<div id="r_tagLayoutView"></div>
......@@ -14,16 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<div class="form-horizontal">
<div class="form-group">
<!-- <label class="control-label col-sm-4">Tag definition</label> -->
<div class="col-sm-12">
<select class="form-control row-margin-bottom" data-id="addTagOptions" required>
</select>
</div>
</div>
<div class="row modalHeight">
<div class="col-sm-12" data-id="tagAttribute" style="display:none">
</div>
</div>
</div>
\ No newline at end of file
<div>
<div class="form-group">
<select class="form-control row-margin-bottom" data-id="addTagOptions" required>
</select>
</div>
<div class="row modalHeight">
<div class="col-sm-12" data-id="tagAttribute" style="display:none">
</div>
</div>
</div>
......@@ -349,9 +349,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
html += '<div><a href="javascript:void(0)" data-id="showMoreLessTerm" class="inputTag inputTagGreen"><span>Show More </span><i class="fa fa-angle-right"></i></a></div>'
}
if (model.get('$id$')) {
html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm" data-guid="' + model.get('$id$').id + '"><i class="fa fa-folder-o">' + " " + 'Assign Term</i></a></div>'
html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm" data-guid="' + model.get('$id$').id + '"><i class="fa fa-folder-o"></i>' + " " + 'Assign Term</a></div>'
} else {
html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm"><i class="fa fa-folder-o">' + " " + 'Assign Term</i></a></div>'
html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm"><i class="fa fa-folder-o"></i>' + " " + 'Assign Term</a></div>'
}
return {
html: '<div class="termTableBreadcrumb" dataterm-id="' + id + '">' + html + '</div>',
......
......@@ -40,11 +40,15 @@ define(['require',
ui: {
auditValue: "[data-id='auditValue']",
auditCreate: "[data-id='auditCreate']",
previousAuditData: "[data-id='previousAuditData']",
nextAuditData: "[data-id='nextAuditData']"
},
/** ui events hash */
events: function() {
var events = {};
events["click " + this.ui.auditCreate] = "onClickAuditCreate";
events["click " + this.ui.nextAuditData] = "onClickNextAuditData";
events["click " + this.ui.previousAuditData] = "onClickPreviousAuditData";
return events;
},
/**
......@@ -54,16 +58,17 @@ define(['require',
initialize: function(options) {
_.extend(this, _.pick(options, 'globalVent', 'guid'));
this.entityCollection = new VEntityList();
this.count = 25;
this.entityCollection.url = "/api/atlas/entities/" + this.guid + "/audit";
this.entityCollection.modelAttrName = "events";
//this.collectionObject = entityCollection;
this.entityCollection.modelAttrName = "events"
this.entityModel = new this.entityCollection.model();
this.pervOld = [];
this.commonTableOptions = {
collection: this.entityCollection,
includeFilter: false,
includePagination: true,
includePagination: false,
includePageSize: false,
includeFooterRecords: true,
includeFooterRecords: false,
gridOpts: {
className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!'
......@@ -72,16 +77,55 @@ define(['require',
paginatorOpts: {}
};
},
bindEvents: function() {
this.listenTo(this.entityCollection, "reset", function(value) {
this.renderTableLayoutView();
}, this);
},
onRender: function() {
this.entityCollection.fetch({ reset: true });
this.bindEvents();
$.extend(this.entityCollection.queryParams, { count: this.count });
this.fetchCollection({
next: this.ui.nextAuditData,
nextClick: false,
previous: this.ui.previousAuditData
});
this.renderTableLayoutView();
},
fetchCollection: function(options) {
var that = this;
this.$('.fontLoader').show();
this.$('.auditTable').hide();
if (that.entityCollection.models.length > 1) {
if (options.nextClick) {
this.pervOld.push(that.entityCollection.first().get('eventKey'));
}
}
this.entityCollection.fetch({
success: function() {
that.$('.fontLoader').hide();
that.$('.auditTable').show();
options.previous.attr('disabled', true);
if (that.entityCollection.models.length <= 1) {
that.pervOld.pop();
options.next.attr('disabled', true);
}
if (that.entityCollection.models.length == 1 && that.next == that.entityCollection.last().get('eventKey')) {
options.next.attr('disabled', true);
options.previous.removeAttr("disabled");
} else {
if (that.entityCollection.models.length > 0) {
that.next = that.entityCollection.last().get('eventKey');
if (options.nextClick) {
options.previous.removeAttr("disabled");
}
if (options.previousClick) {
options.previous.removeAttr("disabled");
}
if (that.pervOld.length == 0) {
options.previous.attr('disabled', true);
}
}
that.renderTableLayoutView();
}
},
silent: true
});
},
renderTableLayoutView: function() {
var that = this;
require(['utils/TableLayout'], function(TableLayout) {
......@@ -161,8 +205,39 @@ define(['require',
view.on('closeModal', function() {
modal.trigger('cancel');
});
view.$el.on('click', 'td a', function() {
modal.trigger('cancel');
})
});
},
onClickNextAuditData: function() {
var that = this;
this.ui.previousAuditData.removeAttr("disabled");
$.extend(this.entityCollection.queryParams, {
startKey: function() {
return that.next
}
});
this.fetchCollection({
next: this.ui.nextAuditData,
nextClick: true,
previous: this.ui.previousAuditData
});
}
},
onClickPreviousAuditData: function() {
var that = this;
this.ui.nextAuditData.removeAttr("disabled");
$.extend(this.entityCollection.queryParams, {
startKey: function() {
return that.pervOld.pop()
}
});
this.fetchCollection({
next: this.ui.nextAuditData,
previousClick: true,
previous: this.ui.previousAuditData
});
},
});
return AuditTableLayoutView;
});
......@@ -111,9 +111,8 @@ define(['require',
for (var i = 0; i < this.commonCollection.models[0].attributes.traitTypes[0].attributeDefinitions.length; i++) {
var attribute = this.commonCollection.models[0].attributes.traitTypes[0].attributeDefinitions;
this.ui.tagAttribute.show();
strAttribute += '<div class="form-group"><label class="control-label col-sm-2">' + attribute[i].name + '</label>' +
'<div class="col-sm-10">' +
'<input type="text" class="form-control attributeInputVal attrName" data-key="' + attribute[i].name + '" ></input></div></div>';
strAttribute += '<div class="form-group"><label>' + attribute[i].name + '</label>' +
'<input type="text" class="form-control attributeInputVal attrName" data-key="' + attribute[i].name + '" ></input></div>';
this.ui.tagAttribute.html(strAttribute);
}
if (this.commonCollection.models[0].attributes.traitTypes[0].superTypes.length > 0) {
......
......@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES:
ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)
ATLAS-1004 Option to enable taxonomy feature (kevalbhatt18 via shwethags)
ATLAS-1003 DataSetLineageServiceTest, GraphBackedDiscoveryServiceTest, and GraphRepoMapperScaleTest failing in some environments (dkantor via shwethags)
ATLAS-1002 Create default user rangertagsync in atlas file authentication for Ranger tag sync module (nixonrodrigues via shwethags)
......
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