Skip to content

Commit

Permalink
Fix more help text fields, based on doc team review for the OpenStack…
Browse files Browse the repository at this point in the history
… provider

Reference: kubev2v#646
Reference: kubev2v#861 (comment)

Fix all comments mentioned by the doc team in
kubev2v#861 and applied
it to all relevant providers.

Signed-off-by: Sharon Gratch <[email protected]>
  • Loading branch information
sgratch committed Jan 31, 2024
1 parent 4e1f873 commit d48de3b
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 125 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { ProviderType, V1beta1Provider, V1Secret } from '@kubev2v/types';
import { Flex, FlexItem, Form, FormGroup, TextInput } from '@patternfly/react-core';

import { EditProvider } from './EditProvider';
import { providerCardItems } from './providerCardItems';
import { EditProviderSectionHeading } from './EditProviderSectionHeading';
import { providerCardItems } from './providerCardItems';
export interface ProvidersCreateFormProps {
newProvider: V1beta1Provider;
newSecret: V1Secret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ export const OpenstackCredentialsEdit: React.FC<EditComponentProps> = ({ secret,

const cacertHelperTextMsgs = {
error: t(
'Error: The format of the provided CA Certificate is invalid. Ensure the CA certificate format is valid.',
'Error: The format of the provided CA certificate is invalid. Ensure the CA certificate format is valid.',
),
success: t(
'A CA certificate to be trusted when connecting to the OpenStack Identity (Keystone) endpoint. Ensure the CA certificate format is valid. To use a CA certificate, drag the file to the text box or browse for it. To use the system CA certificates, leave the field empty.',
'A CA certificate to be trusted when connecting to the OpenStack Identity (Keystone) endpoint. Ensure the CA certificate format is valid. To use a CA certificate, drag the file to the text box or browse for it. To use the system CA certificate, leave the field empty.',
),
};

const insecureSkipVerifyHelperTextPopover = (
<Trans t={t} ns="plugin__forklift-console-plugin">
Note: If <strong>Skip certificate validation</strong> is selected, migrations from this
provider will not be secure.
<br />
<br />
Insecure migration means that the transferred data is sent over an insecure connection and
potentially sensitive data could be exposed.
provider will not be secure, meaning that the transferred data is sent over an insecure
connection and potentially sensitive data could be exposed.
</Trans>
);

Expand Down Expand Up @@ -285,7 +282,7 @@ export const OpenstackCredentialsEdit: React.FC<EditComponentProps> = ({ secret,
<FormGroup
label={
insecureSkipVerify
? t("CA certificate - disabled when 'Skip certificate validation' is checked")
? t("CA certificate - disabled when 'Skip certificate validation' is selected")
: t('CA certificate - leave empty to use system CA certificates')
}
fieldId="cacert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
'OpenStack application credential name needed for application credential authentication.',
)}
helperTextInvalid={t(
"Error: The format of the provided application credential name is invalid. Ensure the name doesn't include whitespace characters.",
'Error: The format of the provided application credential name is invalid. Ensure the name does not include spaces.',
)}
validated={state.validation.applicationCredentialName}
>
Expand All @@ -108,7 +108,7 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
'OpenStack application credential Secret needed for the application credential authentication.',
)}
helperTextInvalid={t(
"Error: The format of the provided application credential secret is invalid. Ensure the secret doesn't include whitespace characters.",
'Error: The format of the provided application credential Secret is invalid. Ensure the Secret does not include spaces.',
)}
validated={state.validation.applicationCredentialSecret}
>
Expand All @@ -135,9 +135,9 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
label={t('Username')}
isRequired
fieldId="username"
helperText={t('A user name for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperText={t('A username for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperTextInvalid={t(
"Error: The format of the provided user name is invalid. Ensure the user name doesn't include whitespace characters.",
'Error: The format of the provided username is invalid. Ensure the username does not include spaces.',
)}
validated={state.validation.username}
>
Expand All @@ -158,7 +158,7 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
fieldId="regionName"
helperText={t('OpenStack region name.')}
helperTextInvalid={t(
"Error: The format of the provided region name is invalid. Ensure the region name doesn't include whitespace characters.",
'Error: The format of the provided region name is invalid. Ensure the region name does not include spaces.',
)}
validated={state.validation.regionName}
>
Expand All @@ -179,7 +179,7 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
fieldId="projectName"
helperText={t('OpenStack project name.')}
helperTextInvalid={t(
"Error: The format of the provided project name is invalid. Ensure the project name doesn't include whitespace characters.",
'Error: The format of the provided project name is invalid. Ensure the project name does not include spaces.',
)}
validated={state.validation.projectName}
>
Expand All @@ -200,7 +200,7 @@ export const ApplicationCredentialNameSecretFieldsFormGroup: React.FC<EditCompon
fieldId="domainName"
helperText={t('OpenStack domain name.')}
helperTextInvalid={t(
"Error: The format of the provided domain name is invalid. Ensure the domain name doesn't include whitespace characters.",
'Error: The format of the provided domain name is invalid. Ensure the domain name does not include spaces.',
)}
validated={state.validation.domainName}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ApplicationWithCredentialsIDFormGroup: React.FC<EditComponentProps>
'OpenStack application credential ID needed for the application credential authentication.',
)}
helperTextInvalid={t(
"Error: The format of the provided application credential ID is invalid. Ensure the ID doesn't include whitespace characters.",
'Error: The format of the provided application credential ID is invalid. Ensure the ID does not include spaces.',
)}
validated={state.validation.applicationCredentialID}
>
Expand All @@ -97,14 +97,14 @@ export const ApplicationWithCredentialsIDFormGroup: React.FC<EditComponentProps>
</FormGroup>

<FormGroup
label={t('Application credential secret')}
label={t('Application credential Secret')}
isRequired
fieldId="applicationCredentialSecret"
helperText={t(
'OpenStack application credential Secret needed for the application credential authentication.',
)}
helperTextInvalid={t(
"Error: The format of the provided application credential secret is invalid. Ensure the secret doesn't include whitespace characters.",
'Error: The format of the provided application credential Secret is invalid. Ensure the Secret does not include spaces.',
)}
validated={state.validation.applicationCredentialSecret}
>
Expand Down Expand Up @@ -133,7 +133,7 @@ export const ApplicationWithCredentialsIDFormGroup: React.FC<EditComponentProps>
fieldId="regionName"
helperText={t('OpenStack region name.')}
helperTextInvalid={t(
"Error: The format of the provided region name is invalid. Ensure the region name doesn't include whitespace characters.",
'Error: The format of the provided region name is invalid. Ensure the region name does not include spaces.',
)}
validated={state.validation.regionName}
>
Expand All @@ -154,7 +154,7 @@ export const ApplicationWithCredentialsIDFormGroup: React.FC<EditComponentProps>
fieldId="projectName"
helperText={t('OpenStack project name.')}
helperTextInvalid={t(
"Error: The format of the provided project name is invalid. Ensure the project name doesn't include whitespace characters.",
'Error: The format of the provided project name is invalid. Ensure the project name does not include spaces.',
)}
validated={state.validation.projectName}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export const PasswordSecretFieldsFormGroup: React.FC<EditComponentProps> = ({
label={t('Username')}
isRequired
fieldId="username"
helperText={t('A user name for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperText={t('A username for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperTextInvalid={t(
"Error: The format of the provided user name is invalid. Ensure the user name doesn't include whitespace characters.",
'Error: The format of the provided username is invalid. Ensure the username does not include spaces.',
)}
validated={state.validation.username}
>
Expand All @@ -102,7 +102,7 @@ export const PasswordSecretFieldsFormGroup: React.FC<EditComponentProps> = ({
'A user password for connecting to the OpenStack Identity (Keystone) endpoint.',
)}
helperTextInvalid={t(
"Error: The format of the provided user password is invalid. Ensure the user password doesn't include whitespace characters.",
'Error: The format of the provided user password is invalid. Ensure the user password does not include spaces.',
)}
validated={state.validation.password}
>
Expand Down Expand Up @@ -130,7 +130,7 @@ export const PasswordSecretFieldsFormGroup: React.FC<EditComponentProps> = ({
fieldId="regionName"
helperText={t('OpenStack region name.')}
helperTextInvalid={t(
"Error: The format of the provided region name is invalid. Ensure the region name doesn't include whitespace characters.",
'Error: The format of the provided region name is invalid. Ensure the region name does not include spaces.',
)}
validated={state.validation.regionName}
>
Expand All @@ -151,7 +151,7 @@ export const PasswordSecretFieldsFormGroup: React.FC<EditComponentProps> = ({
fieldId="projectName"
helperText={t('OpenStack project name.')}
helperTextInvalid={t(
"Error: The format of the provided project name is invalid. Ensure the project name doesn't include whitespace characters.",
'Error: The format of the provided project name is invalid. Ensure the project name does not include spaces.',
)}
validated={state.validation.projectName}
>
Expand All @@ -172,7 +172,7 @@ export const PasswordSecretFieldsFormGroup: React.FC<EditComponentProps> = ({
fieldId="domainName"
helperText={t('OpenStack domain name.')}
helperTextInvalid={t(
"Error: The format of the provided domain name is invalid. Ensure the domain name doesn't include whitespace characters.",
'Error: The format of the provided domain name is invalid. Ensure the domain name does not include spaces.',
)}
validated={state.validation.domainName}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const TokenWithUserIDSecretFieldsFormGroup: React.FC<EditComponentProps>
fieldId="token"
helperText={t('OpenStack token for authentication using a user ID.')}
helperTextInvalid={t(
"Error: The format of the provided token is invalid. Ensure the token doesn't include whitespace characters.",
'Error: The format of the provided token is invalid. Ensure the token does not include spaces.',
)}
validated={state.validation.token}
>
Expand Down Expand Up @@ -105,7 +105,7 @@ export const TokenWithUserIDSecretFieldsFormGroup: React.FC<EditComponentProps>
fieldId="userID"
helperText={t('A user ID for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperTextInvalid={t(
"Error: The format of the provided user ID is invalid. Ensure the user ID doesn't include whitespace characters.",
'Error: The format of the provided user ID is invalid. Ensure the user ID does not include spaces.',
)}
validated={state.validation.userID}
>
Expand All @@ -126,7 +126,7 @@ export const TokenWithUserIDSecretFieldsFormGroup: React.FC<EditComponentProps>
fieldId="projectID"
helperText={t('OpenStack project ID.')}
helperTextInvalid={t(
"Error: The format of the provided project ID is invalid. Ensure the project ID doesn't include whitespace characters.",
'Error: The format of the provided project ID is invalid. Ensure the project ID does not include spaces.',
)}
validated={state.validation.projectID}
>
Expand All @@ -147,7 +147,7 @@ export const TokenWithUserIDSecretFieldsFormGroup: React.FC<EditComponentProps>
fieldId="regionName"
helperText={t('OpenStack region name.')}
helperTextInvalid={t(
"Error: The format of the provided region name is invalid. Ensure the region name doesn't include whitespace characters.",
'Error: The format of the provided region name is invalid. Ensure the region name does not include spaces.',
)}
validated={state.validation.regionName}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const TokenWithUsernameSecretFieldsFormGroup: React.FC<EditComponentProps
fieldId="token"
helperText={t('OpenStack token for authentication using a user name.')}
helperTextInvalid={t(
"Error: The format of the provided token is invalid. Ensure the token doesn't include whitespace characters.",
'Error: The format of the provided token is invalid. Ensure the token does not include spaces.',
)}
validated={state.validation.token}
>
Expand All @@ -105,9 +105,9 @@ export const TokenWithUsernameSecretFieldsFormGroup: React.FC<EditComponentProps
label={t('Username')}
isRequired
fieldId="username"
helperText={t('A user name for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperText={t('A username for connecting to the OpenStack Identity (Keystone) endpoint.')}
helperTextInvalid={t(
"Error: The format of the provided user name is invalid. Ensure the user name doesn't include whitespace characters.",
'Error: The format of the provided username is invalid. Ensure the username does not include spaces.',
)}
validated={state.validation.username}
>
Expand All @@ -128,7 +128,7 @@ export const TokenWithUsernameSecretFieldsFormGroup: React.FC<EditComponentProps
fieldId="regionName"
helperText={t('OpenStack region name.')}
helperTextInvalid={t(
"Error: The format of the provided region name is invalid. Ensure the region name doesn't include whitespace characters.",
'Error: The format of the provided region name is invalid. Ensure the region name does not include spaces.',
)}
validated={state.validation.regionName}
>
Expand All @@ -149,7 +149,7 @@ export const TokenWithUsernameSecretFieldsFormGroup: React.FC<EditComponentProps
fieldId="projectName"
helperText={t('OpenStack project name.')}
helperTextInvalid={t(
"Error: The format of the provided project name is invalid. Ensure the project name doesn't include whitespace characters.",
'Error: The format of the provided project name is invalid. Ensure the project name does not include spaces.',
)}
validated={state.validation.projectName}
>
Expand All @@ -170,7 +170,7 @@ export const TokenWithUsernameSecretFieldsFormGroup: React.FC<EditComponentProps
fieldId="domainName"
helperText={t('OpenStack domain name.')}
helperTextInvalid={t(
"Error: The format of the provided domain name is invalid. Ensure the domain name doesn't include whitespace characters.",
'Error: The format of the provided domain name is invalid. Ensure the domain name does not include spaces.',
)}
validated={state.validation.domainName}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ export const OvirtCredentialsEdit: React.FC<EditComponentProps> = ({ secret, onC

const usernameHelperTextMsgs = {
error: t(
'Error: The format of the provided user name is invalid. Ensure the user name does not include whitespace characters.',
'Error: The format of the provided username is invalid. Ensure the username does not include spaces.',
),
warning: t(
'Warning: The provided user name does not include the user domain. Ensure the user name is in the format of username@user-domain. For example: admin@internal.',
'Warning: The provided username does not include the user domain. Ensure the username is in the format of username@user-domain. For example: admin@internal.',
),
success: t(
'A user name for connecting to the Red Hat Virtualization Manager (RHVM) API endpoint. Ensure the user name is in the format of username@user-domain. For example: admin@internal.',
'A username for connecting to the Red Hat Virtualization Manager (RHVM) API endpoint. Ensure the username is in the format of username@user-domain. For example: admin@internal.',
),
};

const passwordHelperTextMsgs = {
error: t(
'Error: The format of the provided user password is invalid. Ensure the user password does not include whitespace characters.',
'Error: The format of the provided user password is invalid. Ensure the user password does not include spaces.',
),
success: t(
'A user password for connecting to the Red Hat Virtualization Manager (RHVM) API endpoint.',
Expand All @@ -62,20 +62,18 @@ export const OvirtCredentialsEdit: React.FC<EditComponentProps> = ({ secret, onC

const cacertHelperTextMsgs = {
error: t(
'Error: The format of the provided CA Certificate is invalid. Ensure the CA certificate format is in a PEM encoded X.509 format.',
'Error: The format of the provided CA certificate is invalid. Ensure the CA certificate format is in a PEM encoded X.509 format.',
),
success: t(
'A CA certificate to be trusted when connecting to the Red Hat Virtualization Manager (RHVM) API endpoint. Ensure the CA certificate format is in a PEM encoded X.509 format. To use a CA certificate, drag the file to the text box or browse for it. To use the system CA certificates, leave the field empty.',
'A CA certificate to be trusted when connecting to the Red Hat Virtualization Manager (RHVM) API endpoint. Ensure the CA certificate format is in a PEM encoded X.509 format. To use a CA certificate, drag the file to the text box or browse for it. To use the system CA certificate, leave the field empty.',
),
};

const insecureSkipVerifyHelperTextPopover = (
<Trans t={t} ns="plugin__forklift-console-plugin">
Note: If <strong>Skip certificate validation</strong> is selected, migrations from this
provider will not be secure.
<br />
<br /> Insecure migration means that the transferred data is sent over an insecure connection
and potentially sensitive data could be exposed.
provider will not be secure, meaning that the transferred data is sent over an insecure
connection and potentially sensitive data could be exposed.
</Trans>
);

Expand Down Expand Up @@ -251,7 +249,7 @@ export const OvirtCredentialsEdit: React.FC<EditComponentProps> = ({ secret, onC
<FormGroup
label={
insecureSkipVerify
? t("CA certificate - disabled when 'Skip certificate validation' is checked")
? t("CA certificate - disabled when 'Skip certificate validation' is selected")
: t('CA certificate - leave empty to use system CA certificates')
}
labelIcon={
Expand Down
Loading

0 comments on commit d48de3b

Please sign in to comment.