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

Remove extra buttons to create VM or MigrationPolicy #1237

Merged

Conversation

hstastna
Copy link

@hstastna hstastna commented Apr 5, 2023

📝 Description

This is a followup PR for the comment:
#1234 (comment)

Don't display the unnecessary buttons to create VirtualMachine or MigrationPolicy in the empty state pages (no resources present), as there is the button to create the appropriate resource present also in the center of the page, which is the default for Patternfly empty state. Make this change according to the UX suggestions.

Create new MigrationPoliciesCreateButton component to be used where needed.
Update MigrationPoliciesEmptyState component: use preferred ExternalLink component instead of a in there.

Also remove unnecessary pagination for VM's empty state page, as it doesn't make sense for this case.

🎥 Screenshots

Before:
MigrationPolicies empty state - 2 buttons to create the resource present in the page (and no options to create a policy from in the middle button):
mm_before
VirtualMachines empty state - 2 buttons to create the resource present in the page (and no options to create a VM from in the middle button):
vm_before

After:
MigrationPolicies empty state - only 1 button to create the resource present in the page (together w all the options to create a policy from):
mig_after
VirtualMachines empty state - only 1 button to create the resource present in the page (plus options to create a VM from present in the middle button):
vm-after


TODO:

  • figure out what to do with the fact, that the button in the center of the page contains only one option to create the resource, comparing to the removed button from upper right of the page, ask the UX about that - done, missing options added to the buttons for empty states
  • remove unnecessary pagination for VM's empty state

@openshift-ci openshift-ci bot added the approved This issue is something we want to fix label Apr 5, 2023
@hstastna hstastna changed the title Remove extra buttons to create VM or MigrationPolicy [WIP] Remove extra buttons to create VM or MigrationPolicy Apr 5, 2023
@hstastna hstastna force-pushed the Remove_extra_button_to_create_resource branch 5 times, most recently from 9d82bca to 13a34f8 Compare April 13, 2023 13:22
@hstastna hstastna changed the title [WIP] Remove extra buttons to create VM or MigrationPolicy Remove extra buttons to create VM or MigrationPolicy Apr 13, 2023
@hstastna
Copy link
Author

@avivtur @metalice @pcbailey @upalatucci @vojtechszocs please review

Copy link
Member

@avivtur avivtur left a comment

Choose a reason for hiding this comment

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

This looks nice, added some suggestions :)


type VirtualMachinesCreateButtonProps = {
namespace: string;
buttonText?: string;
Copy link
Member

Choose a reason for hiding this comment

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

I think it's best to remove this prop and label the button to be simply "Create", the context should be clear as we are on the VM list page, wdyt?

Copy link
Author

@hstastna hstastna Apr 13, 2023

Choose a reason for hiding this comment

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

For such decisions, we have the UX folks. I just wanted to keep the original naming of the buttons in specific situations (such as presence of some VMs vs. no VMs at all) in this PR.

We have many inconsistencies across the whole UI like this for example, and it is not so straightforward to solve them, so I totally understand this wasn't improved yet by the UX. Actually, Yifat is overwhelmed by many questions from me, regarding such issues in our UI, and she's working on them one by one, it takes time...

src/utils/components/ExternalLink/ExternalLink.tsx Outdated Show resolved Hide resolved
src/utils/components/ExternalLink/ExternalLink.tsx Outdated Show resolved Hide resolved
@hstastna hstastna force-pushed the Remove_extra_button_to_create_resource branch from 13a34f8 to 5234c3c Compare April 13, 2023 17:37
@hstastna hstastna requested a review from avivtur April 13, 2023 17:38
@hstastna
Copy link
Author

/retest

href={href}
target="_blank"
rel="noopener noreferrer"
data-test-id={dataTestID}
{...(stopPropagation ? { onClick: (e) => e.stopPropagation() } : {})}
>
{children || text}
{children || text} <ExternalLinkAltIcon />
Copy link
Member

Choose a reason for hiding this comment

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

This is a generic file we are using across our app does everything looks the same after the change?
co-external-link === ExternalLinkAltIcon , from an appearance perspective?

Copy link
Author

Choose a reason for hiding this comment

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

With this change, the icon has finally the correct size, and everywhere. It was too small and everywhere, according to the designs we have.

@hstastna hstastna force-pushed the Remove_extra_button_to_create_resource branch 2 times, most recently from 3a7f978 to feff163 Compare April 17, 2023 14:26
@hstastna hstastna requested a review from metalice April 17, 2023 14:26
@hstastna hstastna force-pushed the Remove_extra_button_to_create_resource branch 2 times, most recently from 6aa29dd to dbaa135 Compare April 19, 2023 13:57
@hstastna hstastna requested a review from metalice April 19, 2023 13:57
@hstastna
Copy link
Author

@avivtur @metalice @pcbailey @upalatucci @vojtechszocs please review

Don't display the unnecessary buttons to create VirtualMachine
or MigrationPolicy in the empty state pages (no resources present),
as there is the button to create the appropriate resource present
also in the center of the page, which is the default for Patternfly
empty state. Make this change according to the UX suggestions.
@hstastna hstastna force-pushed the Remove_extra_button_to_create_resource branch from dbaa135 to a2409c2 Compare April 21, 2023 18:22
@vojtechszocs
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Passed code review, ready for merge label Apr 21, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hstastna, vojtechszocs

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:
  • OWNERS [hstastna,vojtechszocs]

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

@openshift-ci openshift-ci bot merged commit fd74fdd into kubevirt-ui:main Apr 21, 2023
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 lgtm Passed code review, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants