Fix unreleased bug in host summary UI (#16999)
This commit is contained in:
@@ -271,12 +271,24 @@ const HostSummary = ({
|
||||
platform,
|
||||
diskEncryptionEnabled
|
||||
);
|
||||
|
||||
let statusText;
|
||||
if (platform === "chrome") {
|
||||
statusText = "Always on";
|
||||
} else {
|
||||
statusText = diskEncryptionEnabled ? "On" : "Off";
|
||||
switch (true) {
|
||||
case platform === "chrome":
|
||||
statusText = "Always on";
|
||||
break;
|
||||
case diskEncryptionEnabled === true:
|
||||
statusText = "On";
|
||||
break;
|
||||
case diskEncryptionEnabled === false:
|
||||
statusText = "Off";
|
||||
break;
|
||||
default:
|
||||
// something unexpected happened on the way to this component, display whatever we got or
|
||||
// "Unknown" to draw attention to the issue.
|
||||
statusText = diskEncryptionEnabled || "Unknown";
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="info-flex__item info-flex__item--title">
|
||||
<span className="info-flex__header">Disk encryption</span>
|
||||
|
||||
@@ -783,7 +783,11 @@ export const normalizeEmptyValues = (
|
||||
return reduce(
|
||||
hostData,
|
||||
(result, value, key) => {
|
||||
if ((Number.isFinite(value) && value !== 0) || !isEmpty(value)) {
|
||||
if (
|
||||
(Number.isFinite(value) && value !== 0) ||
|
||||
!isEmpty(value) ||
|
||||
typeof value === "boolean"
|
||||
) {
|
||||
Object.assign(result, { [key]: value });
|
||||
} else {
|
||||
Object.assign(result, { [key]: DEFAULT_EMPTY_CELL_VALUE });
|
||||
|
||||
Reference in New Issue
Block a user