Merge branch 'ui-v0.3' into 'test'

Ui v0.3

See merge request opensource/answer!222
This commit is contained in:
Li Shuailing 2022-11-10 09:08:45 +00:00
commit 0646c9f177
3 changed files with 13 additions and 6 deletions

View File

@ -101,7 +101,7 @@ const Index: FC<Props> = ({ visible, data, changeCallback, nextCallback }) => {
if (admin_email.value && !admin_email.value.match(mailReg)) {
bol = false;
data.admin_email = {
value: '',
value: admin_email.value,
isInvalid: true,
errorMsg: t('admin_email.msg.incorrect'),
};

View File

@ -76,7 +76,7 @@ const Index: FC = () => {
errorMsg: '',
},
site_url: {
value: '',
value: window.location.origin,
isInvalid: false,
errorMsg: '',
},
@ -104,6 +104,9 @@ const Index: FC = () => {
const handleChange = (params: FormDataType) => {
// console.log(params);
setErrorData({
msg: '',
});
setFormData({ ...formData, ...params });
};
@ -150,11 +153,9 @@ const Index: FC = () => {
};
dbCheck(params)
.then(() => {
// handleNext();
checkInstall();
})
.catch((err) => {
console.log(err);
handleErr(err);
});
};
@ -174,7 +175,13 @@ const Index: FC = () => {
handleNext();
})
.catch((err) => {
handleErr(err);
if (err.isError && err.key) {
formData[err.key].isInvalid = true;
formData[err.key].errorMsg = err.value;
setFormData({ ...formData });
} else {
handleErr(err);
}
});
};

View File

@ -41,7 +41,7 @@ const Index: FC<Props> = ({ data }) => {
<br />
{options?.length && (
<>
<span className="text-secondary">{t('options')}</span>
<span className="text-secondary">{t('options')} </span>
{options?.map((item) => {
return <code key={item}>{item} </code>;
})}