File tree Expand file tree Collapse file tree 5 files changed +21
-8
lines changed
components/CippComponents
identity/administration/users/user Expand file tree Collapse file tree 5 files changed +21
-8
lines changed Original file line number Diff line number Diff line change 11import { Box , Stack } from "@mui/material" ;
2+ import { useEffect } from "react" ;
23import CippFormComponent from "./CippFormComponent" ;
34import { useWatch } from "react-hook-form" ;
45
5- const CippMailboxPermissionsDialog = ( { formHook, combinedOptions, isUserGroupLoading } ) => {
6+ const CippMailboxPermissionsDialog = ( {
7+ formHook,
8+ combinedOptions,
9+ isUserGroupLoading,
10+ defaultAutoMap = false
11+ } ) => {
612 const fullAccess = useWatch ( {
713 control : formHook . control ,
814 name : "permissions.AddFullAccess" ,
915 } ) ;
1016
17+ // Set the default AutoMap value when component mounts
18+ useEffect ( ( ) => {
19+ formHook . setValue ( "permissions.AutoMap" , defaultAutoMap ) ;
20+ } , [ formHook , defaultAutoMap ] ) ;
21+
1122 return (
1223 < Stack spacing = { 2 } sx = { { mt : 1 } } >
1324 < Box >
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ import { useForm } from "react-hook-form";
22import { Layout as DashboardLayout } from "/src/layouts/index.js" ;
33import CippFormPage from "/src/components/CippFormPages/CippFormPage" ;
44import { useSettings } from "../../../../hooks/use-settings" ;
5+ import { Divider } from "@mui/material" ;
6+ import { Grid } from "@mui/system" ;
7+ import CippFormComponent from "/src/components/CippComponents/CippFormComponent" ;
58
69const AddContact = ( ) => {
710 const tenantDomain = useSettings ( ) . currentTenant ;
Original file line number Diff line number Diff line change 1- import { useEffect , useMemo } from "react" ;
1+ import { useEffect , useMemo , useCallback } from "react" ;
22import { useRouter } from "next/router" ;
33import { useForm } from "react-hook-form" ;
44import { Layout as DashboardLayout } from "/src/layouts/index.js" ;
55import CippFormPage from "/src/components/CippFormPages/CippFormPage" ;
66import { useSettings } from "../../../../hooks/use-settings" ;
77import { ApiGetCall } from "../../../../api/ApiCall" ;
88import countryList from "/src/data/countryList.json" ;
9+ import { Grid } from "@mui/system" ;
10+ import CippFormComponent from "/src/components/CippComponents/CippFormComponent" ;
11+ import { Divider } from "@mui/material" ;
912
1013const countryLookup = new Map (
1114 countryList . map ( country => [ country . Name , country . Code ] )
Original file line number Diff line number Diff line change 1- import React , { useEffect } from "react" ;
1+ import { useEffect } from "react" ;
22import { Grid } from "@mui/system" ;
33import { useForm , useWatch } from "react-hook-form" ;
44import { Layout as DashboardLayout } from "/src/layouts/index.js" ;
Original file line number Diff line number Diff line change @@ -979,17 +979,13 @@ const Page = () => {
979979 api = { permissionsApiConfig }
980980 row = { graphUserRequest . data ?. [ 0 ] }
981981 allowResubmit = { true }
982- defaultvalues = { {
983- permissions : {
984- AutoMap : true ,
985- } ,
986- } }
987982 >
988983 { ( { formHook } ) => (
989984 < CippMailboxPermissionsDialog
990985 formHook = { formHook }
991986 combinedOptions = { combinedOptions }
992987 isUserGroupLoading = { isUserGroupLoading }
988+ defaultAutoMap = { true }
993989 />
994990 ) }
995991 </ CippApiDialog >
You can’t perform that action at this time.
0 commit comments