shuashuai commented on code in PR #1244:
URL: https://github.com/apache/answer/pull/1244#discussion_r1974982792
##########
ui/src/pages/Install/components/SecondStep/index.tsx:
##########
@@ -81,7 +104,47 @@ const Index: FC<Props> = ({ visible, data, changeCallback,
nextCallback }) => {
errorMsg: t('db_host.msg'),
};
}
-
+ if (!ssl_enabled.value) {
+ bol = true;
+ data.ssl_enabled = {
+ value: false,
+ isInvalid: true,
+ errorMsg: t('ssl_enabled.msg'),
+ };
+ } else if (!ssl_mode.value) {
+ bol = true;
+ data.ssl_mode = {
+ value: 'require',
+ isInvalid: true,
+ errorMsg: '',
+ };
+ }
+ if (ssl_mode.value === 'verify-ca' || ssl_mode.value === 'verify-full') {
+ if (!key_file.value) {
+ bol = false;
+ data.key_file = {
+ value: '',
+ isInvalid: true,
+ errorMsg: t('key_file.msg'),
+ };
+ }
+ if (!pem_file.value) {
+ bol = false;
+ data.pem_file = {
+ value: '',
+ isInvalid: true,
+ errorMsg: t('pem_file.msg'),
+ };
+ }
+ if (!cert_file.value) {
+ bol = false;
+ data.cert_file = {
+ value: '',
+ isInvalid: true,
+ errorMsg: t('cert_file.msg'),
+ };
+ }
+ }
Review Comment:
You've added the checksum logic here, and there are a couple of problems
with it
1. you should only check for other content if ssl_enabled allows it.
2. the errorMsg is not displayed on the ui when the validation fails.
3. why did you set the bol value to true when your own implementation
didn't pass the checksum? What's the point of adding the checksum?
Consider carefully the checksum logic here.
Example of displaying a message on a page that does not pass validation

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]