Skip to content

Commit 8085f4f

Browse files
authored
Merge pull request #23 from KelvinTegelaar/main
[pull] main from KelvinTegelaar:main
2 parents d5eb82e + 16146ca commit 8085f4f

File tree

13 files changed

+179
-119
lines changed

13 files changed

+179
-119
lines changed

generate-placeholders.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const pages = [
4343
{ title: "BPA Report Builder", path: "/tenant/tools/bpa-report-builder" },
4444
{ title: "Standards", path: "/tenant/standards" },
4545
{ title: "Edit Standards", path: "/tenant/standards/list-applied-standards" },
46-
{ title: "List Standards", path: "/tenant/standards/list-standards" },
46+
{ title: "List Standards", path: "/tenant/standards" },
4747
{ title: "Best Practice Analyser", path: "/tenant/standards/bpa-report" },
4848
{ title: "Domains Analyser", path: "/tenant/standards/domains-analyser" },
4949
{ title: "Conditional Access", path: "/tenant/administration" },

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "8.8.1",
3+
"version": "8.8.2",
44
"author": "CIPP Contributors",
55
"homepage": "https://cipp.app/",
66
"bugs": {

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.8.1"
2+
"version": "8.8.2"
33
}

src/components/CippComponents/CippBreadcrumbNav.jsx

Lines changed: 80 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ async function loadTabOptions() {
1616
"/email/administration/exchange-retention",
1717
"/cipp/custom-data",
1818
"/cipp/super-admin",
19-
"/tenant/standards/list-standards",
19+
"/tenant/standards",
2020
"/tenant/manage",
2121
"/tenant/administration/applications",
2222
"/tenant/administration/tenants",
@@ -499,6 +499,46 @@ export const CippBreadcrumbNav = () => {
499499
return result;
500500
};
501501

502+
// Check if a path is valid and return its title from navigation or tabs
503+
const getPathInfo = (path) => {
504+
if (!path) return { isValid: false, title: null };
505+
506+
const normalizedPath = path.replace(/\/$/, "");
507+
508+
// Helper function to recursively search menu items
509+
const findInMenu = (items) => {
510+
for (const item of items) {
511+
if (item.path) {
512+
const normalizedItemPath = item.path.replace(/\/$/, "");
513+
if (normalizedItemPath === normalizedPath) {
514+
return { isValid: true, title: item.title };
515+
}
516+
}
517+
if (item.items && item.items.length > 0) {
518+
const found = findInMenu(item.items);
519+
if (found.isValid) {
520+
return found;
521+
}
522+
}
523+
}
524+
return { isValid: false, title: null };
525+
};
526+
527+
// Check if path exists in navigation
528+
const menuResult = findInMenu(nativeMenuItems);
529+
if (menuResult.isValid) {
530+
return menuResult;
531+
}
532+
533+
// Check if path exists in tab options
534+
const matchingTab = tabOptions.find((tab) => tab.path.replace(/\/$/, "") === normalizedPath);
535+
if (matchingTab) {
536+
return { isValid: true, title: matchingTab.title };
537+
}
538+
539+
return { isValid: false, title: null };
540+
};
541+
502542
// Handle click for hierarchical breadcrumbs
503543
const handleHierarchicalClick = (path, query) => {
504544
if (path) {
@@ -580,6 +620,9 @@ export const CippBreadcrumbNav = () => {
580620
>
581621
{breadcrumbs.map((crumb, index) => {
582622
const isLast = index === breadcrumbs.length - 1;
623+
const pathInfo = getPathInfo(crumb.path);
624+
// Use title from nav/tabs if available, otherwise use the crumb's title
625+
const displayTitle = pathInfo.title || crumb.title;
583626

584627
// Items without paths (headers/groups) - show as text
585628
if (!crumb.path) {
@@ -590,31 +633,46 @@ export const CippBreadcrumbNav = () => {
590633
variant="subtitle2"
591634
sx={{ fontWeight: isLast ? 500 : 400 }}
592635
>
593-
{crumb.title}
636+
{displayTitle}
594637
</Typography>
595638
);
596639
}
597640

598-
// All items with paths are clickable, including the last one
599-
return (
600-
<Link
601-
key={index}
602-
component="button"
603-
variant="subtitle2"
604-
onClick={() => handleHierarchicalClick(crumb.path, crumb.query)}
605-
sx={{
606-
textDecoration: "none",
607-
color: isLast ? "text.primary" : "text.secondary",
608-
fontWeight: isLast ? 500 : 400,
609-
"&:hover": {
610-
textDecoration: "underline",
611-
color: "primary.main",
612-
},
613-
}}
614-
>
615-
{crumb.title}
616-
</Link>
617-
);
641+
// Items with valid paths are clickable
642+
// Items with invalid paths (fallback) are shown as plain text
643+
if (pathInfo.isValid) {
644+
return (
645+
<Link
646+
key={index}
647+
component="button"
648+
variant="subtitle2"
649+
onClick={() => handleHierarchicalClick(crumb.path, crumb.query)}
650+
sx={{
651+
textDecoration: "none",
652+
color: isLast ? "text.primary" : "text.secondary",
653+
fontWeight: isLast ? 500 : 400,
654+
"&:hover": {
655+
textDecoration: "underline",
656+
color: "primary.main",
657+
},
658+
}}
659+
>
660+
{displayTitle}
661+
</Link>
662+
);
663+
} else {
664+
// Invalid path - show as text only
665+
return (
666+
<Typography
667+
key={index}
668+
color={isLast ? "text.primary" : "text.secondary"}
669+
variant="subtitle2"
670+
sx={{ fontWeight: isLast ? 500 : 400 }}
671+
>
672+
{displayTitle}
673+
</Typography>
674+
);
675+
}
618676
})}
619677
</Breadcrumbs>
620678
</Box>

src/components/CippComponents/CippCADeployDrawer.jsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import CippJsonView from "../CippFormPages/CippJSONView";
99
import { CippApiResults } from "./CippApiResults";
1010
import { useSettings } from "../../hooks/use-settings";
1111
import { CippFormTenantSelector } from "./CippFormTenantSelector";
12+
import { CippFormCondition } from "./CippFormCondition";
1213

1314
export const CippCADeployDrawer = ({
1415
buttonText = "Deploy CA Policy",
@@ -24,6 +25,10 @@ export const CippCADeployDrawer = ({
2425
const CATemplates = ApiGetCall({ url: "/api/ListCATemplates", queryKey: "CATemplates" });
2526
const [JSONData, setJSONData] = useState();
2627
const watcher = useWatch({ control: formControl.control, name: "TemplateList" });
28+
const selectedReplaceMode = useWatch({
29+
control: formControl.control,
30+
name: "replacename",
31+
});
2732

2833
// Use external open state if provided, otherwise use internal state
2934
const drawerVisible = open !== null ? open : internalDrawerVisible;
@@ -199,13 +204,25 @@ export const CippCADeployDrawer = ({
199204
label="Disable Security Defaults if enabled when creating policy"
200205
formControl={formControl}
201206
/>
202-
203-
<CippFormComponent
204-
type="switch"
205-
name="CreateGroups"
206-
label="Create groups if they do not exist"
207+
<CippFormCondition
207208
formControl={formControl}
208-
/>
209+
field="replacename"
210+
compareType="is"
211+
compareValue="displayName"
212+
action="disable"
213+
>
214+
<CippFormComponent
215+
type="switch"
216+
name="CreateGroups"
217+
label="Create groups if they do not exist"
218+
formControl={formControl}
219+
helperText={
220+
selectedReplaceMode !== "displayName"
221+
? "Select 'Replace by display name' to create groups specified in the template."
222+
: "Enable this option to create groups that do not exist in the tenant."
223+
}
224+
/>
225+
</CippFormCondition>
209226
</Stack>
210227
</CippOffCanvas>
211228
</>

src/components/CippComponents/CippCentralSearch.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function loadTabOptions() {
4646
"/email/administration/exchange-retention",
4747
"/cipp/custom-data",
4848
"/cipp/super-admin",
49-
"/tenant/standards/list-standards",
49+
"/tenant/standards",
5050
"/tenant/manage",
5151
"/tenant/administration/applications",
5252
"/tenant/administration/tenants",

src/components/CippComponents/CippRestoreBackupDrawer.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ApiPostCall } from "../../api/ApiCall";
1313
export const CippRestoreBackupDrawer = ({
1414
buttonText = "Restore Backup",
1515
backupName = null,
16+
backupData = null,
1617
requiredPermissions = [],
1718
PermissionButton = Button,
1819
...props
@@ -85,7 +86,12 @@ export const CippRestoreBackupDrawer = ({
8586
const values = formControl.getValues();
8687
const startDate = new Date();
8788
const unixTime = Math.floor(startDate.getTime() / 1000) - 45;
88-
const tenantFilterValue = tenantFilter;
89+
90+
// If in AllTenants context, use the tenant from the backup data
91+
let tenantFilterValue = tenantFilter;
92+
if (tenantFilter === "AllTenants" && backupData?.tenantSource) {
93+
tenantFilterValue = backupData.tenantSource;
94+
}
8995

9096
const shippedValues = {
9197
TenantFilter: tenantFilterValue,
@@ -202,7 +208,12 @@ export const CippRestoreBackupDrawer = ({
202208
queryKey: `BackupList-${tenantFilter}-autocomplete`,
203209
labelField: (option) => {
204210
const match = option.BackupName.match(/.*_(\d{4}-\d{2}-\d{2})-(\d{2})(\d{2})/);
205-
return match ? `${match[1]} @ ${match[2]}:${match[3]}` : option.BackupName;
211+
const dateTime = match
212+
? `${match[1]} @ ${match[2]}:${match[3]}`
213+
: option.BackupName;
214+
const tenantDisplay =
215+
tenantFilter === "AllTenants" ? ` (${option.TenantFilter})` : "";
216+
return `${dateTime}${tenantDisplay}`;
206217
},
207218
valueField: "BackupName",
208219
data: {

src/hooks/use-securescore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function useSecureScore({ waiting = true } = {}) {
6868
complianceInformation: translation?.complianceInformation,
6969
actionUrl: remediation
7070
? //this needs to be updated to be a direct url to apply this standard.
71-
"/tenant/standards/list-standards"
71+
"/tenant/standards"
7272
: translation?.actionUrl,
7373
remediation: remediation
7474
? `1. Enable the CIPP Standard: ${remediation.label}`

src/layouts/HeaderedTabbedLayout.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const HeaderedTabbedLayout = (props) => {
115115
!mdDown && {
116116
flexGrow: 1,
117117
overflow: "auto",
118-
height: "calc(100vh - 30px)",
118+
height: "calc(100vh - 350px)",
119119
}
120120
}
121121
>

src/pages/tenant/manage/applied-standards.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ const Page = () => {
10271027
tabOptions={tabOptions}
10281028
title={title}
10291029
subtitle={subtitle}
1030-
backUrl="/tenant/standards/list-standards"
1030+
backUrl="/tenant/standards"
10311031
actions={actions}
10321032
actionsData={{}}
10331033
isFetching={comparisonApi.isFetching || templateDetails.isFetching}

0 commit comments

Comments
 (0)