aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/pages
diff options
context:
space:
mode:
authorEmiliano Ciavatta2020-10-16 13:09:05 +0000
committerEmiliano Ciavatta2020-10-16 13:09:05 +0000
commit5534413b3a3e6e783310be8147ac8340d3098a7e (patch)
tree395428b5f156855764297542ae0e395b1d157aca /frontend/src/components/pages
parentd4bac2d6741f7a291522c29c9ecc87c3e32e21d4 (diff)
Fix tests. General refactor
Diffstat (limited to 'frontend/src/components/pages')
-rw-r--r--frontend/src/components/pages/ConfigurationPage.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/frontend/src/components/pages/ConfigurationPage.js b/frontend/src/components/pages/ConfigurationPage.js
index 2bd2da7..4f0ce21 100644
--- a/frontend/src/components/pages/ConfigurationPage.js
+++ b/frontend/src/components/pages/ConfigurationPage.js
@@ -59,11 +59,11 @@ class ConfigurationPage extends Component {
validateSettings = (settings) => {
let valid = true;
- if (!validation.isValidAddress(settings.config.server_address, true)) {
+ if (!validation.isValidAddress(settings.config["server_address"], true)) {
this.setState({serverAddressError: "invalid ip_address"});
valid = false;
}
- if (settings.config.flag_regex.length < 8) {
+ if (settings.config["flag_regex"].length < 8) {
this.setState({flagRegexError: "flag_regex.length < 8"});
valid = false;
}
@@ -84,7 +84,7 @@ class ConfigurationPage extends Component {
this.setState({
newUsername: "",
newPassword: "",
- settings: settings
+ settings
});
} else {
this.setState({
@@ -128,15 +128,15 @@ class ConfigurationPage extends Component {
<Container className="p-0">
<Row>
<Col>
- <InputField name="server_address" value={settings.config.server_address}
+ <InputField name="server_address" value={settings.config["server_address"]}
error={this.state.serverAddressError}
- onChange={(v) => this.updateParam((s) => s.config.server_address = v)}/>
- <InputField name="flag_regex" value={settings.config.flag_regex}
- onChange={(v) => this.updateParam((s) => s.config.flag_regex = v)}
+ onChange={(v) => this.updateParam((s) => s.config["server_address"] = v)}/>
+ <InputField name="flag_regex" value={settings.config["flag_regex"]}
+ onChange={(v) => this.updateParam((s) => s.config["flag_regex"] = v)}
error={this.state.flagRegexError}/>
<div style={{"marginTop": "10px"}}>
- <CheckField checked={settings.config.auth_required} name="auth_required"
- onChange={(v) => this.updateParam((s) => s.config.auth_required = v)}/>
+ <CheckField checked={settings.config["auth_required"]} name="auth_required"
+ onChange={(v) => this.updateParam((s) => s.config["auth_required"] = v)}/>
</div>
</Col>