renderContent()

in widgets/agile-charts/src/app/widget.js [347:389]


  renderContent() {
    const {
      report, error, isLoading,
      refreshPeriod, youTrack, isCalculationCompleted,
      dateFieldFormat
    } = this.state;

    const isCalculation = ReportModel.isReportCalculation(report);
    const tickPeriodSec = (isCalculation || isCalculationCompleted)
      ? AgileProgressDiagramWidget.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}

        datePattern={dateFieldFormat.datePattern}
        dateNoYearPattern={dateFieldFormat.dateNoYearPattern}

        onTick={this.onWidgetRefresh}
        onOpenSettings={this.openWidgetsSettings}
      />
    );
  }