Commit d604085e by kevalbhatt

ATLAS-3882:- Classic UI: Loader not disappearing while assigning category to term

(cherry picked from commit a43b49c33f93ef2819b747caed7a9baae91d09a4)
parent 5f956110
...@@ -354,6 +354,9 @@ define(['require', ...@@ -354,6 +354,9 @@ define(['require',
}, },
fetchCollection: function() { fetchCollection: function() {
this.collection.fetch({ reset: true }); this.collection.fetch({ reset: true });
if (this.searchVent) {
this.searchVent.trigger('entityList:refresh');
}
}, },
getEntityDef: function(entityObj) { getEntityDef: function(entityObj) {
if (this.activeEntityDef) { if (this.activeEntityDef) {
...@@ -382,9 +385,6 @@ define(['require', ...@@ -382,9 +385,6 @@ define(['require',
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
tagName: tagName, tagName: tagName,
callback: function() { callback: function() {
if (that.searchVent) {
that.searchVent.trigger("Classification:Count:Update");
}
that.fetchCollection(); that.fetchCollection();
} }
})); }));
...@@ -466,9 +466,6 @@ define(['require', ...@@ -466,9 +466,6 @@ define(['require',
guid: that.id, guid: that.id,
tagList: tagList, tagList: tagList,
callback: function() { callback: function() {
if (that.searchVent) {
that.searchVent.trigger("Classification:Count:Update");
}
that.fetchCollection(); that.fetchCollection();
}, },
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
......
...@@ -74,7 +74,7 @@ define(['require', ...@@ -74,7 +74,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'callback', 'showLoader', 'entityDefCollection', 'typeHeaders')); _.extend(this, _.pick(options, 'guid', 'callback', 'showLoader', 'entityDefCollection', 'typeHeaders', 'searchVent'));
var that = this, var that = this,
entityTitle, okLabel; entityTitle, okLabel;
this.selectStoreCollection = new Backbone.Collection(); this.selectStoreCollection = new Backbone.Collection();
...@@ -791,6 +791,9 @@ define(['require', ...@@ -791,6 +791,9 @@ define(['require',
trigger: true trigger: true
}); });
} }
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
} }
} }
}, },
...@@ -801,7 +804,6 @@ define(['require', ...@@ -801,7 +804,6 @@ define(['require',
that.modal.$el.find('button.ok').hideButtonLoader(); that.modal.$el.find('button.ok').hideButtonLoader();
} }
}); });
} catch (e) { } catch (e) {
Utils.notifyError({ Utils.notifyError({
content: e.message content: e.message
......
...@@ -174,7 +174,7 @@ define(['require', ...@@ -174,7 +174,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'guid', 'glossaryCollection', 'glossary', 'collection', 'typeHeaders', 'value', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection')); _.extend(this, _.pick(options, 'guid', 'glossaryCollection', 'glossary', 'collection', 'typeHeaders', 'value', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection', 'searchVent'));
if (this.value && this.value.gType) { if (this.value && this.value.gType) {
if (this.value.gType == "category") { if (this.value.gType == "category") {
this.isCategoryView = true; this.isCategoryView = true;
...@@ -241,6 +241,7 @@ define(['require', ...@@ -241,6 +241,7 @@ define(['require',
"enumDefCollection": that.enumDefCollection, "enumDefCollection": that.enumDefCollection,
"classificationDefCollection": that.classificationDefCollection, "classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection, "glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"getSelectedTermAttribute": function() { "getSelectedTermAttribute": function() {
return that.selectedTermAttribute; return that.selectedTermAttribute;
}, },
...@@ -376,6 +377,9 @@ define(['require', ...@@ -376,6 +377,9 @@ define(['require',
tagList: tagList, tagList: tagList,
callback: function() { callback: function() {
that.getData(); that.getData();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
}, },
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
...@@ -398,6 +402,9 @@ define(['require', ...@@ -398,6 +402,9 @@ define(['require',
guid: that.guid, guid: that.guid,
callback: function() { callback: function() {
that.getData(); that.getData();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
} }
})); }));
}, },
...@@ -442,12 +449,7 @@ define(['require', ...@@ -442,12 +449,7 @@ define(['require',
}, },
renderSearchResultLayoutView: function(options) { renderSearchResultLayoutView: function(options) {
var that = this; var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) { require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
var value = {
'tag': "PII",
'searchType': 'basic'
};
if (that.RSearchResultLayoutView) { if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, { that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
"value": { "searchType": "basic", "term": that.data.qualifiedName }, "value": { "searchType": "basic", "term": that.data.qualifiedName },
......
...@@ -480,8 +480,8 @@ define(['require', ...@@ -480,8 +480,8 @@ define(['require',
if (id) { if (id) {
options.$el.jstree('activate_node', id); options.$el.jstree('activate_node', id);
} }
that.changeLoaderState(false);
} }
that.changeLoaderState(false);
}, },
createAction = function(options) { createAction = function(options) {
var $el = options.el, var $el = options.el,
...@@ -540,9 +540,7 @@ define(['require', ...@@ -540,9 +540,7 @@ define(['require',
}).on("clear_search.jstree", function(e, data) { }).on("clear_search.jstree", function(e, data) {
createAction(_.extend({}, options, data)); createAction(_.extend({}, options, data));
}).bind('loaded.jstree', function(e, data) { }).bind('loaded.jstree', function(e, data) {
if (that.query[type].isNodeNotFoundAtLoad == true) {
treeLoaded({ "$el": $el, "type": type }); treeLoaded({ "$el": $el, "type": type });
}
}); });
}, },
initializeTermTree = function() { initializeTermTree = function() {
......
...@@ -210,6 +210,9 @@ define(['require', ...@@ -210,6 +210,9 @@ define(['require',
this.listenTo(this.typeHeaders, "reset", function(value) { this.listenTo(this.typeHeaders, "reset", function(value) {
this.initializeValues(); this.initializeValues();
}, this); }, this);
this.listenTo(this.searchVent, "entityList:refresh", function(model, response) {
this.onRefreshButton();
}, this);
}, },
initializeValues: function() { initializeValues: function() {
this.renderTypeTagList(); this.renderTypeTagList();
......
...@@ -640,7 +640,7 @@ define(['require', ...@@ -640,7 +640,7 @@ define(['require',
nameCheck = 0, nameCheck = 0,
columnToShow = null, columnToShow = null,
col = {}; col = {};
this.value = Utils.getUrlState.getQueryParams() || this.value; this.value = this.fromView === "glossary" ? this.value : Utils.getUrlState.getQueryParams() || this.value;
if (this.value && this.value.searchType === "basic" && this.searchTableColumns && (this.searchTableColumns[this.value.type] !== undefined)) { if (this.value && this.value.searchType === "basic" && this.searchTableColumns && (this.searchTableColumns[this.value.type] !== undefined)) {
columnToShow = this.searchTableColumns[this.value.type] == null ? [] : this.searchTableColumns[this.value.type]; columnToShow = this.searchTableColumns[this.value.type] == null ? [] : this.searchTableColumns[this.value.type];
} }
...@@ -1047,6 +1047,9 @@ define(['require', ...@@ -1047,6 +1047,9 @@ define(['require',
that.multiSelectEntity = []; that.multiSelectEntity = [];
that.$('.multiSelectTag,.multiSelectTerm').hide(); that.$('.multiSelectTag,.multiSelectTerm').hide();
that.fetchCollection(); that.fetchCollection();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
}, },
tagList: that.getTagList(guid, multiple), tagList: that.getTagList(guid, multiple),
showLoader: that.showLoader.bind(that), showLoader: that.showLoader.bind(that),
...@@ -1120,7 +1123,6 @@ define(['require', ...@@ -1120,7 +1123,6 @@ define(['require',
that.multiSelectEntity = []; that.multiSelectEntity = [];
that.$('.multiSelectTag,.multiSelectTerm').hide(); that.$('.multiSelectTag,.multiSelectTerm').hide();
that.fetchCollection(); that.fetchCollection();
}, },
glossaryCollection: that.glossaryCollection, glossaryCollection: that.glossaryCollection,
}); });
...@@ -1143,6 +1145,9 @@ define(['require', ...@@ -1143,6 +1145,9 @@ define(['require',
hideLoader: that.hideLoader.bind(that), hideLoader: that.hideLoader.bind(that),
callback: function() { callback: function() {
that.fetchCollection(); that.fetchCollection();
if (that.searchVent) {
that.searchVent.trigger('entityList:refresh');
}
} }
}); });
...@@ -1210,6 +1215,7 @@ define(['require', ...@@ -1210,6 +1215,7 @@ define(['require',
var view = new CreateEntityLayoutView({ var view = new CreateEntityLayoutView({
entityDefCollection: that.entityDefCollection, entityDefCollection: that.entityDefCollection,
typeHeaders: that.typeHeaders, typeHeaders: that.typeHeaders,
searchVent: that.searchVent,
callback: function() { callback: function() {
that.fetchCollection(); that.fetchCollection();
} }
......
...@@ -44,7 +44,7 @@ define(['require', ...@@ -44,7 +44,7 @@ define(['require',
* @constructs * @constructs
*/ */
initialize: function(options) { initialize: function(options) {
_.extend(this, _.pick(options, 'tag', 'value', 'glossaryCollection', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection')); _.extend(this, _.pick(options, 'tag', 'value', 'glossaryCollection', 'classificationDefCollection', 'entityDefCollection', 'typeHeaders', 'enumDefCollection', 'searchVent'));
this.collection = this.classificationDefCollection; this.collection = this.classificationDefCollection;
}, },
bindEvents: function() {}, bindEvents: function() {},
...@@ -68,6 +68,7 @@ define(['require', ...@@ -68,6 +68,7 @@ define(['require',
enumDefCollection: that.enumDefCollection, enumDefCollection: that.enumDefCollection,
classificationDefCollection: that.classificationDefCollection, classificationDefCollection: that.classificationDefCollection,
glossaryCollection: that.glossaryCollection, glossaryCollection: that.glossaryCollection,
searchVent: that.searchVent,
fromView: "classification" fromView: "classification"
})); }));
} }
......
...@@ -256,6 +256,7 @@ define(['require', ...@@ -256,6 +256,7 @@ define(['require',
"enumDefCollection": that.enumDefCollection, "enumDefCollection": that.enumDefCollection,
"classificationDefCollection": that.classificationDefCollection, "classificationDefCollection": that.classificationDefCollection,
"glossaryCollection": that.glossaryCollection, "glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"getSelectedTermAttribute": function() { "getSelectedTermAttribute": function() {
return that.selectedTermAttribute; return that.selectedTermAttribute;
}, },
...@@ -465,10 +466,6 @@ define(['require', ...@@ -465,10 +466,6 @@ define(['require',
var that = this; var that = this;
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) { require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
var value = {
'tag': "PII",
'searchType': 'basic'
};
if (that.RSearchResultLayoutView) { if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, { that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
"value": { "searchType": "basic", "term": that.data.qualifiedName }, "value": { "searchType": "basic", "term": that.data.qualifiedName },
......
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