Skip to content

Commit 73e5c2d

Browse files
authored
Merge pull request #59 from KelvinTegelaar/main
[pull] main from KelvinTegelaar:main
2 parents ed28f2c + 3ccac64 commit 73e5c2d

24 files changed

Lines changed: 67815 additions & 41967 deletions

File tree

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "10.2.4",
3+
"version": "10.2.6",
44
"author": "CIPP Contributors",
55
"homepage": "https://cipp.app/",
66
"bugs": {
@@ -40,7 +40,7 @@
4040
"@nivo/sankey": "^0.99.0",
4141
"@react-pdf/renderer": "^4.3.2",
4242
"@reduxjs/toolkit": "^2.11.2",
43-
"@tanstack/query-sync-storage-persister": "^5.76.0",
43+
"@tanstack/query-sync-storage-persister": "^5.90.25",
4444
"@tanstack/react-query": "^5.51.11",
4545
"@tanstack/react-query-devtools": "^5.51.11",
4646
"@tanstack/react-query-persist-client": "^5.76.0",
@@ -49,12 +49,12 @@
4949
"@tiptap/extension-heading": "^3.4.1",
5050
"@tiptap/extension-image": "^3.4.1",
5151
"@tiptap/extension-table": "^3.19.0",
52-
"@tiptap/pm": "^3.4.1",
52+
"@tiptap/pm": "^3.20.4",
5353
"@tiptap/react": "^3.4.1",
5454
"@tiptap/starter-kit": "^3.20.1",
5555
"@uiw/react-json-view": "^2.0.0-alpha.41",
5656
"@vvo/tzdb": "^6.198.0",
57-
"apexcharts": "5.3.5",
57+
"apexcharts": "5.10.4",
5858
"axios": "^1.7.2",
5959
"date-fns": "4.1.0",
6060
"eml-parse-js": "^1.2.0-beta.0",
@@ -99,7 +99,7 @@
9999
"react-syntax-highlighter": "^16.1.0",
100100
"react-time-ago": "^7.3.3",
101101
"react-virtuoso": "^4.18.3",
102-
"react-window": "^2.2.5",
102+
"react-window": "^2.2.7",
103103
"recharts": "^3.7.0",
104104
"redux": "5.0.1",
105105
"redux-devtools-extension": "2.13.9",
@@ -118,4 +118,4 @@
118118
"eslint": "9.39.2",
119119
"eslint-config-next": "16.1.6"
120120
}
121-
}
121+
}

public/version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "10.2.4"
3-
}
2+
"version": "10.2.6"
3+
}

src/components/CippComponents/CippCentralSearch.jsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ export const CippCentralSearch = ({ handleClose, open }) => {
252252
const inBreadcrumbs = leaf.breadcrumbs?.some((crumb) =>
253253
crumb?.toLowerCase().includes(normalizedSearch),
254254
);
255+
const inScope = (leaf.scope === "global" ? "global" : "tenant").includes(normalizedSearch);
255256
// If there's no search value, show no results (you could change this logic)
256-
return normalizedSearch ? inTitle || inPath || inBreadcrumbs : false;
257+
return normalizedSearch ? inTitle || inPath || inBreadcrumbs || inScope : false;
257258
});
258259

