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,16 +331,14 @@ require(['App', ...@@ -331,16 +331,14 @@ require(['App',
} }
}); });
Enums.addOnEntities.forEach(function(addOnEntity) {
CommonViewFunction.fetchRootEntityAttributes({ CommonViewFunction.fetchRootEntityAttributes({
url: UrlLinks.rootEntityDefUrl(addOnEntity), url: UrlLinks.rootEntityDefUrl(Enums.addOnEntities[0]),
entity: addOnEntity, entity: Enums.addOnEntities,
callback: function() { callback: function() {
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
}); });
});
CommonViewFunction.fetchRootClassificationAttributes({ CommonViewFunction.fetchRootClassificationAttributes({
url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]), url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
......
...@@ -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()
...@@ -989,12 +989,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -989,12 +989,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
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) {
var entity = Object.assign(response, { name: options.entity }); _.each(options.entity, function(rootEntity) {
Globals[options.entity] = entity; Globals[rootEntity] = $.extend(true, {}, response, { name: rootEntity, guid: rootEntity });
});
} }
}, },
complete: function(response) { complete: function(response) {
...@@ -1003,18 +1003,18 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -1003,18 +1003,18 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} }
} }
}); });
}, }
CommonViewFunction.fetchRootClassificationAttributes = function(options) { CommonViewFunction.fetchRootClassificationAttributes = 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) {
var classification = Object.assign(response, { name: options.classification }); _.each(options.classification, function(rootClassification) {
Globals[options.classification] = classification; Globals[rootClassification] = $.extend(true, {}, response, { name: rootClassification, guid: rootClassification });
});
} }
}, },
complete: function(response) { complete: function(response) {
......
...@@ -360,16 +360,14 @@ require(['App', ...@@ -360,16 +360,14 @@ require(['App',
} }
}); });
Enums.addOnEntities.forEach(function(addOnEntity) {
CommonViewFunction.fetchRootEntityAttributes({ CommonViewFunction.fetchRootEntityAttributes({
url: UrlLinks.rootEntityDefUrl(addOnEntity), url: UrlLinks.rootEntityDefUrl(Enums.addOnEntities[0]),
entity: addOnEntity, entity: Enums.addOnEntities,
callback: function() { callback: function() {
--that.asyncFetchCounter; --that.asyncFetchCounter;
startApp(); startApp();
} }
}); });
});
CommonViewFunction.fetchRootClassificationAttributes({ CommonViewFunction.fetchRootClassificationAttributes({
url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]), url: UrlLinks.rootClassificationDefUrl(Enums.addOnClassification[0]),
......
...@@ -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()
...@@ -1009,11 +1009,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -1009,11 +1009,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
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) {
Globals[options.entity] = Object.assign(response, { name: options.entity, guid: options.entity });; _.each(options.entity, function(rootEntity) {
Globals[rootEntity] = $.extend(true, {}, response, { name: rootEntity, guid: rootEntity });
});
} }
}, },
complete: function(response) { complete: function(response) {
...@@ -1022,19 +1023,17 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum ...@@ -1022,19 +1023,17 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
} }
} }
}); });
}, }
CommonViewFunction.fetchRootClassificationAttributes = function(options) { CommonViewFunction.fetchRootClassificationAttributes = 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.classification, function(rootClassification) { _.each(options.classification, function(rootClassification) {
var responseData = $.extend(true, {}, response); Globals[rootClassification] = $.extend(true, {}, response, { name: rootClassification, guid: rootClassification });
Globals[rootClassification] = Object.assign(responseData, { name: rootClassification, guid: rootClassification });
}); });
} }
}, },
......
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