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