259260
// Helper to bold‐highlight the matched text
@@ -310,7 +311,9 @@ export const CippCentralSearch = ({ handleClose, open }) => {
310311
{searchValue.trim().length > 0 ? (
311312
filteredItems.length > 0 ? (
312313
<Grid container spacing={2} mt={2}>
313-
{filteredItems.map((item, index) => (
314+
{filteredItems.map((item, index) => {
315+
const isGlobal = item.scope === "global";
316+
return (
314317
<Grid size={{ md: 12, sm: 12, xs: 12 }} key={index}>
315318
<Card variant="outlined" sx={{ height: "100%" }}>
316319
<CardActionArea
@@ -333,6 +336,19 @@ export const CippCentralSearch = ({ handleClose, open }) => {
333336
>
334337
{getItemTypeLabel(item)}
335338
</Typography>
339+
<Typography
340+
variant="caption"
341+
sx={{
342+
px: 1,
343+
py: 0.25,
344+
borderRadius: 1,
345+
backgroundColor: isGlobal ? "info.main" : "success.main",
346+
color: "white",
347+
fontSize: "0.7rem",
348+
}}
349+
>
350+
{isGlobal ? "Global" : "Tenant"}
351+
</Typography>
336352
</Box>
337353
{item.breadcrumbs && item.breadcrumbs.length > 0 && (
338354
<Typography variant="body2" color="textSecondary" sx={{ mb: 0.5 }}>
@@ -353,7 +369,8 @@ export const CippCentralSearch = ({ handleClose, open }) => {
353369
</CardActionArea>
354370
</Card>
355371
</Grid>
356-
))}
372+
);
373+
})}
357374
</Grid>
358375
) : (
359376
<Box mt={2}>No results found.</Box>

src/components/CippComponents/CippNotificationForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const CippNotificationForm = ({
5757
.filter(Boolean);
5858

5959
const Severity = listNotificationConfig.data?.Severity?.map((sev) =>
60-
severityTypes.find((stype) => stype.value === sev)
60+
severityTypes.find((stype) => stype.value === sev),
6161
).filter(Boolean);
6262

6363
formControl.reset({
@@ -142,7 +142,7 @@ export const CippNotificationForm = ({
142142
<Button
143143
variant="outlined"
144144
onClick={notificationDialog.handleOpen}
145-
disabled={formState.isDirty}
145+
disabled={formState.isDirty && !formState.isSubmitSuccessful}
146146
>
147147
Send Test Alert
148148
</Button>

src/components/CippComponents/CippSpeedDial.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ const CippSpeedDial = ({
3939
return acc;
4040
}, {});
4141

42-
const handleSpeedDialClose = () => {
42+
const handleSpeedDialClose = (event, reason) => {
43+
if (reason === "toggle") {
44+
setSpeedDialOpen(false);
45+
setIsHovering(false);
46+
return;
47+
}
4348
if (!isHovering) {
4449
setTimeout(() => {
4550
setSpeedDialOpen(false);

src/components/CippFormPages/CippFormPage.jsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ const CippFormPage = (props) => {
4747
const { isValid, isDirty } = useFormState({ control: formControl.control });
4848

4949
useEffect(() => {
50-
delete router.query.tenantFilter;
51-
5250
if (router.query) {
51+
const { tenantFilter: _tenantFilter, ...queryWithoutTenant } = router.query;
5352
const resetValues = {
5453
...formControl.getValues(),
55-
...router.query,
54+
...queryWithoutTenant,
5655
};
5756
formControl.reset(resetValues);
5857
}
@@ -79,12 +78,26 @@ const CippFormPage = (props) => {
7978
const values = customDataformatter
8079
? customDataformatter(formControl.getValues())
8180
: formControl.getValues();
82-
//remove all empty values or blanks
83-
Object.keys(values).forEach((key) => {
84-
if (values[key] === "" || values[key] === null) {
85-
delete values[key];
81+
//remove all empty values or blanks (recursively)
82+
const removeEmpty = (obj) => {
83+
if (Array.isArray(obj)) {
84+
return obj
85+
.map((item) => (item && typeof item === "object" ? removeEmpty(item) : item))
86+
.filter((item) => item !== "" && item !== null && item !== undefined);
8687
}
87-
});
88+
Object.keys(obj).forEach((key) => {
89+
if (obj[key] === "" || obj[key] === null || obj[key] === undefined) {
90+
delete obj[key];
91+
} else if (typeof obj[key] === "object") {
92+
obj[key] = removeEmpty(obj[key]);
93+
if (!Array.isArray(obj[key]) && Object.keys(obj[key]).length === 0) {
94+
delete obj[key];
95+
}
96+
}
97+
});
98+
return obj;
99+
};
100+
removeEmpty(values);
88101
postCall.mutate({
89102
url: postUrl,
90103
data: values,

src/components/ExecutiveReportButton.js

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
Switch,
1313
Grid,
1414
Paper,
15+
Stack,
1516
IconButton,
1617
} from "@mui/material";
1718
import { PictureAsPdf, Download, Close, Settings } from "@mui/icons-material";
@@ -3065,64 +3066,59 @@ export const ExecutiveReportButton = (props) => {
30653066
in real-time.
30663067
</Typography>
30673068

3068-
<Grid container spacing={1.5}>
3069+
<Stack spacing={1.5}>
30693070
{sectionOptions.map((option) => (
3070-
<Grid item xs={12} key={option.key}>
3071-
<Paper
3072-
sx={{
3073-
p: 1.5,
3074-
border: "1px solid",
3075-
borderColor: sectionConfig[option.key] ? "primary.main" : "divider",
3076-
bgcolor: sectionConfig[option.key] ? "primary.50" : "background.paper",
3077-
cursor: "pointer",
3078-
transition: "all 0.2s ease-in-out",
3079-
"&:hover": {
3080-
borderColor: "primary.main",
3081-
bgcolor: sectionConfig[option.key] ? "primary.100" : "primary.25",
3082-
},
3071+
<Paper
3072+
key={option.key}
3073+
onClick={() => handleSectionToggle(option.key)}
3074+
sx={{
3075+
p: 1.5,
3076+
border: "1px solid",
3077+
borderColor: sectionConfig[option.key] ? "primary.main" : "divider",
3078+
bgcolor: sectionConfig[option.key] ? "primary.50" : "background.paper",
3079+
cursor: "pointer",
3080+
transition: "all 0.2s ease-in-out",
3081+
display: "flex",
3082+
alignItems: "center",
3083+
"&:hover": {
3084+
borderColor: "primary.main",
3085+
bgcolor: sectionConfig[option.key] ? "primary.100" : "primary.25",
3086+
},
3087+
}}
3088+
>
3089+
<Switch
3090+
checked={sectionConfig[option.key]}
3091+
onChange={(event) => {
3092+
event.stopPropagation();
3093+
handleSectionToggle(option.key);
30833094
}}
3084-
>
3085-
<FormControlLabel
3086-
control={
3087-
<Switch
3088-
checked={sectionConfig[option.key]}
3089-
onChange={(event) => {
3090-
event.stopPropagation();
3091-
handleSectionToggle(option.key);
3092-
}}
3093-
color="primary"
3094-
size="small"
3095-
disabled={
3096-
// Disable if this is the last enabled section
3097-
sectionConfig[option.key] &&
3098-
Object.values(sectionConfig).filter(Boolean).length === 1
3099-
}
3100-
/>
3101-
}
3102-
label={
3103-
<Box onClick={() => handleSectionToggle(option.key)}>
3104-
<Typography
3105-
variant="subtitle2"
3106-
fontWeight="bold"
3107-
sx={{ fontSize: "0.875rem" }}
3108-
>
3109-
{option.label}
3110-
</Typography>
3111-
<Typography
3112-
variant="caption"
3113-
color="text.secondary"
3114-
sx={{ fontSize: "0.75rem" }}
3115-
>
3116-
{option.description}
3117-
</Typography>
3118-
</Box>
3119-
}
3120-
sx={{ margin: 0, width: "100%" }}
3121-
/>
3122-
</Paper>
3123-
</Grid>
3095+
onClick={(event) => event.stopPropagation()}
3096+
color="primary"
3097+
size="small"
3098+
disabled={
3099+
sectionConfig[option.key] &&
3100+
Object.values(sectionConfig).filter(Boolean).length === 1
3101+
}
3102+
/>
3103+
<Box sx={{ ml: 1, flexGrow: 1 }}>
3104+
<Typography
3105+
variant="subtitle2"
3106+
fontWeight="bold"
3107+
sx={{ fontSize: "0.875rem" }}
3108+
>
3109+
{option.label}
3110+
</Typography>
3111+
<Typography
3112+
variant="caption"
3113+
color="text.secondary"
3114+
sx={{ fontSize: "0.75rem" }}
3115+
>
3116+
{option.description}
3117+
</Typography>
3118+
</Box>
3119+
</Paper>
31243120
))}
3125-
</Grid>
3121+
</Stack>
31263122

31273123
<Box sx={{ mt: 3, p: 2, bgcolor: "primary.50", borderRadius: 1 }}>
31283124
<Typography variant="caption" color="primary.main" fontWeight="bold">

0 commit comments

Comments
 (0)