Commit d0beadf2 by kevalbhatt Committed by apoorvnaik

ATLAS-2020 : Result Table Column Filter : Filtering using Columns in Result…

ATLAS-2020 : Result Table Column Filter : Filtering using Columns in Result table always sets excludeDeletedEntities to True Signed-off-by: 's avatarapoorvnaik <apoorvnaik@apache.org>
parent e1a142b5
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/atlas.git" "url": "https://git-wip-us.apache.org/repos/asf/incubator-atlas.git"
}, },
"engines": { "engines": {
"node": "4.4.x", "node": "4.4.x",
......
...@@ -69,3 +69,44 @@ ...@@ -69,3 +69,44 @@
display: none; display: none;
opacity: 0.2; opacity: 0.2;
} }
.value-loader {
height: 4px;
width: 50%;
position: relative;
overflow: hidden;
background-color: #ddd;
}
.value-loader:before {
display: block;
position: absolute;
content: "";
left: -200px;
width: 200px;
height: 4px;
background-color: #2980b9;
animation: value-loader 2s linear infinite;
}
@keyframes value-loader {
from {
left: -200px;
width: 30%;
}
50% {
width: 30%;
}
70% {
width: 70%;
}
80% {
left: 50%;
}
95% {
left: 120%;
}
to {
left: 100%;
}
}
\ No newline at end of file
...@@ -69,9 +69,15 @@ ...@@ -69,9 +69,15 @@
box-shadow: 0px 0px 4px #d8d8d8; box-shadow: 0px 0px 4px #d8d8d8;
overflow: scroll !important; overflow: scroll !important;
max-height: 500px; max-height: 500px;
} .resizeHandler {
&.grid-draggable {
.table-quickMenu>thead>tr>th { background-color: $color_jungle_green_approx !important;
}
&:hover {
border-left: 1px solid #d2d2d2;
}
}
>thead>tr>th {
border-width: thin; border-width: thin;
border-color: $color_jungle_green_approx; border-color: $color_jungle_green_approx;
border-bottom-style: solid; border-bottom-style: solid;
...@@ -80,25 +86,29 @@ ...@@ -80,25 +86,29 @@
background-color: transparent; background-color: transparent;
text-align: left; text-align: left;
font-weight: 800; font-weight: 800;
border-top: 0;
font-size: 14px; font-size: 14px;
letter-spacing: 0.25px; letter-spacing: 0.25px;
color: rgba(52, 52, 52, 1); color: rgba(52, 52, 52, 1);
} }
>tbody>tr>td {
.table-quickMenu > tbody > tr > td {
border-color: $color_gallery_approx; border-color: $color_gallery_approx;
color: #333333; color: #333333;
font-weight: 100; font-weight: 100;
padding: 10px 15px; padding: 10px 15px;
}
} }
.backgrid-paginator ul > li > a:hover, td {
.backgrid-paginator ul > .active > a, div.scroll-y {
.backgrid-paginator ul > .active > span { max-height: 200px;
background-color: #2EBC9A !important; overflow-y: auto;
color: #fff !important; }
&:hover { }
background-color: none;
.backgrid {
td {
white-space: normal;
} }
} }
...@@ -108,11 +118,25 @@ ...@@ -108,11 +118,25 @@
margin: 20px 0; margin: 20px 0;
border-radius: 4px; border-radius: 4px;
border: 1px #DDDDDD solid; border: 1px #DDDDDD solid;
} margin: 0px;
float: right;
.backgrid { border-radius: 10px;
td { overflow: hidden;
white-space: normal; >.disabled>span,
>.disabled>a {
&:hover {
cursor: not-allowed;
background-color: #7ed3be !important;
}
}
>.active>span,
>.active>a,
>li>a:hover {
background-color: #2EBC9A !important;
color: #fff !important;
&:hover {
background-color: none;
}
} }
} }
...@@ -216,21 +240,6 @@ ...@@ -216,21 +240,6 @@
} }
} }
.backgrid-paginator ul {
margin: 0px;
float: right;
border-radius: 10px;
overflow: hidden;
}
.backgrid-paginator ul > .disabled > span,
.backgrid-paginator ul > .disabled > a {
&:hover {
cursor: not-allowed;
background-color: #7ed3be !important;
}
}
.popover { .popover {
z-index: 99; z-index: 99;
} }
...@@ -248,7 +257,7 @@ ...@@ -248,7 +257,7 @@
} }
} }
.tab-content > .tab-pane.active { .tab-content>.tab-pane.active {
overflow-x: hidden; overflow-x: hidden;
} }
...@@ -267,40 +276,40 @@ ...@@ -267,40 +276,40 @@
cursor: pointer; cursor: pointer;
} }
.query-builder .rule-container .rule-value-container { .query-builder {
.rule-container .rule-value-container {
display: inline-block !important; display: inline-block !important;
} }
.rules-list>:first-child::before {
.rules-group-header .btn-group.pull-right.group-actions {
float: left !important;
}
.query-builder .rules-list>:first-child::before {
top: -8px; top: -8px;
} }
.rules-group-header .btn-group.group-conditions label {
.query-builder .rules-group-header .btn-group.group-conditions label {
display: none; display: none;
}
.rule-value-container input {
padding: 6px 12px !important;
}
} }
.query-builder .rule-value-container input {
padding: 6px 12px !important; .rules-group-header .btn-group.pull-right.group-actions {
float: left !important;
} }
div.columnmanager-visibilitycontrol { div.columnmanager-visibilitycontrol {
width: auto; width: auto;
margin-bottom: 5px; margin-bottom: 5px;
&.open .btn-atlasAction {
background-color: #37bb9b;
color: #fff;
}
} }
.columnmanager-dropdown-container > li > span.column-label { div.columnmanager-dropdown-container {
width: auto; &.open {
}
div.columnmanager-dropdown-container.open {
overflow: auto; overflow: auto;
} }
>li>span.column-label {
.columnmanager-visibilitycontrol.open .btn-atlasAction { width: auto;
background-color: #37bb9b; }
color: #fff;
} }
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/* panel.scss */ /* panel.scss */
.panel-default { .panel-default {
> .panel-heading { >.panel-heading {
color: $color_jungle_green_approx; color: $color_jungle_green_approx;
background: $white; background: $white;
border-color: $color_jungle_green_approx; border-color: $color_jungle_green_approx;
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
} }
} }
.nav-tabs { .nav-tabs {
> li { >li {
&.active { &.active {
>a { >a {
color: $color_jungle_green_approx; color: $color_jungle_green_approx;
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
//overflow: hidden; //overflow: hidden;
height: calc(100% - 46px)!important; height: calc(100% - 46px)!important;
} }
.ui-resizable-handle{ .ui-resizable-handle {
display: none !important; display: none !important;
} }
} }
.nav-tabs { .nav-tabs {
...@@ -68,8 +68,9 @@ ...@@ -68,8 +68,9 @@
.with-nav-tabs { .with-nav-tabs {
.tab-content { .tab-content {
> .tab-pane.active { >.tab-pane.active {
padding: 20px 10px 0px 10px; padding: 20px 10px 0px 10px;
min-height: 50px;
} }
} }
} }
\ No newline at end of file
...@@ -53,6 +53,9 @@ define([ ...@@ -53,6 +53,9 @@ define([
'enumDefCollection': this.enumDefCollection, 'enumDefCollection': this.enumDefCollection,
'classificationDefCollection': this.classificationDefCollection 'classificationDefCollection': this.classificationDefCollection
} }
this.sharedObj = {
searchTableColumns: {}
}
}, },
bindCommonEvents: function() { bindCommonEvents: function() {
var that = this; var that = this;
...@@ -237,7 +240,7 @@ define([ ...@@ -237,7 +240,7 @@ define([
App.rSideNav.show(new SideNavLayoutView( App.rSideNav.show(new SideNavLayoutView(
_.extend({ _.extend({
'searchVent': that.searchVent 'searchVent': that.searchVent
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
...@@ -253,7 +256,7 @@ define([ ...@@ -253,7 +256,7 @@ define([
'value': paramObj, 'value': paramObj,
'initialView': true, 'initialView': true,
'searchVent': that.searchVent 'searchVent': that.searchVent
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
App.rNContent.$el.html(""); App.rNContent.$el.html("");
...@@ -276,18 +279,22 @@ define([ ...@@ -276,18 +279,22 @@ define([
_.extend({ _.extend({
'value': paramObj, 'value': paramObj,
'searchVent': that.searchVent 'searchVent': that.searchVent
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
} else { } else {
App.rSideNav.currentView.RSearchLayoutView.currentView.manualRender(paramObj); App.rSideNav.currentView.RSearchLayoutView.currentView.manualRender(paramObj);
} }
App.rSideNav.currentView.selectTab(); App.rSideNav.currentView.selectTab();
var isinitialView = true;
if (paramObj) {
isinitialView = (paramObj.type || (paramObj.dslChecked == "true" ? "" : paramObj.tag) || (paramObj.query ? paramObj.query.trim() : "")).length === 0;
}
App.rNContent.show(new SearchDetailLayoutView( App.rNContent.show(new SearchDetailLayoutView(
_.extend({ _.extend({
'value': paramObj, 'value': paramObj,
'searchVent': that.searchVent, 'searchVent': that.searchVent,
'initialView': (paramObj.type || (paramObj.dslChecked == "true" ? "" : paramObj.tag) || (paramObj.query ? paramObj.query.trim() : "")).length === 0 'initialView': isinitialView,
}, that.preFetchedCollectionLists) }, that.preFetchedCollectionLists, that.sharedObj)
)); ));
}); });
}, },
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</div> </div>
<div class="position-relative thick-border"> <div class="position-relative thick-border">
<div data-id="r_tableList" class="table-responsive tableBorder"> </div> <div data-id="r_tableList" class="table-responsive tableBorder"> </div>
<div data-id="r_tableSpinner" class="fontLoader"> <div data-id="r_tableSpinner" class="fontLoader for-ignore">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
</div> </div>
......
...@@ -82,46 +82,46 @@ ...@@ -82,46 +82,46 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<ul class="nav nav-tabs "> <ul class="nav nav-tabs ">
<li role="presentation" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li> <li role="properties" class="tab active"><a href="#tab-details" aria-controls="tab-details" role="tab" data-toggle="tab">Properties</a></li>
<li role="presentation"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li> <li role="tags"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Tags</a></li>
{{#if taxonomy}} {{#if taxonomy}}
<li role="presentation"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li> <li role="terms"><a href="#tab-termTable" aria-controls="tab-termTable" role="tab" data-toggle="tab">Terms</a></li>
{{/if}} {{/if}}
<li role="presentation" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li> <li role="audits" class="tab"><a href="#tab-audit" aria-controls="tab-audit" role="tab" data-toggle="tab">Audits</a></li>
<li role="presentation" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li> <li role="schema" class="tab schemaTable" style="display:none"><a href="#tab-schema" aria-controls="tab-schema" role="tab" data-toggle="tab">Schema</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<div id="tab-details" role="tabpanel" class="tab-pane active"> <div id="tab-details" role="properties" class="tab-pane active">
<div id="r_entityDetailTableLayoutView" style="position: relative;"> <div id="r_entityDetailTableLayoutView" style="position: relative;">
<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>
</div> </div>
</div> </div>
<div id="tab-tagTable" role="tabpanel" class="tab-pane fade"> <div id="tab-tagTable" role="tags" class="tab-pane fade">
<div id="r_tagTableLayoutView" style="position: relative;"> <div id="r_tagTableLayoutView" style="position: relative;">
<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>
</div> </div>
</div> </div>
<div id="tab-termTable" role="tabpanel" class="tab-pane"> <div id="tab-termTable" role="terms" class="tab-pane">
<div id="r_termTableLayoutView" style="position: relative;"> <div id="r_termTableLayoutView" style="position: relative;">
<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>
</div> </div>
</div> </div>
<div id="tab-audit" role="tabpanel" class="tab-pane"> <div id="tab-audit" role="audits" class="tab-pane">
<div id="r_auditTableLayoutView" style="position: relative;"> <div id="r_auditTableLayoutView" style="position: relative;">
<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>
</div> </div>
</div> </div>
<div id="tab-schema" role="tabpanel" class="tab-pane"> <div id="tab-schema" role="schema" class="tab-pane">
<div id="r_schemaTableLayoutView" style="position: relative;"> <div id="r_schemaTableLayoutView" style="position: relative;">
<div class="fontLoader"> <div class="fontLoader">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<div class=""> <div class="">
<div class="tableOverlay"></div> <div class="tableOverlay"></div>
<!-- Not for table Loader its only for initial loading --> <!-- Not for table Loader its only for initial loading -->
<div class="fontLoader"> <div class="fontLoader" style="z-index:999">
<i class="fa fa-refresh fa-spin-custom"></i> <i class="fa fa-refresh fa-spin-custom"></i>
</div> </div>
<div class="ellipsis" style="display: none;"><span class="searchResult" style=" font-size: 16px;"></span> <div class="ellipsis" style="display: none;"><span class="searchResult" style=" font-size: 16px;"></span>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div class="searchTable"> <div class="searchTable">
<div data-id="containerCheckBox" style="display: none;"> <div data-id="containerCheckBox" style="display: none;">
<input type="checkbox" id="inputLabel" class="checkbox-inline" name="queryType" value="text" name="check" value="1" data-id="checkDeletedEntity" /> <input type="checkbox" id="inputLabel" class="checkbox-inline" name="queryType" name="check" data-id="checkDeletedEntity" />
<label class="checkbox-inline" for="inputLabel"> <label class="checkbox-inline" for="inputLabel">
<b>Include historical entities</b></label> <b>Include historical entities</b></label>
</div> </div>
...@@ -53,3 +53,6 @@ ...@@ -53,3 +53,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="text-center" data-id="columnEmptyInfo" style="display: none;">
<h4>Please select one/more column to see the data</h4>
</div>
\ No newline at end of file
...@@ -170,7 +170,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -170,7 +170,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var fetch = true; var fetch = true;
var fetchId = (_.isObject(id) ? id.id : id); var fetchId = (_.isObject(id) ? id.id : id);
fetchInputOutputValue(fetchId); fetchInputOutputValue(fetchId);
tempLink += '<div data-id="' + fetchId + '"></div>'; tempLink += '<div data-id="' + fetchId + '"><div class="value-loader"></div></div>';
} else { } else {
tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>' tempLink += '<a href="#!/detailPage/' + id + '">' + name + '</a>'
} }
...@@ -214,7 +214,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -214,7 +214,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} }
} }
if (isTable) { if (isTable) {
table += '<tr><td>' + _.escape(key) + '</td><td>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</td></tr>'; table += '<tr><td>' + _.escape(key) + '</td><td><div ' + (_.isObject(valueObject[key]) ? 'class="scroll-y"' : '') + '>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</div></td></tr>';
} else { } else {
table += '<div>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</div>'; table += '<div>' + (_.isObject(valueObject[key]) ? keyValue : _.escape(keyValue)) + '</div>';
} }
......
...@@ -131,6 +131,8 @@ define(['require', ...@@ -131,6 +131,8 @@ define(['require',
includeOverlayLoader: false, includeOverlayLoader: false,
includeTableLoader: true,
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
...@@ -146,7 +148,7 @@ define(['require', ...@@ -146,7 +148,7 @@ define(['require',
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'collection', 'columns', 'includePagination', _.extend(this, _.pick(options, 'collection', 'columns', 'includePagination',
'includeHeaderSearch', 'includeFilter', 'includePageSize', 'includeHeaderSearch', 'includeFilter', 'includePageSize',
'includeFooterRecords', 'includeColumnManager', 'includeSizeAbleColumns', 'includeOrderAbleColumns', 'includeOverlayLoader')); 'includeFooterRecords', 'includeColumnManager', 'includeSizeAbleColumns', 'includeOrderAbleColumns', 'includeOverlayLoader', 'includeTableLoader'));
_.extend(this.gridOpts, options.gridOpts, { collection: this.collection, columns: this.columns }); _.extend(this.gridOpts, options.gridOpts, { collection: this.collection, columns: this.columns });
_.extend(this.filterOpts, options.filterOpts); _.extend(this.filterOpts, options.filterOpts);
...@@ -160,14 +162,20 @@ define(['require', ...@@ -160,14 +162,20 @@ define(['require',
/** all events binding here */ /** all events binding here */
bindEvents: function() { bindEvents: function() {
this.listenTo(this.collection, 'request', function() { this.listenTo(this.collection, 'request', function() {
if (this.includeTableLoader) {
this.$('div[data-id="r_tableSpinner"]').addClass('show'); this.$('div[data-id="r_tableSpinner"]').addClass('show');
}
if (this.includeOverlayLoader) { if (this.includeOverlayLoader) {
this.$('.t_tableOverlay').addClass('fontLoader');
this.$('.t_tableOverlay').show(); this.$('.t_tableOverlay').show();
} }
}, this); }, this);
this.listenTo(this.collection, 'sync error', function() { this.listenTo(this.collection, 'sync error', function() {
if (this.includeTableLoader) {
this.$('div[data-id="r_tableSpinner"]').removeClass('show'); this.$('div[data-id="r_tableSpinner"]').removeClass('show');
}
if (this.includeOverlayLoader) { if (this.includeOverlayLoader) {
this.$('.t_tableOverlay').removeClass('fontLoader');
this.$('.t_tableOverlay').hide(); this.$('.t_tableOverlay').hide();
} }
}, this); }, this);
......
...@@ -45,8 +45,25 @@ define(['require', ...@@ -45,8 +45,25 @@ define(['require',
that = this; that = this;
events["click " + this.ui.tabs] = function(e) { events["click " + this.ui.tabs] = function(e) {
var urlString = "", var urlString = "",
elementName = $(e.currentTarget).data(); elementName = $(e.currentTarget).data(),
var tabStateUrls = Globals.saveApplicationState.tabState; tabStateUrls = Globals.saveApplicationState.tabState,
urlStateObj = Utils.getUrlState,
hashUrl = Utils.getUrlState.getQueryUrl().hash;
if (urlStateObj.isTagTab()) {
if (hashUrl != tabStateUrls.tagUrl) {
Globals.saveApplicationState.tabState.tagUrl = hashUrl;
}
} else if (urlStateObj.isSearchTab()) {
if (hashUrl != tabStateUrls.searchUrl) {
Globals.saveApplicationState.tabState.searchUrl = hashUrl;
}
} else if (urlStateObj.isTaxonomyTab()) {
if (hashUrl != tabStateUrls.taxonomyUrl) {
Globals.saveApplicationState.tabState.isTaxonomyTab = hashUrl;
}
}
if (elementName.name == "tab-tag") { if (elementName.name == "tab-tag") {
urlString = tabStateUrls.tagUrl; //'#!/tag'; urlString = tabStateUrls.tagUrl; //'#!/tag';
} else if (elementName.name == "tab-taxonomy") { } else if (elementName.name == "tab-taxonomy") {
...@@ -66,7 +83,7 @@ define(['require', ...@@ -66,7 +83,7 @@ define(['require',
return events; return events;
}, },
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'url', 'value', 'tag', 'selectFirst', 'classificationDefCollection', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection')); _.extend(this, _.pick(options, 'url', 'value', 'tag', 'selectFirst', 'classificationDefCollection', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection', 'searchTableColumns'));
if (Globals.taxonomy) { if (Globals.taxonomy) {
this.tabClass = "tab col-sm-4"; this.tabClass = "tab col-sm-4";
} else { } else {
...@@ -110,7 +127,8 @@ define(['require', ...@@ -110,7 +127,8 @@ define(['require',
typeHeaders: that.typeHeaders, typeHeaders: that.typeHeaders,
entityDefCollection: that.entityDefCollection, entityDefCollection: that.entityDefCollection,
enumDefCollection: that.enumDefCollection, enumDefCollection: that.enumDefCollection,
classificationDefCollection: that.classificationDefCollection classificationDefCollection: that.classificationDefCollection,
searchTableColumns: that.searchTableColumns
})); }));
}); });
}, },
......
...@@ -53,7 +53,7 @@ define(['require', ...@@ -53,7 +53,7 @@ define(['require',
var VCommonModel = new VCommon(); var VCommonModel = new VCommon();
VCommonModel.aboutUs(url, { VCommonModel.aboutUs(url, {
success: function(data) { success: function(data) {
var str = "<b>Version : </b>" + data.Version; var str = "<b>Version : </b>" + _.escape(data.Version);
that.ui.atlasVersion.html(str); that.ui.atlasVersion.html(str);
}, },
complete: function() {} complete: function() {}
......
...@@ -112,6 +112,9 @@ define(['require', ...@@ -112,6 +112,9 @@ define(['require',
this.listenTo(this.collection, 'reset', function() { this.listenTo(this.collection, 'reset', function() {
this.entityObject = this.collection.first().toJSON(); this.entityObject = this.collection.first().toJSON();
var collectionJSON = this.entityObject.entity; var collectionJSON = this.entityObject.entity;
// MergerRefEntity.
Utils.findAndMergeRefEntity(collectionJSON.attributes, this.entityObject.referredEntities);
if (collectionJSON && collectionJSON.guid) { if (collectionJSON && collectionJSON.guid) {
var tagGuid = collectionJSON.guid; var tagGuid = collectionJSON.guid;
this.readOnly = Enums.entityStateReadOnly[collectionJSON.status]; this.readOnly = Enums.entityStateReadOnly[collectionJSON.status];
...@@ -162,20 +165,29 @@ define(['require', ...@@ -162,20 +165,29 @@ define(['require',
this.ui.editButton.show(); this.ui.editButton.show();
} }
} }
if (collectionJSON.attributes && collectionJSON.attributes.columns) {
var valueSorted = _.sortBy(collectionJSON.attributes.columns, function(val) {
return val.attributes.position
});
collectionJSON.attributes.columns = valueSorted;
}
} }
this.hideLoader(); this.hideLoader();
var obj = { var obj = {
entity: collectionJSON, entity: collectionJSON,
referredEntities: this.entityObject.referredEntities,
guid: this.id, guid: this.id,
entityName: this.name, entityName: this.name,
typeHeaders: this.typeHeaders, typeHeaders: this.typeHeaders,
entityDefCollection: this.entityDefCollection, entityDefCollection: this.entityDefCollection,
fetchCollection: this.fetchCollection.bind(that), fetchCollection: this.fetchCollection.bind(that),
enumDefCollection: this.enumDefCollection, enumDefCollection: this.enumDefCollection,
classificationDefCollection: this.classificationDefCollection classificationDefCollection: this.classificationDefCollection,
attributeDefs: (function() {
return that.getEntityDef(collectionJSON);
})()
} }
this.getEntityDef(obj); this.renderEntityDetailTableLayoutView(obj);
this.renderAuditTableLayoutView(obj);
this.renderTagTableLayoutView(obj); this.renderTagTableLayoutView(obj);
this.renderTermTableLayoutView(_.extend({}, obj, { term: true })); this.renderTermTableLayoutView(_.extend({}, obj, { term: true }));
// To render Schema check attribute "schemaElementsAttribute" // To render Schema check attribute "schemaElementsAttribute"
...@@ -241,16 +253,14 @@ define(['require', ...@@ -241,16 +253,14 @@ define(['require',
fetchCollection: function() { fetchCollection: function() {
this.collection.fetch({ reset: true }); this.collection.fetch({ reset: true });
}, },
getEntityDef: function(obj) { getEntityDef: function(entityObj) {
var data = this.entityDefCollection.fullCollection.findWhere({ name: obj.entity.typeName }).toJSON(); var data = this.entityDefCollection.fullCollection.findWhere({ name: entityObj.typeName }).toJSON();
var attributeDefs = Utils.getNestedSuperTypeObj({ var attributeDefs = Utils.getNestedSuperTypeObj({
data: data, data: data,
attrMerge: true, attrMerge: true,
collection: this.entityDefCollection collection: this.entityDefCollection
}); });
obj['attributeDefs'] = attributeDefs; return attributeDefs;
this.renderEntityDetailTableLayoutView(obj);
this.renderAuditTableLayoutView(obj);
}, },
onClickTagCross: function(e) { onClickTagCross: function(e) {
var tagName = $(e.currentTarget).parent().text(), var tagName = $(e.currentTarget).parent().text(),
......
...@@ -20,9 +20,8 @@ define(['require', ...@@ -20,9 +20,8 @@ define(['require',
'backbone', 'backbone',
'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl', 'hbs!tmpl/entity/EntityDetailTableLayoutView_tmpl',
'utils/CommonViewFunction', 'utils/CommonViewFunction',
'models/VEntity', 'models/VEntity'
'utils/Utils' ], function(require, Backbone, EntityDetailTableLayoutView_tmpl, CommonViewFunction, VEntity) {
], function(require, Backbone, EntityDetailTableLayoutView_tmpl, CommonViewFunction, VEntity, Utils) {
'use strict'; 'use strict';
var EntityDetailTableLayoutView = Backbone.Marionette.LayoutView.extend( var EntityDetailTableLayoutView = Backbone.Marionette.LayoutView.extend(
...@@ -49,7 +48,7 @@ define(['require', ...@@ -49,7 +48,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'entity', 'referredEntities', 'typeHeaders', 'attributeDefs')); _.extend(this, _.pick(options, 'entity', 'typeHeaders', 'attributeDefs', 'attributes'));
this.entityModel = new VEntity({}); this.entityModel = new VEntity({});
}, },
bindEvents: function() {}, bindEvents: function() {},
...@@ -57,17 +56,8 @@ define(['require', ...@@ -57,17 +56,8 @@ define(['require',
this.entityTableGenerate(); this.entityTableGenerate();
}, },
entityTableGenerate: function() { entityTableGenerate: function() {
var that = this, var table = CommonViewFunction.propertyTable({ scope: this, valueObject: this.entity.attributes, attributeDefs: this.attributeDefs });
attributeObject = this.entity.attributes; this.ui.detailValue.append(table);
Utils.findAndMergeRefEntity(attributeObject, that.referredEntities);
if (attributeObject && attributeObject.columns) {
var valueSorted = _.sortBy(attributeObject.columns, function(val) {
return val.attributes.position
});
attributeObject.columns = valueSorted;
}
var table = CommonViewFunction.propertyTable({ scope: this, valueObject: attributeObject, attributeDefs: this.attributeDefs });
that.ui.detailValue.append(table);
} }
}); });
return EntityDetailTableLayoutView; return EntityDetailTableLayoutView;
......
...@@ -94,7 +94,7 @@ define(['require', ...@@ -94,7 +94,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 'attribute', 'referredEntities', 'fetchCollection', 'enumDefCollection')); _.extend(this, _.pick(options, 'guid', 'entityDefCollection', 'attribute', 'fetchCollection', 'enumDefCollection'));
this.schemaCollection = new VSchemaList([], {}); this.schemaCollection = new VSchemaList([], {});
this.commonTableOptions = { this.commonTableOptions = {
collection: this.schemaCollection, collection: this.schemaCollection,
...@@ -166,15 +166,11 @@ define(['require', ...@@ -166,15 +166,11 @@ define(['require',
} }
} }
_.each(this.attribute, function(obj) { _.each(this.attribute, function(obj) {
newModel = that.referredEntities[obj.guid]; if (!Enums.entityStateReadOnly[obj.status]) {
if (newModel.attributes['position']) { that.activeObj.push(obj);
newModel['position'] = newModel.attributes['position']; that.schemaCollection.push(obj);
} } else if (Enums.entityStateReadOnly[obj.status]) {
if (!Enums.entityStateReadOnly[newModel.status]) { that.deleteObj.push(obj);
that.activeObj.push(newModel);
that.schemaCollection.push(newModel);
} else if (Enums.entityStateReadOnly[newModel.status]) {
that.deleteObj.push(newModel);
} }
}); });
$('body').click(function(e) { $('body').click(function(e) {
......
...@@ -43,7 +43,7 @@ define(['require', ...@@ -43,7 +43,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection')); _.extend(this, _.pick(options, 'value', 'initialView', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'searchTableColumns'));
}, },
bindEvents: function() {}, bindEvents: function() {},
onRender: function() { onRender: function() {
...@@ -51,19 +51,9 @@ define(['require', ...@@ -51,19 +51,9 @@ define(['require',
}, },
renderSearchResultLayoutView: function() { renderSearchResultLayoutView: function() {
var that = this; var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) { require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
if (that.RSearchResultLayoutView) { if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView({ that.RSearchResultLayoutView.show(new SearchResultLayoutView(that.options));
value: that.value,
tag: that.tag,
initialView: that.initialView,
entityDefCollection: that.entityDefCollection,
typeHeaders: that.typeHeaders,
searchVent: that.searchVent,
enumDefCollection: that.enumDefCollection
}));
} }
}); });
} }
......
...@@ -81,7 +81,7 @@ define(['require', ...@@ -81,7 +81,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection')); _.extend(this, _.pick(options, 'value', 'typeHeaders', 'searchVent', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'searchTableColumns'));
this.type = "basic"; this.type = "basic";
var param = Utils.getUrlState.getQueryParams(); var param = Utils.getUrlState.getQueryParams();
this.query = { this.query = {
...@@ -94,7 +94,8 @@ define(['require', ...@@ -94,7 +94,8 @@ define(['require',
type: null, type: null,
typeFilter: null, typeFilter: null,
tagFilter: null, tagFilter: null,
tag: null tag: null,
attributes: null
} }
}; };
if (!this.value) { if (!this.value) {
...@@ -244,7 +245,8 @@ define(['require', ...@@ -244,7 +245,8 @@ define(['require',
type: null, type: null,
tag: null, tag: null,
entityFilters: null, entityFilters: null,
tagFilters: null tagFilters: null,
attributes: null
}), param); }), param);
}, },
fetchCollection: function(value) { fetchCollection: function(value) {
...@@ -389,9 +391,9 @@ define(['require', ...@@ -389,9 +391,9 @@ define(['require',
if (this.dsl) { if (this.dsl) {
params['attributes'] = null; params['attributes'] = null;
} else { } else {
var columnList = JSON.parse(Utils.localStorage.getValue('columnList')); var columnList = this.value && this.value.type && this.searchTableColumns ? this.searchTableColumns[this.value.type] : null;
if (columnList) { if (columnList) {
params['attributes'] = columnList[this.query[this.type].type]; params['attributes'] = columnList.join(',');
} else { } else {
params['attributes'] = null; params['attributes'] = null;
} }
...@@ -408,7 +410,7 @@ define(['require', ...@@ -408,7 +410,7 @@ define(['require',
}); });
}, },
dslFulltextToggle: function(e) { dslFulltextToggle: function(e) {
var paramQuery = ""; var paramObj = Utils.getUrlState.getQueryParams();
if (e.currentTarget.checked) { if (e.currentTarget.checked) {
this.type = "dsl"; this.type = "dsl";
this.dsl = true; this.dsl = true;
...@@ -422,8 +424,11 @@ define(['require', ...@@ -422,8 +424,11 @@ define(['require',
this.dsl = false; this.dsl = false;
this.type = "basic"; this.type = "basic";
} }
if (Utils.getUrlState.getQueryParams() && this.type == Utils.getUrlState.getQueryParams().searchType) { if (paramObj && this.type == paramObj.searchType) {
this.updateQueryObject(Utils.getUrlState.getQueryParams()); this.updateQueryObject(paramObj);
}
if (this.type == "basic") {
this.query[this.type].attribute = paramObj.attributes ? paramObj.attributes : null;
} }
Utils.setUrl({ Utils.setUrl({
url: '#!/search/searchResult', url: '#!/search/searchResult',
......
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