fleet/frontend/router/paths.ts
Lucas Manuel Rodriguez 964f85b174
Amend policy creation and spec (for proprietary query), and add update APIs (#2890)
* Amend policy creation (proprietary query), add update APIs

* Fix Datastore.SavePolicy bug (and add tests)

* Add integration tests for new policy APIs

* Add author email

* Add activities

* Push breaking changes for return policy fields

* WIP

* Add integration test for host policies

* Make more improvements to policy representation

* Improve upgrade code (from PR review comments)

* PR changes

* Revert activities for policies

* Use *uint instead of uint for queryID, use fleet.PolicyPayload

* Filter out other schemas

* New policy flow (#2922)

* created new policy flow -- no API connection

* added api props

* fixed prop name

* lint fixes

* removed unused modal; fixed style

* name, desc icons; created global components

* lint fixes

* ignoring certain files and lines for prettier

* Update frontend/pages/policies/PolicyPage/PolicyPage.tsx

* Make policy names unique across deployment

* Amend upgrade script

* Fix migration for unique names

* Do not deduplicate but instead rename policies

Co-authored-by: Martavis Parker <47053705+martavis@users.noreply.github.com>
2021-11-24 14:16:42 -03:00

56 lines
2.0 KiB
TypeScript

import { IHost } from "../interfaces/host";
import { IQuery } from "../interfaces/query";
import { IPolicy } from "../interfaces/policy";
import URL_PREFIX from "./url_prefix";
export default {
ROOT: `${URL_PREFIX}/`,
HOME: `${URL_PREFIX}/dashboard`,
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: (packId: number): string => {
return `${URL_PREFIX}/packs/${packId}/edit`;
},
PACK: (packId: number): string => {
return `${URL_PREFIX}/packs/${packId}`;
},
EDIT_QUERY: (query: IQuery): string => {
return `${URL_PREFIX}/queries/${query.id}`;
},
EDIT_POLICY: (policy: IPolicy): string => {
return `${URL_PREFIX}/policies/${policy.id}`;
},
FORGOT_PASSWORD: `${URL_PREFIX}/login/forgot`,
API_ONLY_USER: `${URL_PREFIX}/apionlyuser`,
FLEET_403: `${URL_PREFIX}/403`,
// FLEET_500: `${URL_PREFIX}/500`,
LOGIN: `${URL_PREFIX}/login`,
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_POLICY: `${URL_PREFIX}/policies/new`,
NEW_QUERY: `${URL_PREFIX}/queries/new`,
RESET_PASSWORD: `${URL_PREFIX}/login/reset`,
SETUP: `${URL_PREFIX}/setup`,
USER_SETTINGS: `${URL_PREFIX}/profile`,
URL_PREFIX,
};