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

Enhance OpenStack provider help text fields #861

Merged

Conversation

sgratch
Copy link
Collaborator

@sgratch sgratch commented Jan 30, 2024

Reference: #646

Enhance and rephrase the help text fields and validations for following OpenStack dialogs:

  1. Create OpenStack provider.
  2. OpenStack Credentials view/edit modes.
  3. OpenStack details - URL field
  4. OpenStack details - URL icon help text

Changes include adding tooltips to skip ca cert field and supporting formatted help text.

Few Screenshots

image
Screenshot from 2024-01-30 13-32-59
Screenshot from 2024-01-30 13-33-34

Screenshot from 2024-01-30 13-33-52
image

@sgratch sgratch requested review from yaacov and rszwajko January 30, 2024 11:35
@sgratch
Copy link
Collaborator Author

sgratch commented Jan 30, 2024

cc:// @RichardHoch @anarnold97

Comment on lines 25 to 29
<Trans t={t} ns="plugin__forklift-console-plugin">
{
'Error: The format of the provided URL is invalid. Ensure the URL includes a scheme, a domain name, and a path. For example: <strong>https://identity_service.com:5000/v3</strong>.'
}
</Trans>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Trans t={t} ns="plugin__forklift-console-plugin">
{
'Error: The format of the provided URL is invalid. Ensure the URL includes a scheme, a domain name, and a path. For example: <strong>https://identity_service.com:5000/v3</strong>.'
}
</Trans>
<Trans t={t} ns="plugin__forklift-console-plugin">
Error: The format of the provided URL is invalid. Ensure the URL includes
a scheme, a domain name, and a path. For example:
<strong>https://identity_service.com:5000/v3</strong>.
</Trans>

@sgratch sgratch force-pushed the enhance-openstack-provider-help-text-fields branch 2 times, most recently from 0b0c102 to 10fd83c Compare January 30, 2024 18:02
@sgratch
Copy link
Collaborator Author

sgratch commented Jan 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

36.0% Duplication on New Code (required ≤ 20%)

See analysis details on SonarCloud

Regarding code duplication - this was the situation with the old code as well. We dup the code per authentication type. Do you want me to change that now?

@sgratch sgratch requested a review from yaacov January 30, 2024 18:11
),
validated: 'error',
};
const urlValidationHook: ValidationHookType = (value) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urlValidationHook is a validator, it should be implemented in the validations part of our project, please move it to currect directory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not added as part of this PR, I just added more logic to that method.
In addition, this validation method exists for all providers as part of the modal code (ocp, oVirt,vsphere), so better do that in a separate follow up PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"you touch it you own it", it was not in the right place before you added to it, and it's not in it's right place now. Since you added to it, can you move it to the currect place ?
p.s.
you will also need to rename to fit the validation methods naming convention

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with a folow up PR to fix in all places this method is used out of place

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 51 to 55
<Trans t={t} ns="plugin__forklift-console-plugin">
{
"Note: If 'Skip certificate validation' 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."
}
</Trans>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Trans t={t} ns="plugin__forklift-console-plugin">
{
"Note: If 'Skip certificate validation' 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."
}
</Trans>
<Trans t={t} ns="plugin__forklift-console-plugin">
Note: If 'Skip certificate validation' is selected, migrations from this provider will be insecure.<br />
<br />
Insecure migration means that the transferred data is sent over an insecure connection and potentially
sensitive data could be exposed.
</Trans>

