fleet/frontend/interfaces/software.ts

876 lines
29 KiB
TypeScript
Raw Normal View History

import { startCase } from "lodash";
import PropTypes from "prop-types";
2024-07-16 17:16:57 +00:00
import { IconNames } from "components/icons";
import { HOST_APPLE_PLATFORMS, Platform } from "./platform";
import vulnerabilityInterface from "./vulnerability";
import { ILabelSoftwareTitle } from "./label";
import { ICommandResult } from "./command";
export default PropTypes.shape({
type: PropTypes.string,
name: PropTypes.string,
version: PropTypes.string,
source: PropTypes.string,
id: PropTypes.number,
vulnerabilities: PropTypes.arrayOf(vulnerabilityInterface),
});
export interface ISoftwareResponse {
counts_updated_at: string;
software: ISoftware[];
}
export interface ISoftwareCountResponse {
count: number;
}
export interface IGetSoftwareByIdResponse {
software: ISoftware;
}
// TODO: old software interface. replaced with ISoftwareVersion
// check to see if we still need this.
export interface ISoftware {
id: number;
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
name: string; // e.g., "Figma.app"
/** Custom name set per team by admin */
display_name?: string; // e.g. "Figma for Desktop"
version: string; // e.g., "2.1.11"
bundle_identifier?: string | null; // e.g., "com.figma.Desktop"
application_id?: string | null; // e.g., "us.zoom.videomeetings" for Android apps
source: string; // "apps" | "ipados_apps" | "ios_apps" | "programs" | "rpm_packages" | "deb_packages" | "android_apps" | ?
generated_cpe: string;
vulnerabilities: ISoftwareVulnerability[] | null;
hosts_count?: number;
last_opened_at?: string | null; // e.g., "2021-08-18T15:11:35Z”
installed_paths?: string[];
extension_for?: string;
vendor?: string;
icon_url: string | null; // Only available on team view if an admin uploaded an icon to a team's software
}
export type IVulnerabilitySoftware = Omit<
ISoftware,
"vulnerabilities" | "icon_url"
> & {
resolved_in_version: string;
};
export interface ISoftwareTitleVersion {
id: number;
version: string;
vulnerabilities: string[] | null; // TODO: does this return null or is it omitted?
hosts_count?: number;
}
export interface ISoftwarePatchPolicy {
id: number;
name: string;
}
export type SoftwareInstallPolicyType = "dynamic" | "patch";
export type SoftwareInstallPolicyTypeSet = Set<SoftwareInstallPolicyType>;
// A policy type returned from the API is set to:
// 1. dynamic if only auto install, and
// 2.patch if it's both auto install and patch policy
// This doesn't include patch alone, as policies set to patch only are under ISoftwarePackage.patch_policy
export interface ISoftwareInstallPolicy {
id: number;
name: string;
type: SoftwareInstallPolicyType;
}
// A policy type in the UI uses a Set because a policy in
// Software Details > Policy can be both dynamic AND/OR patch
export interface ISoftwareInstallPolicyUI {
id: number;
name: string;
type: SoftwareInstallPolicyTypeSet;
}
// Match allowedCategories in cmd/maintained-apps/main.go
export type SoftwareCategory =
| "Browsers"
| "Communication"
| "Developer tools"
Add 2 new app categories: 🔐 Security and 🛠️ Utilities (#37098) This pull request adds support for two new software categories, "Security" and "Utilities", across the application. The changes ensure these categories are available in the database, frontend type definitions, UI elements, documentation, and are fully tested in both migration and integration test suites. **Database and Migration Updates:** * Added "Security" and "Utilities" entries to the `software_categories` table and updated initial data in `schema.sql`. * Introduced a new migration (`20251210000000_AddSecurityAndUtilitiesCategories.go`) to insert/remove these categories, with an accompanying test to verify migration behavior. [[1]](diffhunk://#diff-57da59e73fff8f2ffccd167299027899614281c591b79715b7000bed0e9d8516R1-R31) [[2]](diffhunk://#diff-5e6db34b45e83ec5cf2b9cb41e4bfd4ee934f456dd9c0ae4313a448d39319c72R1-R28) **Frontend and Documentation Updates:** * Updated the `SoftwareCategory` type and category lists to include "Security" and "Utilities", ensuring they appear in the UI and are selectable. [[1]](diffhunk://#diff-4297079e443d574eb530c70ef48de3cab80e56f783c7b395d58c31c29be6bb0eL77-R79) [[2]](diffhunk://#diff-405dcd4f0bd6881e4b20a75212467d13c143ddc486b5c9d29ed9035033c32361R25-R26) * Added documentation for the new categories in `yaml-files.md`. **Testing Enhancements:** * Added and updated tests to verify the new categories are displayed and handled correctly in both frontend and backend integration tests. [[1]](diffhunk://#diff-d151ee297fdaf54f8ea7027bc46de12247c43406b464265f24ade5a49cb19e49R210-R211) [[2]](diffhunk://#diff-bbd0c5a6bc2f9a24e633031d4c6a3f5b0be7cbfe78ef1b56cdf9a7a2c32e21e2R19358-R19365) [[3]](diffhunk://#diff-2bd8ca2ddaad7aac0c438a2afd76a26872378249f757c9c81a31005d0e57cf1fR18447-R18460)
2025-12-18 19:26:50 +00:00
| "Productivity"
| "Security"
| "Utilities";
export interface ISoftwarePackageStatus {
installed: number;
pending_install: number;
failed_install: number;
pending_uninstall: number;
failed_uninstall: number;
}
export interface ISoftwareAppStoreAppStatus {
installed: number;
pending: number;
failed: number;
}
interface IFleetMaintainedVersion {
id: number;
version: string;
}
export interface ISoftwarePackage {
name: string;
/** Not included in SoftwareTitle software.software_package response, hoisted up one level
* Custom name set per team by admin
*/
display_name?: string;
title_id: number;
url: string;
version: string;
uploaded_at: string;
install_script: string;
uninstall_script: string;
pre_install_query?: string;
post_install_script?: string;
automatic_install?: boolean; // POST only
Update UI for software self-service features (#19244) Issues https://github.com/fleetdm/fleet/issues/17587, https://github.com/fleetdm/fleet/issues/18836, https://github.com/fleetdm/fleet/issues/18837, https://github.com/fleetdm/fleet/pull/18339, and https://github.com/fleetdm/fleet/pull/18340 # TODOS - Integrate backend - Unit/integration tests - Various todos noted in comments - Cleanup styles and organization of components (de-duplicating and consolidating where possible) - Activity feed updates (if any) # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)). --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
self_service: boolean;
icon_url: string | null;
status: ISoftwarePackageStatus;
patch_policy?: ISoftwarePatchPolicy | null;
automatic_install_policies?: ISoftwareInstallPolicy[] | null;
install_during_setup?: boolean;
labels_include_any: ILabelSoftwareTitle[] | null;
labels_include_all: ILabelSoftwareTitle[] | null;
labels_exclude_any: ILabelSoftwareTitle[] | null;
categories?: SoftwareCategory[] | null;
fleet_maintained_app_id?: number | null;
fleet_maintained_versions?: IFleetMaintainedVersion[] | null;
hash_sha256?: string | null;
}
export interface IAppStoreApp {
name: string;
/** Not included in SoftwareTitle software.app_store_app response, hoisted up one level
* Custom name set per team by admin
*/
display_name?: string;
app_store_id: string; // API returns this as a string
latest_version: string;
created_at: string;
icon_url: string;
self_service: boolean;
platform: typeof HOST_APPLE_PLATFORMS[number] | "android";
status: ISoftwareAppStoreAppStatus;
install_during_setup?: boolean;
automatic_install_policies?: ISoftwareInstallPolicy[] | null;
automatic_install?: boolean;
last_install?: IAppLastInstall | null;
last_uninstall?: {
script_execution_id: string;
uninstalled_at: string;
} | null;
version?: string;
labels_include_any: ILabelSoftwareTitle[] | null;
labels_include_all: ILabelSoftwareTitle[] | null;
labels_exclude_any: ILabelSoftwareTitle[] | null;
categories?: SoftwareCategory[] | null;
configuration?: string;
}
/**
* package: includes FMA, custom packages, and are defined under software_package
* app-store: includes VPP, Google Play Store apps and are defined under app_store_app
*/
export type InstallerType = "package" | "app-store";
export const isSoftwarePackage = (
data: ISoftwarePackage | IAppStoreApp
): data is ISoftwarePackage =>
(data as ISoftwarePackage).install_script !== undefined;
export interface ISoftwareTitle {
id: number;
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
name: string;
/** Custom name set per team by admin */
display_name?: string;
icon_url: string | null;
versions_count: number;
source: SoftwareSource;
extension_for?: SoftwareExtensionFor;
hosts_count: number;
versions: ISoftwareTitleVersion[] | null;
software_package: ISoftwarePackage | null;
app_store_app: IAppStoreApp | null;
/** @deprecated Use extension_for instead */
browser?: string;
Update UI for software self-service features (#19244) Issues https://github.com/fleetdm/fleet/issues/17587, https://github.com/fleetdm/fleet/issues/18836, https://github.com/fleetdm/fleet/issues/18837, https://github.com/fleetdm/fleet/pull/18339, and https://github.com/fleetdm/fleet/pull/18340 # TODOS - Integrate backend - Unit/integration tests - Various todos noted in comments - Cleanup styles and organization of components (de-duplicating and consolidating where possible) - Activity feed updates (if any) # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)). --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
}
export interface ISoftwareTitleDetails {
id: number;
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
name: string;
/** Custom name set per team by admin */
display_name?: string;
icon_url: string | null;
Update UI for software self-service features (#19244) Issues https://github.com/fleetdm/fleet/issues/17587, https://github.com/fleetdm/fleet/issues/18836, https://github.com/fleetdm/fleet/issues/18837, https://github.com/fleetdm/fleet/pull/18339, and https://github.com/fleetdm/fleet/pull/18340 # TODOS - Integrate backend - Unit/integration tests - Various todos noted in comments - Cleanup styles and organization of components (de-duplicating and consolidating where possible) - Activity feed updates (if any) # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)). --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
software_package: ISoftwarePackage | null;
app_store_app: IAppStoreApp | null;
source: SoftwareSource;
extension_for?: SoftwareExtensionFor;
hosts_count: number;
versions: ISoftwareTitleVersion[] | null;
counts_updated_at?: string;
bundle_identifier?: string;
versions_count?: number;
Auto software update frontend (#37677) <!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #35459 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [ ] Added/updated automated tests working on these - [X] QA'd all new/changed functionality manually ## Screenshots | Option does not appear for FMA apps | | --- | | <img width="723" height="419" alt="image" src="https://github.com/user-attachments/assets/f9f1328e-e38c-452c-b06e-337a69c13e71" /> | | Option does not appear for custom packages | | --- | | <img width="731" height="416" alt="image" src="https://github.com/user-attachments/assets/3de78f15-d7ce-45c7-875f-a250fc00a160" /> | | Option does not appear for macOS VPP apps | | --- | | <img width="725" height="454" alt="image" src="https://github.com/user-attachments/assets/07dcb074-f57d-4cc4-a746-20b80c821fb6" /> | | Option appears iOS VPP apps | | --- | | <img width="727" height="420" alt="image" src="https://github.com/user-attachments/assets/ec4ce503-0300-437c-b3f2-248928fcfe7b" /> | | Option appears iPadOS VPP apps | | --- | | <img width="727" height="422" alt="image" src="https://github.com/user-attachments/assets/0030c6cc-3d93-480c-af93-740fca4d5b57" /> | | Form with auto-updates disabled | | --- | | <img width="668" height="517" alt="image" src="https://github.com/user-attachments/assets/d59a7ba4-dc83-4a80-ba94-0befc7635f05" /> | | Start / end time validation | | --- | | <img width="668" height="679" alt="image" src="https://github.com/user-attachments/assets/939fd09a-76f6-42de-9c71-fe4982f3f84b" /> | | Maintenance window length validation | | --- | | <img width="664" height="681" alt="image" src="https://github.com/user-attachments/assets/a2eab676-5166-42a9-9043-2565014e33cb" /> | | Badge and banner appears after saving | | --- | | <img width="766" height="529" alt="image" src="https://github.com/user-attachments/assets/48d89e1d-4430-4dd7-b8e6-d5b04ebad47f" /> | --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com> Co-authored-by: Nico <32375741+nulmete@users.noreply.github.com>
2026-01-05 16:43:26 +00:00
auto_update_enabled?: boolean;
auto_update_window_start?: string;
auto_update_window_end?: string;
/** @deprecated Use extension_for instead */
browser?: string;
}
export interface ISoftwareVulnerability {
cve: string;
details_link: string;
cvss_score?: number | null;
epss_probability?: number | null;
cisa_known_exploit?: boolean | null;
cve_published?: string | null;
cve_description?: string | null;
resolved_in_version?: string | null;
created_at?: string | null;
}
export interface ISoftwareVersion {
id: number;
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
name: string; // e.g., "Figma.app"
/** Custom name set per team by admin */
display_name?: string; // e.g. "Figma for Desktop"
version: string; // e.g., "2.1.11"
bundle_identifier?: string; // e.g., "com.figma.Desktop"
source: SoftwareSource;
extension_for: SoftwareExtensionFor;
release: string; // TODO: on software/verions/:id?
vendor: string;
arch: string; // e.g., "x86_64" // TODO: on software/verions/:id?
generated_cpe: string;
vulnerabilities: ISoftwareVulnerability[] | null;
hosts_count?: number;
/** @deprecated Use extension_for instead */
browser?: string;
}
export const SOURCE_TYPE_CONVERSION = {
apt_sources: "Package (APT)",
deb_packages: "Package (deb)",
portage_packages: "Package (Portage)",
rpm_packages: "Package (RPM)",
yum_sources: "Package (YUM)",
2025-10-24 18:54:57 +00:00
npm_packages: "Package (npm)",
pacman_packages: "Package (pacman)",
2023-12-04 19:26:26 +00:00
atom_packages: "Package (Atom)", // Atom packages were removed from software inventory. Mapping is maintained for backwards compatibility. (2023-12-04)
python_packages: "Package (Python)",
tgz_packages: "Package (tar)",
apps: "Application (macOS)",
UI – Add VPP features for iPadOS and iOS (#20755) ## Addresses #20467 – part 2 ### Aggregate software: #### Software titles <img width="1616" alt="sw-titles-updated" src="https://github.com/user-attachments/assets/0b9922c7-e36e-4d2f-b204-95c3cdf9b602"> #### Software versions <img width="1616" alt="Screenshot 2024-07-29 at 6 14 21 PM" src="https://github.com/user-attachments/assets/5a097700-cd6c-45b1-a21f-9d76a733f0ae"> #### Host software <img width="1616" alt="Screenshot 2024-07-29 at 6 23 01 PM" src="https://github.com/user-attachments/assets/84e18695-f47a-4022-bd53-7f5d37ce452a"> ### Add software modal (VPP) _screenshots use mocked data - UI is flexible enough to display cleanly before and after backend is in place:_ <img width="1339" alt="happy" src="https://github.com/user-attachments/assets/8900aa93-316c-4a09-8e5a-1a1e45b0c458"> #### No apps: <img width="1572" alt="Screenshot 2024-07-29 at 6 35 03 PM" src="https://github.com/user-attachments/assets/466b9b6c-4d3d-49dd-94a9-94e395d89cb7"> #### Not enabled: <img width="1572" alt="Screenshot 2024-07-29 at 6 37 45 PM" src="https://github.com/user-attachments/assets/9bcfd480-8741-4d95-ba3b-550dee4dc673"> #### Error: <img width="1572" alt="Screenshot 2024-07-29 at 6 39 39 PM" src="https://github.com/user-attachments/assets/e944dd40-676e-4aba-9cd9-49ff319bf402"> ### Vuln support – Not supported for now: _see above screenshots for `list` endpoints_ #### Software title detail <img width="1616" alt="Screenshot 2024-07-29 at 6 47 29 PM" src="https://github.com/user-attachments/assets/2e30fd0a-21e4-4d19-bf9b-71a994bfd0e7"> #### Software version and OS detail: <img width="1616" alt="Screenshot 2024-07-29 at 6 48 28 PM" src="https://github.com/user-attachments/assets/e8fec769-ba97-4b6b-b10c-9bb4c973c732"> <img width="1616" alt="Screenshot 2024-07-29 at 6 50 25 PM" src="https://github.com/user-attachments/assets/0ac15727-e0cb-447c-8758-c58b79656d1a"> - [x] Changes file added for user-visible changes in `changes/`, - [x] Added/updated tests - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2024-07-30 17:14:25 +00:00
ios_apps: "Application (iOS)",
ipados_apps: "Application (iPadOS)",
android_apps: "Application (Android)",
chrome_extensions: "Browser plugin", // chrome_extensions can include any chrome-based browser (e.g., edge), so we rely instead on the `extension_for` field computed by Fleet server and fallback to this value if it is not present.
firefox_addons: "Browser plugin", // we rely on `extension_for` when computing which browser to show in firefox_addons display names.
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)",
vscode_extensions: "IDE extension", // vscode_extensions can include any vscode-based editor (e.g., Cursor, Trae, Windsurf), so we rely instead on the `extension_for` field computed by Fleet server and fallback to this value if it is not present.
sh_packages: "Script-only package (macOS & Linux)",
ps1_packages: "Script-only package (Windows)",
2025-10-14 15:01:45 +00:00
jetbrains_plugins: "IDE extension", // jetbrains_plugins can include any JetBrains IDE (e.g., IntelliJ, PyCharm, WebStorm), so we rely instead on the `extension_for` field computed by Fleet server and fallback to this value if it is not present.
Add go_binaries table (#39877) **Related issue:** Resolves #40138 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually Installed: ``` go install golang.org/x/tools/cmd/goimports@latest go install golang.org/x/tools/gopls@latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ``` Validated: ``` osquery> SELECT * FROM go_packages; +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ | name | version | module_path | import_path | go_version | installed_path | +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ | goimports | v0.42.0 | golang.org/x/tools | golang.org/x/tools/cmd/goimports | go1.25.5 | /Users/josh/go/bin/goimports | | golangci-lint | v1.64.8 | github.com/golangci/golangci-lint | github.com/golangci/golangci-lint/cmd/golangci-lint | go1.25.5 | /Users/josh/go/bin/golangci-lint | | gopls | v0.21.1 | golang.org/x/tools/gopls | golang.org/x/tools/gopls | go1.25.5 | /Users/josh/go/bin/gopls | +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ ``` ## fleetd/orbit/Fleet Desktop - [x] Verified compatibility with the latest released version of Fleet (see [Must rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md)) - [x] If the change applies to only one platform, confirmed that `runtime.GOOS` is used as needed to isolate changes - [x] Verified that fleetd runs on macOS, Linux and Windows --------- Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
2026-03-16 18:27:00 +00:00
go_binaries: "Binary (Go)",
2022-06-08 19:01:38 +00:00
} as const;
export type SoftwareSource = keyof typeof SOURCE_TYPE_CONVERSION;
/** Map installable software source to platform */
export const INSTALLABLE_SOURCE_PLATFORM_CONVERSION = {
apt_sources: "linux",
deb_packages: "linux",
portage_packages: "linux",
rpm_packages: "linux",
yum_sources: "linux",
pacman_packages: "linux",
tgz_packages: "linux",
npm_packages: null,
atom_packages: null,
python_packages: null,
apps: "darwin",
ios_apps: "ios",
ipados_apps: "ipados",
android_apps: "android", // 4.76 Currently hidden upstream as not installable
chrome_extensions: null,
firefox_addons: null,
safari_extensions: null,
homebrew_packages: "darwin",
programs: "windows",
ie_extensions: null,
chocolatey_packages: "windows",
pkg_packages: "darwin",
vscode_extensions: null,
sh_packages: "linux", // 4.76 Added support for Linux hosts only
ps1_packages: "windows",
2025-10-14 15:01:45 +00:00
jetbrains_plugins: null,
Add go_binaries table (#39877) **Related issue:** Resolves #40138 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually Installed: ``` go install golang.org/x/tools/cmd/goimports@latest go install golang.org/x/tools/gopls@latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ``` Validated: ``` osquery> SELECT * FROM go_packages; +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ | name | version | module_path | import_path | go_version | installed_path | +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ | goimports | v0.42.0 | golang.org/x/tools | golang.org/x/tools/cmd/goimports | go1.25.5 | /Users/josh/go/bin/goimports | | golangci-lint | v1.64.8 | github.com/golangci/golangci-lint | github.com/golangci/golangci-lint/cmd/golangci-lint | go1.25.5 | /Users/josh/go/bin/golangci-lint | | gopls | v0.21.1 | golang.org/x/tools/gopls | golang.org/x/tools/gopls | go1.25.5 | /Users/josh/go/bin/gopls | +---------------+---------+-----------------------------------+-----------------------------------------------------+------------+----------------------------------+ ``` ## fleetd/orbit/Fleet Desktop - [x] Verified compatibility with the latest released version of Fleet (see [Must rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md)) - [x] If the change applies to only one platform, confirmed that `runtime.GOOS` is used as needed to isolate changes - [x] Verified that fleetd runs on macOS, Linux and Windows --------- Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
2026-03-16 18:27:00 +00:00
go_binaries: null,
} as const;
export const SCRIPT_PACKAGE_SOURCES = ["sh_packages", "ps1_packages"];
/** Sources that don't map cleanly to versions or hosts in software inventory.
* UI behavior for these sources:
* - Never shows Update available (no version to compare against the package version).
* - Skips showing recently updated and waiting for inventory UI status/tooltip after successful install/uninstall (no inventory entry to await)
* - Skips showing a host count (hosts cannot be mapped to the package).
* - Skips showing a versions table (versions cannot be mapped to the package).
* - Skips linking to View all hosts (hosts cannot be mapped to the package). */
export const NO_VERSION_OR_HOST_DATA_SOURCES = [
"tgz_packages",
...SCRIPT_PACKAGE_SOURCES,
];
export type InstallableSoftwareSource = keyof typeof INSTALLABLE_SOURCE_PLATFORM_CONVERSION;
const EXTENSION_FOR_TYPE_CONVERSION = {
// chrome versions
chrome: "Chrome",
chromium: "Chromium",
opera: "Opera",
yandex: "Yandex",
brave: "Brave",
edge: "Edge",
edge_beta: "Edge Beta",
firefox: "Firefox",
// vscode versions
vscode: "VSCode",
vscode_insiders: "VSCode Insiders",
vscodium: "VSCodium",
vscodium_insiders: "VSCodium Insiders",
trae: "Trae",
windsurf: "Windsurf",
cursor: "Cursor",
2025-10-14 15:01:45 +00:00
// jebtbrains versions
clion: "CLion",
datagrip: "DataGrip",
goland: "GoLand",
intellij_idea: "IntelliJ IDEA",
intellij_idea_community_edition: "IntelliJ IDEA Community Edition",
phpstorm: "PhpStorm",
pycharm: "PyCharm",
pycharm_community_edition: "PyCharm Community Edition",
resharper: "ReSharper",
rider: "Rider",
rubymine: "RubyMine",
rust_rov: "RustRover",
webstorm: "WebStorm",
} as const;
export type SoftwareExtensionFor =
| keyof typeof EXTENSION_FOR_TYPE_CONVERSION
| "";
export const formatSoftwareType = ({
source,
extension_for,
}: {
source: SoftwareSource;
extension_for?: SoftwareExtensionFor;
}) => {
let type: string = SOURCE_TYPE_CONVERSION[source] || "Unknown";
if (extension_for) {
type += ` (${
EXTENSION_FOR_TYPE_CONVERSION[extension_for] || startCase(extension_for)
})`;
}
return type;
};
/**
* This list comprises all possible states of software install operations.
*/
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
export const SOFTWARE_UNINSTALL_STATUSES = [
"uninstalled",
"pending_uninstall",
"failed_uninstall",
] as const;
export type SoftwareUninstallStatus = typeof SOFTWARE_UNINSTALL_STATUSES[number];
export const SOFTWARE_INSTALL_STATUSES = [
"installed",
2024-09-04 21:46:48 +00:00
"pending_install",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
"failed_install",
] as const;
// Script-only software statuses
export const SOFTWARE_SCRIPT_STATUSES = [
"ran_script",
"pending_script",
"failed_script",
] as const;
export type SoftwareInstallStatus = typeof SOFTWARE_INSTALL_STATUSES[number];
export const SOFTWARE_INSTALL_UNINSTALL_STATUSES = [
...SOFTWARE_INSTALL_STATUSES,
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
...SOFTWARE_UNINSTALL_STATUSES,
// Script-only software statuses use API's SOFTWARE_INSTALL_STATUSES
] as const;
/*
* SoftwareInstallUninstallStatus represents the possible states of software install operations.
*/
export type SoftwareInstallUninstallStatus = typeof SOFTWARE_INSTALL_UNINSTALL_STATUSES[number];
/** Include script-only software statuses */
export const ENAHNCED_SOFTWARE_INSTALL_UNINSTALL_STATUSES = [
...SOFTWARE_INSTALL_STATUSES,
...SOFTWARE_UNINSTALL_STATUSES,
...SOFTWARE_SCRIPT_STATUSES, // Script-only software
] as const;
/*
* EnhancedSoftwareInstallUninstallStatus represents the possible states of software install operations including script-only software used in the UI.
*/
export type EnhancedSoftwareInstallUninstallStatus = typeof ENAHNCED_SOFTWARE_INSTALL_UNINSTALL_STATUSES[number];
export const isValidSoftwareInstallUninstallStatus = (
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
s: string | undefined | null
): s is EnhancedSoftwareInstallUninstallStatus =>
!!s &&
ENAHNCED_SOFTWARE_INSTALL_UNINSTALL_STATUSES.includes(
s as EnhancedSoftwareInstallUninstallStatus
);
export const SOFTWARE_AGGREGATE_STATUSES = [
"installed",
"pending",
"failed",
] as const;
export type SoftwareAggregateStatus = typeof SOFTWARE_AGGREGATE_STATUSES[number];
export const isValidSoftwareAggregateStatus = (
s: string | undefined | null
): s is SoftwareAggregateStatus =>
!!s && SOFTWARE_AGGREGATE_STATUSES.includes(s as SoftwareAggregateStatus);
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
export const isSoftwareUninstallStatus = (
s: string | undefined | null
): s is SoftwareUninstallStatus =>
!!s && SOFTWARE_UNINSTALL_STATUSES.includes(s as SoftwareUninstallStatus);
// not a typeguard, as above 2 functions are
export const isPendingStatus = (s: string | undefined | null) =>
["pending_install", "pending_uninstall"].includes(s || "");
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
export const resolveUninstallStatus = (
activityStatus?: string
): SoftwareUninstallStatus => {
let resolvedStatus = activityStatus;
if (resolvedStatus === "pending") {
resolvedStatus = "pending_uninstall";
}
if (resolvedStatus === "failed") {
resolvedStatus = "failed_uninstall";
}
if (!isSoftwareUninstallStatus(resolvedStatus)) {
console.warn(
`Unexpected uninstall status "${activityStatus}" for activity. Defaulting to "pending_uninstall".`
);
resolvedStatus = "pending_uninstall";
}
return resolvedStatus as SoftwareUninstallStatus;
};
/**
* ISoftwareInstallResult is the shape of a software install result object
* returned by the Fleet API.
*/
export interface ISoftwareInstallResult {
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
host_display_name?: string;
install_uuid: string;
software_title: string;
software_title_id: number;
software_package: string;
host_id: number;
status: SoftwareInstallUninstallStatus;
detail: string;
output: string;
pre_install_query_output: string;
post_install_script_output: string;
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
created_at: string;
updated_at: string | null;
self_service: boolean;
}
// Script results are only install results, never uninstall
export type ISoftwareScriptResult = Omit<ISoftwareInstallResult, "status"> & {
status: SoftwareInstallStatus;
};
export interface ISoftwareInstallResults {
results: ISoftwareInstallResult;
}
2025-10-28 16:44:17 +00:00
/** For Software .ipa installs, we use the install results API to return MDM command results */
export interface ISoftwareIpaInstallResults {
results: ICommandResult;
2025-10-28 16:44:17 +00:00
}
// ISoftwareInstallerType defines the supported installer types for
// software uploaded by the IT admin.
export type ISoftwareInstallerType = "pkg" | "msi" | "deb" | "rpm" | "exe";
export interface ISoftwareLastInstall {
install_uuid: string;
installed_at: string;
}
export interface IAppLastInstall {
command_uuid: string;
installed_at: string;
}
interface SignatureInformation {
installed_path: string;
team_identifier: string;
hash_sha256: string | null;
}
export interface ISoftwareLastUninstall {
script_execution_id: string;
uninstalled_at: string;
}
export interface ISoftwareInstallVersion {
version: string;
bundle_identifier: string;
last_opened_at?: string;
vulnerabilities: string[] | null;
installed_paths: string[];
signature_information?: SignatureInformation[];
}
export interface IHostSoftwarePackage {
name: string;
self_service: boolean;
icon_url: string | null;
version: string;
last_install: ISoftwareLastInstall | null;
last_uninstall: ISoftwareLastUninstall | null;
categories?: SoftwareCategory[] | null;
automatic_install_policies?: ISoftwareInstallPolicy[] | null;
2025-10-28 16:44:17 +00:00
platform?: Platform;
}
export interface IHostAppStoreApp {
app_store_id: string;
platform: Platform;
self_service: boolean;
icon_url: string;
version: string;
last_install: IAppLastInstall | null;
categories?: SoftwareCategory[] | null;
automatic_install_policies?: ISoftwareInstallPolicy[] | null;
}
export interface IHostSoftware {
id: number;
/** All software names displayed by UI is ran through getDisplayedSoftwareName */
name: string; // e.g., "mock software.app"
/** Custom name set per team by admin */
display_name?: string; // e.g. "Mock Software"
icon_url: string | null;
software_package: IHostSoftwarePackage | null;
app_store_app: IHostAppStoreApp | null;
source: SoftwareSource;
extension_for?: SoftwareExtensionFor;
bundle_identifier?: string;
status: Exclude<SoftwareInstallUninstallStatus, "uninstalled"> | null;
installed_versions: ISoftwareInstallVersion[] | null;
}
Update UI for software self-service features (#19244) Issues https://github.com/fleetdm/fleet/issues/17587, https://github.com/fleetdm/fleet/issues/18836, https://github.com/fleetdm/fleet/issues/18837, https://github.com/fleetdm/fleet/pull/18339, and https://github.com/fleetdm/fleet/pull/18340 # TODOS - Integrate backend - Unit/integration tests - Various todos noted in comments - Cleanup styles and organization of components (de-duplicating and consolidating where possible) - Activity feed updates (if any) # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [ ] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] If database migrations are included, checked table schema to confirm autoupdate - For database migrations: - [ ] Checked schema for all modified table for columns that will auto-update timestamps during migration. - [ ] Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects. - [ ] Ensured the correct collation is explicitly set for character columns (`COLLATE utf8mb4_unicode_ci`). - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)). --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2024-05-31 10:09:53 +00:00
/**
* Comprehensive list of possible UI software statuses for host > software > library/self-service.
*
* These are more detailed than the raw API `.status` and are determined by:
* - Whether the host is online or offline
* - If the fleet-installed version is newer than any in installed_versions
* - Special handling for tarballs (tgz_packages)
* - Cases where the software inventory has not yet updated to reflect a recent change
* (i.e., last_install date vs host software's updated_at date)
*/
// Error UI statuses
export const HOST_SOFTWARE_UI_ERROR_STATUSES = [
"failed_install", // Install attempt failed
"failed_install_installed", // Install attempt failed but version still present
"failed_install_update_available", // Install/update failed; newer installer version available
"failed_uninstall_installed", // Uninstall attempt failed but version still present
"failed_uninstall", // Uninstall attempt failed
"failed_uninstall_update_available", // Uninstall/update failed; newer installer version available
"failed_script", // Script package failed to run
] as const;
export type HostSoftwareUiErrorStatus = typeof HOST_SOFTWARE_UI_ERROR_STATUSES[number];
export const isSoftwareErrorStatus = (
status: IHostSoftwareUiStatus
): status is HostSoftwareUiErrorStatus =>
HOST_SOFTWARE_UI_ERROR_STATUSES.includes(status as HostSoftwareUiErrorStatus);
// Pending UI statuses for OFFLINE hosts
export const HOST_SOFTWARE_UI_PENDING_STATUSES = [
"pending_install", // Install scheduled (no newer installer version)
"pending_uninstall", // Uninstall scheduled
"pending_update", // Update scheduled (no newer installer version)
"pending_script", // Fleet-initiated script run scheduled
] as const;
export type HostSoftwareUiPendingStatus = typeof HOST_SOFTWARE_UI_PENDING_STATUSES[number];
export const isSoftwarePendingStatus = (
status: IHostSoftwareUiStatus
): status is HostSoftwareUiPendingStatus =>
HOST_SOFTWARE_UI_PENDING_STATUSES.includes(
status as HostSoftwareUiPendingStatus
);
// In-progress UI statuses for ONLINE hosts
export const HOST_SOFTWARE_UI_IN_PROGRESS_STATUSES = [
"installing", // Fleet-initiated install in progress
"updating", // Update (install) in progress with newer fleet installer
"uninstalling", // Fleet-initiated uninstall in progress
"running_script", // Fleet-initiated script run in progress
] as const;
export type HostSoftwareUiInProgressStatus = typeof HOST_SOFTWARE_UI_IN_PROGRESS_STATUSES[number];
export const isSoftwareInProgressStatus = (
status: IHostSoftwareUiStatus
): status is HostSoftwareUiInProgressStatus =>
HOST_SOFTWARE_UI_IN_PROGRESS_STATUSES.includes(
status as HostSoftwareUiInProgressStatus
);
// Success/steady-state UI statuses
export const HOST_SOFTWARE_UI_SUCCESS_STATUSES = [
"installed", // Present in inventory; no newer fleet installer version (tarballs: successful install only)
"uninstalled", // Not present in inventory (tarballs: successful uninstall or never installed)
// NOTE: Recently statuses cannot apply to tarballs as we cannot detect inventory
"recently_updated", // Update applied (installer newer than inventory), but inventory not yet refreshed
"recently_installed", // Install applied (installer NOT newer than inventory), but inventory not yet refreshed
"recently_uninstalled", // Uninstall applied, but inventory not yet refreshed
"ran_script", // Script package ran successfully
"never_ran_script", // Script package never ran before
] as const;
export type HostSoftwareUiSuccessStatus = typeof HOST_SOFTWARE_UI_SUCCESS_STATUSES[number];
export const isSoftwareSuccessStatus = (
status: IHostSoftwareUiStatus
): status is HostSoftwareUiSuccessStatus =>
HOST_SOFTWARE_UI_SUCCESS_STATUSES.includes(
status as HostSoftwareUiSuccessStatus
);
// Update-available UI status
export const HOST_SOFTWARE_UI_UPDATE_AVAILABLE_STATUSES = [
"update_available", // In inventory, but newer fleet installer version is available
] as const;
export type HostSoftwareUiUpdateAvailableStatus = typeof HOST_SOFTWARE_UI_UPDATE_AVAILABLE_STATUSES[number];
export const isSoftwareUpdateAvailableStatus = (
status: IHostSoftwareUiStatus
): status is HostSoftwareUiUpdateAvailableStatus =>
HOST_SOFTWARE_UI_UPDATE_AVAILABLE_STATUSES.includes(
status as HostSoftwareUiUpdateAvailableStatus
);
// Master UI status type, combining all:
export type IHostSoftwareUiStatus =
| HostSoftwareUiErrorStatus
| HostSoftwareUiPendingStatus
| HostSoftwareUiSuccessStatus
| HostSoftwareUiInProgressStatus
| HostSoftwareUiUpdateAvailableStatus;
/**
* Extends IHostSoftware with a computed `ui_status` field.
*
* The `ui_status` categorizes software installation state for the UI by
* combining the `status`, `installed_versions` info, and other factors
* like host online state (via getUiStatus helper function), enabling
* more detailed and status labels needed for the status and actions columns.
*/
export interface IHostSoftwareWithUiStatus extends IHostSoftware {
ui_status: IHostSoftwareUiStatus;
}
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
/**
* Allows unified data model for rendering of host VPP software installs and uninstalls
* Optional as pending may not have a commandUuid
*/
export type IVPPHostSoftware = IHostSoftware & {
commandUuid?: string;
};
export type IHostSoftwareUninstall = IHostSoftwareWithUiStatus & {
scriptExecutionId: string;
};
export type IDeviceSoftware = IHostSoftware;
export type IDeviceSoftwareWithUiStatus = IHostSoftwareWithUiStatus;
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
const INSTALL_STATUS_PREDICATES: Record<
EnhancedSoftwareInstallUninstallStatus | "pending",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
string
> = {
pending: "pending",
2024-07-16 17:16:57 +00:00
installed: "installed",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
uninstalled: "uninstalled",
2024-09-04 21:46:48 +00:00
pending_install: "told Fleet to install",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
failed_install: "failed to install",
2024-09-05 19:20:36 +00:00
pending_uninstall: "told Fleet to uninstall",
failed_uninstall: "failed to uninstall",
ran_script: "ran", // Script-only software
failed_script: "failed to run", // Script-only software
pending_script: "told Fleet to run", // Script-only software
2024-07-16 17:16:57 +00:00
} as const;
export const getInstallUninstallStatusPredicate = (
status: string | undefined,
isScriptPackage = false
) => {
2024-07-16 17:16:57 +00:00
if (!status) {
return INSTALL_STATUS_PREDICATES.pending;
}
// If it is a script package, map install statuses to script-specific predicates
if (isScriptPackage) {
switch (status.toLowerCase()) {
case "installed":
return INSTALL_STATUS_PREDICATES.ran_script;
case "pending_install":
return INSTALL_STATUS_PREDICATES.pending_script;
case "failed_install":
return INSTALL_STATUS_PREDICATES.failed_script;
default:
break;
}
}
// For all other cases, return the matching predicate or default to pending
2024-07-16 17:16:57 +00:00
return (
INSTALL_STATUS_PREDICATES[
status.toLowerCase() as keyof typeof INSTALL_STATUS_PREDICATES
] || INSTALL_STATUS_PREDICATES.pending
2024-07-16 17:16:57 +00:00
);
};
export const aggregateInstallStatusCounts = (
packageStatuses: ISoftwarePackage["status"]
) => ({
installed: packageStatuses.installed,
pending: packageStatuses.pending_install + packageStatuses.pending_uninstall,
failed: packageStatuses.failed_install + packageStatuses.failed_uninstall,
});
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
export const INSTALL_STATUS_ICONS: Record<
EnhancedSoftwareInstallUninstallStatus | "pending" | "failed",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
IconNames
> = {
2024-07-16 17:16:57 +00:00
pending: "pending-outline",
2024-09-04 21:46:48 +00:00
pending_install: "pending-outline",
2024-07-16 17:16:57 +00:00
installed: "success-outline",
UI – Uninstall features for host details, install/uninstall actions, activity feed, misc other items (#21933) ## #21566 - Host details updates for Uninstall packages details > software page. Full tasks outlined in the issue, [Figma here](https://www.figma.com/design/ToQaK2yUJwDyzagTdrbOfX/%2320320-Uninstall-packages?node-id=5364-13173&m=dev) **Updated install status tooltips:** ![install-status-tooltips](https://github.com/user-attachments/assets/9869c7d6-f953-4adc-9692-52f5dad9d81a) **Uninstall action:** ![uninstall-action](https://github.com/user-attachments/assets/189d5755-556c-48ca-8824-08db14ec95d4) **Update install details:** ![Screenshot 2024-09-09 at 1 12 58 PM](https://github.com/user-attachments/assets/f52b349b-9f01-49d4-b952-6efd60f29979) ## #21931 - updated specs for install/uninstall states ## #21568 - activity feed items for Uninstall ![Screenshot 2024-09-09 at 5 00 07 PM](https://github.com/user-attachments/assets/eb61949a-9f8d-4b9e-a437-2d31a6808f07) ![Screenshot 2024-09-09 at 5 42 52 PM](https://github.com/user-attachments/assets/a8c2de0e-27e3-4d2b-bf69-702ea7b72e48) ![Screenshot 2024-09-09 at 5 43 03 PM](https://github.com/user-attachments/assets/b6127ed3-6fcf-439e-aa3d-91038a025d92) ## #21567 - Uninstall details modal ![Screenshot 2024-09-10 at 7 42 18 PM](https://github.com/user-attachments/assets/a42e4e4a-eadd-4e75-84c5-c5f6a6230950) _remaining TODO_: - [x] manually QA 'failed' states - [x] determine where to source timestamp from for uninstall activities - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor@fleetdm.com>
2024-09-12 15:51:59 +00:00
uninstalled: "success-outline",
2024-07-16 17:16:57 +00:00
failed: "error-outline",
2024-09-04 21:46:48 +00:00
failed_install: "error-outline",
2024-09-05 19:20:36 +00:00
pending_uninstall: "pending-outline",
failed_uninstall: "error-outline",
ran_script: "success-outline", // Script-only software
failed_script: "error-outline", // Script-only software
pending_script: "pending-outline", // Script-only software
2024-07-16 17:16:57 +00:00
} as const;
type IHostSoftwarePackageWithLastInstall = IHostSoftwarePackage & {
last_install: ISoftwareLastInstall;
};
export const hasHostSoftwarePackageLastInstall = (
software: IHostSoftware
): software is IHostSoftware & {
software_package: IHostSoftwarePackageWithLastInstall;
} => {
return !!software.software_package?.last_install;
};
type IHostAppWithLastInstall = IHostAppStoreApp & {
last_install: IAppLastInstall;
};
export const hasHostSoftwareAppLastInstall = (
software: IHostSoftware
): software is IHostSoftware & {
app_store_app: IHostAppWithLastInstall;
} => {
return !!software.app_store_app?.last_install;
};
export const isIpadOrIphoneSoftwareSource = (source: string) =>
["ios_apps", "ipados_apps"].includes(source);
Auto software update frontend (#37677) <!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #35459 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [ ] Added/updated automated tests working on these - [X] QA'd all new/changed functionality manually ## Screenshots | Option does not appear for FMA apps | | --- | | <img width="723" height="419" alt="image" src="https://github.com/user-attachments/assets/f9f1328e-e38c-452c-b06e-337a69c13e71" /> | | Option does not appear for custom packages | | --- | | <img width="731" height="416" alt="image" src="https://github.com/user-attachments/assets/3de78f15-d7ce-45c7-875f-a250fc00a160" /> | | Option does not appear for macOS VPP apps | | --- | | <img width="725" height="454" alt="image" src="https://github.com/user-attachments/assets/07dcb074-f57d-4cc4-a746-20b80c821fb6" /> | | Option appears iOS VPP apps | | --- | | <img width="727" height="420" alt="image" src="https://github.com/user-attachments/assets/ec4ce503-0300-437c-b3f2-248928fcfe7b" /> | | Option appears iPadOS VPP apps | | --- | | <img width="727" height="422" alt="image" src="https://github.com/user-attachments/assets/0030c6cc-3d93-480c-af93-740fca4d5b57" /> | | Form with auto-updates disabled | | --- | | <img width="668" height="517" alt="image" src="https://github.com/user-attachments/assets/d59a7ba4-dc83-4a80-ba94-0befc7635f05" /> | | Start / end time validation | | --- | | <img width="668" height="679" alt="image" src="https://github.com/user-attachments/assets/939fd09a-76f6-42de-9c71-fe4982f3f84b" /> | | Maintenance window length validation | | --- | | <img width="664" height="681" alt="image" src="https://github.com/user-attachments/assets/a2eab676-5166-42a9-9043-2565014e33cb" /> | | Badge and banner appears after saving | | --- | | <img width="766" height="529" alt="image" src="https://github.com/user-attachments/assets/48d89e1d-4430-4dd7-b8e6-d5b04ebad47f" /> | --------- Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com> Co-authored-by: Nico <32375741+nulmete@users.noreply.github.com>
2026-01-05 16:43:26 +00:00
export const isIpadOrIphoneSoftware = (platform: string) =>
["ios", "ipados"].includes(platform);
export const isAndroidSoftwareSource = (source: string) =>
source === "android_apps";
export interface IFleetMaintainedApp {
id: number;
name: string;
version: string;
2025-03-21 13:33:06 +00:00
platform: FleetMaintainedAppPlatform;
software_title_id?: number; // null unless the team already has the software added (as a Fleet-maintained app, App Store (app), or custom package)
}
2025-03-21 13:33:06 +00:00
export type FleetMaintainedAppPlatform = Extract<
Platform,
"darwin" | "windows"
>;
export interface ICombinedFMA {
name: string;
macos: Omit<IFleetMaintainedApp, "name"> | null;
windows: Omit<IFleetMaintainedApp, "name"> | null;
}
export interface IFleetMaintainedAppDetails {
id: number;
name: string;
version: string;
2025-03-21 13:33:06 +00:00
platform: FleetMaintainedAppPlatform;
pre_install_script: string;
install_script: string;
2025-03-21 13:33:06 +00:00
post_install_script: string;
uninstall_script: string;
url: string;
slug: string;
2025-03-21 13:33:06 +00:00
software_title_id?: number; // null unless the team already has the software added (as a Fleet-maintained app, App Store (app), or custom package)
categories: SoftwareCategory[] | null;
}
export const ROLLING_ARCH_LINUX_NAMES = [
"Arch Linux",
"Arch Linux ARM",
"Manjaro Linux",
"Manjaro Linux ARM",
"Manjaro ARM Linux",
];
export const ROLLING_ARCH_LINUX_VERSIONS = ROLLING_ARCH_LINUX_NAMES.map(
(name) => `${name} rolling`
);