Commit 0c3d2ed3 by kevalbhatt Committed by nixonrodrigues

ATLAS-3870:- UI: hive_table entity table not updating queryparams based on filter selected

parent 337575c8
...@@ -775,7 +775,7 @@ define(['require', ...@@ -775,7 +775,7 @@ define(['require',
success: function(model, response) { success: function(model, response) {
that.modal.$el.find('button.ok').hideButtonLoader(); that.modal.$el.find('button.ok').hideButtonLoader();
that.modal.close(); that.modal.close();
var msgType = that.guid ? 'editSuccessMessage' : 'addSuccessMessage'; var msgType = (model.mutatedEntities && model.mutatedEntities.UPDATE) ? 'editSuccessMessage' : 'addSuccessMessage';
Utils.notifySuccess({ Utils.notifySuccess({
content: "Entity " + Messages.getAbbreviationMsg(false, msgType) content: "Entity " + Messages.getAbbreviationMsg(false, msgType)
}); });
......
...@@ -115,7 +115,7 @@ define(['require', ...@@ -115,7 +115,7 @@ define(['require',
if (!that.model.has("__internal_UI_businessMetadataName")) { if (!that.model.has("__internal_UI_businessMetadataName")) {
updateObj["__internal_UI_businessMetadataName"] = businessMetadata; updateObj["__internal_UI_businessMetadataName"] = businessMetadata;
} }
if (typeName.indexOf("date") > -1) { if (typeName === "date" || typeName === "array<date>") {
if (multi && updateObj[key].value) { if (multi && updateObj[key].value) {
var dateValues = updateObj[key].value.split(','), var dateValues = updateObj[key].value.split(','),
dateStr = []; dateStr = [];
...@@ -133,7 +133,7 @@ define(['require', ...@@ -133,7 +133,7 @@ define(['require',
}); });
this.$el.on('keypress', '.select2_only_number .select2-search__field', function() { this.$el.on('keypress', '.select2_only_number .select2-search__field', function() {
var typename = $(this).parents(".select2_only_number").find("select[data-typename]").data("typename") var typename = $(this).parents(".select2_only_number").find("select[data-typename]").data("typename")
if (typename.indexOf("float") > -1 && event.which == 46) { if ((typename === "float" || typename === "array<float>") && event.which == 46) {
return; return;
} }
if ((event.which < 48 || event.which > 57)) { if ((event.which < 48 || event.which > 57)) {
...@@ -159,10 +159,10 @@ define(['require', ...@@ -159,10 +159,10 @@ define(['require',
if (!isMultiValued && !_.isEmpty(val)) { if (!isMultiValued && !_.isEmpty(val)) {
val = _.escape(val); val = _.escape(val);
} }
if (!_.isUndefinedNull(val) && typeName.indexOf("boolean") > -1) { if (!_.isUndefinedNull(val) && (typeName === "boolean" || typeName === "array<boolean>")) {
val = String(val); val = String(val);
} }
if (typeName.indexOf("date") > -1) { if (typeName === "date" || typeName === "array<date>") {
if (isMultiValued && val && val.length) { if (isMultiValued && val && val.length) {
var dateStr = []; var dateStr = [];
_.each(val, function(selectedDate) { _.each(val, function(selectedDate) {
...@@ -175,11 +175,11 @@ define(['require', ...@@ -175,11 +175,11 @@ define(['require',
val = moment(val).format(Globals.dateFormat); val = moment(val).format(Globals.dateFormat);
} }
} }
if (typeName.indexOf("string") > -1) { if (typeName === "string" || typeName === "array<string>") {
returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>'; returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName.indexOf("boolean") > -1) { } else if (typeName === "boolean" || typeName === "array<boolean>") {
returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>'; returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>';
} else if (typeName.indexOf("date") > -1) { } else if (typeName === "date" || typeName === "array<date>") {
returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : ""); returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : "");
setTimeout(function() { setTimeout(function() {
var dateObj = { singleDatePicker: true, showDropdowns: true, autoUpdateInput: isMultiValued ? false : true }, var dateObj = { singleDatePicker: true, showDropdowns: true, autoUpdateInput: isMultiValued ? false : true },
...@@ -195,7 +195,7 @@ define(['require', ...@@ -195,7 +195,7 @@ define(['require',
}); });
} }
}, 0); }, 0);
} else if (typeName.indexOf("byte") > -1 || typeName.indexOf("short") > -1 || typeName.indexOf("int") > -1 || typeName.indexOf("float") > -1 || typeName.indexOf("double") > -1 || typeName.indexOf("long") > -1) { } else if (typeName === "byte" || typeName === "array<byte>" || typeName === "short" || typeName === "array<short>" || typeName === "int" || typeName === "array<int>" || typeName === "float" || typeName === "array<float>" || typeName === "double" || typeName === "array<double>" || typeName === "long" || typeName === "array<long>") {
allowOnlyNum = true; allowOnlyNum = true;
returnEL = '<' + elType + ' data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>'; returnEL = '<' + elType + ' data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName) { } else if (typeName) {
......
...@@ -80,11 +80,11 @@ define(['require', ...@@ -80,11 +80,11 @@ define(['require',
var value = _.extend({}, that.value, { var value = _.extend({}, that.value, {
'guid': that.guid, 'guid': that.guid,
'searchType': 'relationship', 'searchType': 'relationship',
'profileDBView': true,
'typeName': that.typeName 'typeName': that.typeName
}); });
that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({ that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({
'value': value, 'value': value,
'profileDBView': true,
'typeHeaders': that.typeHeaders, 'typeHeaders': that.typeHeaders,
'entityDefCollection': that.entityDefCollection, 'entityDefCollection': that.entityDefCollection,
'enumDefCollection': that.enumDefCollection, 'enumDefCollection': that.enumDefCollection,
......
...@@ -147,7 +147,7 @@ define(['require', ...@@ -147,7 +147,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName', 'businessMetadataDefCollection')); _.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName', 'businessMetadataDefCollection', 'profileDBView'));
this.entityModel = new VEntity(); this.entityModel = new VEntity();
this.searchCollection = new VSearchList(); this.searchCollection = new VSearchList();
this.limit = 25; this.limit = 25;
...@@ -250,7 +250,7 @@ define(['require', ...@@ -250,7 +250,7 @@ define(['require',
collection: this.searchCollection, collection: this.searchCollection,
includePagination: false, includePagination: false,
includeFooterRecords: false, includeFooterRecords: false,
includeColumnManager: (Utils.getUrlState.isSearchTab() && this.value && this.value.searchType === "basic" && !this.value.profileDBView ? true : false), includeColumnManager: (Utils.getUrlState.isSearchTab() && this.value && this.value.searchType === "basic" && !this.profileDBView ? true : false),
includeOrderAbleColumns: false, includeOrderAbleColumns: false,
includeSizeAbleColumns: false, includeSizeAbleColumns: false,
includeTableLoader: false, includeTableLoader: false,
...@@ -486,7 +486,8 @@ define(['require', ...@@ -486,7 +486,8 @@ define(['require',
if (dataLength > 0) { if (dataLength > 0) {
that.$('.searchTable').removeClass('noData') that.$('.searchTable').removeClass('noData')
} }
if (Utils.getUrlState.isSearchTab() && value && !value.profileDBView) {
if (Utils.getUrlState.isSearchTab() && value && !that.profileDBView) {
var searchString = 'Results for: <span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value) + "</span>"; var searchString = 'Results for: <span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value) + "</span>";
if (Globals.entityCreate && Globals.entityTypeConfList && Utils.getUrlState.isSearchTab()) { if (Globals.entityCreate && Globals.entityTypeConfList && Utils.getUrlState.isSearchTab()) {
searchString += "<p>If you do not find the entity in search result below then you can" + '<a href="javascript:void(0)" data-id="createEntity"> create new entity</a></p>'; searchString += "<p>If you do not find the entity in search result below then you can" + '<a href="javascript:void(0)" data-id="createEntity"> create new entity</a></p>';
...@@ -510,7 +511,7 @@ define(['require', ...@@ -510,7 +511,7 @@ define(['require',
this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType); this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType);
} }
_.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': value.term || null }); _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': value.term || null });
if (value.profileDBView && value.typeName && value.guid) { if (this.profileDBView && value.typeName && value.guid) {
var profileParam = {}; var profileParam = {};
profileParam['guid'] = value.guid; profileParam['guid'] = value.guid;
profileParam['relation'] = value.typeName === 'hive_db' ? '__hive_table.db' : '__hbase_table.namespace'; profileParam['relation'] = value.typeName === 'hive_db' ? '__hive_table.db' : '__hbase_table.namespace';
...@@ -520,12 +521,12 @@ define(['require', ...@@ -520,12 +521,12 @@ define(['require',
} }
if (isPostMethod) { if (isPostMethod) {
this.searchCollection.filterObj = _.extend({}, filterObj); this.searchCollection.filterObj = _.extend({}, filterObj);
apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName')) apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName'));
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj); Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
} else { } else {
apiObj.data = null; apiObj.data = null;
this.searchCollection.filterObj = null; this.searchCollection.filterObj = null;
if (this.value.profileDBView) { if (this.profileDBView) {
_.extend(this.searchCollection.queryParams, checkBoxValue); _.extend(this.searchCollection.queryParams, checkBoxValue);
} }
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj); Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
...@@ -537,7 +538,7 @@ define(['require', ...@@ -537,7 +538,7 @@ define(['require',
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj); Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
} else { } else {
apiObj.data = null; apiObj.data = null;
if (this.value.profileDBView) { if (this.profileDBView) {
_.extend(this.searchCollection.queryParams, checkBoxValue); _.extend(this.searchCollection.queryParams, checkBoxValue);
} }
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj); Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
...@@ -655,7 +656,7 @@ define(['require', ...@@ -655,7 +656,7 @@ define(['require',
col['name'] = { col['name'] = {
label: this.value && this.value.profileDBView ? "Table Name" : "Name", label: this.value && this.profileDBView ? "Table Name" : "Name",
cell: "html", cell: "html",
editable: false, editable: false,
resizeable: true, resizeable: true,
...@@ -734,7 +735,7 @@ define(['require', ...@@ -734,7 +735,7 @@ define(['require',
} }
}) })
}; };
if (this.value && this.value.profileDBView) { if (this.value && this.profileDBView) {
col['createTime'] = { col['createTime'] = {
label: "Date Created", label: "Date Created",
cell: "Html", cell: "Html",
...@@ -751,7 +752,7 @@ define(['require', ...@@ -751,7 +752,7 @@ define(['require',
}) })
} }
} }
if (this.value && !this.value.profileDBView) { if (this.value && !this.profileDBView) {
col['description'] = { col['description'] = {
label: "Description", label: "Description",
cell: "String", cell: "String",
......
...@@ -778,7 +778,7 @@ define(['require', ...@@ -778,7 +778,7 @@ define(['require',
success: function(model, response) { success: function(model, response) {
that.modal.$el.find('button.ok').hideButtonLoader(); that.modal.$el.find('button.ok').hideButtonLoader();
that.modal.close(); that.modal.close();
var msgType = that.guid ? "editSuccessMessage" : "addSuccessMessage"; var msgType = (model.mutatedEntities && model.mutatedEntities.UPDATE) ? "editSuccessMessage" : "addSuccessMessage";
Utils.notifySuccess({ Utils.notifySuccess({
content: "Entity" + Messages.getAbbreviationMsg(false, msgType) content: "Entity" + Messages.getAbbreviationMsg(false, msgType)
}); });
......
...@@ -115,7 +115,7 @@ define(['require', ...@@ -115,7 +115,7 @@ define(['require',
if (!that.model.has("__internal_UI_businessMetadataName")) { if (!that.model.has("__internal_UI_businessMetadataName")) {
updateObj["__internal_UI_businessMetadataName"] = businessMetadata; updateObj["__internal_UI_businessMetadataName"] = businessMetadata;
} }
if (typeName.indexOf("date") > -1) { if (typeName === "date" || typeName === "array<date>") {
if (multi && updateObj[key].value) { if (multi && updateObj[key].value) {
var dateValues = updateObj[key].value.split(','), var dateValues = updateObj[key].value.split(','),
dateStr = []; dateStr = [];
...@@ -133,7 +133,7 @@ define(['require', ...@@ -133,7 +133,7 @@ define(['require',
}); });
this.$el.on('keypress', '.select2_only_number .select2-search__field', function() { this.$el.on('keypress', '.select2_only_number .select2-search__field', function() {
var typename = $(this).parents(".select2_only_number").find("select[data-typename]").data("typename") var typename = $(this).parents(".select2_only_number").find("select[data-typename]").data("typename")
if (typename.indexOf("float") > -1 && event.which == 46) { if ((typename === "float" || typename === "array<float>") && event.which == 46) {
return; return;
} }
if ((event.which < 48 || event.which > 57)) { if ((event.which < 48 || event.which > 57)) {
...@@ -159,10 +159,10 @@ define(['require', ...@@ -159,10 +159,10 @@ define(['require',
if (!isMultiValued && !_.isEmpty(val)) { if (!isMultiValued && !_.isEmpty(val)) {
val = _.escape(val); val = _.escape(val);
} }
if (!_.isUndefinedNull(val) && typeName.indexOf("boolean") > -1) { if (!_.isUndefinedNull(val) && (typeName === "boolean" || typeName === "array<boolean>")) {
val = String(val); val = String(val);
} }
if (typeName.indexOf("date") > -1) { if (typeName === "date" || typeName === "array<date>") {
if (isMultiValued && val && val.length) { if (isMultiValued && val && val.length) {
var dateStr = []; var dateStr = [];
_.each(val, function(selectedDate) { _.each(val, function(selectedDate) {
...@@ -175,11 +175,11 @@ define(['require', ...@@ -175,11 +175,11 @@ define(['require',
val = moment(val).format(Globals.dateFormat); val = moment(val).format(Globals.dateFormat);
} }
} }
if (typeName.indexOf("string") > -1) { if (typeName === "string" || typeName === "array<string>") {
returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>'; returnEL = '<' + elType + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter String" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName.indexOf("boolean") > -1) { } else if (typeName === "boolean" || typeName === "array<boolean>") {
returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>'; returnEL = '<select data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" data-multi="' + isMultiValued + '" class="form-control">' + (isMultiValued ? "" : '<option value="">--Select Value--</option>') + '<option value="true" ' + (!_.isUndefinedNull(val) && val == "true" ? "selected" : "") + '>true</option><option value="false" ' + (!_.isUndefinedNull(val) && val == "false" ? "selected" : "") + '>false</option></select>';
} else if (typeName.indexOf("date") > -1) { } else if (typeName === "date" || typeName === "array<date>") {
returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : ""); returnEL = '<' + (isMultiValued ? "textarea" : "input") + ' type="text" data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '"data-multi="' + isMultiValued + '" data-type="date" class="form-control" ' + (isMultiValued === false && !_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '>' + (isMultiValued === true && !_.isUndefinedNull(val) ? val : "") + (isMultiValued ? "</textarea>" : "");
setTimeout(function() { setTimeout(function() {
var dateObj = { singleDatePicker: true, showDropdowns: true, autoUpdateInput: isMultiValued ? false : true }, var dateObj = { singleDatePicker: true, showDropdowns: true, autoUpdateInput: isMultiValued ? false : true },
...@@ -195,7 +195,7 @@ define(['require', ...@@ -195,7 +195,7 @@ define(['require',
}); });
} }
}, 0); }, 0);
} else if (typeName.indexOf("byte") > -1 || typeName.indexOf("short") > -1 || typeName.indexOf("int") > -1 || typeName.indexOf("float") > -1 || typeName.indexOf("double") > -1 || typeName.indexOf("long") > -1) { } else if (typeName === "byte" || typeName === "array<byte>" || typeName === "short" || typeName === "array<short>" || typeName === "int" || typeName === "array<int>" || typeName === "float" || typeName === "array<float>" || typeName === "double" || typeName === "array<double>" || typeName === "long" || typeName === "array<long>") {
allowOnlyNum = true; allowOnlyNum = true;
returnEL = '<' + elType + ' data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>'; returnEL = '<' + elType + ' data-key="' + key + '" data-businessMetadata="' + businessMetadata + '" data-typename="' + typeName + '" type="number" data-multi="' + isMultiValued + '" data-tags="true" placeholder="Enter Number" class="form-control" ' + (!_.isUndefinedNull(val) ? 'value="' + val + '"' : "") + '></' + elType + '>';
} else if (typeName) { } else if (typeName) {
......
...@@ -80,11 +80,11 @@ define(['require', ...@@ -80,11 +80,11 @@ define(['require',
var value = _.extend({}, that.value, { var value = _.extend({}, that.value, {
'guid': that.guid, 'guid': that.guid,
'searchType': 'relationship', 'searchType': 'relationship',
'profileDBView': true,
'typeName': that.typeName 'typeName': that.typeName
}); });
that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({ that.RProfileTableOrColumnLayoutView.show(new SearchResultLayoutView({
'value': value, 'value': value,
'profileDBView': true,
'typeHeaders': that.typeHeaders, 'typeHeaders': that.typeHeaders,
'entityDefCollection': that.entityDefCollection, 'entityDefCollection': that.entityDefCollection,
'enumDefCollection': that.enumDefCollection, 'enumDefCollection': that.enumDefCollection,
......
...@@ -153,7 +153,7 @@ define(['require', ...@@ -153,7 +153,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName', 'businessMetadataDefCollection')); _.extend(this, _.pick(options, 'value', 'guid', 'initialView', 'isTypeTagNotExists', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'searchVent', 'enumDefCollection', 'tagCollection', 'searchTableColumns', 'isTableDropDisable', 'fromView', 'glossaryCollection', 'termName', 'businessMetadataDefCollection', 'profileDBView'));
this.entityModel = new VEntity(); this.entityModel = new VEntity();
this.searchCollection = new VSearchList(); this.searchCollection = new VSearchList();
this.limit = 25; this.limit = 25;
...@@ -259,7 +259,7 @@ define(['require', ...@@ -259,7 +259,7 @@ define(['require',
collection: this.searchCollection, collection: this.searchCollection,
includePagination: false, includePagination: false,
includeFooterRecords: false, includeFooterRecords: false,
includeColumnManager: (Utils.getUrlState.isSearchTab() && this.value && this.value.searchType === "basic" && !this.value.profileDBView ? true : false), includeColumnManager: (Utils.getUrlState.isSearchTab() && this.value && this.value.searchType === "basic" && !this.profileDBView ? true : false),
includeOrderAbleColumns: false, includeOrderAbleColumns: false,
includeSizeAbleColumns: false, includeSizeAbleColumns: false,
includeTableLoader: false, includeTableLoader: false,
...@@ -496,7 +496,7 @@ define(['require', ...@@ -496,7 +496,7 @@ define(['require',
that.$('.searchTable').removeClass('noData') that.$('.searchTable').removeClass('noData')
} }
if (Utils.getUrlState.isSearchTab() && value && !value.profileDBView) { if (Utils.getUrlState.isSearchTab() && value && !that.profileDBView) {
// var searchString = 'Results for: <span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value, true) + "</span>"; // var searchString = 'Results for: <span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value, true) + "</span>";
var isCapsuleView = true; var isCapsuleView = true;
var searchString = '<span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value, isCapsuleView) + "</span>"; var searchString = '<span class="filterQuery">' + CommonViewFunction.generateQueryOfFilter(that.value, isCapsuleView) + "</span>";
...@@ -522,7 +522,7 @@ define(['require', ...@@ -522,7 +522,7 @@ define(['require',
this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType); this.searchCollection.url = UrlLinks.searchApiUrl(value.searchType);
} }
_.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': value.term || null }); _.extend(this.searchCollection.queryParams, { 'limit': this.limit, 'offset': this.offset, 'query': _.trim(value.query), 'typeName': value.type || null, 'classification': value.tag || null, 'termName': value.term || null });
if (value.profileDBView && value.typeName && value.guid) { if (this.profileDBView && value.typeName && value.guid) {
var profileParam = {}; var profileParam = {};
profileParam['guid'] = value.guid; profileParam['guid'] = value.guid;
profileParam['relation'] = value.typeName === 'hive_db' ? '__hive_table.db' : '__hbase_table.namespace'; profileParam['relation'] = value.typeName === 'hive_db' ? '__hive_table.db' : '__hbase_table.namespace';
...@@ -532,12 +532,12 @@ define(['require', ...@@ -532,12 +532,12 @@ define(['require',
} }
if (isPostMethod) { if (isPostMethod) {
this.searchCollection.filterObj = _.extend({}, filterObj); this.searchCollection.filterObj = _.extend({}, filterObj);
apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName')) apiObj['data'] = _.extend(checkBoxValue, filterObj, _.pick(this.searchCollection.queryParams, 'query', 'excludeDeletedEntities', 'limit', 'offset', 'typeName', 'classification', 'termName'));
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj); Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
} else { } else {
apiObj.data = null; apiObj.data = null;
this.searchCollection.filterObj = null; this.searchCollection.filterObj = null;
if (this.value.profileDBView) { if (this.profileDBView) {
_.extend(this.searchCollection.queryParams, checkBoxValue); _.extend(this.searchCollection.queryParams, checkBoxValue);
} }
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj); Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
...@@ -549,7 +549,7 @@ define(['require', ...@@ -549,7 +549,7 @@ define(['require',
Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj); Globals.searchApiCallRef = this.searchCollection.getBasicRearchResult(apiObj);
} else { } else {
apiObj.data = null; apiObj.data = null;
if (this.value.profileDBView) { if (this.profileDBView) {
_.extend(this.searchCollection.queryParams, checkBoxValue); _.extend(this.searchCollection.queryParams, checkBoxValue);
} }
Globals.searchApiCallRef = this.searchCollection.fetch(apiObj); Globals.searchApiCallRef = this.searchCollection.fetch(apiObj);
...@@ -668,7 +668,7 @@ define(['require', ...@@ -668,7 +668,7 @@ define(['require',
col['name'] = { col['name'] = {
label: this.value && this.value.profileDBView ? "Table Name" : "Name", label: this.value && this.profileDBView ? "Table Name" : "Name",
cell: "html", cell: "html",
editable: false, editable: false,
resizeable: true, resizeable: true,
...@@ -747,7 +747,7 @@ define(['require', ...@@ -747,7 +747,7 @@ define(['require',
} }
}) })
}; };
if (this.value && this.value.profileDBView) { if (this.value && this.profileDBView) {
col['createTime'] = { col['createTime'] = {
label: "Date Created", label: "Date Created",
cell: "Html", cell: "Html",
...@@ -764,7 +764,7 @@ define(['require', ...@@ -764,7 +764,7 @@ define(['require',
}) })
} }
} }
if (this.value && !this.value.profileDBView) { if (this.value && !this.profileDBView) {
col['description'] = { col['description'] = {
label: "Description", label: "Description",
cell: "String", cell: "String",
......
...@@ -105,6 +105,7 @@ define([ ...@@ -105,6 +105,7 @@ define([
that.metricCollection.fetch({ that.metricCollection.fetch({
complete: function() { complete: function() {
that.entityCountObj = _.first(that.metricCollection.toJSON()); that.entityCountObj = _.first(that.metricCollection.toJSON());
that.fromManualRender = true;
that.ui.entitySearchTree.jstree(true).refresh(); that.ui.entitySearchTree.jstree(true).refresh();
that.changeLoaderState(false); that.changeLoaderState(false);
} }
......
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