fleet/frontend/pages/ManageControlsPage/SetupExperience/SetupExperienceNavItems.tsx
jacobshandling 477f3cbaec
UI: Couple Setup experience > Install software selected platform with URL (#33327)
## For #33299 

- Couple card logic to URL param
- Validate param, push to default macos if invalid or missing
- Validate that other setup experience cards don't have a platform
param, push to no param if present


![ezgif-7ab225faff3840](https://github.com/user-attachments/assets/ea1c0382-a928-4855-a083-c8c52ec2ab4f)


- [x] QA'd all new/changed functionality manually

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-09-23 09:54:39 -07:00

52 lines
1.5 KiB
TypeScript

import PATHS from "router/paths";
import { InjectedRouter } from "react-router";
import { ISideNavItem } from "pages/admin/components/SideNav/SideNav";
import EndUserAuthentication from "./cards/EndUserAuthentication/EndUserAuthentication";
import BootstrapPackage from "./cards/BootstrapPackage";
import SetupAssistant from "./cards/SetupAssistant";
import InstallSoftware from "./cards/InstallSoftware";
import RunScript from "./cards/RunScript";
export interface ISetupExperienceCardProps {
currentTeamId: number;
router: InjectedRouter;
urlPlatformParam?: string; // not yet guaranteed to be a valid platform
}
const SETUP_EXPERIENCE_NAV_ITEMS: ISideNavItem<ISetupExperienceCardProps>[] = [
{
title: "1. End user authentication",
urlSection: "end-user-auth",
path: PATHS.CONTROLS_END_USER_AUTHENTICATION,
Card: EndUserAuthentication,
},
{
title: "2. Bootstrap package",
urlSection: "bootstrap-package",
path: PATHS.CONTROLS_BOOTSTRAP_PACKAGE,
Card: BootstrapPackage,
},
{
title: "3. Install software",
urlSection: "install-software",
path: PATHS.CONTROLS_INSTALL_SOFTWARE("macos"),
Card: InstallSoftware,
},
{
title: "4. Run script",
urlSection: "run-script",
path: PATHS.CONTROLS_RUN_SCRIPT,
Card: RunScript,
},
{
title: "5. Setup assistant",
urlSection: "setup-assistant",
path: PATHS.CONTROLS_SETUP_ASSITANT,
Card: SetupAssistant,
},
];
export default SETUP_EXPERIENCE_NAV_ITEMS;