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
Vm overview boot order summary #3560
Vm overview boot order summary #3560
Conversation
@suomiy @mareklibra please review |
/retest |
@Ranelim @matthewcarleton please review. |
On empty state, boot order will mention that no drive was selected, therefore the VM will attempt boot from all the available disks (only disks), by order of appearance on YAML. When there are one or more drives selected on the boot order, the VM will attempt to boot only from the specified (priorities) drives and will disregard the rest of the disks. |
import { ValueEnum } from '../../value-enum'; | ||
|
||
export class DiskType extends ValueEnum<string> { | ||
static readonly DISK = new DiskType('disk'); | ||
static readonly CDROM = new DiskType('cdrom'); | ||
static readonly FLOPPY = new DiskType('floppy'); | ||
static readonly LUN = new DiskType('lun'); | ||
static readonly typeLabels = { |
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.
this could get confused with the enum: please see #3436 (review)
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.
moved the dictionary away from the consts and renamed it.
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 added a constractor option :-)
+1 to what @Ranelim is saying. Also, should we clarify here with "Show default boot disks"? |
cc5545b
to
b9f2091
Compare
@Ranelim @matthewcarleton updated the screenshots, please re-review |
b9f2091
to
49c5597
Compare
/test e2e-gcp-console |
LGTM @Ranelim WDYT? |
/test e2e-gcp-console |
49c5597
to
bf6f0fb
Compare
/test analyze |
bf6f0fb
to
6a6e92c
Compare
@@ -11,3 +12,8 @@ export type VMMultiStatus = { | |||
importerPodsStatuses?: any[]; | |||
progress?: number; | |||
}; | |||
|
|||
export type BootableDeviceType = { |
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.
nit: missing typeLabel
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.
nice ! added
be4cb24
to
4157754
Compare
4157754
to
8c6b136
Compare
@suomiy @mareklibra rebased, please review. |
}; | ||
|
||
// Note(Yaacov): className='text-secondary' is a hack to fix TextVariants being overriden. | ||
const EmptyState: React.FC = () => ( |
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't we make a real component out of this?
margin-top: 0; | ||
} | ||
|
||
.kubevirt-boot-order-suammary__empty-text { |
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.
typo: suammary
@@ -79,18 +79,14 @@ export const VMTemplateDetailsList: React.FC<VMTemplateResourceListProps> = ({ | |||
canUpdateTemplate, | |||
}) => { | |||
const id = getBasicID(template); | |||
const sortedBootableDevices = getBootableDevicesInOrder(template); | |||
const devices = getDevices(asVM(template)); |
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.
getDevices already expects VmLikeEntity
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.
🌔 🌃 🕙
.filter((nic) => nic.bootOrder) | ||
.map((nic) => ({ type: DEVICE_TYPE_INTERFACE, value: nic })); | ||
export const getDevices = (vm: VMLikeEntityKind): BootableDeviceType[] => { | ||
const disks = getDisks(asVM(vm)).map((disk) => ({ |
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 call asVM
just once?
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 ❗
value: disk, | ||
})); | ||
const nics = getInterfaces(asVM(vm)).map((nic) => ({ | ||
type: DEVICE_TYPE_INTERFACE, |
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 convert these into plain string enum?
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.
sure 👍
/test e2e-gcp-console |
/test e2e-gcp-console |
isExpanded={isExpanded} | ||
className="kubevirt-boot-order-summary__expandable" | ||
> | ||
<List> |
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.
This should be an ordered list but I see that the list component doesn't come with the option. It would be great if we could contribute that back to PatternFly, but in the meantime what's the easiest way to ensure this is numbered? I think it makes a big difference, WDYT @Ranelim (this would apply to the expanded list as well.
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.
Added a commit that use ordered list:
p.s.
@matthewcarleton Will open a PR / Discussion in patternfly's github and cc you.
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.
LGTM @Ranelim WDYT?
Not sure I follow what images I need to update where. The Boot-order PR and the images u added to your PR seem aligned.
But the only difference is how the CD-ROM string appears. Adding @matthewcarleton to confirm this. The design display:
Drive [1]: [container] (CD-COM)
And not:
CD-drive-[1] (CD-ROM)
This is fetched from the CD-COM creation.
The “Drive [#]” is the field title, and the rest is the field name itself.
I like the numbering order implemented. Better than bullets
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 good catch @Ranelim I didn't notice that. I agree we want to keep the proper format for CD-ROMs here.
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 the lack of consistency here is quite unfortunate.
Also it can be quite difficult to understand this constellation:
- Drive 2
- Drive 1
I think the names would be a better solution here.
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.
@matthewcarleton @Ranelim this PR is continuing in: #3436 please open/continue this discussion there.
#3436 also handle the modal that use the same device labeler, so will also benefit from this discussion.
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.
2c8629f
to
0f3c4a9
Compare
|
||
import './boot-order-summary.scss'; | ||
|
||
export const BootOrderSummaryEmptyState = ({ devices }: BootOrderSummaryEmptyStateProps) => { |
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 are trying to use BootOrderSummaryEmptyState: React.FC<BootOrderSummaryEmptyStateProps>
convention in all of our code
|
||
const options = devices.filter((device) => !device.value.bootOrder); | ||
|
||
const onToggle = () => { |
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 memoize this with useCallback
?
import { BootOrderSummaryEmptyState } from './boot-order-summary-empty-state'; | ||
|
||
// NOTE(yaacov): using <ol> because '@patternfly/react-core' <List> currently miss isOrder parameter. | ||
export const BootOrderSummary = ({ devices }: BootOrderSummaryProps) => { |
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
> | ||
<ol> | ||
{options.map((option) => ( | ||
<ListItem key={deviceKey(option)}>{deviceLabel(option)}</ListItem> |
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 would rather use <li>
for consistency until the List
component is fixed
) : ( | ||
<ol> | ||
{sources.map((source) => ( | ||
<ListItem key={deviceKey(source)}>{deviceLabel(source)}</ListItem> |
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
/approve - without counting the cdrom issue |
/lgtm |
@yaacov: you cannot LGTM your own PR. In response to this:
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 kubernetes/test-infra repository. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: glekner, suomiy, yaacov 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 |
Depend on: #3396Jira: https://jira.coreos.com/browse/CNV-2907
Update boot order summary in VM Overview page.
Design:
https://github.com/openshift/openshift-origin-design/blob/master/web-console/knikubevirt/vm-details/vm-boot-order/vm-boot-order.md
Screenshot: