in packages/issue-dashboard-widgets/widgets/distribution-reports/app/widget.js [350:393]
renderConfigurationForm() {
const submitForm = async (selectedReportId, refreshPeriod, youTrack) => {
// eslint-disable-next-line react/no-access-state-in-setstate
const reportIsChanged = selectedReportId !== (this.state.report || {}).id;
this.setState({
youTrack,
isLoading: reportIsChanged,
isConfiguring: false,
// eslint-disable-next-line react/no-access-state-in-setstate
report: reportIsChanged ? null : this.state.report,
error: ReportModel.ErrorTypes.OK
}, async () => {
const reportWithData = await this.loadReportWithAppliedConfigSettings(
selectedReportId, youTrack
);
if (reportWithData) {
this.setState({
report: reportWithData,
isLoading: false,
isNewWidget: false,
refreshPeriod
}, async () => await Promise.all([
this.recalculateIfRequired(), this.saveConfig()
]));
}
});
};
const {
report, refreshPeriod, youTrack
} = this.state;
return (
<Configuration
reportId={(report || {}).id}
refreshPeriod={refreshPeriod}
onSubmit={submitForm}
onCancel={this.cancelConfig}
onGetReportDraft={ReportModel.NewReport.issueDistribution}
dashboardApi={this.props.dashboardApi}
youTrackId={(youTrack || {}).id}
/>
);
}