Repository: incubator-atlas Updated Branches: refs/heads/master 079ce35ef -> 99d514367
ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/fa9fbbd7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/fa9fbbd7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/fa9fbbd7 Branch: refs/heads/master Commit: fa9fbbd7c74c2ff9e1e897258f6a102755ad4b4f Parents: 079ce35 Author: Shwetha GS <[email protected]> Authored: Wed Jul 13 15:23:09 2016 +0530 Committer: Shwetha GS <[email protected]> Committed: Wed Jul 13 15:23:09 2016 +0530 ---------------------------------------------------------------------- dashboardv2/public/css/scss/override.scss | 21 +++++ dashboardv2/public/css/scss/tag.scss | 15 ++- .../audit/AuditTableLayoutView_tmpl.html | 17 +++- .../schema/SchemaTableLayoutView_tmpl.html | 2 +- .../js/templates/tag/addTagModalView_tmpl.html | 23 ++--- .../public/js/utils/CommonViewFunction.js | 4 +- .../js/views/audit/AuditTableLayoutView.js | 99 +++++++++++++++++--- .../public/js/views/tag/addTagModalView.js | 5 +- release-log.txt | 1 + 9 files changed, 147 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/css/scss/override.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss index 743728a..8732423 100644 --- a/dashboardv2/public/css/scss/override.scss +++ b/dashboardv2/public/css/scss/override.scss @@ -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; + } + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/css/scss/tag.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/tag.scss b/dashboardv2/public/css/scss/tag.scss index a9cba82..0271daa 100644 --- a/dashboardv2/public/css/scss/tag.scss +++ b/dashboardv2/public/css/scss/tag.scss @@ -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; http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html index fca11a5..2bf3880 100644 --- a/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html +++ b/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html @@ -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> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html index d648009..43447d9 100644 --- a/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html +++ b/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html @@ -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> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html b/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html index 7ada413..f0826ca 100644 --- a/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html +++ b/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html @@ -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> http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/utils/CommonViewFunction.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js index 782cb54..495d6b8 100644 --- a/dashboardv2/public/js/utils/CommonViewFunction.js +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -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>', http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/views/audit/AuditTableLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js index fd7fabe..23cc50d 100644 --- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js +++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js @@ -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; }); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/views/tag/addTagModalView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/tag/addTagModalView.js b/dashboardv2/public/js/views/tag/addTagModalView.js index f1cb026..d51be9f 100644 --- a/dashboardv2/public/js/views/tag/addTagModalView.js +++ b/dashboardv2/public/js/views/tag/addTagModalView.js @@ -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) { http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index b1b62fd..f162611 100644 --- a/release-log.txt +++ b/release-log.txt @@ -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)
