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

Refactor review tab for the create VM wizard #4983

Merged

Conversation

pcbailey
Copy link
Contributor

@pcbailey pcbailey commented Apr 8, 2020

This PR refactors the review tab for the create VM wizard.

Known To-Dos:

  • Finish advanced settings section

Screenshot of current status:
Selection_664

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 8, 2020
@openshift-ci-robot openshift-ci-robot added the component/kubevirt Related to kubevirt-plugin label Apr 8, 2020
@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from 76e1304 to c3438e9 Compare April 9, 2020 15:10
Copy link
Member

@atiratree atiratree left a comment

Choose a reason for hiding this comment

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

+1 The review tab is starting to look more presentable :)

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2020
@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from c3438e9 to b5a18d7 Compare April 14, 2020 21:35
@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from b5a18d7 to bb073fe Compare April 16, 2020 00:58

export const getCreateVMWizards = (state): Map<string, any> =>
_.get(state, ['plugins', 'kubevirt', 'createVmWizards']);

export const getOS = ({ osID, iUserTemplates, openshiftFlag, iCommonTemplates }: GetOSParams) => {
Copy link
Member

Choose a reason for hiding this comment

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

please move it to './combined.ts' or something new file please.

There are many files which use getCreateVMWizards or use it transitively. Cyclic dependency happened to me a couple of times because of this.

Do you think we should add some notice here or rename the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved getOS. I think we should both rename the file and put a warning to explain the issue. Do you want to do that in this PR or handle it as a followup?

Copy link
Member

Choose a reason for hiding this comment

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

ok let's do it in the followup

@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from bb073fe to 437021c Compare April 16, 2020 15:37
Copy link
Contributor

@matthewcarleton matthewcarleton left a comment

Choose a reason for hiding this comment

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

just a few comments outside our other conversation :)

{ title: 'Interface' },
{ title: 'Size' },
{ title: 'Storage Class' },
{ title: 'Access Mode' },
Copy link
Contributor

Choose a reason for hiding this comment

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

can we change this from access mode to just access, same for volume mode? It helps with the table layout when on smaller viewports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can, but the term 'volume' has specific meanings in storage. Do you think that will be a problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm I'm not sure. It has context with the values so maybe not? I guess we'd want to ask someone like @aglitke who would have more insight on this.

Copy link
Member

Choose a reason for hiding this comment

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

Volume is too generic. We should probably keep both intact for consistency

Copy link
Contributor

Choose a reason for hiding this comment

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

adding a screenshot for reference. You can see with the longer titles we get an overlay.
Screen Shot 2020-04-17 at 10 15 15 AM

Copy link

Choose a reason for hiding this comment

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

I think "Access" could be okay but can't think of a way to shorten "Volume Mode". I also see that "Filesystem" is wrapping. Would it be enough to shorten just the Access Mode column?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add the wrappable transform to make the headers wrap. Would that be sufficient, @matthewcarleton?

Copy link
Contributor

Choose a reason for hiding this comment

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

ya we can follow up on this if it's too much effort to get in but I'd like to see the table cleaned up a bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to what @aglitke is saying about the access mode. That will help with the spacing. I wonder too if we can drop access from "shared access (RWX)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Dropping "Mode" from the "Access" header. The other options that may show up in that column are Single User (RWO) and Read Only (ROX). I don't think those can be shortened and retain their meaning.

@@ -5,3 +5,56 @@
.kubevirt-create-vm-modal__review-tab-lower-section {
margin-top: 20px;
}

.kubevirt-create-vm-modal__review-tab-section-container {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can adjust the class names to be a bit shorter :)
kv-create-vm__review__section wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm all for it, but maybe in a future PR. This follows the convention that's used through the plugin and I think if we're going to change it, we should change it everywhere at the same time.

@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch 2 times, most recently from 184631c to 4756db0 Compare April 17, 2020 11:57
{ title: 'Interface' },
{ title: 'Size' },
{ title: 'Storage Class' },
{ title: 'Access Mode' },
Copy link
Member

Choose a reason for hiding this comment

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

Volume is too generic. We should probably keep both intact for consistency

];
});

return (
Copy link
Member

Choose a reason for hiding this comment

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

we should use EmptyState when there are no networks. Please see networking-tab.tsx

+ same for storage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, but the styling could use some tweaking. The text looks odd being centered while everything else is left-aligned. It will probably look fine on small screens, but no so much on regular/large screens. Thoughts? @matthewcarleton

Selection_660

Copy link
Member

Choose a reason for hiding this comment

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

yea the text is quite overwhelming, added few suggestions bellow

Copy link
Contributor

Choose a reason for hiding this comment

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

ya, I'd suggest left aligning and just using body text. Although it feels like with not NICs there should be an alert of some kind. WDYT @suomiy ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's how it looks after the changes I made. Thoughts? @matthewcarleton @suomiy
Selection_661

Copy link
Member

Choose a reason for hiding this comment

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

Not sure, about alerts. It is a bit unusual situation, but the user should be quite aware what is going on - if he has VM without NICs for some reason (maybe will add them later)

Copy link
Member

Choose a reason for hiding this comment

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

also, isn't it enough to say No network interfaces? @matthewcarleton @pcbailey

@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from ba471d6 to 47efedd Compare April 17, 2020 15:10
if (!reviewValue) {
return null;
}
const reviewValue = value || getReviewValue(field, fieldType) || EMPTY_MESSAGE;
Copy link
Member

Choose a reason for hiding this comment

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

can you please use text-secondary className for empty message? As it would be hard to distinguish against actual description with this value.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 ya I suggested just normal text but I agree differentiating it will help. I also think "no description" would actually be better too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the text-secondary class and changed the message to be "No" plus the field title lowercased.

</Table>
</span>
)}
{!showStorages && (

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean the design of the empty state or the other code?

];
});

return (
Copy link
Member

Choose a reason for hiding this comment

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

yea the text is quite overwhelming, added few suggestions bellow

@pcbailey pcbailey force-pushed the refactor-review-tab-for-wizard branch from e7788b4 to 72f6b58 Compare April 17, 2020 18:43
@pcbailey pcbailey changed the title WIP: Refactor review tab for the create VM wizard Refactor review tab for the create VM wizard Apr 17, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 17, 2020
@atiratree
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 17, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 17, 2020
@spadgett
Copy link
Member

/hold
for #5100

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2020
@spadgett
Copy link
Member

/hold cancel
/retest

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2020
@openshift-merge-robot openshift-merge-robot merged commit dcdc0d4 into openshift:master Apr 18, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 20, 2020
}
}

dt {
Copy link
Member

Choose a reason for hiding this comment

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

Hi @pcbailey, it looks this changes the styling of all dt and dd elements in the console, breaking the layout of our detail pages. This needs to be scoped to only the context where it is used. We should be following http://getbem.com/ naming and ideally use a class name for these styles.

Copy link
Member

Choose a reason for hiding this comment

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

@pcbailey pcbailey deleted the refactor-review-tab-for-wizard branch October 26, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/kubevirt Related to kubevirt-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants