Commit 58bbee4c by kevalbhatt

ATLAS-1559 : Regression - If a new tag is created then the earlier tags doesn't render properly

parent 42de5913
...@@ -179,8 +179,18 @@ define(['require', ...@@ -179,8 +179,18 @@ define(['require',
this.$('.searchResult').find(".inputAssignTag.multiSelectTag").hide(); this.$('.searchResult').find(".inputAssignTag.multiSelectTag").hide();
} }
}); });
this.listenTo(this.searchCollection, "error", function(value, responseData) { this.listenTo(this.searchCollection, "error", function(model, response) {
this.$('.fontLoader').hide(); this.$('.fontLoader').hide();
var responseJSON = response ? response.responseJSON : response;
if (response && responseJSON && (responseJSON.errorMessage || responseJSON.message || responseJSON.error)) {
Utils.notifyError({
content: responseJSON.errorMessage || responseJSON.message || responseJSON.error
});
} else {
Utils.notifyError({
content: "Invalid Expression : " + model.queryParams.query
});
}
}, this); }, this);
}, },
onRender: function() { onRender: function() {
...@@ -217,7 +227,7 @@ define(['require', ...@@ -217,7 +227,7 @@ define(['require',
return; return;
} }
this.showLoader(); this.showLoader();
if (Globals.searchApiCallRef) { if (Globals.searchApiCallRef && Globals.searchApiCallRef.readyState === 1) {
Globals.searchApiCallRef.abort(); Globals.searchApiCallRef.abort();
} }
$.extend(this.searchCollection.queryParams, { limit: this.limit }); $.extend(this.searchCollection.queryParams, { limit: this.limit });
...@@ -233,6 +243,7 @@ define(['require', ...@@ -233,6 +243,7 @@ define(['require',
_.extend(this.searchCollection.queryParams, { 'query': value.query.trim() }); _.extend(this.searchCollection.queryParams, { 'query': value.query.trim() });
} }
Globals.searchApiCallRef = this.searchCollection.fetch({ Globals.searchApiCallRef = this.searchCollection.fetch({
skipDefaultError: true,
success: function() { success: function() {
if (that.searchCollection.models.length < that.limit) { if (that.searchCollection.models.length < that.limit) {
that.ui.nextData.attr('disabled', true); that.ui.nextData.attr('disabled', true);
......
...@@ -50,7 +50,7 @@ define(['require', ...@@ -50,7 +50,7 @@ define(['require',
/** ui events hash */ /** ui events hash */
events: function() { events: function() {
var events = {}; var events = {};
events["click " + this.ui.addTagListBtn] = 'onClickAddTagBtn'; events["click " + this.ui.addTagListBtn] = 'onClickAddTagAttributeBtn';
events["click " + this.ui.editButton] = 'onEditButton'; events["click " + this.ui.editButton] = 'onEditButton';
return events; return events;
}, },
...@@ -63,15 +63,16 @@ define(['require', ...@@ -63,15 +63,16 @@ define(['require',
}, },
bindEvents: function() { bindEvents: function() {
this.listenTo(this.collection, 'reset', function() { this.listenTo(this.collection, 'reset', function() {
this.model = this.collection.fullCollection.findWhere({ name: this.tag }); if (!this.model) {
/// this.model = this.collection.fullCollection.findWhere({ typeName: $(".dataTypeSelector").val() }); this.model = this.collection.fullCollection.findWhere({ name: this.tag });
if (this.model) { if (this.model) {
this.renderTagDetail(); this.renderTagDetail();
} else { } else {
this.$('.fontLoader').hide(); this.$('.fontLoader').hide();
Utils.notifyError({ Utils.notifyError({
content: 'Tag Not Found' content: 'Tag Not Found'
}); });
}
} }
}, this); }, this);
this.listenTo(this.tagCollection, 'error', function(error, response) { this.listenTo(this.tagCollection, 'error', function(error, response) {
...@@ -149,7 +150,7 @@ define(['require', ...@@ -149,7 +150,7 @@ define(['require',
}), }),
success: function(model, response) { success: function(model, response) {
if (model.classificationDefs) { if (model.classificationDefs) {
that.model.set(model.classificationDefs[0], { merge: true }); that.model.set(model.classificationDefs[0]);
} }
that.renderTagDetail(); that.renderTagDetail();
Utils.notifySuccess({ Utils.notifySuccess({
...@@ -159,7 +160,7 @@ define(['require', ...@@ -159,7 +160,7 @@ define(['require',
} }
}); });
}, },
onClickAddTagBtn: function(e) { onClickAddTagAttributeBtn: function(e) {
var that = this; var that = this;
require(['views/tag/AddTagAttributeView', require(['views/tag/AddTagAttributeView',
'modules/Modal' 'modules/Modal'
......
...@@ -62,7 +62,7 @@ define(['require', ...@@ -62,7 +62,7 @@ define(['require',
}, },
bindEvents: function() { bindEvents: function() {
var that = this; var that = this;
this.listenTo(this.collection, "reset", function() { this.listenTo(this.collection, "reset add", function() {
this.tagsAndTypeGenerator('collection'); this.tagsAndTypeGenerator('collection');
}, this); }, this);
this.ui.tagsParent.on('click', 'li.parent-node a', function() { this.ui.tagsParent.on('click', 'li.parent-node a', function() {
...@@ -256,7 +256,7 @@ define(['require', ...@@ -256,7 +256,7 @@ define(['require',
success: function(model, response) { success: function(model, response) {
that.ui.createTag.removeAttr("disabled"); that.ui.createTag.removeAttr("disabled");
that.createTag = true; that.createTag = true;
that.collection.reset(model.get('classificationDefs')); that.collection.add(model.get('classificationDefs'));
that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val(), true); that.setUrl('#!/tag/tagAttribute/' + ref.ui.tagName.val(), true);
Utils.notifySuccess({ Utils.notifySuccess({
content: "Tag " + that.name + Messages.addSuccessMessage content: "Tag " + that.name + Messages.addSuccessMessage
......
...@@ -9,7 +9,10 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ...@@ -9,7 +9,10 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai) ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES: ALL CHANGES:
ATLAS-1559 Regression - If a new tag is created then the earlier tags doesn't render properly (kevalbhatt)
ATLAS-1508 Make AtlasADAuthenticationProvider like Ranger ADLdap Methods (gss2002 via mneethiraj) ATLAS-1508 Make AtlasADAuthenticationProvider like Ranger ADLdap Methods (gss2002 via mneethiraj)
ATLAS-1547 Add tests for DeleteHandlerV1 (sumasai via mneethiraj)
ATLAS-1557 IDBased resolver should attempt unique-attribute match as well (mneethiraj)
ATLAS-1555 Move classification endpoint from Entities API to Entity API and remove Entities API (svimal2106) ATLAS-1555 Move classification endpoint from Entities API to Entity API and remove Entities API (svimal2106)
ATLAS-1548 Create entity : Change PUT and POST object structure based on new API Changes (kevalbhatt) ATLAS-1548 Create entity : Change PUT and POST object structure based on new API Changes (kevalbhatt)
ATLAS-1522 entity type attributes (like hive_table.sd, hive_table.columns) should use AtlasObjectId as value instead of entire entity contents (mneethiraj) ATLAS-1522 entity type attributes (like hive_table.sd, hive_table.columns) should use AtlasObjectId as value instead of entire entity contents (mneethiraj)
......
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