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


##########
ui/src/pages/Install/components/SecondStep/index.tsx:
##########
@@ -179,12 +242,107 @@ 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="checkbox" id="sslEnabled">
+                <Form.Check.Input
+                  value={data.ssl_enabled.value}
+                  type="checkbox"
+                  onChange={(e) => {
+                    changeCallback({
+                      ssl_enabled: {
+                        value: e.target.checked,
+                        isInvalid: false,
+                        errorMsg: '',
+                      },
+                    });
+                  }}
+                />
+                <Form.Label className="ms-1" htmlFor="ssl_enabled">
+                  {t('ssl_enabled.label')}
+                </Form.Label>
+              </Form.Check>
+            </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}>{item.value}</option>;
+                })}
+              </Form.Select>
+            </Form.Group>
+          )}

Review Comment:
   It is more intuitive to use the radio component instead of select.
   
![image](https://github.com/user-attachments/assets/9f4601c6-d4ae-442d-8d92-fa2857e50aa3)
   
   When iterating through the generated content, you need to add a key to the 
subitem,
   ```
    return  <option value={item.value} key={item.value}>{item.value}</option>;
   ```
   
   
   
   



-- 
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]

Reply via email to