renderReportsSettings()

in widgets/agile-charts/src/app/configuration.js [390:445]


  renderReportsSettings() {
    const {
      reports,
      selectedReport,
      reportSettingsLoadingError,
      selectedYouTrack,
      currentUser
    } = this.state;

    const reportWithSettings = Configuration.
      areReportSettingsLoaded(selectedReport) ? selectedReport : undefined;

    return (
      <div>
        <div className="ring-form__group">
          <Select
            data={Configuration.makeReportsOptionsList(
              reports
            )}
            selected={Configuration.reportToSelectItem(
              selectedReport
            )}
            onSelect={this.changeReport}
            filter={true}
            label={i18n('Select report')}
            size={InputSize.FULL}
          />
        </div>
        {
          reportWithSettings &&
          <div>
            { this.renderCloneNonOwnReportWarning(reportWithSettings) }
            <BurnDownChartForm
              report={reportWithSettings}
              onReportSettingsChange={this.onReportSettingsChange}
              onValidStateChange={this.onReportValidStatusChange}
              disabled={!reportWithSettings.own}
              currentUser={currentUser}
              fetchYouTrack={
                makeYouTrackFetcher(this.props.dashboardApi, selectedYouTrack)
              }
            />
          </div>
        }
        {
          !reportWithSettings && !reportSettingsLoadingError && <LoaderInline/>
        }
        {
          !reportWithSettings && reportSettingsLoadingError &&
          <div className="ring-form__group">
            {reportSettingsLoadingError}
          </div>
        }
      </div>
    );
  }