mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
UI: include team_id when nav to new policy from host details (#13757)
This commit is contained in:
parent
6130a7bbd7
commit
72f5c5b30c
3 changed files with 6 additions and 3 deletions
|
|
@ -155,6 +155,7 @@ const reducer = (state: InitialStateType, action: IAction) => {
|
|||
}
|
||||
};
|
||||
|
||||
// TODO: Can we remove policyTeamId in favor of always using URL team_id param?
|
||||
export const PolicyContext = createContext<InitialStateType>(initialState);
|
||||
|
||||
const PolicyProvider = ({ children }: Props): JSX.Element => {
|
||||
|
|
|
|||
|
|
@ -464,7 +464,9 @@ const HostDetailsPage = ({
|
|||
setLastEditedQueryBody(osPolicyQuery);
|
||||
setLastEditedQueryResolution("");
|
||||
setLastEditedQueryCritical(false);
|
||||
router.replace(NEW_POLICY);
|
||||
router.replace(
|
||||
`${NEW_POLICY}${host?.team_id ? `?team_id=${host?.team_id}` : ""}`
|
||||
);
|
||||
};
|
||||
|
||||
const onDestroyHost = async () => {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import Icon from "components/Icon/Icon";
|
|||
|
||||
import { ITeam } from "interfaces/team";
|
||||
|
||||
interface IRenderOSPolicyModal {
|
||||
interface IOSPolicyModal {
|
||||
onCreateNewPolicy: (team: ITeam) => void;
|
||||
onCancel: () => void;
|
||||
osVersion?: string;
|
||||
|
|
@ -30,7 +30,7 @@ const OSPolicyModal = ({
|
|||
detailsUpdatedAt,
|
||||
osPolicy,
|
||||
osPolicyLabel,
|
||||
}: IRenderOSPolicyModal): JSX.Element => {
|
||||
}: IOSPolicyModal): JSX.Element => {
|
||||
const [copyMessage, setCopyMessage] = useState("");
|
||||
|
||||
const renderOsPolicyLabel = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue