Fleet UI: Surface VS code extensions in UI (#17333)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
- Surface VS code extensions in the software inventory
|
||||
@@ -105,6 +105,7 @@ export const SOURCE_TYPE_CONVERSION: Record<string, string> = {
|
||||
ie_extensions: "Browser plugin (IE)",
|
||||
chocolatey_packages: "Package (Chocolatey)",
|
||||
pkg_packages: "Package (pkg)",
|
||||
vscode_extensions: "IDE extension (VS Code)",
|
||||
} as const;
|
||||
|
||||
const BROWSER_TYPE_CONVERSION: Record<string, string> = {
|
||||
|
||||
@@ -59,6 +59,7 @@ export const SOFTWARE_SOURCE_TO_ICON_MAP = {
|
||||
ie_extensions: Extension,
|
||||
chocolatey_packages: Package,
|
||||
pkg_packages: Package,
|
||||
vscode_extensions: Extension,
|
||||
} as const;
|
||||
|
||||
export const SOFTWARE_ICON_SIZES: Record<string, string> = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import ReactTooltip from "react-tooltip";
|
||||
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
|
||||
import { ISoftware } from "interfaces/software";
|
||||
import { ISoftware, SOURCE_TYPE_CONVERSION } from "interfaces/software";
|
||||
import PATHS from "router/paths";
|
||||
|
||||
import HeaderCell from "components/TableContainer/DataTable/HeaderCell/HeaderCell";
|
||||
@@ -68,28 +68,8 @@ interface IDataColumn {
|
||||
// or one of the custom `filterTypes` defined for the `useTable` instance (see `DataTable`)
|
||||
}
|
||||
|
||||
const TYPE_CONVERSION: Record<string, string> = {
|
||||
apt_sources: "Package (APT)",
|
||||
deb_packages: "Package (deb)",
|
||||
portage_packages: "Package (Portage)",
|
||||
rpm_packages: "Package (RPM)",
|
||||
yum_sources: "Package (YUM)",
|
||||
npm_packages: "Package (NPM)",
|
||||
atom_packages: "Package (Atom)", // Atom packages were removed from software inventory. Mapping is maintained for backwards compatibility. (2023-12-04)
|
||||
python_packages: "Package (Python)",
|
||||
apps: "Application (macOS)",
|
||||
chrome_extensions: "Browser plugin (Chrome)",
|
||||
firefox_addons: "Browser plugin (Firefox)",
|
||||
safari_extensions: "Browser plugin (Safari)",
|
||||
homebrew_packages: "Package (Homebrew)",
|
||||
programs: "Program (Windows)",
|
||||
ie_extensions: "Browser plugin (IE)",
|
||||
chocolatey_packages: "Package (Chocolatey)",
|
||||
pkg_packages: "Package (pkg)",
|
||||
};
|
||||
|
||||
const formatSoftwareType = (source: string) => {
|
||||
const DICT = TYPE_CONVERSION;
|
||||
const DICT = SOURCE_TYPE_CONVERSION;
|
||||
return DICT[source] || "Unknown";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user