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

Add warning for Boot menu switch on running VM. #560

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/components/VmDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ class VmDialog extends React.Component {
}

const isEdit = !!vm
const isUp = (isEdit && vm.get('status') === 'up')
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be isRunning


const sortedClusters = sortedBy(clusters.get('clusters'), 'name')

Expand Down Expand Up @@ -462,6 +463,16 @@ class VmDialog extends React.Component {
<h1 id={`${idPrefix}-create-title`}>{msg.createANewVm()}</h1>
)

const bootMenuHint = isUp
? (<React.Fragment>
{msg.bootMenuTooltip()}
<br />
<span className='pficon pficon-warning-triangle-o' />
&nbsp;
{msg.bootMenuWarning()}
</React.Fragment>)
: msg.bootMenuTooltip()

return (
<DetailContainer>
{title}
Expand Down Expand Up @@ -596,7 +607,14 @@ class VmDialog extends React.Component {
)}

<dt>
<FieldHelp content={msg.bootMenuTooltip()} text={msg.bootMenu()} />
{
isUp &&
<React.Fragment>
<span className='pficon pficon-warning-triangle-o' />
&nbsp;
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, use of padding would be better.
Considering time constraint, let's keep it for a follow-up.

</React.Fragment>
}
<FieldHelp content={bootMenuHint} text={msg.bootMenu()} />
</dt>
<dd>
<Switch
Expand Down
1 change: 1 addition & 0 deletions src/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export const messages = {
network: 'Network',
noNetwork: 'No network',
vnicProfileEmpty: '<Empty>',
bootMenuWarning: 'All changes will take effect only after reboot!',
Copy link
Contributor

Choose a reason for hiding this comment

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

Please no exclamation mark ! in similar texts.
Considering time constraint, let's keep it for a follow-up

}

export type MessageIdType = $Keys<typeof messages>