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

CNV-29444: Feature guide user to pipelines #1911

Conversation

pcbailey
Copy link
Member

@pcbailey pcbailey commented Apr 30, 2024

📝 Description

This PR adds elements to guide users to use pipelines for bootable volume creation.

Jira: https://issues.redhat.com/browse/CNV-29444

🎥 Screenshots

pipelines-title-popover--2024-05-02_09-25

pipelines-empty-state--2024-05-02_09-25

pipelines-windows--2024-05-02_09-22

pipelines-rhel--2024-05-02_09-24

pipelines-windows-and-rhel--2024-05-02_09-23

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Apr 30, 2024

@pcbailey: This pull request references CNV-29444 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target either version "4.16." or "openshift-4.16.", but it targets "CNV v4.16.0" instead.

In response to this:

📝 Description

Jira: https://issues.redhat.com/browse/CNV-29444

🎥 Demo

Coming soon

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Apr 30, 2024
@pcbailey pcbailey force-pushed the feature-guide-user-to-pipelines branch from 19400f9 to 411ab57 Compare May 1, 2024 14:04
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented May 2, 2024

@pcbailey: This pull request references CNV-29444 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target either version "4.16." or "openshift-4.16.", but it targets "CNV v4.16.0" instead.

In response to this:

📝 Description

This PR adds elements to guide users to use pipelines for bootable volume creation.

Jira: https://issues.redhat.com/browse/CNV-29444

🎥 Screenshots

pipelines-title-popover--2024-05-02_09-25

pipelines-empty-state--2024-05-02_09-25

pipelines-windows--2024-05-02_09-22

pipelines-rhel--2024-05-02_09-24

pipelines-windows-and-rhel--2024-05-02_09-23

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pcbailey pcbailey changed the title WIP: CNV-29444: Feature guide user to pipelines CNV-29444: Feature guide user to pipelines May 2, 2024
@pcbailey pcbailey changed the title CNV-29444: Feature guide user to pipelines WIP: CNV-29444: Feature guide user to pipelines May 2, 2024
@pcbailey pcbailey force-pushed the feature-guide-user-to-pipelines branch from 411ab57 to cefe22d Compare May 2, 2024 18:46
@pcbailey pcbailey changed the title WIP: CNV-29444: Feature guide user to pipelines CNV-29444: Feature guide user to pipelines May 2, 2024
import { getDisabledQuickStarts, QuickStart } from '@patternfly/quickstarts';

const useQuickStarts = (filterDisabledQuickStarts = true): WatchK8sResult<QuickStart[]> => {
const preferredLanguage = useTranslation().i18n.language;
Copy link
Member

@metalice metalice May 3, 2024

Choose a reason for hiding this comment

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

its nicer to deconstruct on left side then the right when using hooks

Copy link
Member Author

@pcbailey pcbailey May 3, 2024

Choose a reason for hiding this comment

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

I'm not sure what you mean. Could you explain a bit more and explain why?

Also, the code in this file is from console. I copied it over in my attempt to get quick starts working. If we end up having to use it I'll clean it up.


if (filterDisabledQuickStarts) {
const disabledQuickStarts = getDisabledQuickStarts();
disabledQuickStarts.forEach((quickStartName) => delete groupedQuickStarts[quickStartName]);
Copy link
Member

Choose a reason for hiding this comment

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

instead of delete and modifing the obj u can filter and get a new obj. from running on one obj u modify a different obj. better to work on groupedQuickStarts and filter on it

).toUpperCase();

if (quickStartLanguage === preferredLanguage && quickStartCountry === preferredCountry) {
return quickStart;
Copy link
Member

Choose a reason for hiding this comment

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

here u are returning the first match, and all other checks u are returning the last match?

Copy link
Member Author

Choose a reason for hiding this comment

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

This code is also from console. I'll clean it up as well if we end up using it.

Comment on lines +65 to +81
if (quickStartLanguage === preferredLanguage) {
if (!quickStartCountry && !sameLanguageWithoutCountry) {
sameLanguageWithoutCountry = quickStart;
} else if (quickStartCountry && !sameLanguageWithAnyCountry) {
sameLanguageWithAnyCountry = quickStart;
}
}
if (quickStartLanguage === 'en') {
if (quickStartCountry === preferredCountry && !fallbackLanguageSameCountry) {
fallbackLanguageSameCountry = quickStart;
} else if (!quickStartCountry && !fallbackLanguageNoCountry) {
fallbackLanguageNoCountry = quickStart;
} else if (!fallbackLanguageAnyCountry) {
fallbackLanguageAnyCountry = quickStart;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Please consider changing the mechanism to a more readable one, this if, if else if isn't something we usually do.

Comment on lines +64 to +70
<div className="bootable-volumes-pipelines-hint">
<img alt="os-icon" className="bootable-volumes-pipelines-hint__icon" src={rhelIcon} />
<Trans ns="plugin__kubevirt-plugin" t={t}>
Interested in using a <b>RHEL Bootable Volume</b>? Click{' '}
<AddBootableVolumeLink loadError={loadError} /> to get started.
</Trans>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

there is a lot of repeative code here , in the 3 return statements, can create a new component that take a some props and create this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly. They're not exactly alike though and the main changes are all in the Trans block. I'll take a look and see if I can come up with something worth using.

@metalice
Copy link
Member

metalice commented May 3, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label May 3, 2024
Copy link
Contributor

openshift-ci bot commented May 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: metalice, pcbailey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 18ef0d8 into kubevirt-ui:main May 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This issue is something we want to fix jira/valid-reference lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants