Skip to content

Fix: Fix blocked for spam and add alert text #4463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions src/components/CippCards/CippExchangeInfoCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
IconButton,
Typography,
CircularProgress,
Alert,
} from "@mui/material";
import { PropertyList } from "/src/components/property-list";
import { PropertyListItem } from "/src/components/property-list-item";
Expand Down Expand Up @@ -59,6 +60,11 @@ export const CippExchangeInfoCard = (props) => {
</Stack>
}
/>
{exchangeData?.BlockedForSpam ? (
<Alert severity="warning" sx={{ mx: 2, mt: 2, mb: 2 }}>
This mailbox is currently blocked for spam.
</Alert>
) : null}
<Divider />
<PropertyList>
<PropertyListItem
Expand All @@ -81,7 +87,10 @@ export const CippExchangeInfoCard = (props) => {
Hidden from GAL:
</Typography>
<Typography variant="inherit">
{getCippFormatting(exchangeData?.HiddenFromAddressLists, "HiddenFromAddressLists")}
{getCippFormatting(
exchangeData?.HiddenFromAddressLists,
"HiddenFromAddressLists"
)}
</Typography>
</Grid>
<Grid size={{ xs: 12, md: 4 }}>
Expand Down Expand Up @@ -127,14 +136,15 @@ export const CippExchangeInfoCard = (props) => {
value={
isLoading ? (
<Skeleton variant="text" width={200} />
) : (() => {
) : (
(() => {
const forwardingAddress = exchangeData?.ForwardingAddress;
const forwardAndDeliver = exchangeData?.ForwardAndDeliver;

// Determine forwarding type and clean address
let forwardingType = "None";
let cleanAddress = "";

if (forwardingAddress) {
if (forwardingAddress.startsWith("smtp:")) {
forwardingType = "External";
Expand All @@ -144,18 +154,17 @@ export const CippExchangeInfoCard = (props) => {
cleanAddress = forwardingAddress;
}
}

return (
<Grid container spacing={2}>
<Grid size={{ xs: 12, md: 6 }}>
<Typography variant="inherit" color="text.primary" gutterBottom>
Forwarding Status:
</Typography>
<Typography variant="inherit">
{forwardingType === "None"
{forwardingType === "None"
? getCippFormatting(false, "ForwardingStatus")
: `${forwardingType} Forwarding`
}
: `${forwardingType} Forwarding`}
</Typography>
</Grid>
{forwardingType !== "None" && (
Expand All @@ -172,18 +181,17 @@ export const CippExchangeInfoCard = (props) => {
<Typography variant="inherit" color="text.primary" gutterBottom>
Forwarding Address:
</Typography>
<Typography variant="inherit">
{cleanAddress}
</Typography>
<Typography variant="inherit">{cleanAddress}</Typography>
</Grid>
</>
)}
</Grid>
);
})()
)
}
/>

{/* Archive section - always show status */}
<PropertyListItem
divider
Expand All @@ -207,7 +215,10 @@ export const CippExchangeInfoCard = (props) => {
Auto Expanding Archive:
</Typography>
<Typography variant="inherit">
{getCippFormatting(exchangeData?.AutoExpandingArchive, "AutoExpandingArchive")}
{getCippFormatting(
exchangeData?.AutoExpandingArchive,
"AutoExpandingArchive"
)}
</Typography>
</Grid>
<Grid size={{ xs: 12, md: 6 }}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/identity/administration/users/user/exchange.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Page = () => {
waiting: waiting,
});
const userRequest = ApiGetCall({
url: `/api/ListUserMailboxDetails?UserId=${userId}&tenantFilter=${userSettingsDefaults.currentTenant}`,
url: `/api/ListUserMailboxDetails?UserId=${userId}&tenantFilter=${userSettingsDefaults.currentTenant}&userMail=${graphUserRequest.data?.[0]?.userPrincipalName}`,
queryKey: `Mailbox-${userId}`,
waiting: waiting,
});
Expand Down
Loading