shuashuai commented on code in PR #1244:
URL: https://github.com/apache/answer/pull/1244#discussion_r1945870725
##########
ui/src/pages/Install/components/SecondStep/index.tsx:
##########
@@ -183,6 +191,35 @@ const Index: FC<Props> = ({ visible, data, changeCallback,
nextCallback }) => {
<Form.Control.Feedback type="invalid">
{data.db_password.errorMsg}
</Form.Control.Feedback>
+ <div className='conditional-checkbox'>
+ <label htmlFor='sslMode' className='switch switch-default'>
+ SSL Mode On
+ </label>
+ <input
+ id='sslMode'
+ type='checkbox'
+ checked={checked}
+ onChange={handleChange}
+ />
+
+ {/* Inline conditional if checked state is `true` will show
the div, otherwise, it won't */}
+
+ {checked && (
+ <div
+ number-input
+ id='sslmodeOptionsDropdown'
+ className='form-group col-lg-2 col-md-4 col-sm-8'
+ >
+ <label htmlFor ='sslmodeOptions'>
+ <span className='requiredAsterisk' />
+ </label>
+ <select id='sslmode' className='form-control'>
+ <option>require</option>
+ <option>verify-ca</option>
+ </select>
+ </div>
+ )}
+ </div>
</Form.Group>
Review Comment:
1. Our UI uses bootstrap and react-bootstrap. Please adjust the UI to keep
it consistent.

2. All copywriting in the project needs to be processed using i18n. You can
refer to the existing usage in the project.
After the functions are completed, you can test your own advancedness,
including UI and functions.
##########
ui/src/pages/Install/components/SecondStep/index.tsx:
##########
@@ -113,6 +113,14 @@ const Index: FC<Props> = ({ visible, data, changeCallback,
nextCallback }) => {
nextCallback();
};
+ //checkbox for sslmode enabled or not
+ const [checked, setChecked] = useState(false);
+
+ const handleChange = () => {
+ // Change state to the opposite when checkbox changes
+ setChecked(!checked);
+ };
+
Review Comment:
Your customized handlechange function doesn't pass the required content, it
just saves it on the current page, so you need to add the parameters on the
`/Install/index.tsxt`.

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