in widgets/distribution-reports/src/app/widget.js [394:437]
renderContent() {
const {
report,
error,
isLoading,
refreshPeriod,
youTrack,
isCalculationCompleted
} = this.state;
const isCalculation = ReportModel.isReportCalculation(report);
const tickPeriodSec = (isCalculation || isCalculationCompleted)
? DistributionReportsWidget.PROGRESS_BAR_REFRESH_PERIOD
: refreshPeriod;
const millisInSec = 1000;
if (isCalculationCompleted) {
const COMPLETED_PROGRESS = 100;
const shouldShowCompletedProgress =
report.status.progress < COMPLETED_PROGRESS &&
!ReportModel.isReportError(report);
if (shouldShowCompletedProgress) {
report.status.calculationInProgress = true;
report.status.progress = COMPLETED_PROGRESS;
}
}
return (
<Content
report={report}
error={error}
youTrack={youTrack}
dashboardApi={this.props.dashboardApi}
widgetLoader={isLoading || isCalculation}
tickPeriod={tickPeriodSec * millisInSec}
editable={this.props.editable}
onTick={this.onWidgetRefresh}
onOpenSettings={this.openWidgetsSettings}
onChangeReportSortOrders={this.onChangeReportSortOrders}
onChangePresentationMode={this.onChangeReportPresentation}
/>
);
}