summaryrefslogtreecommitdiff
path: root/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-07-21 15:33:37 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 19:48:16 +0200
commit912e1b96bfa7d6c022d854fa744f719b49ca98d0 (patch)
tree49cdaf109aa08b0149c34174ce0f00c7056221ea /frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js
parent791b5d1e443f97adc756264878c3aae41ca0f748 (diff)
Add first plotting attempts for portfolios
Diffstat (limited to 'frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js')
-rw-r--r--frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js
index ace2d751..2d001302 100644
--- a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js
+++ b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js
@@ -20,20 +20,17 @@ class NewPortfolioModalComponent extends React.Component {
reset() {
this.textInput.value = ''
- AVAILABLE_METRICS.forEach(metric => {
+ AVAILABLE_METRICS.forEach((metric) => {
this.metricCheckboxes[metric].checked = true
})
this.repeatsInput.value = 1
}
onSubmit() {
- this.props.callback(
- this.textInput.value,
- {
- enabledMetrics: AVAILABLE_METRICS.filter(metric => this.metricCheckboxes[metric].checked),
- repeatsPerScenario: parseInt(this.repeatsInput.value),
- },
- )
+ this.props.callback(this.textInput.value, {
+ enabledMetrics: AVAILABLE_METRICS.filter((metric) => this.metricCheckboxes[metric].checked),
+ repeatsPerScenario: parseInt(this.repeatsInput.value),
+ })
this.reset()
}
@@ -51,7 +48,7 @@ class NewPortfolioModalComponent extends React.Component {
onCancel={this.onCancel.bind(this)}
>
<form
- onSubmit={e => {
+ onSubmit={(e) => {
e.preventDefault()
this.onSubmit()
}}
@@ -62,19 +59,19 @@ class NewPortfolioModalComponent extends React.Component {
type="text"
className="form-control"
required
- ref={textInput => (this.textInput = textInput)}
+ ref={(textInput) => (this.textInput = textInput)}
/>
</div>
<h4>Targets</h4>
<h5>Metrics</h5>
<div className="form-group">
- {AVAILABLE_METRICS.map(metric => (
+ {AVAILABLE_METRICS.map((metric) => (
<div className="form-check" key={metric}>
<label className="form-check-label">
<input
type="checkbox"
className="form-check-input"
- ref={checkbox => (this.metricCheckboxes[metric] = checkbox)}
+ ref={(checkbox) => (this.metricCheckboxes[metric] = checkbox)}
/>
<code>{metric}</code>
</label>
@@ -87,7 +84,7 @@ class NewPortfolioModalComponent extends React.Component {
type="number"
className="form-control"
required
- ref={repeatsInput => (this.repeatsInput = repeatsInput)}
+ ref={(repeatsInput) => (this.repeatsInput = repeatsInput)}
/>
</div>
</form>