From 671dffa5873adfc263a575341e5949a9debd5e72 Mon Sep 17 00:00:00 2001 From: Sharon Gratch Date: Mon, 7 Oct 2024 11:47:03 +0300 Subject: [PATCH] Wrap all password/token fields (with hidden content option) with InputGroup item. Reference: https://issues.redhat.com/browse/MTV-1572 After migrating to Patternfly 5, all the password/token fields in all forms that include the 'hidden content button' field, were splitted into 2 lines. The button was pushed to next line. For fixing, need to wrap the field's entries with the InputGroup item. Signed-off-by: Sharon Gratch --- .../components/edit/EsxiCredentialsEdit.tsx | 46 +++++++++++-------- .../edit/OpenshiftCredentialsEdit.tsx | 46 +++++++++++-------- ...ionCredentialNameSecretFieldsFormGroup.tsx | 40 ++++++++-------- .../ApplicationWithCredentialsIDFormGroup.tsx | 40 ++++++++-------- .../PasswordSecretFieldsFormGroup.tsx | 38 +++++++-------- .../TokenWithUserIDSecretFieldsFormGroup.tsx | 40 ++++++++-------- ...TokenWithUsernameSecretFieldsFormGroup.tsx | 40 ++++++++-------- .../components/edit/OvirtCredentialsEdit.tsx | 46 +++++++++++-------- .../edit/VCenterCredentialsEdit.tsx | 46 +++++++++++-------- .../tabs/Hosts/modals/VSphereNetworkModal.tsx | 29 ++++++------ 10 files changed, 232 insertions(+), 179 deletions(-) diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/EsxiCredentialsEdit.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/EsxiCredentialsEdit.tsx index 672e27813..326325ae2 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/EsxiCredentialsEdit.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/EsxiCredentialsEdit.tsx @@ -5,7 +5,15 @@ import { CertificateUpload } from 'src/modules/Providers/utils/components/Certif import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n'; import { FormGroupWithHelpText } from '@kubev2v/common'; -import { Button, Divider, Form, Popover, Switch, TextInput } from '@patternfly/react-core'; +import { + Button, + Divider, + Form, + InputGroup, + Popover, + Switch, + TextInput, +} from '@patternfly/react-core'; import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon'; import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon'; import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon'; @@ -158,23 +166,25 @@ export const EsxiCredentialsEdit: React.FC = ({ secret, onCh helperTextInvalid={state.validation.password.msg} validated={state.validation.password.type} > - onChangePassword(v, e)} - value={password} - validated={state.validation.password.type} - /> - + + onChangePassword(v, e)} + value={password} + validated={state.validation.password.type} + /> + + diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenshiftCredentialsEdit.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenshiftCredentialsEdit.tsx index 953f76b73..a4331e724 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenshiftCredentialsEdit.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenshiftCredentialsEdit.tsx @@ -5,7 +5,15 @@ import { CertificateUpload } from 'src/modules/Providers/utils/components/Certif import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n'; import { FormGroupWithHelpText } from '@kubev2v/common'; -import { Button, Divider, Form, Popover, Switch, TextInput } from '@patternfly/react-core'; +import { + Button, + Divider, + Form, + InputGroup, + Popover, + Switch, + TextInput, +} from '@patternfly/react-core'; import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon'; import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon'; import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon'; @@ -133,23 +141,25 @@ export const OpenshiftCredentialsEdit: React.FC = ({ secret, helperTextInvalid={state.validation.token.msg} validated={state.validation.token.type} > - onChangeToken(v, e)} - value={token} - validated={state.validation.token.type} - /> - + + onChangeToken(v, e)} + value={token} + validated={state.validation.token.type} + /> + + diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenstackCredentialsEditFormGroups/ApplicationCredentialNameSecretFieldsFormGroup.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenstackCredentialsEditFormGroups/ApplicationCredentialNameSecretFieldsFormGroup.tsx index 224015a02..6c669ab8a 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenstackCredentialsEditFormGroups/ApplicationCredentialNameSecretFieldsFormGroup.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/OpenstackCredentialsEditFormGroups/ApplicationCredentialNameSecretFieldsFormGroup.tsx @@ -4,7 +4,7 @@ import { openstackSecretFieldValidator, safeBase64Decode } from 'src/modules/Pro import { useForkliftTranslation } from 'src/utils/i18n'; import { FormGroupWithHelpText } from '@kubev2v/common'; -import { Button, TextInput } from '@patternfly/react-core'; +import { Button, InputGroup, TextInput } from '@patternfly/react-core'; import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon'; import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon'; @@ -113,24 +113,26 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC - onChangeFactory('applicationCredentialSecret')(v, e)} - validated={state.validation.applicationCredentialSecret.type} - /> - + + onChangeFactory('applicationCredentialSecret')(v, e)} + validated={state.validation.applicationCredentialSecret.type} + /> + + helperTextInvalid={state.validation.applicationCredentialSecret.msg} validated={state.validation.applicationCredentialSecret.type} > - onChangeFactory('applicationCredentialSecret')(v, e)} - validated={state.validation.applicationCredentialSecret.type} - /> - + + onChangeFactory('applicationCredentialSecret')(v, e)} + validated={state.validation.applicationCredentialSecret.type} + /> + + = ({ helperTextInvalid={state.validation.password.msg} validated={state.validation.password.type} > - onChangeFactory('password')(v, e)} - validated={state.validation.password.type} - /> - + + onChangeFactory('password')(v, e)} + validated={state.validation.password.type} + /> + + helperTextInvalid={state.validation.token.msg} validated={state.validation.token.type} > - onChangeFactory('token')(v, e)} - validated={state.validation.token.type} - /> - + + onChangeFactory('token')(v, e)} + validated={state.validation.token.type} + /> + + - onChangeFactory('token')(v, e)} - validated={state.validation.token.type} - /> - + + onChangeFactory('token')(v, e)} + validated={state.validation.token.type} + /> + + = ({ secret, onC helperTextInvalid={state.validation.password.msg} validated={state.validation.password.type} > - onChangePassword(v, e)} - /> - + + onChangePassword(v, e)} + /> + + diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/VCenterCredentialsEdit.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/VCenterCredentialsEdit.tsx index e9d00d76b..00bf93eb4 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/VCenterCredentialsEdit.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/components/CredentialsSection/components/edit/VCenterCredentialsEdit.tsx @@ -5,7 +5,15 @@ import { CertificateUpload } from 'src/modules/Providers/utils/components/Certif import { ForkliftTrans, useForkliftTranslation } from 'src/utils/i18n'; import { FormGroupWithHelpText } from '@kubev2v/common'; -import { Button, Divider, Form, Popover, Switch, TextInput } from '@patternfly/react-core'; +import { + Button, + Divider, + Form, + InputGroup, + Popover, + Switch, + TextInput, +} from '@patternfly/react-core'; import EyeIcon from '@patternfly/react-icons/dist/esm/icons/eye-icon'; import EyeSlashIcon from '@patternfly/react-icons/dist/esm/icons/eye-slash-icon'; import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon'; @@ -152,23 +160,25 @@ export const VCenterCredentialsEdit: React.FC = ({ secret, o helperTextInvalid={state.validation.password.msg} validated={state.validation.password.type} > - onChangePassword(v, e)} - value={password} - validated={state.validation.password.type} - /> - + + onChangePassword(v, e)} + value={password} + validated={state.validation.password.type} + /> + + diff --git a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/modals/VSphereNetworkModal.tsx b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/modals/VSphereNetworkModal.tsx index 26fc32922..2e1aa6dda 100644 --- a/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/modals/VSphereNetworkModal.tsx +++ b/packages/forklift-console-plugin/src/modules/Providers/views/details/tabs/Hosts/modals/VSphereNetworkModal.tsx @@ -11,6 +11,7 @@ import { Form, HelperText, HelperTextItem, + InputGroup, Modal, ModalVariant, Text, @@ -270,19 +271,21 @@ export const VSphereNetworkModal: React.FC = ({ helperTextInvalid={t('Invalid password')} validated={state.validation.password} > - onChangePassword(v, e)} - validated={state.validation.password} - /> - + + onChangePassword(v, e)} + validated={state.validation.password} + /> + + )}