in widgets/agile-charts/src/app/configuration.js [518:572]
render() {
const {
youTracks,
selectedYouTrack,
errorMessage,
reports,
selectedReport,
selectedReportIsValid,
tab,
boardFormSettings
} = this.state;
const youTrackServiceToSelectItem = it => it && {
key: it.id,
label: it.name,
description: it.homeUrl,
model: it
};
const isFormInvalid = errorMessage || (
tab === Configuration.TABS.AGILE_BASED_CHART
? !boardFormSettings
: !selectedReport || !selectedReportIsValid
);
return (
<ConfigurationForm
warning={errorMessage}
isInvalid={isFormInvalid}
isLoading={this.state.isLoading}
panelControls={this.renderRefreshPeriod()}
onSave={this.submitForm}
onCancel={this.props.onCancel}
>
{
youTracks.length > 1 &&
<div className="ring-form__group">
<Select
data={youTracks.map(youTrackServiceToSelectItem)}
selected={youTrackServiceToSelectItem(selectedYouTrack)}
onSelect={this.changeYouTrack}
filter={true}
label={i18n('Select YouTrack')}
size={InputSize.FULL}
/>
</div>
}
{
reports
? this.renderGeneralSettings()
: (!errorMessage && <LoaderInline/>)
}
</ConfigurationForm>
);
}