ATLAS-1585 : Search result page should show the entityType for each result Signed-off-by: Madhan Neethiraj <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/17a9aad0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/17a9aad0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/17a9aad0 Branch: refs/heads/master Commit: 17a9aad063c0905f9e15cfa650a92ac26f2c46ba Parents: c74ba14 Author: kevalbhatt <[email protected]> Authored: Wed Feb 22 14:41:35 2017 +0530 Committer: Madhan Neethiraj <[email protected]> Committed: Wed Feb 22 10:21:28 2017 -0800 ---------------------------------------------------------------------- dashboardv2/public/css/scss/override.scss | 9 ++++-- dashboardv2/public/css/scss/tree.scss | 1 + dashboardv2/public/js/modules/Modal.js | 5 +--- .../js/views/audit/AuditTableLayoutView.js | 31 +++++++++++--------- .../js/views/search/SearchResultLayoutView.js | 18 ++++++++++++ 5 files changed, 43 insertions(+), 21 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/17a9aad0/dashboardv2/public/css/scss/override.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss index 5c8206d..89c12ca 100644 --- a/dashboardv2/public/css/scss/override.scss +++ b/dashboardv2/public/css/scss/override.scss @@ -223,9 +223,12 @@ } .backgrid-paginator ul > .disabled > span, -.backgrid-paginator ul > .disabled > a, -.backgrid-paginator ul > .disabled > a:hover { - cursor: pointer; +.backgrid-paginator ul > .disabled > a { + &:hover { + cursor: not-allowed; + background-color: #7ed3be !important; + } + } .popover { http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/17a9aad0/dashboardv2/public/css/scss/tree.scss ---------------------------------------------------------------------- diff --git a/dashboardv2/public/css/scss/tree.scss b/dashboardv2/public/css/scss/tree.scss index 29210a0..50396ba 100644 --- a/dashboardv2/public/css/scss/tree.scss +++ b/dashboardv2/public/css/scss/tree.scss @@ -173,5 +173,6 @@ } .popoverTerm { + text-align: center; margin-top: 25px !important; } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/17a9aad0/dashboardv2/public/js/modules/Modal.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/modules/Modal.js b/dashboardv2/public/js/modules/Modal.js index 1f64f40..e5c7e6f 100644 --- a/dashboardv2/public/js/modules/Modal.js +++ b/dashboardv2/public/js/modules/Modal.js @@ -16,10 +16,7 @@ * limitations under the License. */ -define(function(require) { - - var Backbone = require('backbone'); - var template = require('hbs!tmpl/common/modal'); +define(['require', 'backbone', 'hbs!tmpl/common/modal'], function(require, Backbone, template) { var Modal = Backbone.View.extend({ http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/17a9aad0/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 d837cf3..b98e512 100644 --- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js +++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js @@ -92,28 +92,34 @@ define(['require', getToOffset: function() { var toOffset = 0; if (this.entityCollection.models.length < this.count) { - toOffset = ((this.currPage - 1) * (this.count - 1) + (this.entityCollection.models.length)); + toOffset = (this.getFromOffset() + (this.entityCollection.models.length)); } else { - toOffset = ((this.currPage - 1) * (this.count - 1) + (this.entityCollection.models.length - 1)); + toOffset = (this.getFromOffset() + (this.entityCollection.models.length - 1)); } return toOffset; }, + getFromOffset: function(options) { + var count = (this.currPage - 1) * (this.count - 1); + if (options && (options.nextClick || options.previousClick || this.entityCollection.models.length)) { + return count + 1; + } else { + return count; + } + }, renderOffset: function(options) { - var that = this; if (options.nextClick) { options.previous.removeAttr("disabled"); - if (that.entityCollection.length != 0) { - that.currPage++; - that.ui.pageRecordText.html("Showing " + ((that.currPage - 1) * (that.count - 1) + 1) + " - " + that.getToOffset()); + if (this.entityCollection.length != 0) { + this.currPage++; + } - } - if (options.previousClick) { + } else if (options.previousClick) { options.next.removeAttr("disabled"); - if (that.currPage > 1 && that.entityCollection.models.length) { - that.currPage--; - that.ui.pageRecordText.html("Showing " + ((that.currPage - 1) * (that.count - 1) + 1) + " - " + that.getToOffset()); + if (this.currPage > 1 && this.entityCollection.models.length) { + this.currPage--; } } + this.ui.pageRecordText.html("Showing " + this.getFromOffset(options) + " - " + this.getToOffset()); }, fetchCollection: function(options) { var that = this; @@ -130,9 +136,6 @@ define(['require', options.previous.attr('disabled', true); options.next.attr('disabled', true); } - if (!options.nextClick && !options.previousClick) { - that.ui.pageRecordText.html("Showing " + ((that.currPage - 1) * (that.count - 1) + 1) + " - " + that.getToOffset()); - } that.$('.fontLoader').hide(); that.$('.auditTable').show(); that.renderOffset(options); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/17a9aad0/dashboardv2/public/js/views/search/SearchResultLayoutView.js ---------------------------------------------------------------------- diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js index 71319b9..85d642f 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -398,6 +398,24 @@ define(['require', } }) }; + col['typeName'] = { + label: "Type", + cell: "Html", + editable: false, + sortable: false, + formatter: _.extend({}, Backgrid.CellFormatter.prototype, { + fromRaw: function(rawValue, model) { + if (that.searchCollection.queryType == "DSL") { + var obj = model.toJSON(); + } else { + var obj = model.get('entity'); + } + if (obj && obj.typeName) { + return '<a title="Search ' + obj.typeName + '" href="#!/search/searchResult?query=' + obj.typeName + ' &searchType=dsl&dslChecked=true">' + obj.typeName + '</a>'; + } + } + }) + }; col['owner'] = { label: "Owner", cell: "String",
