Commit 38fd4f35 by Keval Bhatt

ATLAS-1091 : Improvement in DSL search functionality.(kevalbhatt)

parent 81ceabbd
......@@ -25,6 +25,7 @@ $action_gray:#999999;
$color_keppel_approx: #37bb9b;
$color_gallery_approx: #eee;
$gray: #808080;
$dark_gray:#666;
$color_tuna_approx: #323544;
$color_celeste_approx: #ccc;
$color_cornflower_blue_approx: #66afe9;
......@@ -38,7 +39,7 @@ $color_ironside_gray_approx: #686868;
$color_mercury_approx: #e6e6e6;
$color_whisper_approx: #f6f7fa;
$color_bombay_approx: #b5b9bc;
$red: red;
$red: #f00;
//theme color
//colors
$color_white_lilac_approx: #f6f7fb;
......@@ -100,7 +101,6 @@ $black_80: rgba(0, 0, 0, 0.8);
$color_bright_turquoise_approx: #00ffd0;
$color_mountain_mist_approx: #999;
$color_suva_gray_approx: #868686;
// $tag_color:#9599a0;
$tag_color:#4A90E2;
$delete_link:#BB5838;
//urls
......
......@@ -132,10 +132,49 @@
}
}
.select2-container .select2-selection--single {
height: 34px;
.select2-selection__rendered {
padding-left: 12px;
.select2-container {
.select2-selection--single,
.select2-selection--multiple {
min-height: 34px;
.select2-selection__rendered {
padding-left: 12px;
}
}
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: $white;
color: $color_mountain_mist_approx;
border: 1px solid $tag_color;
}
.select2-container--default .select2-search--inline .select2-search__field {
color: #555;
}
.typeLOV {
.select2-container--default {
.select2-selection--multiple {
.select2-selection__rendered {
padding-right: 13px;
.select2-selection__choice {
font-size: 14px;
color: $color_mountain_mist_approx;
border: 1px solid $color_mountain_mist_approx;
}
.select2-search__field {
font-size: 14px;
}
}
.select2-selection__clear {
position: absolute;
float: none;
margin: 0px;
right: 4px;
top: 5px;
color: $color_mountain_mist_approx;
}
}
}
}
......@@ -182,3 +221,16 @@
.backgrid-paginator ul > .disabled > a:hover {
cursor: pointer;
}
.popover-content {
ul {
color: $dark_gray;
padding: 0px 5px;
margin-bottom: 0px;
cursor: pointer;
a {
color: $dark_gray;
padding: 5px;
}
}
}
......@@ -105,16 +105,6 @@
margin: 15px 0px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #fff;
color: #9599a0;
border: 1px solid $tag_color;
}
.select2-container--default .select2-search--inline .select2-search__field {
color: #555;
}
.inputTag {
display: inline-block;
border: 1px $tag_color solid;
......@@ -325,6 +315,14 @@ form-control .tagInpput {
float: right;
}
.multiSelectTag {
float: right;
}
.inputAssignTag.multiSelectTag {
margin-right: 10px;
}
.popover.popoverTag {
display: block;
}
......
......@@ -104,36 +104,12 @@
}
}
.termPopoverList {
color: #666;
padding: 0px 5px;
margin-bottom: 0px;
a {
color: #666;
padding: 5px;
}
}
.termPopover {
cursor: pointer;
}
.termMoveDiv {
width: 550px;
height: 200px;
margin: 10px;
}
.tagPopoverList {
color: #666;
padding: 0px 5px;
margin-bottom: 0px;
a {
color: #666;
padding: 5px;
}
}
.toggleArrow {
position: absolute;
left: 0px;
......@@ -141,12 +117,12 @@
cursor: pointer;
}
.addTermDiable {
border-color: #FF0000 !important;
.addTermDisable {
border-color: $red !important;
}
.alertTerm {
color: #FF0000 !important;
color: $red !important;
}
......
......@@ -33,7 +33,23 @@ define(['require',
this.modelName = 'VSearch';
this.modelAttrName = 'results';
this.bindErrorEvents();
}
},
parseRecords: function(resp, options) {
this.responseData = {
dataType: resp.dataType,
query: resp.query,
queryType: resp.queryType,
requestId: resp.requestId
};
try {
if (!this.modelAttrName) {
throw new Error("this.modelAttrName not defined for " + this);
}
return _.reject(resp[this.modelAttrName], _.isNull);
} catch (e) {
console.log(e);
}
},
},
//Static Class Members
{
......
......@@ -20,7 +20,7 @@
<button class="btn btn-atlasAction btn-atlas pull-right" onclick="this.blur();" title="Refresh" data-id="refreshTaxanomy"><i class="fa fa-refresh"></i></button>
</div>
<div>
<select type="text" class="form-control" data-id="searchTermInput" placeholder="Search term"></select>
<select type="text" class="form-control" data-id="searchTermInput"></select>
</div>
<div class="">
<ul class="taxonomyTree">
......
......@@ -29,18 +29,12 @@
</div>
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" data-id="searchInput" placeholder="Search using a query string: e.g. sales_fact">
</div>
<!-- <div data-id="advanceSearchContainer">
<div class="form-group">
<select type="text" class="col-md-12 form-control tagListSelect" data-id="tagListInput" multiple></select>
</div>
<div class="form-group">
<select type="text" class="col-md-12 form-control" data-id="termListInput" multiple></select>
<div class="typeLOV">
<select data-id="typeLOV"></select>
</div>
</div> -->
<input type="text" class="form-control" data-id="searchInput" placeholder="Search using a query string: e.g. sales_fact" style="margin-top: 5px;">
</div>
<div class="clearAdvanceSearch" data-id="clearSearch">Clear</div>
<button class="btn btn-atlas advanceSearchBtn" data-id="searchBtn">Search</button>
<button class="btn btn-atlas advanceSearchBtn" data-id="searchBtn" disabled="disabled">Search</button>
</div>
</div>
<div id="searchResult"></div>
<div id="searchResult"></div>
......@@ -315,11 +315,13 @@ define(['require',
termSearchData: function() {
var that = this;
var str = '<option></option>';
for (var j = 0; j < this.termCollection.models.length; j++) {
var terms = this.termCollection.models[j].attributes.name;
str += '<option>' + terms + '</option>';
this.ui.searchTermInput.html(str);
this.termCollection.fullCollection.comparator = function(model) {
return model.get('name');
}
this.termCollection.fullCollection.sort().each(function(model) {
str += '<option>' + model.get('name') + '</option>';
});
this.ui.searchTermInput.html(str);
// this.ui.searchTermInput.setAttribute('data-href' : that.termCollection.url);
this.ui.searchTermInput.select2({
placeholder: "Search Term",
......@@ -480,11 +482,11 @@ define(['require',
view.ui.termName.on('keyup', function() {
if (this.value.indexOf(' ') >= 0) {
modal.$el.find('button.ok').prop('disabled', true);
view.ui.termName.addClass("addTermDiable");
view.ui.termName.addClass("addTermDisable");
view.$('.alertTerm').show();
} else {
modal.$el.find('button.ok').prop('disabled', false);
view.ui.termName.removeClass("addTermDiable");
view.ui.termName.removeClass("addTermDisable");
view.$('.alertTerm').hide();
}
});
......@@ -626,11 +628,11 @@ define(['require',
view.ui.termName.on('keyup', function() {
if (this.value.indexOf(' ') >= 0) {
modal.$el.find('button.ok').prop('disabled', true);
view.ui.termName.addClass("addTermDiable");
view.ui.termName.addClass("addTermDisable");
view.$('.alertTerm').show();
} else {
modal.$el.find('button.ok').prop('disabled', false);
view.ui.termName.removeClass("addTermDiable");
view.ui.termName.removeClass("addTermDisable");
view.$('.alertTerm').hide();
}
});
......
......@@ -195,9 +195,12 @@ define(['require',
},
fetchCollection: function(value) {
var that = this;
if (value && (value.query === undefined || value.query === "")) {
return;
}
this.$('.fontLoader').show();
this.$('.searchTable').hide();
that.$('.searchResult').hide();
this.$('.searchResult').hide();
if (Globals.searchApiCallRef) {
Globals.searchApiCallRef.abort();
}
......@@ -208,7 +211,10 @@ define(['require',
$.extend(this.searchCollection.queryParams, { limit: this.limit });
this.offset = 0;
}
_.extend(this.searchCollection.queryParams, { 'query': value.query });
if (Utils.getUrlState.isTagTab()) {
this.searchCollection.url = "/api/atlas/discovery/search/dsl";
}
_.extend(this.searchCollection.queryParams, { 'query': value.query.trim() });
}
Globals.searchApiCallRef = this.searchCollection.fetch({
success: function() {
......@@ -239,7 +245,7 @@ define(['require',
that.checkTableFetch();
that.offset = that.offset - that.limit;
if (that.firstFetch) {
that.renderTableLayoutView();
that.startRenderTableProcess();
}
}
if (that.firstFetch) {
......@@ -250,7 +256,7 @@ define(['require',
}
// checking length for not rendering the table
if (that.searchCollection.models.length) {
that.renderTableLayoutView();
that.startRenderTableProcess();
}
var resultData = 'Results for <b>' + that.searchCollection.queryParams.query + '</b>'
var multiAssignData = '<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"></i>' + " " + 'Assign Term</a>'
......@@ -259,11 +265,14 @@ define(['require',
silent: true
});
},
renderTableLayoutView: function() {
startRenderTableProcess: function() {
this.getEntityTableColumns();
},
renderTableLayoutView: function(col) {
var that = this,
count = 5;
require(['utils/TableLayout'], function(TableLayout) {
var columns = new Backgrid.Columns(that.getEntityTableColumns());
var columns = new Backgrid.Columns(col);
that.REntityTableLayoutView.show(new TableLayout(_.extend({}, that.commonTableOptions, {
globalVent: that.globalVent,
columns: columns
......@@ -295,9 +304,10 @@ define(['require',
var responseData = this.searchCollection.responseData;
if (this.searchCollection.responseData) {
if (responseData.dataType && responseData.dataType.typeName.indexOf('_temp') == -1) {
return this.getFixedDslColumn();
that.renderTableLayoutView(that.getFixedDslColumn())
} else {
var idFound = false;
var idFound = false,
fetchResultCount = 0;
_.each(this.searchCollection.models, function(model) {
var modelJSON = model.toJSON();
var guid = "";
......@@ -320,26 +330,36 @@ define(['require',
});
if (guid.length) {
idFound = true;
++fetchResultCount;
model.getEntity(guid, {
async: false,
success: function(data) {
if (data.definition) {
if (data.definition.id && data.definition.values) {
that.searchCollection.get(data.definition.id).set(data.definition.values);
that.searchCollection.get(data.definition.id).set('$id$', data.definition.id);
that.searchCollection.get(data.definition.id).set('$traits$', data.definition.traits);
var id = "";
if (_.isObject(data.definition.id) && data.definition.id.id) {
id = data.definition.id.id;
} else {
id = data.definition.id;
}
that.searchCollection.get(id).set(data.definition.values);
that.searchCollection.get(id).set('$id$', data.definition.id);
that.searchCollection.get(id).set('$traits$', data.definition.traits);
}
}
},
error: function(error, data, status) {},
complete: function() {}
complete: function() {
--fetchResultCount;
if (fetchResultCount === 0) {
that.renderTableLayoutView(that.getFixedDslColumn())
}
}
});
}
});
if (idFound) {
return this.getFixedDslColumn();
} else {
return this.getDaynamicColumn();
if (idFound === false) {
that.renderTableLayoutView(this.getDaynamicColumn())
}
}
}
......@@ -371,11 +391,16 @@ define(['require',
var that = this,
nameCheck = 0,
col = {};
this.searchCollection.each(function(model) {
if (model.get('name') || model.get('qualifiedName')) {
for (var i = 0; i < this.searchCollection.models.length; i++) {
var model = this.searchCollection.models[i];
if (model && (model.get('name') || model.get('qualifiedName'))) {
++nameCheck
}
});
if (model && model.get('$id$') === undefined) {
i = i - 1;
that.searchCollection.remove(model);
}
}
if (Globals.taxonomy) {
col['Check'] = {
name: "selected",
......@@ -542,7 +567,7 @@ define(['require',
var view = new AddTermToEntityLayoutView({
guid: guid,
multiple: multiple,
callback: function(termName) {
callback: function() {
that.fetchCollection();
that.arr = [];
},
......
......@@ -77,7 +77,7 @@ define(['require',
var str = '',
that = this;
this.ui.parentTag.empty();
this.tagCollection.each(function(val) {
this.tagCollection.fullCollection.each(function(val) {
str += '<option>' + val.get("tags") + '</option>';
});
that.ui.parentTag.html(str);
......
......@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES:
ATLAS-1091 Improvement in DSL search functionality. (kevalbhatt)
ATLAS-1080 Regression - UI - hive_storagedesc is shown as "undefined" in UI.(kevalbhatt)
ATLAS-1089 Storm hook should handle cyclic references in topology object (mneethiraj via sumasai)
ATLAS-1086 Build failure in hive-bridge after security fixes in ATLAS-762 (sumasai)
......
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