Skip to content

Commit

Permalink
Merge pull request #2868 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
JohnDuprey authored Aug 30, 2024
2 parents c29d0e3 + 6495cb1 commit 652c2eb
Showing 1 changed file with 35 additions and 34 deletions.
69 changes: 35 additions & 34 deletions src/views/email-exchange/administration/EditMailboxPermissions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,14 @@ const ForwardingSettings = ({ refresh }) => {
const userId = query.get('userId')
const tenantDomain = query.get('tenantDomain')
const [content, setContent] = useState([])
const [showLoading, setShowLoading] = useState(false)
const [currentRefresh, setCurrentRefresh] = useState('')
const {
data: details,
isFetching,
isSuccess,
error,
} = useGenericPostRequestQuery({
path: `/api/ListExoRequest?Cmdlet=Get-Mailbox&TenantFilter=${tenantDomain}&Select=ForwardingAddress,ForwardingSmtpAddress,DeliverToMailboxAndForward&refresh=${refresh}`,
path: `/api/ListExoRequest?Cmdlet=Get-Mailbox&TenantFilter=${tenantDomain}&Select=ForwardingAddress,ForwardingSmtpAddress,DeliverToMailboxAndForward&refresh=${currentRefresh}`,
values: { Identity: userId },
})
Expand All @@ -821,7 +820,6 @@ const ForwardingSettings = ({ refresh }) => {
useEffect(() => {
if (refresh !== currentRefresh) {
setShowLoading(false)
setCurrentRefresh(refresh)
}
Expand Down Expand Up @@ -904,42 +902,39 @@ const ForwardingSettings = ({ refresh }) => {
},
])
}
} else if ((isFetching || usersIsFetching) && showLoading === false) {
setContent([
{
heading: 'Forward and Deliver',
body: <Skeleton />,
},
{
heading: 'Forwarding Address',
body: <Skeleton />,
},
])
setShowLoading(true)
}
}, [
refresh,
currentRefresh,
users,
details,
usersSuccess,
isSuccess,
isFetching,
usersIsFetching,
showLoading,
])
}, [refresh, currentRefresh, users, details, usersSuccess, isSuccess])

return (
<CRow>
<CCol md={6}>
{content.map((item, index) => (
<div key={index}>
<h5>{item.heading}</h5>
<p>{item.body}</p>
</div>
))}
<CCol md={8}>
{isFetching || usersIsFetching ? (
<>
<div>
<h5>Forward and Deliver</h5>
<p>
<Skeleton />
</p>
</div>
<div>
<h5>Forwarding Address</h5>
<p>
<Skeleton />
</p>
</div>
</>
) : (
<>
{content.map((item, index) => (
<div key={index}>
<h5>{item.heading}</h5>
<p>{item.body}</p>
</div>
))}
</>
)}
</CCol>
<CCol md={6}>
<CCol md={4}>
<CButton
onClick={() => setCurrentRefresh((Math.random() + 1).toString(36).substring(7))}
color="primary"
Expand Down Expand Up @@ -1114,6 +1109,9 @@ const OutOfOffice = ({ refreshFunction }) => {
</>
)
}
OutOfOffice.propTypes = {
refreshFunction: PropTypes.func,
}

const OutOfOfficeSettings = ({ refresh }) => {
const query = useQuery()
Expand Down Expand Up @@ -1200,3 +1198,6 @@ const OutOfOfficeSettings = ({ refresh }) => {
</CRow>
)
}
OutOfOfficeSettings.propTypes = {
refresh: PropTypes.string,
}

0 comments on commit 652c2eb

Please sign in to comment.