Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(credentials): ds-391 SSH key placeholder text #443

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,12 @@ exports[`CredentialFormFields should render specific to authType for type networ
isRequired={true}
name="ssh_key"
onChange={[Function]}
placeholder="Enter SSH Key"
placeholder="Enter private SSH Key"
rows={10}
/>
<FormHelperText>
Please paste your private SSH key here. This key will be used to authenticate your access to the system.
</FormHelperText>
</FormGroup>
<FormGroup
fieldId="ssh_passphrase"
Expand Down
17 changes: 15 additions & 2 deletions src/views/credentials/addCredentialModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
* @module AddCredentialModal
*/
import React, { useCallback, useEffect, useState } from 'react';
import { ActionGroup, Button, Form, FormGroup, Modal, ModalVariant, TextArea, TextInput } from '@patternfly/react-core';
import {
ActionGroup,
Button,
Form,
FormGroup,
FormHelperText,
Modal,
ModalVariant,
TextArea,
TextInput
} from '@patternfly/react-core';
import { SimpleDropdown } from '../../components/simpleDropdown/simpleDropdown';
import { type CredentialType } from '../../types/types';

Expand All @@ -13,7 +23,7 @@
credential?: CredentialType;
credentialType?: string;
onClose?: () => void;
onSubmit?: (payload: any) => void;

Check warning on line 26 in src/views/credentials/addCredentialModal.tsx

View workflow job for this annotation

GitHub Actions / Integration (18.x)

Unexpected any. Specify a different type

Check warning on line 26 in src/views/credentials/addCredentialModal.tsx

View workflow job for this annotation

GitHub Actions / Integration (20.x)

Unexpected any. Specify a different type
}

interface CredentialFormType extends Partial<CredentialType> {
Expand Down Expand Up @@ -64,7 +74,7 @@
return () => {
setFormData(initialFormState);
};
}, [typeValue, credential]);

Check warning on line 77 in src/views/credentials/addCredentialModal.tsx

View workflow job for this annotation

GitHub Actions / Integration (18.x)

React Hook useEffect has a missing dependency: 'initialFormState'. Either include it or remove the dependency array

Check warning on line 77 in src/views/credentials/addCredentialModal.tsx

View workflow job for this annotation

GitHub Actions / Integration (20.x)

React Hook useEffect has a missing dependency: 'initialFormState'. Either include it or remove the dependency array

const handleInputChange = useCallback(
(field: string, value: string) => {
Expand Down Expand Up @@ -208,13 +218,16 @@
<FormGroup label="SSH Key" isRequired fieldId="ssh_key">
<TextArea
value={formData?.ssh_key}
placeholder="Enter SSH Key"
placeholder="Enter private SSH Key"
isRequired
id="credential-ssh-key"
name="ssh_key"
onChange={event => handleInputChange('ssh_key', event.target.value)}
rows={10}
/>
<FormHelperText>
Please paste your private SSH key here. This key will be used to authenticate your access to the system.
</FormHelperText>
</FormGroup>
<FormGroup label="SSH passphrase" fieldId="ssh_passphrase">
<TextInput
Expand Down
Loading