? t('CA certificate - disabled when skip certificate validation is checked')
: t('CA certificate - leave empty to use system certificates')
? t(
"CA certificate - disabled and ignored when 'Skip certificate validation' is checked",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"CA certificate - disabled and ignored when 'Skip certificate validation' is checked",
"CA certificate - disabled when 'Skip certificate validation' is checked",

Comment on lines 44 to 47
<Trans t={t} ns="plugin__forklift-console-plugin">
{
'URL of the OpenStack Identity (Keystone) endpoint. For example: <strong>https://identity_service.com:5000/v3</strong>.'
}
</Trans>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Trans t={t} ns="plugin__forklift-console-plugin">
{
'URL of the OpenStack Identity (Keystone) endpoint. For example: <strong>https://identity_service.com:5000/v3</strong>.'
}
</Trans>
<Trans t={t} ns="plugin__forklift-console-plugin">
[ reactnode ]
</Trans>

can you replace all the places you send a string to Trans ?

Copy link
Collaborator Author

@sgratch sgratch Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few places left to replace for other providers as well. I'll fix it in a follow up PR, together with doc review fixes.

Reference: kubev2v#646

Enhance and rephrase the help text fields and validations for following OpenStack dialogs:

1. Create OpenStack provider.
2. OpenStack Credentials view/edit modes.
3. OpenStack details - URL field
4. OpenStack details - URL icon help text

Changes include supporting formatted help text.

Signed-off-by: Sharon Gratch <[email protected]>
@sgratch sgratch force-pushed the enhance-openstack-provider-help-text-fields branch from 10fd83c to c65e5a2 Compare January 30, 2024 19:38
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

36.2% Duplication on New Code (required ≤ 20%)

See analysis details on SonarCloud

@sgratch sgratch requested a review from yaacov January 30, 2024 19:45
@yaacov yaacov merged commit dc2b7ce into kubev2v:main Jan 30, 2024
6 of 7 checks passed
@sgratch sgratch deleted the enhance-openstack-provider-help-text-fields branch January 30, 2024 23:16
sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 30, 2024
…texts to Obj

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

A follow up for kubev2v#854 and kubev2v#861 that includes the following fixes:
1. Fix vSphere and oVirt help text fields and code comments, based on doc team review.
2. Replace all reminded <Trans> text appearances from String to React Obj.

Signed-off-by: Sharon Gratch <[email protected]>
sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 30, 2024
…texts to Obj

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

A follow up for kubev2v#854 and kubev2v#861 that includes the following fixes:
1. Fix vSphere and oVirt help text fields and code comments, based on doc team review.
2. Replace all reminded <Trans> text appearances from String to React Obj.

Signed-off-by: Sharon Gratch <[email protected]>
sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 31, 2024
…texts to Obj

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

A follow up for kubev2v#854 and kubev2v#861 that includes the following fixes:
1. Fix vSphere and oVirt help text fields and code comments, based on doc team review.
2. Replace all reminded <Trans> text appearances from String to React Obj.

Signed-off-by: Sharon Gratch <[email protected]>
sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 31, 2024
…texts to Obj

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

A follow up for kubev2v#854 and kubev2v#861 that includes the following fixes:
1. Fix vSphere and oVirt help text fields and code comments, based on doc team review.
2. Replace all reminded <Trans> text appearances from String to React Obj.

Signed-off-by: Sharon Gratch <[email protected]>

const cacertHelperTextMsgs = {
error: t(
'Error: The format of the provided CA Certificate is invalid. Ensure the CA certificate format is valid.',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First ooccurance: please change to "CA certificate"

),
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.',
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is system CA certificates supposed to be plural? [I don't know]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both works for me, it's one certificate per our provider, but the system may have more then one for other servers, so both singular and plural are ok with me.

Copy link
Collaborator Author

@sgratch sgratch Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change to a singular phrasing since the current text refers to the ca assigned to our provider:
"To use the system CA certificate, leave the field empty"

<Trans t={t} ns="plugin__forklift-console-plugin">
Note: If {"'"}Skip certificate validation{"'"} 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.
Copy link

@RichardHoch RichardHoch Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"not be secure[tags], meaning that the transferred data..."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not be secure => be inscure
when I talkd to people i say the connection is inscure, "the connnection is not secure" sounds strange to my ears

@@ -231,15 +282,13 @@ export const OpenstackCredentialsEdit: React.FC<EditComponentProps> = ({ secret,
<FormGroup
label={
insecureSkipVerify
? t('CA certificate - disabled when skip certificate validation is checked')
: t('CA certificate - leave empty to use system certificates')
? t("CA certificate - disabled when 'Skip certificate validation' is checked")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is selected"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichardHoch This is a Switch component for selecting the options, so I wonder which action is commonly used for a Switch clicking. I checked other documentations and saw that they use checked but I guess that select is ok as well....

? t('CA certificate - disabled when skip certificate validation is checked')
: t('CA certificate - leave empty to use system certificates')
? t("CA certificate - disabled when 'Skip certificate validation' is checked")
: t('CA certificate - leave empty to use system CA certificates')
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CA certificates or cetrtificate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I'll leave the plural phrasing...

)}
helperTextInvalid={t(
"Error: The format of the provided application credential name is invalid. Ensure the name doesn't include whitespace characters.",
)}
Copy link

@RichardHoch RichardHoch Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "spaces" instead of "whitespace characters" ? This is a "global" issue; I did not mark it every time. If I should mark every time, let me know.

)}
helperTextInvalid={t(
"Error: The format of the provided application credential Secret is invalid. Ensure the secret doesn't include whitespace characters.",
)}
Copy link

@RichardHoch RichardHoch Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be Secret in both places.

helperText={t('A user name 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.",
)}
Copy link

@RichardHoch RichardHoch Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either "user name" or "username" is OK -- but please use the same for the UI and the messages, Help texts, etc.

? t(
"CA certificate - disabled and ignored when 'Skip certificate validation' is checked",
)
? t("CA certificate - disabled when 'Skip certificate validation' is checked")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is selected"

? t(
"CA certificate - disabled and ignored when 'Skip certificate validation' is checked",
)
? t("CA certificate - disabled when 'Skip certificate validation' is checked")
: t('CA certificate - leave empty to use system CA certificates')
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

certificates or certificate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I'll leave the plural phrasing...

insecureSkipVerify: {
label: t('Skip certificate validation'),
description: t("If true, the provider's REST API TLS certificate won't be validated."),
description: t(
"If true (check box is checked), the provider's CA certificate won't be validated.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(check box is selected)

},
cacert: {
label: t('CA certificate'),
description: t(
'Custom certification used to verify the OpenStack REST API server, when empty use system certificate.',
'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.',
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systen CA certifucates or certificate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to a singular phrasing

description: t("If true, the provider's REST API TLS certificate won't be validated."),
description: t(
"If true (check box is checked), the provider's CA certificate won't be validated.",
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is selected

helperTextPopover: (
<Trans t={t} ns="plugin__forklift-console-plugin">
Note: If this field is checked/true, the migration from this provider will be insecure.
{'<br><br>'} Insecure migration means that the transferred data is sent over an insecure

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 'Note' above

insecureSkipVerify: {
label: t('Skip certificate validation'),
description: t("If true, the provider's REST API TLS certificate won't be validated."),
description: t(
"If true (check box is checked), the provider's CA certificate won't be validated.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 128-134: See examples above.

description: t("If true, the provider's REST API TLS certificate won't be validated."),
description: t(
"If true (check box is checked), the provider's CA certificate won't be validated.",
),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same...

insecureSkipVerify: {
label: t('Skip certificate validation'),
description: t("If true, the provider's REST API TLS certificate won't be validated."),
description: t(
"If true (check box is checked), the provider's CA certificate won't be validated.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above...

sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 31, 2024
…texts to Obj

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

A follow up for kubev2v#854 and kubev2v#861 that includes the following fixes:
1. Fix vSphere and oVirt help text fields and code comments, based on doc team review.
2. Replace all reminded <Trans> text appearances from String to React Obj.

Signed-off-by: Sharon Gratch <[email protected]>
sgratch added a commit to sgratch/forklift-console-plugin that referenced this pull request Jan 31, 2024
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants