Use-case:
I've created a QA-monitoring confluence page used to check QA statistics for different product teams. Multiple Jira API-calls are made related to Incidents, Sprint-bugs, Total user-stories, Overall requirement coverage, Total automation/manual tests etc. Please see the code sample below.
~1200 api-calls are made in ~1.5 minutes. Afterwards, I'm populating the confluence page with relevant data.
Questions:
- How to show ajax-wait-like-gifs to the inform the user to wait until page load?
- For pageload time optimization, how to use jquery-promises? (any example). Any best practices?
Thanks in advance
$.each(teams, function (index, value) {
// Defect or Bugs
AJS.$.ajax({
url: `${JIRA_REST_URL}${PROJECT}${value}${DEFECTS}${DURATION}${MAX_RES}`,
type: "GET",
success: function (data) {
if (document.getElementById(`${value}_DEFECTS`) != null) {
document.getElementById(`${value}_DEFECTS`).innerHTML = JSON.parse(JSON.stringify(data)).total;
}
},
error: function (err) {
console.log(err)
}
});
});
$.each(product_teams, function () {
$.each(this, function (name, value) {
// Incidents
AJS.$.ajax({
url: `${JIRA_REST_URL}${INCIDENTS}${value}${QUOT}${DURATION}${MAX_RES}`,
type: "GET",
success: function (data) {
if (document.getElementById(`${name}_INCIDENTS`) != null) {
document.getElementById(`${name}_INCIDENTS`).innerHTML = JSON.parse(JSON.stringify(data)).total;
}
},
error: function (err) {
console.log(err)
}
});
});
});
....
question from:
https://stackoverflow.com/questions/65643061/jira-api-calls-from-confluence 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…