diff options
Diffstat (limited to 'frontend/src/components/modals/custom-components')
3 files changed, 26 insertions, 18 deletions
diff --git a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js index 2d001302..19049931 100644 --- a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js @@ -19,11 +19,13 @@ class NewPortfolioModalComponent extends React.Component { } reset() { - this.textInput.value = '' - AVAILABLE_METRICS.forEach((metric) => { - this.metricCheckboxes[metric].checked = true - }) - this.repeatsInput.value = 1 + if (this.textInput) { + this.textInput.value = '' + AVAILABLE_METRICS.forEach((metric) => { + this.metricCheckboxes[metric].checked = true + }) + this.repeatsInput.value = 1 + } } onSubmit() { diff --git a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js index d7d99982..5ba74b0f 100644 --- a/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewScenarioModalComponent.js @@ -19,21 +19,25 @@ class NewScenarioModalComponent extends React.Component { } componentDidUpdate() { - if (this.props.currentPortfolioScenarioIds.length === 0) { - this.textInput.value = 'Base scenario' - } else if (this.textInput.value === 'Base scenario') { - this.textInput.value = '' + if (this.textInput) { + if (this.props.currentPortfolioScenarioIds.length === 0) { + this.textInput.value = 'Base scenario' + } else if (this.textInput.value === 'Base scenario') { + this.textInput.value = '' + } } } reset() { - this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : '' - this.traceSelect.selectedIndex = 0 - this.traceLoadInput.value = 1.0 - this.topologySelect.selectedIndex = 0 - this.failuresCheckbox.checked = false - this.performanceInterferenceCheckbox.checked = false - this.schedulerSelect.selectedIndex = 0 + if (this.textInput) { + this.textInput.value = this.props.currentPortfolioScenarioIds.length === 0 ? 'Base scenario' : '' + this.traceSelect.selectedIndex = 0 + this.traceLoadInput.value = 1.0 + this.topologySelect.selectedIndex = 0 + this.failuresCheckbox.checked = false + this.performanceInterferenceCheckbox.checked = false + this.schedulerSelect.selectedIndex = 0 + } } onSubmit() { diff --git a/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js b/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js index d8262baa..8a625b13 100644 --- a/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewTopologyModalComponent.js @@ -13,8 +13,10 @@ class NewTopologyModalComponent extends React.Component { } reset() { - this.textInput.value = '' - this.originTopology.selectedIndex = 0 + if (this.textInput) { + this.textInput.value = '' + this.originTopology.selectedIndex = 0 + } } onSubmit() { |
