diff --git a/src/Components/CreateImageWizard/ValidatedTextInput.tsx b/src/Components/CreateImageWizard/ValidatedInput.tsx
similarity index 68%
rename from src/Components/CreateImageWizard/ValidatedTextInput.tsx
rename to src/Components/CreateImageWizard/ValidatedInput.tsx
index 1379d141e..7aa999c40 100644
--- a/src/Components/CreateImageWizard/ValidatedTextInput.tsx
+++ b/src/Components/CreateImageWizard/ValidatedInput.tsx
@@ -3,6 +3,8 @@ import React, { useState } from 'react';
import {
HelperText,
HelperTextItem,
+ TextArea,
+ TextAreaProps,
TextInput,
TextInputProps,
} from '@patternfly/react-core';
@@ -19,16 +21,18 @@ interface ValidatedTextInputPropTypes extends TextInputProps {
placeholder?: string;
}
-interface HookValidatedTextInputPropTypes extends TextInputProps {
- dataTestId?: string | undefined;
- ouiaId?: string;
- ariaLabel: string | undefined;
- value: string;
- placeholder?: string;
- stepValidation: StepValidation;
- fieldName: string;
- warning?: string;
-}
+type HookValidatedInputPropTypes = TextInputProps &
+ TextAreaProps & {
+ dataTestId?: string | undefined;
+ ouiaId?: string;
+ ariaLabel: string | undefined;
+ value: string;
+ placeholder?: string;
+ stepValidation: StepValidation;
+ fieldName: string;
+ warning?: string;
+ inputType?: 'textInput' | 'textArea';
+ };
export const HookValidatedInput = ({
dataTestId,
@@ -41,8 +45,9 @@ export const HookValidatedInput = ({
stepValidation,
fieldName,
type = 'text',
+ inputType,
warning = undefined,
-}: HookValidatedTextInputPropTypes) => {
+}: HookValidatedInputPropTypes) => {
const [isPristine, setIsPristine] = useState(!value ? true : false);
// Do not surface validation on pristine state components
// Allow step validation to be set on pristine state, when needed
@@ -60,18 +65,31 @@ export const HookValidatedInput = ({
return (
<>
-
+ {inputType === 'textArea' ? (
+
+ ) : (
+
+ )}
{validated === 'error' && (
@@ -90,7 +108,7 @@ export const HookValidatedInput = ({
);
};
-export const ValidatedTextInput = ({
+export const ValidatedInput = ({
dataTestId,
ouiaId,
ariaLabel,
diff --git a/src/Components/CreateImageWizard/steps/Details/index.tsx b/src/Components/CreateImageWizard/steps/Details/index.tsx
index fa29419fc..5ef23cabe 100644
--- a/src/Components/CreateImageWizard/steps/Details/index.tsx
+++ b/src/Components/CreateImageWizard/steps/Details/index.tsx
@@ -19,7 +19,7 @@ import {
} from '../../../../store/wizardSlice';
import { useGenerateDefaultName } from '../../utilities/useGenerateDefaultName';
import { useDetailsValidation } from '../../utilities/useValidation';
-import { HookValidatedInput } from '../../ValidatedTextInput';
+import { HookValidatedInput } from '../../ValidatedInput';
const DetailsStep = () => {
const dispatch = useAppDispatch();
@@ -29,14 +29,14 @@ const DetailsStep = () => {
useGenerateDefaultName();
const handleNameChange = (
- _event: React.FormEvent,
+ _event: React.FormEvent,
name: string
) => {
dispatch(changeBlueprintName(name));
};
const handleDescriptionChange = (
- _event: React.FormEvent,
+ _event: React.FormEvent,
description: string
) => {
dispatch(changeBlueprintDescription(description));
diff --git a/src/Components/CreateImageWizard/steps/FileSystem/FileSystemTable.tsx b/src/Components/CreateImageWizard/steps/FileSystem/FileSystemTable.tsx
index b9dbfbfe5..0a5c4d4e6 100644
--- a/src/Components/CreateImageWizard/steps/FileSystem/FileSystemTable.tsx
+++ b/src/Components/CreateImageWizard/steps/FileSystem/FileSystemTable.tsx
@@ -33,7 +33,7 @@ import {
selectPartitions,
} from '../../../../store/wizardSlice';
import { useFilesystemValidation } from '../../utilities/useValidation';
-import { HookValidatedInput } from '../../ValidatedTextInput';
+import { HookValidatedInput } from '../../ValidatedInput';
export const FileSystemContext = React.createContext(true);
diff --git a/src/Components/CreateImageWizard/steps/Hostname/components/HostnameInput.tsx b/src/Components/CreateImageWizard/steps/Hostname/components/HostnameInput.tsx
index a7f9c7c92..381ec828e 100644
--- a/src/Components/CreateImageWizard/steps/Hostname/components/HostnameInput.tsx
+++ b/src/Components/CreateImageWizard/steps/Hostname/components/HostnameInput.tsx
@@ -8,7 +8,7 @@ import {
selectHostname,
} from '../../../../../store/wizardSlice';
import { useHostnameValidation } from '../../../utilities/useValidation';
-import { HookValidatedInput } from '../../../ValidatedTextInput';
+import { HookValidatedInput } from '../../../ValidatedInput';
const HostnameInput = () => {
const dispatch = useAppDispatch();
diff --git a/src/Components/CreateImageWizard/steps/TargetEnvironment/Aws/index.tsx b/src/Components/CreateImageWizard/steps/TargetEnvironment/Aws/index.tsx
index 7a1300d11..03750afd9 100644
--- a/src/Components/CreateImageWizard/steps/TargetEnvironment/Aws/index.tsx
+++ b/src/Components/CreateImageWizard/steps/TargetEnvironment/Aws/index.tsx
@@ -26,7 +26,7 @@ import {
selectAwsAccountId,
selectAwsShareMethod,
} from '../../../../../store/wizardSlice';
-import { ValidatedTextInput } from '../../../ValidatedTextInput';
+import { ValidatedInput } from '../../../ValidatedInput';
import { isAwsAccountIdValid } from '../../../validators';
export type AwsShareMethod = 'manual' | 'sources';
@@ -123,7 +123,7 @@ const Aws = () => {
{shareMethod === 'manual' && (
<>
- {
{shareMethod === 'manual' && (
<>
- {
- {
/>
- {
}
isRequired
>
- {
const dispatch = useAppDispatch();
const index = 0;
@@ -30,21 +30,21 @@ const UserInfo = () => {
const userIsAdministrator = useAppSelector(userIsAdministratorSelector);
const handleNameChange = (
- _e: React.FormEvent,
+ _e: React.FormEvent,
value: string
) => {
dispatch(setUserNameByIndex({ index: index, name: value }));
};
const handlePasswordChange = (
- _event: React.FormEvent,
+ _event: React.FormEvent,
value: string
) => {
dispatch(setUserPasswordByIndex({ index: index, password: value }));
};
const handleSshKeyChange = (
- _event: React.FormEvent,
+ _event: React.FormEvent,
value: string
) => {
dispatch(setUserSshKeyByIndex({ index: index, sshKey: value }));
@@ -85,6 +85,7 @@ const UserInfo = () => {