in widgets/agile-charts/src/app/configuration.js [184:215]
async updateReportsSelectorModel() {
const getUpdatedCurrentReport = async currentReportId => {
if (currentReportId) {
try {
return await loadReportWithSettings(
this.fetchYouTrack, currentReportId
);
} catch (err) {
return Configuration.createNewReport();
}
}
return Configuration.createNewReport();
};
const selectedReport = await getUpdatedCurrentReport(
(this.state.selectedReport || {}).id
);
const tab = (
!selectedReport.id ||
ReportModel.ReportTypes.isSprintBased(selectedReport)
) ? Configuration.TABS.AGILE_BASED_CHART
: Configuration.TABS.CUSTOM_CHART;
this.setState(
{selectedReport, tab},
async () => await this.changeReport(selectedReport)
);
const reports = await loadIndependentBurnDownReports(
async (url, params) => this.fetchYouTrack(url, params)
);
this.setState({reports});
}