Skip to content

Commit 37a8d1f

Browse files
Merge pull request #4493 from KelvinTegelaar/dev
Dev to release
2 parents 2ca26d2 + 0d484f7 commit 37a8d1f

File tree

70 files changed

+9808
-2118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+9808
-2118
lines changed

public/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "8.2.1"
2+
"version": "8.3.0"
33
}

src/components/CippCards/CippBannerListCard.jsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export const CippBannerListCard = (props) => {
7272
<li key={item.id}>
7373
<Stack
7474
direction="row"
75-
flexWrap="wrap"
7675
justifyContent="space-between"
7776
sx={{
7877
p: 3,
@@ -86,12 +85,18 @@ export const CippBannerListCard = (props) => {
8685
onClick={isCollapsible ? () => handleExpand(item.id) : undefined}
8786
>
8887
{/* Left Side: cardLabelBox */}
89-
<Stack direction="row" spacing={2} alignItems="center">
88+
<Stack
89+
direction="row"
90+
spacing={2}
91+
alignItems="center"
92+
sx={{ flex: 1, minWidth: 0 }}
93+
>
9094
<Box
9195
sx={{
9296
alignItems: "center",
9397
display: "flex",
9498
flexDirection: "column",
99+
flexShrink: 0,
95100
}}
96101
>
97102
{typeof item.cardLabelBox === "object" ? (
@@ -111,8 +116,16 @@ export const CippBannerListCard = (props) => {
111116
</Box>
112117

113118
{/* Main Text and Subtext */}
114-
<Box>
115-
<Typography color="text.primary" variant="h6">
119+
<Box sx={{ flex: 1, minWidth: 0 }}>
120+
<Typography
121+
color="text.primary"
122+
variant="h6"
123+
sx={{
124+
overflow: "hidden",
125+
textOverflow: "ellipsis",
126+
whiteSpace: "nowrap",
127+
}}
128+
>
116129
{item.text}
117130
</Typography>
118131
<Typography color="text.secondary" variant="body2">
@@ -122,7 +135,7 @@ export const CippBannerListCard = (props) => {
122135
</Stack>
123136

124137
{/* Right Side: Status and Expand Icon */}
125-
<Stack alignItems="center" direction="row" spacing={2}>
138+
<Stack alignItems="center" direction="row" spacing={2} sx={{ flexShrink: 0 }}>
126139
{item?.statusText && (
127140
<Stack alignItems="center" direction="row" spacing={1}>
128141
<Box
@@ -166,7 +179,7 @@ export const CippBannerListCard = (props) => {
166179
{item?.propertyItems?.length > 0 && (
167180
<CippPropertyListCard
168181
propertyItems={item.propertyItems || []}
169-
layout="dual"
182+
layout={other.layout || "dual"}
170183
isFetching={item.isFetching || false}
171184
/>
172185
)}

src/components/CippCards/CippExchangeInfoCard.jsx

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
IconButton,
99
Typography,
1010
CircularProgress,
11+
Alert,
1112
} from "@mui/material";
1213
import { PropertyList } from "/src/components/property-list";
1314
import { PropertyListItem } from "/src/components/property-list-item";
@@ -59,6 +60,11 @@ export const CippExchangeInfoCard = (props) => {
5960
</Stack>
6061
}
6162
/>
63+
{exchangeData?.BlockedForSpam ? (
64+
<Alert severity="warning" sx={{ mx: 2, mt: 2, mb: 2 }}>
65+
This mailbox is currently blocked for spam.
66+
</Alert>
67+
) : null}
6268
<Divider />
6369
<PropertyList>
6470
<PropertyListItem
@@ -81,7 +87,10 @@ export const CippExchangeInfoCard = (props) => {
8187
Hidden from GAL:
8288
</Typography>
8389
<Typography variant="inherit">
84-
{getCippFormatting(exchangeData?.HiddenFromAddressLists, "HiddenFromAddressLists")}
90+
{getCippFormatting(
91+
exchangeData?.HiddenFromAddressLists,
92+
"HiddenFromAddressLists"
93+
)}
8594
</Typography>
8695
</Grid>
8796
<Grid size={{ xs: 12, md: 4 }}>
@@ -127,14 +136,15 @@ export const CippExchangeInfoCard = (props) => {
127136
value={
128137
isLoading ? (
129138
<Skeleton variant="text" width={200} />
130-
) : (() => {
139+
) : (
140+
(() => {
131141
const forwardingAddress = exchangeData?.ForwardingAddress;
132142
const forwardAndDeliver = exchangeData?.ForwardAndDeliver;
133-
143+
134144
// Determine forwarding type and clean address
135145
let forwardingType = "None";
136146
let cleanAddress = "";
137-
147+
138148
if (forwardingAddress) {
139149
if (forwardingAddress.startsWith("smtp:")) {
140150
forwardingType = "External";
@@ -144,18 +154,17 @@ export const CippExchangeInfoCard = (props) => {
144154
cleanAddress = forwardingAddress;
145155
}
146156
}
147-
157+
148158
return (
149159
<Grid container spacing={2}>
150160
<Grid size={{ xs: 12, md: 6 }}>
151161
<Typography variant="inherit" color="text.primary" gutterBottom>
152162
Forwarding Status:
153163
</Typography>
154164
<Typography variant="inherit">
155-
{forwardingType === "None"
165+
{forwardingType === "None"
156166
? getCippFormatting(false, "ForwardingStatus")
157-
: `${forwardingType} Forwarding`
158-
}
167+
: `${forwardingType} Forwarding`}
159168
</Typography>
160169
</Grid>
161170
{forwardingType !== "None" && (
@@ -172,18 +181,17 @@ export const CippExchangeInfoCard = (props) => {
172181
<Typography variant="inherit" color="text.primary" gutterBottom>
173182
Forwarding Address:
174183
</Typography>
175-
<Typography variant="inherit">
176-
{cleanAddress}
177-
</Typography>
184+
<Typography variant="inherit">{cleanAddress}</Typography>
178185
</Grid>
179186
</>
180187
)}
181188
</Grid>
182189
);
183190
})()
191+
)
184192
}
185193
/>
186-
194+
187195
{/* Archive section - always show status */}
188196
<PropertyListItem
189197
divider
@@ -207,7 +215,10 @@ export const CippExchangeInfoCard = (props) => {
207215
Auto Expanding Archive:
208216
</Typography>
209217
<Typography variant="inherit">
210-
{getCippFormatting(exchangeData?.AutoExpandingArchive, "AutoExpandingArchive")}
218+
{getCippFormatting(
219+
exchangeData?.AutoExpandingArchive,
220+
"AutoExpandingArchive"
221+
)}
211222
</Typography>
212223
</Grid>
213224
<Grid size={{ xs: 12, md: 6 }}>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { useState } from "react";
2+
import { Dialog, DialogContent, DialogTitle, Button, DialogActions } from "@mui/material";
3+
import { Search } from "@mui/icons-material";
4+
import { useForm, FormProvider } from "react-hook-form";
5+
import { ApiPostCall } from "/src/api/ApiCall";
6+
import { CippApiResults } from "./CippApiResults";
7+
import { useSettings } from "../../hooks/use-settings";
8+
9+
export const BreachSearchDialog = ({ createDialog }) => {
10+
const tenantFilter = useSettings()?.currentTenant;
11+
const methods = useForm({
12+
defaultValues: {},
13+
});
14+
15+
// Use methods for form handling and control
16+
const { handleSubmit } = methods;
17+
18+
const [isRunning, setIsRunning] = useState(false);
19+
const breachSearchResults = ApiPostCall({
20+
urlFromData: true,
21+
});
22+
23+
const handleForm = () => {
24+
setIsRunning(true);
25+
breachSearchResults.mutate({
26+
url: "/api/ExecBreachSearch",
27+
queryKey: `breach-search-${tenantFilter}`,
28+
data: { tenantFilter: tenantFilter },
29+
});
30+
};
31+
32+
// Reset running state when dialog is closed
33+
const handleClose = () => {
34+
setIsRunning(false);
35+
createDialog.handleClose();
36+
};
37+
38+
return (
39+
<Dialog open={createDialog.open} onClose={handleClose} maxWidth="sm" fullWidth>
40+
<FormProvider {...methods}>
41+
<form onSubmit={handleSubmit(handleForm)}>
42+
<DialogTitle>Run Breach Search</DialogTitle>
43+
<DialogContent>
44+
<div className="mb-3">
45+
<p>
46+
This will run a breach search to check for potentially compromised passwords and information
47+
for the current tenant: <strong>{tenantFilter?.displayName || tenantFilter}</strong>
48+
</p>
49+
</div>
50+
<CippApiResults apiObject={breachSearchResults} alertSx={{ mt: 2 }} />
51+
</DialogContent>
52+
<DialogActions>
53+
<Button onClick={handleClose}>Cancel</Button>
54+
<Button
55+
type="submit"
56+
variant="contained"
57+
disabled={isRunning || breachSearchResults.isLoading}
58+
startIcon={<Search />}
59+
>
60+
Run Breach Search
61+
</Button>
62+
</DialogActions>
63+
</form>
64+
</FormProvider>
65+
</Dialog>
66+
);
67+
};

0 commit comments

Comments
 (0)