-
-
{displayText}
- {labelType !== "builtin" && !isOnlyObserver && (
- <>
-
-
- >
- )}
+ return (
+
+
+
+ {PLATFORM_LABEL_DISPLAY_NAMES[displayText] || displayText}
+
+ {labelType !== "builtin" && !isOnlyObserver && (
+ <>
+
+
+ >
+ )}
+
+
+ {description}
+
-
- {description}
-
-
- );
+ );
+ }
+
+ return null;
};
const renderHeader = () => {
@@ -1051,24 +1139,36 @@ const ManageHostsPage = ({
);
};
- const renderLabelOrPolicyBlock = () => {
- const type = selectedLabel?.type;
-
- if (policyId || selectedLabel) {
+ const renderActiveFilterBlock = () => {
+ const showSelectedLabel =
+ selectedLabel &&
+ selectedLabel.type !== "all" &&
+ selectedLabel.type !== "status";
+ if (policyId || softwareId || showSelectedLabel) {
return (
-
- {policyId && renderPoliciesFilterBlock()}
- {!policyId &&
- type !== "all" &&
- type !== "status" &&
- selectedLabel &&
- renderHeaderLabelBlock(selectedLabel)}
+
+ {showSelectedLabel && renderHeaderLabelBlock()}
+ {!!policyId &&
+ !softwareId &&
+ !showSelectedLabel &&
+ renderPoliciesFilterBlock()}
+ {!!softwareId &&
+ !policyId &&
+ !showSelectedLabel &&
+ renderSoftwareFilterBlock()}
);
}
return null;
};
+ const renderSoftwareVulnerabilities = () => {
+ if (softwareDetails) {
+ return
;
+ }
+ return null;
+ };
+
const renderForm = () => {
if (isAddLabel) {
return (
@@ -1261,7 +1361,8 @@ const ManageHostsPage = ({
)}
- {renderLabelOrPolicyBlock()}
+ {renderActiveFilterBlock()}
+ {renderSoftwareVulnerabilities()}
{config && (!isPremiumTier || teams) && renderTable(selectedTeam)}
)}
diff --git a/frontend/pages/hosts/ManageHostsPage/_styles.scss b/frontend/pages/hosts/ManageHostsPage/_styles.scss
index 64981c1093..8dd1f683f9 100644
--- a/frontend/pages/hosts/ManageHostsPage/_styles.scss
+++ b/frontend/pages/hosts/ManageHostsPage/_styles.scss
@@ -241,7 +241,7 @@
}
}
- &__labels-policies-wrap {
+ &__labels-active-filter-wrap {
margin-bottom: $pad-medium;
}
@@ -260,4 +260,19 @@
padding: $pad-small;
margin-right: $pad-small;
}
+
+ &__software-filter-block {
+ .button--small-text-icon {
+ margin-left: 0;
+ padding-left: 12px;
+ }
+ .software-filter-button {
+ display: inline-flex;
+ align-items: center;
+ }
+ .software-filter-tooltip {
+ display: inline-flex;
+ align-items: center;
+ }
+ }
}
diff --git a/frontend/pages/hosts/ManageHostsPage/components/SoftwareVulnerabilities/SoftwareVulnerabilities.tsx b/frontend/pages/hosts/ManageHostsPage/components/SoftwareVulnerabilities/SoftwareVulnerabilities.tsx
new file mode 100644
index 0000000000..e5bd805bc7
--- /dev/null
+++ b/frontend/pages/hosts/ManageHostsPage/components/SoftwareVulnerabilities/SoftwareVulnerabilities.tsx
@@ -0,0 +1,70 @@
+/* eslint-disable react/prop-types */
+import React, { useState } from "react";
+
+import { ISoftware } from "interfaces/software";
+
+import CloseIcon from "../../../../../../assets/images/icon-close-fleet-black-16x16@2x.png";
+import ExternalLinkIcon from "../../../../../../assets/images/open-new-tab-12x12@2x.png";
+import IssueIcon from "../../../../../../assets/images/icon-issue-fleet-black-50-16x16@2x.png";
+
+interface ISoftwareVulnerabilitiesProps {
+ software: ISoftware;
+}
+
+const baseClass = "software-vulnerabilities";
+
+const SoftwareVulnerabilities = ({
+ software,
+}: ISoftwareVulnerabilitiesProps): JSX.Element | null => {
+ const { name, version, vulnerabilities } = software;
+ const count = vulnerabilities?.length;
+
+ const [showVulnerabilities, setShowVulnerablities] = useState