PLT-3237 Update displayed config values in admin console after saving (#3506)
* Reloaded admin console data when settings are saved * Fixed attempting to save an invalid config setting overwriting the stored config
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b1520d0b94
Коммит
b114062c1b
@@ -19,17 +19,12 @@ export default class ConfigurationSettings extends AdminSettings {
|
||||
this.getConfigFromState = this.getConfigFromState.bind(this);
|
||||
|
||||
this.renderSettings = this.renderSettings.bind(this);
|
||||
|
||||
this.state = Object.assign(this.state, {
|
||||
listenAddress: props.config.ServiceSettings.ListenAddress,
|
||||
webserverMode: props.config.ServiceSettings.WebserverMode
|
||||
});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.config.ServiceSettings.ListenAddress !== this.props.config.ServiceSettings.ListenAddress) {
|
||||
this.setState({listenAddress: nextProps.config.ServiceSettings.ListenAddress});
|
||||
}
|
||||
// special case for this page since we don't update AdminSettings components when the
|
||||
// stored config changes, but we want this page to update when you reload the config
|
||||
this.setState(this.getStateFromConfig(nextProps.config));
|
||||
}
|
||||
|
||||
getConfigFromState(config) {
|
||||
@@ -39,6 +34,13 @@ export default class ConfigurationSettings extends AdminSettings {
|
||||
return config;
|
||||
}
|
||||
|
||||
getStateFromConfig(config) {
|
||||
return {
|
||||
listenAddress: config.ServiceSettings.ListenAddress,
|
||||
webserverMode: config.ServiceSettings.WebserverMode
|
||||
};
|
||||
}
|
||||
|
||||
renderTitle() {
|
||||
return (
|
||||
<h3>
|
||||
|
||||
Ссылка в новой задаче
Block a user