Skip to content

Commit 19b8aaa

Browse files
committed
#RI-4022 - fix ssh username validation, fix maxlength
1 parent 2807b8d commit 19b8aaa

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/InstanceForm.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ const AddStandaloneForm = (props: Props) => {
262262
if (!values.sshPort) {
263263
errs.sshPort = fieldDisplayNames.sshPort
264264
}
265+
if (!values.sshUsername) {
266+
errs.sshUsername = fieldDisplayNames.sshUsername
267+
}
265268
if (values.sshPassType === SshPassType.PrivateKey && !values.sshPrivateKey) {
266269
errs.sshPrivateKey = fieldDisplayNames.sshPrivateKey
267270
}

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ export const fieldDisplayNames = {
2121
sentinelMasterName: 'Primary Group Name',
2222
sshHost: 'SSH Host',
2323
sshPort: 'SSH Port',
24-
sshPrivateKey: 'SSH Private Key'
24+
sshPrivateKey: 'SSH Private Key',
25+
sshUsername: 'SSH Username',
2526
}

redisinsight/ui/src/pages/home/components/AddInstanceForm/InstanceForm/form-components/SSHDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const SSHDetails = (props: Props) => {
121121
className={flexGroupClassName}
122122
>
123123
<EuiFlexItem className={cx(flexItemClassName)}>
124-
<EuiFormRow label="Username">
124+
<EuiFormRow label="Username*">
125125
<EuiFieldText
126126
name="sshUsername"
127127
id="sshUsername"
@@ -196,6 +196,7 @@ const SSHDetails = (props: Props) => {
196196
value={formik.values.sshPrivateKey ?? ''}
197197
onChange={formik.handleChange}
198198
fullWidth
199+
maxLength={50_000}
199200
placeholder="Enter SSH Private Key"
200201
data-testid="sshPrivateKey"
201202
/>

0 commit comments

Comments
 (0)