shuashuai commented on code in PR #1244:
URL: https://github.com/apache/answer/pull/1244#discussion_r1980794989


##########
ui/src/pages/Install/components/SecondStep/index.tsx:
##########
@@ -179,12 +243,119 @@ const Index: FC<Props> = ({ visible, data, 
changeCallback, nextCallback }) => {
                 });
               }}
             />
-
             <Form.Control.Feedback type="invalid">
               {data.db_password.errorMsg}
             </Form.Control.Feedback>
           </Form.Group>
-
+          {data.db_type.value === 'postgres' && (
+            <Form.Group
+              controlId="ssl_enabled"
+              className="conditional-checkbox">
+              <Form.Check
+                type="switch"
+                id="sslEnabled"
+                checked={data.ssl_enabled.value}
+                label={t('ssl_enabled.label')}
+                onChange={(e) => {
+                  changeCallback({
+                    ssl_enabled: {
+                      value: e.target.checked,
+                      isInvalid: false,
+                      errorMsg: '',
+                    },
+                  });
+                }}
+              />
+            </Form.Group>
+          )}
+          {data.db_type.value === 'postgres' && data.ssl_enabled.value && (
+            <Form.Group controlId="sslmodeOptionsDropdown" className="mb-3">
+              <Form.Label>{t('ssl_mode.label')}</Form.Label>
+              <Form.Select
+                value={data.ssl_mode.value}
+                onChange={(e) => {
+                  changeCallback({
+                    ssl_mode: {
+                      value: e.target.value,
+                      isInvalid: false,
+                      errorMsg: '',
+                    },
+                  });
+                }}>
+                {sslModes.map((item) => {
+                  return (
+                    <option value={item.value} key={item.value}>
+                      {item.value}
+                    </option>
+                  );
+                })}
+              </Form.Select>
+            </Form.Group>
+          )}
+          {data.db_type.value === 'postgres' &&
+            data.ssl_enabled.value &&
+            (data.ssl_mode.value === 'verify-ca' ||
+              data.ssl_mode.value === 'verify-full') && (
+              <InputGroup className="mb-3" hasValidation>
+                <Form.Control

Review Comment:
   UI exception when validation fails here
   
![image](https://github.com/user-attachments/assets/06c85a8c-45f5-4ace-9b8e-f9e9963c680e)
   
   The fetch can be split here into three separate Form.Group
   
   



-- 
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: commits-unsubscr...@answer.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to