ui: refactor duplicate code in getWarning()
This commit is contained in:
parent
61eb9a7a23
commit
08926d778b
|
@ -75,23 +75,22 @@ function getBody(props) {
|
||||||
|
|
||||||
function getWarning(warningType) {
|
function getWarning(warningType) {
|
||||||
if (warningType == WarningType.SINGLE) {
|
if (warningType == WarningType.SINGLE) {
|
||||||
return (
|
var warning = <span>This option may cause a system to become unstable or
|
||||||
<div className={'info-pane-warning'} key={'warning'}>
|
may change a system's state in undesirable ways. Therefore, this option
|
||||||
<WarningIcon/>This option may cause a system to become unstable or may
|
is not recommended for use in production or other sensitive
|
||||||
change a system's state in undesirable ways. Therefore, this option
|
environments.</span>;
|
||||||
is not recommended for use in production or other sensitive environments.
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return (
|
warning = <span>Some options have been selected that may cause a system
|
||||||
<div className={'info-pane-warning'} key={'warning'}>
|
to become unstable or may change a system's state in undesirable ways.
|
||||||
<WarningIcon/>Some options have been selected that may cause a system
|
Running Infection Monkey in a production or other sensitive environment
|
||||||
to become unstable or may change a system's state in undesirable ways.
|
with this configuration is not recommended.</span>;
|
||||||
Running Infection Monkey in a production or other sensitive environment
|
|
||||||
with this configuration is not recommended.
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={'info-pane-warning'} key={'warning'}>
|
||||||
|
<WarningIcon/>{warning}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export {getDefaultPaneParams, InfoPane, WarningType}
|
export {getDefaultPaneParams, InfoPane, WarningType}
|
||||||
|
|
Loading…
Reference in New Issue