-
Notifications
You must be signed in to change notification settings - Fork 30
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
Adding the ability to start in pause mode #772
Adding the ability to start in pause mode #772
Conversation
79b99b4
to
0ebad86
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.
0ebad86
to
a5efc43
Compare
{ | ||
hasPendingChange: startStrategyChanged, | ||
tabLabel: VirtualMachineDetailsTabLabel.Details, | ||
label: t('Start in Pause 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.
please change to label: t('Start in pause mode')
<FormGroup | ||
fieldId="start-pause-mode" | ||
helperText={t( | ||
'Applying the Start/Pause mode to this Virtual Machine will cause it to partially reboot and pause.', |
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 change to Applying the start/pause mode to this VirtualMachine will cause it to partially reboot and pause.
id="start-pause-mode" | ||
isChecked={checked} | ||
onChange={setChecked} | ||
label={t('Start this VirtualMachine in Pause 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.
please change to Start this VirtualMachine in pause mode
@@ -257,6 +258,24 @@ const VirtualMachineDetailsLeftGrid: React.FC<VirtualMachineDetailsLeftGridProps | |||
} | |||
data-test-id={`${vm?.metadata?.name}-boot-method`} | |||
/> | |||
<VirtualMachineDescriptionItem | |||
descriptionData={vm?.spec?.template?.spec?.startStrategy ? t('ON') : t('OFF')} | |||
descriptionHeader={t('Start in Pause 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.
please change to Start in pause mode
isOpen={isOpen} | ||
onClose={onClose} | ||
onSubmit={onSubmit} | ||
headerText={t('Start in Pause 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.
please change to Start in pause mode
const updatedVirtualMachine = React.useMemo(() => { | ||
const updatedVM = produce<V1VirtualMachine>(vm, (vmDraft: V1VirtualMachine) => { | ||
ensurePath(vmDraft, ['spec.template.spec']); | ||
vmDraft.spec.template.spec.startStrategy = checked ? 'Paused' : null; |
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 use printableVMStatus.Paused
instead of hard-coded 'Paused'
isOpen={isOpen} | ||
onClose={onClose} | ||
onSubmit={onSubmit} | ||
headerText={t('Start in Pause 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.
please change to Start in pause mode
const startStrategyChanged = getChangedStartStrategy( | ||
vm, | ||
vmi, | ||
!!vm?.spec?.template?.spec?.startStrategy, |
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 be extracted from vm, no need to send another arg :)
tabLabel: VirtualMachineDetailsTabLabel.Details, | ||
label: t('Start in Pause Mode'), | ||
handleAction: () => { | ||
history.push(getTabURL(vm, VirtualMachineDetailsTab.Details)); |
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.
is this needed?
a5efc43
to
688ef1c
Compare
Signed-off-by: Dana Orr <dorr@redhat.com>
688ef1c
to
01ee9bc
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DanaOrr, metalice 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 |
Signed-off-by: Dana Orr dorr@redhat.com
📝 Description
Adding "Start in Pause mode" item to the Details tab.
🎥 Demo