Show hg binary verification error messages (#1637)

Show hg verification error messages on global hg config page if trying to save invalid hg binary.
This commit is contained in:
Eduard Heimbuch
2021-05-03 19:04:08 +02:00
committed by GitHub
parent 7464baf767
commit 579b58ba5f
8 changed files with 113 additions and 48 deletions

View File

@@ -135,7 +135,8 @@ class Configuration extends React.Component<Props, State> {
event.preventDefault();
this.setState({
modifying: true
modifying: true,
error: undefined
});
const { modifiedConfiguration } = this.state;
@@ -182,9 +183,7 @@ class Configuration extends React.Component<Props, State> {
const { t } = this.props;
const { fetching, error, configuration, modifying, valid } = this.state;
if (error) {
return <ErrorNotification error={error} />;
} else if (fetching || !configuration) {
if (fetching || !configuration) {
return <Loading />;
} else {
const readOnly = this.isReadOnly();
@@ -200,6 +199,12 @@ class Configuration extends React.Component<Props, State> {
{this.renderConfigChangedNotification()}
<form onSubmit={this.modifyConfiguration}>
{this.props.render(renderProps)}
{error && (
<>
<hr />
<ErrorNotification error={error} />
</>
)}
<hr />
<Level
right={<SubmitButton label={t("config.form.submit")} disabled={!valid || readOnly} loading={modifying} />}