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
Refactor review tab for the create VM wizard #4983
Conversation
76e1304
to
c3438e9
Compare
There was a problem hiding this 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 :)
...tend/packages/kubevirt-plugin/src/components/create-vm-wizard/form/form-field-review-row.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/components/create-vm-wizard/form/form-field-form.tsx
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/form/form-field-review-row.scss
Outdated
Show resolved
Hide resolved
...tend/packages/kubevirt-plugin/src/components/create-vm-wizard/form/form-field-review-row.tsx
Outdated
Show resolved
Hide resolved
...nd/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.scss
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
...tend/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.tsx
Outdated
Show resolved
Hide resolved
c3438e9
to
b5a18d7
Compare
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/FlavorRow.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Show resolved
Hide resolved
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Outdated
Show resolved
Hide resolved
b5a18d7
to
bb073fe
Compare
|
||
export const getCreateVMWizards = (state): Map<string, any> => | ||
_.get(state, ['plugins', 'kubevirt', 'createVmWizards']); | ||
|
||
export const getOS = ({ osID, iUserTemplates, openshiftFlag, iCommonTemplates }: GetOSParams) => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
...nd/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/advanced-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/k8s/wrapper/vm/vm-template-wrapper.ts
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/k8s/wrapper/vm/vm-template-wrapper.ts
Outdated
Show resolved
Hide resolved
...tend/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
bb073fe
to
437021c
Compare
There was a problem hiding this 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' }, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)"
There was a problem hiding this comment.
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.
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.scss
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.scss
Outdated
Show resolved
Hide resolved
@@ -5,3 +5,56 @@ | |||
.kubevirt-create-vm-modal__review-tab-lower-section { | |||
margin-top: 20px; | |||
} | |||
|
|||
.kubevirt-create-vm-modal__review-tab-section-container { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.scss
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/review-tab.scss
Show resolved
Hide resolved
184631c
to
4756db0
Compare
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/k8s/wrapper/vm/vm-template-wrapper.ts
Outdated
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/components/create-vm-wizard/selectors/combined.ts
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/selectors/vm/flavor-text.ts
Outdated
Show resolved
Hide resolved
frontend/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/utils.ts
Outdated
Show resolved
Hide resolved
{ title: 'Interface' }, | ||
{ title: 'Size' }, | ||
{ title: 'Storage Class' }, | ||
{ title: 'Access Mode' }, |
There was a problem hiding this comment.
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
frontend/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/utils.ts
Outdated
Show resolved
Hide resolved
...nd/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/advanced-tab.tsx
Outdated
Show resolved
Hide resolved
]; | ||
}); | ||
|
||
return ( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Show resolved
Hide resolved
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Show resolved
Hide resolved
ba471d6
to
47efedd
Compare
if (!reviewValue) { | ||
return null; | ||
} | ||
const reviewValue = value || getReviewValue(field, fieldType) || EMPTY_MESSAGE; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
...end/packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/general-tab.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
</Table> | ||
</span> | ||
)} | ||
{!showStorages && ( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
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?
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Show resolved
Hide resolved
]; | ||
}); | ||
|
||
return ( |
There was a problem hiding this comment.
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
e7788b4
to
72f6b58
Compare
...ckages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/networking-review.tsx
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
.../packages/kubevirt-plugin/src/components/create-vm-wizard/tabs/review-tab/storage-review.tsx
Outdated
Show resolved
Hide resolved
/lgtm |
[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 |
/hold |
/hold cancel |
} | ||
} | ||
|
||
dt { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've opened https://bugzilla.redhat.com/show_bug.cgi?id=1959550
This PR refactors the review tab for the create VM wizard.
Known To-Dos:
Screenshot of current status: