Skip to content

Commit 0523c8c

Browse files
committed
bring back offboarding defaults
1 parent 137e9b0 commit 0523c8c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/components/CippWizard/CippWizardOffboarding.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import { CippFormCondition } from "../CippComponents/CippFormCondition";
55
import { useWatch } from "react-hook-form";
66
import { useEffect, useState } from "react";
77
import { Grid } from "@mui/system";
8+
import { useSettings } from "../../hooks/use-settings";
89

910
export const CippWizardOffboarding = (props) => {
1011
const { postUrl, formControl, onPreviousStep, onNextStep, currentStep } = props;
1112
const currentTenant = formControl.watch("tenantFilter");
1213
const selectedUsers = useWatch({ control: formControl.control, name: "user" });
1314
const [showAlert, setShowAlert] = useState(false);
15+
const userSettingsDefaults = useSettings().userSettingsDefaults;
1416

1517
useEffect(() => {
1618
if (selectedUsers.length >= 4) {
@@ -19,6 +21,14 @@ export const CippWizardOffboarding = (props) => {
1921
}
2022
}, [selectedUsers]);
2123

24+
useEffect(() => {
25+
if (userSettingsDefaults?.offboardingDefaults) {
26+
userSettingsDefaults.offboardingDefaults.forEach((setting) => {
27+
formControl.setValue(setting.name, setting.value);
28+
});
29+
}
30+
}, [userSettingsDefaults]);
31+
2232
return (
2333
<Stack spacing={4}>
2434
<Grid container spacing={4}>

src/pages/cipp/preferences.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,26 @@ const Page = () => {
255255
/>
256256
),
257257
},
258+
{
259+
label: "Disable Sign in",
260+
value: (
261+
<CippFormComponent
262+
type="switch"
263+
name="offboardingDefaults.DisableSignIn"
264+
formControl={formcontrol}
265+
/>
266+
),
267+
},
268+
{
269+
label: "Remove all MFA Devices",
270+
value: (
271+
<CippFormComponent
272+
type="switch"
273+
name="offboardingDefaults.RemoveMFADevices"
274+
formControl={formcontrol}
275+
/>
276+
),
277+
},
258278
]}
259279
/>
260280
</Stack>

0 commit comments

Comments
 (0)