fleet/frontend/router/paths.ts
Martavis Parker b6659cfaaa
Refactored Manage Hosts (#2233)
* Add new feature: team policies

* Continue work on team policies

* Continue work on team policies

* Continue team policies

* Revert accidental deletion

* Rename variables

* code refactored; working on runtime errors

* updated front end docs

* Update URLs from team to teams, add tests for policy auth

* Fix test

* Continue work on team policies

* Add permission checks

* mange hosts functional and cleaned up; typing

* improved label logic

* added try catch to awaits

* lint fixes

* frontend unit tests don't work for functional components

* test fix

* revert

* Address errors related to refetch on window focus

* Add loading error check

* Fix typos in loading error checks

* Guard against invariant condition in useEffect

* Update links and routes for team policies

* lint fixes

* Update frontend/pages/hosts/ManageHostsPage/helpers.ts

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>

* Change inherited policies button, tooltip

* lint fixes

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: Tomas Touceda <chiiph@gmail.com>
2021-09-30 12:32:06 -07:00

52 lines
1.8 KiB
TypeScript

import { IHost } from "../interfaces/host";
import { IPack } from "../interfaces/pack";
import { IQuery } from "../interfaces/query";
import URL_PREFIX from "./url_prefix";
export default {
ADMIN_USERS: `${URL_PREFIX}/settings/users`,
ADMIN_SETTINGS: `${URL_PREFIX}/settings/organization`,
ADMIN_TEAMS: `${URL_PREFIX}/settings/teams`,
ALL_PACKS: `${URL_PREFIX}/packs/all`,
EDIT_PACK: (pack: IPack): string => {
return `${URL_PREFIX}/packs/${pack.id}/edit`;
},
PACK: (pack: IPack): string => {
return `${URL_PREFIX}/packs/${pack.id}`;
},
EDIT_QUERY: (query: IQuery): string => {
return `${URL_PREFIX}/queries/${query.id}`;
},
FORGOT_PASSWORD: `${URL_PREFIX}/login/forgot`,
HOME: `${URL_PREFIX}/`,
API_ONLY_USER: `${URL_PREFIX}/apionlyuser`,
FLEET_403: `${URL_PREFIX}/403`,
FLEET_500: `${URL_PREFIX}/500`,
LOGIN: `${URL_PREFIX}/login`,
HOMEPAGE: `${URL_PREFIX}/home/dashboard`,
LOGOUT: `${URL_PREFIX}/logout`,
MANAGE_HOSTS: `${URL_PREFIX}/hosts/manage`,
HOST_DETAILS: (host: IHost): string => {
return `${URL_PREFIX}/hosts/${host.id}`;
},
TEAM_DETAILS_MEMBERS: (teamId: number): string => {
return `${URL_PREFIX}/settings/teams/${teamId}/members`;
},
TEAM_DETAILS_OPTIONS: (teamId: number): string => {
return `${URL_PREFIX}/settings/teams/${teamId}/options`;
},
MANAGE_PACKS: `${URL_PREFIX}/packs/manage`,
NEW_PACK: `${URL_PREFIX}/packs/new`,
MANAGE_QUERIES: `${URL_PREFIX}/queries/manage`,
MANAGE_SCHEDULE: `${URL_PREFIX}/schedule/manage`,
MANAGE_TEAM_SCHEDULE: (teamId: number): string => {
return `${URL_PREFIX}/schedule/manage/teams/${teamId}`;
},
MANAGE_POLICIES: `${URL_PREFIX}/policies/manage`,
NEW_QUERY: `${URL_PREFIX}/queries/new`,
RESET_PASSWORD: `${URL_PREFIX}/login/reset`,
SETUP: `${URL_PREFIX}/setup`,
USER_SETTINGS: `${URL_PREFIX}/profile`,
URL_PREFIX,
};