Commit de696534 by kevalbhatt

ATLAS-3777:- Classic UI , Regression : On clicking tag filters , the dialog…

ATLAS-3777:- Classic UI , Regression : On clicking tag filters , the dialog window says "No Attributes are available !"
parent 0e53c3ee
...@@ -331,15 +331,13 @@ require(['App', ...@@ -331,15 +331,13 @@ require(['App',
} }
}); });
Enums.addOnEntities.forEach(function(addOnEntity) { CommonViewFunction.fetchRootEntityAttributes({
CommonViewFunction.fetchRootEntityAttributes({ url: UrlLinks.rootEntityDefUrl(Enums.addOnEntities[0]),
url: UrlLinks.rootEntityDefUrl(addOnEntity), entity: Enums.addOnEntities,
entity: addOnEntity, callback: function() {
callback: function() { --that.asyncFetchCounter;
--that.asyncFetchCounter; startApp();
startApp(); }
}
});
}); });
CommonViewFunction.fetchRootClassificationAttributes({ CommonViewFunction.fetchRootClassificationAttributes({
......
...@@ -473,7 +473,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -473,7 +473,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var classificationDef = classificationDefCollection.fullCollection.findWhere({ 'name': value[skey].classification }), var classificationDef = classificationDefCollection.fullCollection.findWhere({ 'name': value[skey].classification }),
attributeDefs = []; attributeDefs = [];
if (classificationDef) { if (classificationDef) {
Utils.getNestedSuperTypeObj({ attributeDefs = Utils.getNestedSuperTypeObj({
collection: classificationDefCollection, collection: classificationDefCollection,
attrMerge: true, attrMerge: true,
data: classificationDef.toJSON() data: classificationDef.toJSON()
...@@ -489,7 +489,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -489,7 +489,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
var entityDef = entityDefCollection.fullCollection.findWhere({ 'name': value[skey].typeName }), var entityDef = entityDefCollection.fullCollection.findWhere({ 'name': value[skey].typeName }),
attributeDefs = []; attributeDefs = [];
if (entityDef) { if (entityDef) {
Utils.getNestedSuperTypeObj({ attributeDefs = Utils.getNestedSuperTypeObj({
collection: entityDefCollection, collection: entityDefCollection,
attrMerge: true, attrMerge: true,
data: entityDef.toJSON() data: entityDef.toJSON()
...@@ -985,44 +985,44 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -985,44 +985,44 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
return list.join(','); return list.join(',');
} }
CommonViewFunction.fetchRootEntityAttributes = function(options) { CommonViewFunction.fetchRootEntityAttributes = function(options) {
$.ajax({ $.ajax({
url: options.url, url: options.url,
methods: 'GET', methods: 'GET',
dataType: 'json', dataType: 'json',
delay: 250, cache: true,
cache: true, success: function(response) {
success: function(response) { if (response) {
if (response) { _.each(options.entity, function(rootEntity) {
var entity = Object.assign(response, { name: options.entity }); Globals[rootEntity] = $.extend(true, {}, response, { name: rootEntity, guid: rootEntity });
Globals[options.entity] = entity; });
}
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
} }
}); },
}, complete: function(response) {
CommonViewFunction.fetchRootClassificationAttributes = function(options) { if (options.callback) {
$.ajax({ options.callback(response);
url: options.url,
methods: 'GET',
dataType: 'json',
delay: 250,
cache: true,
success: function(response) {
if (response) {
var classification = Object.assign(response, { name: options.classification });
Globals[options.classification] = classification;
}
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
} }
}); }
} });
}
CommonViewFunction.fetchRootClassificationAttributes = function(options) {
$.ajax({
url: options.url,
methods: 'GET',
dataType: 'json',
cache: true,
success: function(response) {
if (response) {
_.each(options.classification, function(rootClassification) {
Globals[rootClassification] = $.extend(true, {}, response, { name: rootClassification, guid: rootClassification });
});
}
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
}
});
}
return CommonViewFunction; return CommonViewFunction;
}); });
\ No newline at end of file
...@@ -360,15 +360,13 @@ require(['App', ...@@ -360,15 +360,13 @@ require(['App',
} }
}); });
Enums.addOnEntities.forEach(function(addOnEntity) { CommonViewFunction.fetchRootEntityAttributes({
CommonViewFunction.fetchRootEntityAttributes({ url: UrlLinks.rootEntityDefUrl(Enums.addOnEntities[0]),
url: UrlLinks.rootEntityDefUrl(addOnEntity), entity: Enums.addOnEntities,
entity: addOnEntity, callback: function() {
callback: function() { --that.asyncFetchCounter;
--that.asyncFetchCounter; startApp();
startApp(); }
}
});
}); });
CommonViewFunction.fetchRootClassificationAttributes({ CommonViewFunction.fetchRootClassificationAttributes({
......
...@@ -491,9 +491,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -491,9 +491,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} else if (k == "tagFilters") { } else if (k == "tagFilters") {
if (classificationDefCollection) { if (classificationDefCollection) {
var classificationDef = classificationDefCollection.fullCollection.findWhere({ 'name': value[skey].classification }), var classificationDef = classificationDefCollection.fullCollection.findWhere({ 'name': value[skey].classification }),
attributeDefs = [] attributeDefs = [];
if (classificationDef) { if (classificationDef) {
Utils.getNestedSuperTypeObj({ attributeDefs = Utils.getNestedSuperTypeObj({
collection: classificationDefCollection, collection: classificationDefCollection,
attrMerge: true, attrMerge: true,
data: classificationDef.toJSON() data: classificationDef.toJSON()
...@@ -1005,45 +1005,44 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -1005,45 +1005,44 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
return list.join(','); return list.join(',');
} }
CommonViewFunction.fetchRootEntityAttributes = function(options) { CommonViewFunction.fetchRootEntityAttributes = function(options) {
$.ajax({ $.ajax({
url: options.url, url: options.url,
methods: 'GET', methods: 'GET',
dataType: 'json', dataType: 'json',
delay: 250, cache: true,
cache: true, success: function(response) {
success: function(response) { if (response) {
if (response) { _.each(options.entity, function(rootEntity) {
Globals[options.entity] = Object.assign(response, { name: options.entity, guid: options.entity });; Globals[rootEntity] = $.extend(true, {}, response, { name: rootEntity, guid: rootEntity });
} });
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
} }
}); },
}, complete: function(response) {
CommonViewFunction.fetchRootClassificationAttributes = function(options) { if (options.callback) {
$.ajax({ options.callback(response);
url: options.url,
methods: 'GET',
dataType: 'json',
delay: 250,
cache: true,
success: function(response) {
if (response) {
_.each(options.classification, function(rootClassification) {
var responseData = $.extend(true, {}, response);
Globals[rootClassification] = Object.assign(responseData, { name: rootClassification, guid: rootClassification });
});
}
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
} }
}); }
} });
}
CommonViewFunction.fetchRootClassificationAttributes = function(options) {
$.ajax({
url: options.url,
methods: 'GET',
dataType: 'json',
cache: true,
success: function(response) {
if (response) {
_.each(options.classification, function(rootClassification) {
Globals[rootClassification] = $.extend(true, {}, response, { name: rootClassification, guid: rootClassification });
});
}
},
complete: function(response) {
if (options.callback) {
options.callback(response);
}
}
});
}
return CommonViewFunction; return CommonViewFunction;
}); });
\ No newline at end of file
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