From 797f335d9933f171e15a2fada86deec5e21ff653 Mon Sep 17 00:00:00 2001 From: Zac Richards <107489668+Zacgoose@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:30:17 +0800 Subject: [PATCH 01/86] Add configurable columns and maxWidth to wizard steps Enhanced the CippWizard and CippWizardConfirmation components to support a configurable number of columns for confirmation display and per-step maxWidth settings. Updated the offboarding wizard to use 3 columns and a 'lg' maxWidth for the confirmation step, and refactored layout logic for improved flexibility. --- src/components/CippWizard/CippWizard.jsx | 29 ++++-- .../CippWizard/CippWizardConfirmation.jsx | 91 ++++++++++++------- src/components/CippWizard/CippWizardPage.jsx | 3 +- .../offboarding-wizard/index.js | 4 + 4 files changed, 86 insertions(+), 41 deletions(-) diff --git a/src/components/CippWizard/CippWizard.jsx b/src/components/CippWizard/CippWizard.jsx index b1a5457be67e..8e6a645dd89b 100644 --- a/src/components/CippWizard/CippWizard.jsx +++ b/src/components/CippWizard/CippWizard.jsx @@ -5,8 +5,13 @@ import { WizardSteps } from "./wizard-steps"; import { useForm, useWatch } from "react-hook-form"; export const CippWizard = (props) => { - const { postUrl, orientation = "horizontal", steps } = props; - + const { + postUrl, + orientation = "horizontal", + steps, + contentMaxWidth = "md", + } = props; + const formControl = useForm({ mode: "onChange", defaultValues: props.initialState }); const formWatcher = useWatch({ control: formControl.control, @@ -35,6 +40,8 @@ export const CippWizard = (props) => { const content = useMemo(() => { const StepComponent = stepsWithVisibility[activeStep].component; + const currentStep = stepsWithVisibility[activeStep]; + return ( { lastStep={stepsWithVisibility.length - 1} currentStep={activeStep} postUrl={postUrl} - options={stepsWithVisibility[activeStep].componentProps?.options} - title={stepsWithVisibility[activeStep].componentProps?.title} - subtext={stepsWithVisibility[activeStep].componentProps?.subtext} - valuesKey={stepsWithVisibility[activeStep].componentProps?.valuesKey} - {...stepsWithVisibility[activeStep].componentProps} + options={currentStep.componentProps?.options} + title={currentStep.componentProps?.title} + subtext={currentStep.componentProps?.subtext} + valuesKey={currentStep.componentProps?.valuesKey} + {...currentStep.componentProps} /> ); }, [activeStep, handleNext, handleBack, stepsWithVisibility, formControl]); + // Get the maxWidth for the current step, fallback to global setting + const currentStepMaxWidth = useMemo(() => { + const currentStep = stepsWithVisibility[activeStep]; + return currentStep.maxWidth ?? contentMaxWidth; + }, [activeStep, stepsWithVisibility, contentMaxWidth]); + return ( {orientation === "vertical" ? ( @@ -80,7 +93,7 @@ export const CippWizard = (props) => { steps={stepsWithVisibility} />
- {content} + {content}
diff --git a/src/components/CippWizard/CippWizardConfirmation.jsx b/src/components/CippWizard/CippWizardConfirmation.jsx index b0d497670b43..d70acb9d7eef 100644 --- a/src/components/CippWizard/CippWizardConfirmation.jsx +++ b/src/components/CippWizard/CippWizardConfirmation.jsx @@ -7,7 +7,16 @@ import { getCippTranslation } from "../../utils/get-cipp-translation"; import { getCippFormatting } from "../../utils/get-cipp-formatting"; export const CippWizardConfirmation = (props) => { - const { postUrl, lastStep, formControl, onPreviousStep, onNextStep, currentStep } = props; + const { + postUrl, + lastStep, + formControl, + onPreviousStep, + onNextStep, + currentStep, + columns = 2 // Default to 2 columns for backward compatibility + } = props; + const formValues = formControl.getValues(); const formEntries = Object.entries(formValues); @@ -43,21 +52,48 @@ export const CippWizardConfirmation = (props) => { !["user", "userPrincipalName", "username"].includes(key) ); - const halfIndex = Math.ceil(filteredEntries.length / 2); - const firstHalf = filteredEntries.slice(0, halfIndex); - const secondHalf = filteredEntries.slice(halfIndex); + // Dynamically split entries based on columns prop + const splitEntries = () => { + const entriesPerColumn = Math.ceil(filteredEntries.length / columns); + const result = []; + + for (let i = 0; i < columns; i++) { + const start = i * entriesPerColumn; + const end = start + entriesPerColumn; + result.push(filteredEntries.slice(start, end)); + } + + return result; + }; - if (tenantEntry) { - firstHalf.unshift(tenantEntry); - } + const columnEntries = splitEntries(); - if (userEntry) { - secondHalf.unshift(userEntry); + // Distribute special entries across first available columns + if (tenantEntry && columnEntries[0]) { + columnEntries[0].unshift(tenantEntry); + } + if (userEntry && columnEntries[1]) { + columnEntries[1].unshift(userEntry); } + // Calculate Grid sizes based on number of columns + const getGridSize = () => { + const sizes = { + 1: { lg: 12, md: 12, xs: 12 }, + 2: { lg: 6, md: 6, xs: 12 }, + 3: { lg: 4, md: 6, xs: 12 }, + 4: { lg: 3, md: 6, xs: 12 }, + 6: { lg: 2, md: 4, xs: 12 }, + }; + + return sizes[columns] || sizes[2]; // Default to 2 columns + }; + + const gridSize = getGridSize(); + return ( - {firstHalf.length === 0 ? ( + {filteredEntries.length === 0 ? ( @@ -68,28 +104,19 @@ export const CippWizardConfirmation = (props) => { ) : ( - - - {firstHalf.map(([key, value]) => ( - - ))} - - - - - {secondHalf.map(([key, value]) => ( - - ))} - - + {columnEntries.map((columnData, index) => ( + + + {columnData.map(([key, value]) => ( + + ))} + + + ))} )} diff --git a/src/components/CippWizard/CippWizardPage.jsx b/src/components/CippWizard/CippWizardPage.jsx index ed092bf2ce6b..66025bcdd379 100644 --- a/src/components/CippWizard/CippWizardPage.jsx +++ b/src/components/CippWizard/CippWizardPage.jsx @@ -13,6 +13,7 @@ const CippWizardPage = (props) => { wizardTitle, backButton = true, wizardOrientation = "horizontal", + maxWidth = "xl", ...other } = props; return ( @@ -25,7 +26,7 @@ const CippWizardPage = (props) => { py: 4, }} > - + {backButton && ( + + Click "Reset All to Off" to turn off all options, then click "Save" to clear tenant defaults. + + + + + + + ); From dd5cf90889b18033f048d1c8bdfcd85ca316b07c Mon Sep 17 00:00:00 2001 From: Zac Richards <107489668+Zacgoose@users.noreply.github.com> Date: Tue, 19 Aug 2025 22:31:16 +0800 Subject: [PATCH 05/86] Add Power Platform and Power BI portal support Introduces configuration and UI support for Power Platform and Power BI portals, including new portal link toggles in preferences, icon mapping, translations, and filtering logic based on user-specific or global settings. Updates relevant components and data files to enable these portals and ensure user preferences are respected throughout. --- .../CippComponents/CippSettingsSideBar.jsx | 67 +++++- .../CippComponents/CippTenantSelector.jsx | 156 +++++++++----- .../CippComponents/CippTranslations.jsx | 2 + src/components/bulk-actions-menu.js | 6 +- src/data/portals.json | 18 ++ src/pages/cipp/preferences.js | 201 +++++++++++++++++- src/pages/index.js | 43 +++- .../tenant/administration/tenants/index.js | 2 + src/utils/get-cipp-formatting.js | 4 + 9 files changed, 431 insertions(+), 68 deletions(-) diff --git a/src/components/CippComponents/CippSettingsSideBar.jsx b/src/components/CippComponents/CippSettingsSideBar.jsx index bb62097e02ca..715d8bf8bf6b 100644 --- a/src/components/CippComponents/CippSettingsSideBar.jsx +++ b/src/components/CippComponents/CippSettingsSideBar.jsx @@ -14,9 +14,10 @@ import CippFormComponent from "./CippFormComponent"; import { ApiGetCall, ApiPostCall } from "../../api/ApiCall"; import { getCippError } from "../../utils/get-cipp-error"; import { useFormState } from "react-hook-form"; +import { useEffect } from "react"; export const CippSettingsSideBar = (props) => { - const { formcontrol, ...others } = props; + const { formcontrol, initialUserType, ...others } = props; const { isDirty, isValid } = useFormState({ control: formcontrol.control }); const currentUser = ApiGetCall({ @@ -28,6 +29,28 @@ export const CippSettingsSideBar = (props) => { url: "/api/ExecUserSettings", relatedQueryKeys: "userSettings", }); + + // Set the correct default value once we have the initial user type and current user data + useEffect(() => { + if (initialUserType && currentUser.data?.clientPrincipal?.userDetails) { + const defaultUserOption = initialUserType === "currentUser" + ? { + label: "Current User", + value: currentUser.data.clientPrincipal.userDetails, + } + : { + label: "All Users", + value: "allUsers" + }; + + // Only set if not already set to avoid infinite loops + const currentUserValue = formcontrol.getValues("user"); + if (!currentUserValue || currentUserValue.value !== defaultUserOption.value) { + formcontrol.setValue("user", defaultUserOption); + } + } + }, [initialUserType, currentUser.data?.clientPrincipal?.userDetails, formcontrol]); + const handleSaveChanges = () => { const formValues = formcontrol.getValues(); @@ -38,6 +61,21 @@ export const CippSettingsSideBar = (props) => { tablePageSize: formValues.tablePageSize, userAttributes: formValues.userAttributes, + // Portal Links Configuration + portalLinks: { + M365_Portal: formValues.portalLinks?.M365_Portal, + Exchange_Portal: formValues.portalLinks?.Exchange_Portal, + Entra_Portal: formValues.portalLinks?.Entra_Portal, + Teams_Portal: formValues.portalLinks?.Teams_Portal, + Azure_Portal: formValues.portalLinks?.Azure_Portal, + Intune_Portal: formValues.portalLinks?.Intune_Portal, + SharePoint_Admin: formValues.portalLinks?.SharePoint_Admin, + Security_Portal: formValues.portalLinks?.Security_Portal, + Compliance_Portal: formValues.portalLinks?.Compliance_Portal, + Power_Platform_Portal: formValues.portalLinks?.Power_Platform_Portal, + Power_BI_Portal: formValues.portalLinks?.Power_BI_Portal, + }, + // Offboarding Defaults offboardingDefaults: { ConvertToShared: formValues.offboardingDefaults?.ConvertToShared, @@ -65,6 +103,24 @@ export const CippSettingsSideBar = (props) => { saveSettingsPost.mutate({ url: "/api/ExecUserSettings", data: shippedValues }); }; + // Create user options based on current user data + const getUserOptions = () => { + if (!currentUser.data?.clientPrincipal?.userDetails) { + return []; + } + + return [ + { + label: "Current User", + value: currentUser.data.clientPrincipal.userDetails + }, + { + label: "All Users", + value: "allUsers" + }, + ]; + }; + return ( <> @@ -81,15 +137,8 @@ export const CippSettingsSideBar = (props) => { disableClearable={true} name="user" formControl={formcontrol} - defaultValue={{ - label: "Current User", - value: currentUser.data?.clientPrincipal?.userDetails, - }} multiple={false} - options={[ - { label: "Current User", value: currentUser.data?.clientPrincipal?.userDetails }, - { label: "All Users", value: "allUsers" }, - ]} + options={getUserOptions()} /> {saveSettingsPost.isError && ( diff --git a/src/components/CippComponents/CippTenantSelector.jsx b/src/components/CippComponents/CippTenantSelector.jsx index cb3db82c1645..aa78fc46d787 100644 --- a/src/components/CippComponents/CippTenantSelector.jsx +++ b/src/components/CippComponents/CippTenantSelector.jsx @@ -2,7 +2,7 @@ import PropTypes from "prop-types"; import { CippAutoComplete } from "../CippComponents/CippAutocomplete"; import { ApiGetCall } from "../../api/ApiCall"; import { IconButton, SvgIcon, Tooltip, Box } from "@mui/material"; -import { FilePresent, Laptop, Mail, Refresh, Share, Shield, ShieldMoon } from "@mui/icons-material"; +import { FilePresent, Laptop, Mail, Refresh, Share, Shield, ShieldMoon, PrecisionManufacturing, BarChart } from "@mui/icons-material"; import { BuildingOfficeIcon, GlobeAltIcon, @@ -43,6 +43,111 @@ export const CippTenantSelector = (props) => { toast: true, }); + // Filter portal actions based on user preferences + const getFilteredPortalActions = () => { + // Define all available portal actions with current tenant data + const allPortalActions = [ + { + key: "M365_Portal", + label: "M365 Admin Portal", + link: `https://admin.cloud.microsoft/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, + icon: , + }, + { + key: "Exchange_Portal", + label: "Exchange Portal", + link: `https://admin.cloud.microsoft/exchange?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, + icon: , + }, + { + key: "Entra_Portal", + label: "Entra Portal", + link: `https://entra.microsoft.com/${currentTenant?.value}`, + icon: , + }, + { + key: "Teams_Portal", + label: "Teams Portal", + link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, + icon: , + }, + { + key: "Azure_Portal", + label: "Azure Portal", + link: `https://portal.azure.com/${currentTenant?.value}`, + icon: , + }, + { + key: "Intune_Portal", + label: "Intune Portal", + link: `https://intune.microsoft.com/${currentTenant?.value}`, + icon: , + }, + { + key: "SharePoint_Admin", + label: "SharePoint Portal", + link: `/api/ListSharePointAdminUrl?tenantFilter=${currentTenant?.value}`, + icon: , + external: true, + }, + { + key: "Security_Portal", + label: "Security Portal", + link: `https://security.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`, + icon: , + }, + { + key: "Compliance_Portal", + label: "Compliance Portal", + link: `https://purview.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`, + icon: , + }, + { + key: "Power_Platform_Portal", + label: "Power Platform Portal", + link: `https://admin.powerplatform.microsoft.com/account/login/${currentTenant?.addedFields?.customerId}`, + icon: , + }, + { + key: "Power_BI_Portal", + label: "Power BI Portal", + link: `https://app.powerbi.com/admin-portal?ctid=${currentTenant?.addedFields?.customerId}`, + icon: , + }, + ]; + + // Default to all links enabled (final fallback) + const defaultLinks = { + M365_Portal: true, + Exchange_Portal: true, + Entra_Portal: true, + Teams_Portal: true, + Azure_Portal: true, + Intune_Portal: true, + SharePoint_Admin: true, + Security_Portal: true, + Compliance_Portal: true, + Power_Platform_Portal: true, + Power_BI_Portal: true, + }; + + let portalLinks; + if (settings.UserSpecificSettings?.portalLinks) { + portalLinks = { ...defaultLinks, ...settings.UserSpecificSettings.portalLinks }; + } else if (settings.portalLinks) { + portalLinks = { ...defaultLinks, ...settings.portalLinks }; + } else { + portalLinks = defaultLinks; + } + + const filteredActions = allPortalActions.filter(action => { + const isEnabled = portalLinks[action.key] === true; + return isEnabled; + }); + + return filteredActions; + }; + // This effect handles updates when the tenant is changed via dropdown selection useEffect(() => { if (!router.isReady) return; @@ -240,54 +345,7 @@ export const CippTenantSelector = (props) => { "onPremisesLastSyncDateTime", "onPremisesLastPasswordSyncDateTime", ]} - actions={[ - { - label: "M365 Admin Portal", - link: `https://admin.cloud.microsoft/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, - icon: , - }, - { - label: "Exchange Portal", - link: `https://admin.cloud.microsoft/exchange?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, - icon: , - }, - { - label: "Entra Portal", - link: `https://entra.microsoft.com/${currentTenant?.value}`, - icon: , - }, - { - label: "Teams Portal", - link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`, - icon: , - }, - { - label: "Azure Portal", - link: `https://portal.azure.com/${currentTenant?.value}`, - icon: , - }, - { - label: "Intune Portal", - link: `https://intune.microsoft.com/${currentTenant?.value}`, - icon: , - }, - { - label: "SharePoint Portal", - link: `/api/ListSharePointAdminUrl?tenantFilter=${currentTenant?.value}`, - icon: , - external: true, - }, - { - label: "Security Portal", - link: `https://security.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`, - icon: , - }, - { - label: "Compliance Portal", - link: `https://purview.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`, - icon: , - }, - ]} + actions={getFilteredPortalActions()} /> ); diff --git a/src/components/CippComponents/CippTranslations.jsx b/src/components/CippComponents/CippTranslations.jsx index ebdbca9238bf..6ab449050f2e 100644 --- a/src/components/CippComponents/CippTranslations.jsx +++ b/src/components/CippComponents/CippTranslations.jsx @@ -36,6 +36,8 @@ export const CippTranslations = { portal_security: "Security Portal", portal_compliance: "Compliance Portal", portal_sharepoint: "SharePoint Portal", + portal_platform: "Power Platform Portal", + portal_bi: "Power BI Portal", "@odata.type": "Type", roleDefinitionId: "GDAP Role", FromIP: "From IP", diff --git a/src/components/bulk-actions-menu.js b/src/components/bulk-actions-menu.js index fd15898e28a3..dc1a0c167c1a 100644 --- a/src/components/bulk-actions-menu.js +++ b/src/components/bulk-actions-menu.js @@ -2,7 +2,7 @@ import PropTypes from "prop-types"; import ChevronDownIcon from "@heroicons/react/24/outline/ChevronDownIcon"; import { Button, Link, ListItemText, Menu, MenuItem, SvgIcon } from "@mui/material"; import { usePopover } from "../hooks/use-popover"; -import { FilePresent, Laptop, Mail, Share, Shield, ShieldMoon } from "@mui/icons-material"; +import { FilePresent, Laptop, Mail, Share, Shield, ShieldMoon, PrecisionManufacturing, BarChart } from "@mui/icons-material"; import { GlobeAltIcon, UsersIcon, ServerIcon } from "@heroicons/react/24/outline"; function getIconByName(iconName) { @@ -25,6 +25,10 @@ function getIconByName(iconName) { return ; case "ShieldMoon": return ; + case "PrecisionManufacturing": + return ; + case "BarChart": + return ; default: return null; } diff --git a/src/data/portals.json b/src/data/portals.json index 2a3d78cdd3ae..5c8011ebff77 100644 --- a/src/data/portals.json +++ b/src/data/portals.json @@ -79,5 +79,23 @@ "target": "_blank", "external": true, "icon": "ShieldMoon" + }, + { + "label": "Power Platform Portal", + "name": "Power_Platform_Portal", + "url": "https://admin.powerplatform.microsoft.com/account/login/customerId", + "variable": "customerId", + "target": "_blank", + "external": true, + "icon": "PrecisionManufacturing" + }, + { + "label": "Power BI Portal", + "name": "Power_BI_Portal", + "url": "https://app.powerbi.com/admin-portal?ctid=customerId", + "variable": "customerId", + "target": "_blank", + "external": true, + "icon": "BarChart" } ] \ No newline at end of file diff --git a/src/pages/cipp/preferences.js b/src/pages/cipp/preferences.js index 38f6fe99bd27..85ee3874cd57 100644 --- a/src/pages/cipp/preferences.js +++ b/src/pages/cipp/preferences.js @@ -4,16 +4,39 @@ import { Grid } from "@mui/system"; import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippPropertyListCard } from "../../components/CippCards/CippPropertyListCard"; import CippFormComponent from "../../components/CippComponents/CippFormComponent"; -import { useForm } from "react-hook-form"; +import { useForm, useWatch } from "react-hook-form"; import { useSettings } from "../../hooks/use-settings"; import countryList from "../../data/countryList.json"; import { CippSettingsSideBar } from "../../components/CippComponents/CippSettingsSideBar"; import CippDevOptions from "/src/components/CippComponents/CippDevOptions"; import { ApiGetCall } from "../../api/ApiCall"; import { getCippFormatting } from "../../utils/get-cipp-formatting"; +import { useEffect, useState } from "react"; const Page = () => { const settings = useSettings(); + const [initialUserType, setInitialUserType] = useState(null); + + // Default portal links configuration + const defaultPortalLinks = { + M365_Portal: true, + Exchange_Portal: true, + Entra_Portal: true, + Teams_Portal: true, + Azure_Portal: true, + Intune_Portal: true, + SharePoint_Admin: true, + Security_Portal: true, + Compliance_Portal: true, + Power_Platform_Portal: true, + Power_BI_Portal: true, + }; + + const auth = ApiGetCall({ + url: "/api/me", + queryKey: "authmecipp", + }); + const cleanedSettings = { ...settings }; if (cleanedSettings.offboardingDefaults?.keepCopy) { @@ -21,13 +44,110 @@ const Page = () => { settings.handleUpdate(cleanedSettings); } - const formcontrol = useForm({ mode: "onChange", defaultValues: cleanedSettings }); + // Determine if we have user-specific settings and set initial user type + useEffect(() => { + if (cleanedSettings && auth.data?.clientPrincipal?.userDetails && initialUserType === null) { + const hasUserSpecificSettings = cleanedSettings.UserSpecificSettings && + Object.keys(cleanedSettings.UserSpecificSettings).length > 0; + + setInitialUserType(hasUserSpecificSettings ? "currentUser" : "allUsers"); + } + }, [cleanedSettings, auth.data?.clientPrincipal?.userDetails, initialUserType]); - const auth = ApiGetCall({ - url: "/api/me", - queryKey: "authmecipp", + // Set default portal links if they don't exist at global level + if (!cleanedSettings.portalLinks) { + cleanedSettings.portalLinks = defaultPortalLinks; + } + + // Determine initial portal links based on user type + const getInitialPortalLinks = () => { + if (initialUserType === "currentUser" && cleanedSettings.UserSpecificSettings?.portalLinks) { + // Merge with defaults to ensure all keys exist + return { ...defaultPortalLinks, ...cleanedSettings.UserSpecificSettings.portalLinks }; + } + + // Use global settings or defaults + return { ...defaultPortalLinks, ...cleanedSettings.portalLinks }; + }; + + // Set up initial form values with proper user selector default + const initialFormValues = { + ...cleanedSettings, + user: initialUserType === "currentUser" ? { + label: "Current User", + value: auth.data?.clientPrincipal?.userDetails || "currentUser", + } : { + label: "All Users", + value: "allUsers" + }, + portalLinks: getInitialPortalLinks() + }; + + const formcontrol = useForm({ + mode: "onChange", + defaultValues: initialFormValues + }); + + // Watch the user selector to determine which settings to show + const selectedUser = useWatch({ + control: formcontrol.control, + name: "user" }); + // Update form when initial user type is determined + useEffect(() => { + if (initialUserType !== null && auth.data?.clientPrincipal?.userDetails) { + const userValue = initialUserType === "currentUser" + ? { + label: "Current User", + value: auth.data.clientPrincipal.userDetails, + } + : { + label: "All Users", + value: "allUsers" + }; + + const newFormValues = { + ...cleanedSettings, + user: userValue, + portalLinks: getInitialPortalLinks() + }; + + // Reset the entire form with new values + formcontrol.reset(newFormValues); + } + }, [initialUserType, auth.data?.clientPrincipal?.userDetails]); + + // Handle switching between user types + useEffect(() => { + if (selectedUser?.value && initialUserType !== null) { + const getPortalLinksForUserType = () => { + if (selectedUser.value === "allUsers") { + // Show global settings (root level) + return { ...defaultPortalLinks, ...cleanedSettings.portalLinks }; + } else { + // Show user-specific settings if they exist, otherwise show global settings + const userSpecificLinks = cleanedSettings.UserSpecificSettings?.portalLinks; + const globalLinks = cleanedSettings.portalLinks; + return { ...defaultPortalLinks, ...globalLinks, ...userSpecificLinks }; + } + }; + + const newPortalLinks = getPortalLinksForUserType(); + const currentPortalLinks = formcontrol.getValues("portalLinks"); + + // Only update if the portal links actually changed + if (JSON.stringify(currentPortalLinks) !== JSON.stringify(newPortalLinks)) { + // Reset form with updated portal links but preserve other values + const currentValues = formcontrol.getValues(); + formcontrol.reset({ + ...currentValues, + portalLinks: newPortalLinks + }); + } + } + }, [selectedUser?.value, cleanedSettings, initialUserType]); + const addedAttributes = [ { value: "consentProvidedForMinor", label: "consentProvidedForMinor" }, { value: "employeeId", label: "employeeId" }, @@ -48,10 +168,64 @@ const Page = () => { { value: "100", label: "100" }, { value: "250", label: "250" }, ]; + const languageListOptions = countryList.map((language) => { return { value: language.Code, label: language.Name }; }); + // Portal links configuration + const portalLinksConfig = [ + { + name: "portalLinks.M365_Portal", + label: "M365 Portal", + }, + { + name: "portalLinks.Exchange_Portal", + label: "Exchange Portal", + }, + { + name: "portalLinks.Entra_Portal", + label: "Entra Portal", + }, + { + name: "portalLinks.Teams_Portal", + label: "Teams Portal", + }, + { + name: "portalLinks.Azure_Portal", + label: "Azure Portal", + }, + { + name: "portalLinks.Intune_Portal", + label: "Intune Portal", + }, + { + name: "portalLinks.SharePoint_Admin", + label: "SharePoint Admin", + }, + { + name: "portalLinks.Security_Portal", + label: "Security Portal", + }, + { + name: "portalLinks.Compliance_Portal", + label: "Compliance Portal", + }, + { + name: "portalLinks.Power_Platform_Portal", + label: "Power Platform Portal", + }, + { + name: "portalLinks.Power_BI_Portal", + label: "Power BI Portal", + }, + ]; + + // Don't render until we've determined the initial user type + if (initialUserType === null || !auth.data?.clientPrincipal?.userDetails) { + return
Loading...
; + } + return ( <> @@ -293,8 +467,23 @@ const Page = () => { showDivider={false} /> - + + ({ + label: portal.label, + value: ( + + ), + }))} + />
diff --git a/src/pages/index.js b/src/pages/index.js index 75dab8251e66..a898b2b73c28 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -17,7 +17,8 @@ import { ExecutiveReportButton } from "../components/ExecutiveReportButton.js"; import { CippStandardsDialog } from "../components/CippCards/CippStandardsDialog.jsx"; const Page = () => { - const { currentTenant } = useSettings(); + const settings = useSettings(); + const { currentTenant } = settings; const [domainVisible, setDomainVisible] = useState(false); const [standardsDialogOpen, setStandardsDialogOpen] = useState(false); @@ -174,12 +175,48 @@ const Page = () => { return `${sizeInMB}MB`; }; + // Function to filter portals based on user preferences + const getFilteredPortals = () => { + const defaultLinks = { + M365_Portal: true, + Exchange_Portal: true, + Entra_Portal: true, + Teams_Portal: true, + Azure_Portal: true, + Intune_Portal: true, + SharePoint_Admin: true, + Security_Portal: true, + Compliance_Portal: true, + Power_Platform_Portal: true, + Power_BI_Portal: true, + }; + + let portalLinks; + if (settings.UserSpecificSettings?.portalLinks) { + portalLinks = { ...defaultLinks, ...settings.UserSpecificSettings.portalLinks }; + } else if (settings.portalLinks) { + portalLinks = { ...defaultLinks, ...settings.portalLinks }; + } else { + portalLinks = defaultLinks; + } + + // Filter the portals based on user settings + return Portals.filter(portal => { + const settingKey = portal.name; + return settingKey ? portalLinks[settingKey] === true : true; + }); + }; + useEffect(() => { if (currentTenantInfo.isSuccess) { const tenantLookup = currentTenantInfo.data?.find( (tenant) => tenant.defaultDomainName === currentTenant ); - const menuItems = Portals.map((portal) => ({ + + // Get filtered portals based on user preferences + const filteredPortals = getFilteredPortals(); + + const menuItems = filteredPortals.map((portal) => ({ label: portal.label, target: "_blank", link: portal.url.replace(portal.variable, tenantLookup?.[portal.variable]), @@ -187,7 +224,7 @@ const Page = () => { })); setPortalMenuItems(menuItems); } - }, [currentTenantInfo.isSuccess, currentTenant]); + }, [currentTenantInfo.isSuccess, currentTenant, settings.portalLinks, settings.UserSpecificSettings]); return ( <> diff --git a/src/pages/tenant/administration/tenants/index.js b/src/pages/tenant/administration/tenants/index.js index 0b85618ece44..6458468d9b26 100644 --- a/src/pages/tenant/administration/tenants/index.js +++ b/src/pages/tenant/administration/tenants/index.js @@ -18,6 +18,8 @@ const Page = () => { "portal_intune", "portal_security", "portal_compliance", + "portal_platform", + "portal_bi", ]; const actions = [ diff --git a/src/utils/get-cipp-formatting.js b/src/utils/get-cipp-formatting.js index 3aff37d2a74c..05eeeca3bb44 100644 --- a/src/utils/get-cipp-formatting.js +++ b/src/utils/get-cipp-formatting.js @@ -7,6 +7,8 @@ import { Shield, Description, GroupOutlined, + PrecisionManufacturing, + BarChart, } from "@mui/icons-material"; import { Chip, Link, SvgIcon } from "@mui/material"; import { Box } from "@mui/system"; @@ -54,6 +56,8 @@ export const getCippFormatting = (data, cellName, type, canReceive, flatten = tr portal_security: Shield, portal_compliance: CompassCalibration, portal_sharepoint: Description, + portal_platform: PrecisionManufacturing, + portal_bi: BarChart, }; // Create a helper function to render chips with CollapsibleChipList From 4d7dcb51b352f20872b74b7f95f40e888305a57a Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 21 Aug 2025 12:42:50 +0200 Subject: [PATCH 06/86] added edu licenses which don't show up in the default files --- src/data/M365Licenses-additional.json | 250 ++++++++++++++++++++++ src/utils/get-cipp-license-translation.js | 5 +- 2 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 src/data/M365Licenses-additional.json diff --git a/src/data/M365Licenses-additional.json b/src/data/M365Licenses-additional.json new file mode 100644 index 000000000000..09733867f764 --- /dev/null +++ b/src/data/M365Licenses-additional.json @@ -0,0 +1,250 @@ +[ + { + "Product_Display_Name": "Office 365 Education E3 for Faculty", + "String_Id": "ENTERPRISEPACK_FACULTY", + "GUID": "e4fa3838-3d01-42df-aa28-5e0a4c68604b", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A1 for Faculty", + "String_Id": "STANDARDWOFFPACK_FACULTY", + "GUID": "94763226-9b3c-4e75-a931-5c89701abe66", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 for Faculty", + "String_Id": "ENTERPRISEPREMIUM_FACULTY", + "GUID": "a4585165-0533-458a-97e3-c400570268c4", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 without Audio Conferencing for faculty", + "String_Id": "ENTERPRISEPREMIUM_NOPSTNCONF_FACULTY", + "GUID": "9a320620-ca3d-4705-a79d-27c135c96e05", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 Education E1 for Faculty", + "String_Id": "STANDARDPACK_FACULTY", + "GUID": "a19037fc-48b4-4d57-b079-ce44b7832473", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A3 for Faculty", + "String_Id": "M365EDU_A3_FACULTY", + "GUID": "4b590615-0888-425a-a965-b3bf7789848d", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 for Faculty", + "String_Id": "M365EDU_A5_FACULTY", + "GUID": "e97c048c-37a4-45fb-ab50-922fbf07a370", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 without Audio Conferencing for Faculty", + "String_Id": "M365EDU_A5_NOPSTNCONF_FACULTY", + "GUID": "65200ac3-f927-4407-a3d5-c63562dff461", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 Education for Homeschool for Faculty", + "String_Id": "STANDARDWOFFPACK_HOMESCHOOL_FAC", + "GUID": "43e691ad-1491-4e8c-8dc9-da6b8262c03b", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A1 for Faculty (for Device)", + "String_Id": "STANDARDWOFFPACK_FACULTY_DEVICE", + "GUID": "af4e28de-6b52-4fd3-a5f4-6bf708a304d3", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft Teams Rooms Basic for EDU", + "String_Id": "Microsoft_Teams_Rooms_Basic_FAC", + "GUID": "a4e376bd-c61e-4618-9901-3fc0cb1b88bb", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft Teams Rooms Basic without Audio Conferencing for EDU", + "String_Id": "Microsoft_Teams_Rooms_Basic_without_Audio_Conferencing_FAC", + "GUID": "7da0ac23-26f8-4d04-8731-9016d9883340", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft Teams Rooms Pro for EDU", + "String_Id": "Microsoft_Teams_Rooms_Pro_FAC", + "GUID": "c25e2b36-e161-4946-bef2-69239729f690", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft Teams Rooms Pro without Audio Conferencing for EDU", + "String_Id": "Microsoft_Teams_Rooms_Pro_without_Audio_Conferencing_FAC", + "GUID": "271f6b1a-de32-4849-bcf4-b79b8a7c2cfe", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 Education E3 for Students", + "String_Id": "ENTERPRISEPACK_STUDENT", + "GUID": "8fc2205d-4e51-4401-97f0-5c89ef1aafb", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A1 for Students", + "String_Id": "STANDARDWOFFPACK_STUDENT", + "GUID": "314c4481-f395-4525-be8b-2ec4bb1e9d91", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 for Students", + "String_Id": "ENTERPRISEPREMIUM_STUDENT", + "GUID": "ee656612-49fa-43e5-b67e-cb1fdf7699df", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 without PSTN Conferencing for Students", + "String_Id": "ENTERPRISEPREMIUM_NOPSTNCONF_STUDENT", + "GUID": "1164451b-e2e5-4c9e-8fa6-e5122d90dbdc", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 Education E1 for Students", + "String_Id": "STANDARDPACK_STUDENT", + "GUID": "d37ba356-38c5-4c82-90da-3d714f72a382", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A3 for Students", + "String_Id": "M365EDU_A3_STUDENT", + "GUID": "7cfd9a2b-e110-4c39-bf20-c6a3f36a3121", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A3 for Students use benefits", + "String_Id": "M365EDU_A3_STUUSEBNFT", + "GUID": "18250162-5d87-4436-a834-d795c15c80f3", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 for Students", + "String_Id": "M365EDU_A5_STUDENT", + "GUID": "46c119d4-0379-4a9d-85e4-97c66d3f909e", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 Student use benefits", + "String_Id": "M365EDU_A5_STUUSEBNFT", + "GUID": "31d57bc7-3a05-4867-ab53-97a17835a411", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 without Audio Conferencing for Students", + "String_Id": "M365EDU_A5_NOPSTNCONF_STUDENT", + "GUID": "a25c01ce-bab1-47e9-a6d0-ebe939b99ff9", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Microsoft 365 A5 without Audio Conferencing for Students use benefit", + "String_Id": "M365EDU_A5_NOPSTNCONF_STUUSEBNFT", + "GUID": "81441ae1-0b31-4185-a6c0-32b6b84d419f", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A3 for Students", + "String_Id": "ENTERPRISEPACKPLUS_STUDENT", + "GUID": "98b6e773-24d4-4c0d-a968-6e787a1f8204", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A3 Student use benefit", + "String_Id": "ENTERPRISEPACKPLUS_STUUSEBNFT", + "GUID": "476aad1e-7a7f-473c-9d20-35665a5cbd4f", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 Student use benefit", + "String_Id": "ENTERPRISEPREMIUM_STUUSEBNFT", + "GUID": "f6e603f1-1a6d-4d32-a730-34b809cb9731", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A5 without Audio Conferencing for Students use benefit", + "String_Id": "ENTERPRISEPREMIUM_NOPSTNCONF_STUUSEBNFT", + "GUID": "bc86c9cd-3058-43ba-9972-141678675ac1", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 Education for Homeschool for Students", + "String_Id": "STANDARDWOFFPACK_HOMESCHOOL_STU", + "GUID": "afbb89a7-db5f-45fb-8af0-1bc5c5015709", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + }, + { + "Product_Display_Name": "Office 365 A1 for Students (for Device)", + "String_Id": "STANDARDWOFFPACK_STUDENT_DEVICE", + "GUID": "160d609e-ab08-4fce-bc1c-ea13321942ac", + "Service_Plan_Name": "", + "Service_Plan_Id": "", + "Service_Plans_Included_Friendly_Names": "" + } +] diff --git a/src/utils/get-cipp-license-translation.js b/src/utils/get-cipp-license-translation.js index 9e36c5cc7db1..8ab4f402c980 100644 --- a/src/utils/get-cipp-license-translation.js +++ b/src/utils/get-cipp-license-translation.js @@ -1,6 +1,9 @@ -import M365Licenses from "../data/M365Licenses.json"; +import M365LicensesDefault from "../data/M365Licenses.json"; +import M365LicensesAdditional from "../data/M365Licenses-additional.json"; export const getCippLicenseTranslation = (licenseArray) => { + //combine M365LicensesDefault and M365LicensesAdditional to one array + const M365Licenses = [...M365LicensesDefault, ...M365LicensesAdditional]; let licenses = []; if (!Array.isArray(licenseArray) && typeof licenseArray === "object") { From 8afe9185f81e73a34e124d255301b5d821044389 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 21 Aug 2025 13:41:06 +0200 Subject: [PATCH 07/86] invite guest update --- .../CippComponents/CippInviteGuestDrawer.jsx | 142 ++++++++++++++++++ .../identity/administration/users/index.js | 11 +- .../identity/administration/users/invite.jsx | 38 ----- 3 files changed, 146 insertions(+), 45 deletions(-) create mode 100644 src/components/CippComponents/CippInviteGuestDrawer.jsx delete mode 100644 src/pages/identity/administration/users/invite.jsx diff --git a/src/components/CippComponents/CippInviteGuestDrawer.jsx b/src/components/CippComponents/CippInviteGuestDrawer.jsx new file mode 100644 index 000000000000..d6818a092fbe --- /dev/null +++ b/src/components/CippComponents/CippInviteGuestDrawer.jsx @@ -0,0 +1,142 @@ +import React, { useState } from "react"; +import { Button } from "@mui/material"; +import { Grid } from "@mui/system"; +import { useForm } from "react-hook-form"; +import { Send } from "@mui/icons-material"; +import { CippOffCanvas } from "./CippOffCanvas"; +import CippFormComponent from "./CippFormComponent"; +import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "../../hooks/use-settings"; +import { ApiPostCall } from "../../api/ApiCall"; + +export const CippInviteGuestDrawer = ({ + buttonText = "Invite Guest", + requiredPermissions = [], + PermissionButton = Button, +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const userSettingsDefaults = useSettings(); + + const formControl = useForm({ + mode: "onChange", + defaultValues: { + tenantFilter: userSettingsDefaults.currentTenant, + displayName: "", + mail: "", + redirectUri: "", + sendInvite: false, + }, + }); + + const inviteGuest = ApiPostCall({ + urlFromData: true, + relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], + }); + + const handleSubmit = () => { + const formData = formControl.getValues(); + inviteGuest.mutate({ + url: "/api/AddGuest", + data: formData, + relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], + }); + }; + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset({ + tenantFilter: userSettingsDefaults.currentTenant, + displayName: "", + mail: "", + redirectUri: "", + sendInvite: false, + }); + }; + + return ( + <> + setDrawerVisible(true)} + startIcon={} + > + {buttonText} + + + + + + } + > + + + + + + + + + + + + + + + + + + + ); +}; \ No newline at end of file diff --git a/src/pages/identity/administration/users/index.js b/src/pages/identity/administration/users/index.js index 69a290b92615..34f03064e477 100644 --- a/src/pages/identity/administration/users/index.js +++ b/src/pages/identity/administration/users/index.js @@ -5,6 +5,7 @@ import Link from "next/link"; import { useSettings } from "/src/hooks/use-settings.js"; import { PermissionButton } from "../../../../utils/permissions"; import { CippUserActions } from "/src/components/CippComponents/CippUserActions.jsx"; +import { CippInviteGuestDrawer } from "/src/components/CippComponents/CippInviteGuestDrawer.jsx"; const Page = () => { const pageTitle = "Users"; @@ -72,14 +73,10 @@ const Page = () => { > Bulk Add Users - } - > - Invite Guest - + PermissionButton={PermissionButton} + /> } apiData={{ diff --git a/src/pages/identity/administration/users/invite.jsx b/src/pages/identity/administration/users/invite.jsx deleted file mode 100644 index cf6cabf8d965..000000000000 --- a/src/pages/identity/administration/users/invite.jsx +++ /dev/null @@ -1,38 +0,0 @@ -import { Box } from "@mui/material"; -import { Grid } from "@mui/system"; -import CippFormPage from "../../../../components/CippFormPages/CippFormPage"; -import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { useForm } from "react-hook-form"; -import { useSettings } from "../../../../hooks/use-settings"; -import CippInviteUser from "../../../../components/CippFormPages/CippInviteGuest"; -const Page = () => { - const userSettingsDefaults = useSettings(); - - const formControl = useForm({ - mode: "onChange", - defaultValues: { - tenantFilter: userSettingsDefaults.currentTenant, - }, - }); - - return ( - <> - - - - - - - - ); -}; - -Page.getLayout = (page) => {page}; - -export default Page; From a1f7f222b70842b02057fe829f02929b675db7f6 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:26:34 +0200 Subject: [PATCH 08/86] HVE and shared mailbox drawer. --- .../CippComponents/CippHVEUserDrawer.jsx | 171 ++++++++++++++++++ .../CippSharedMailboxDrawer.jsx | 128 +++++++++++++ .../email/administration/mailboxes/index.js | 14 +- 3 files changed, 303 insertions(+), 10 deletions(-) create mode 100644 src/components/CippComponents/CippHVEUserDrawer.jsx create mode 100644 src/components/CippComponents/CippSharedMailboxDrawer.jsx diff --git a/src/components/CippComponents/CippHVEUserDrawer.jsx b/src/components/CippComponents/CippHVEUserDrawer.jsx new file mode 100644 index 000000000000..3c4ba53ca852 --- /dev/null +++ b/src/components/CippComponents/CippHVEUserDrawer.jsx @@ -0,0 +1,171 @@ +import React, { useState } from "react"; +import { Button, Alert, Box } from "@mui/material"; +import { Grid } from "@mui/system"; +import { useForm } from "react-hook-form"; +import { PersonAdd } from "@mui/icons-material"; +import { CippOffCanvas } from "./CippOffCanvas"; +import CippFormComponent from "./CippFormComponent"; +import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "../../hooks/use-settings"; +import { ApiPostCall } from "../../api/ApiCall"; + +export const CippHVEUserDrawer = ({ + buttonText = "Add HVE User", + requiredPermissions = [], + PermissionButton = Button, +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const userSettingsDefaults = useSettings(); + + const formControl = useForm({ + mode: "onChange", + defaultValues: { + tenantFilter: userSettingsDefaults.currentTenant, + displayName: "", + password: "", + primarySMTPAddress: "", + }, + }); + + const createHVEUser = ApiPostCall({ + urlFromData: true, + relatedQueryKeys: ["Mailboxes"], + }); + + const handleSubmit = () => { + const formData = formControl.getValues(); + const postData = { + tenantFilter: formData.tenantFilter, + displayName: formData.displayName, + password: formData.password, + primarySMTPAddress: formData.primarySMTPAddress, + }; + createHVEUser.mutate({ + url: "/api/ExecHVEUser", + data: postData, + relatedQueryKeys: ["Mailboxes"], + }); + }; + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset({ + tenantFilter: userSettingsDefaults.currentTenant, + displayName: "", + password: "", + primarySMTPAddress: "", + }); + }; + + return ( + <> + setDrawerVisible(true)} + startIcon={} + > + {buttonText} + + + + + + } + > + + + + + HVE SMTP Configuration Settings: + +
  • + Server: smtp-hve.office365.com +
  • +
  • + Port: 587 +
  • +
  • + Encryption: STARTTLS +
  • +
  • + TLS Support: TLS 1.2 and TLS 1.3 +
  • +
    + + Use these settings to configure your email client for HVE access. + +
    +
    +
    + + + + + + + + + + + + + + +
    +
    + + ); +}; diff --git a/src/components/CippComponents/CippSharedMailboxDrawer.jsx b/src/components/CippComponents/CippSharedMailboxDrawer.jsx new file mode 100644 index 000000000000..887c46ec1bd2 --- /dev/null +++ b/src/components/CippComponents/CippSharedMailboxDrawer.jsx @@ -0,0 +1,128 @@ +import { useState } from "react"; +import { Button } from "@mui/material"; +import { useForm } from "react-hook-form"; +import { Divider } from "@mui/material"; +import { Add } from "@mui/icons-material"; +import { CippOffCanvas } from "./CippOffCanvas"; +import CippFormComponent from "./CippFormComponent"; +import { CippFormDomainSelector } from "./CippFormDomainSelector"; +import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "../../hooks/use-settings"; +import { ApiPostCall } from "../../api/ApiCall"; +import { Grid } from "@mui/system"; + +export const CippSharedMailboxDrawer = ({ + buttonText = "Add Shared Mailbox", + requiredPermissions = [], + PermissionButton = Button, +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const tenantDomain = useSettings().currentTenant; + + const formControl = useForm({ + mode: "onChange", + defaultValues: { + displayName: "", + username: "", + domain: null, + }, + }); + + const createSharedMailbox = ApiPostCall({ + urlFromData: true, + relatedQueryKeys: ["Mailboxes"], + }); + + const handleSubmit = () => { + const formData = formControl.getValues(); + const postData = { + tenantID: tenantDomain, + displayName: formData.displayName, + username: formData.username, + domain: formData.domain?.value, + }; + createSharedMailbox.mutate({ + url: "/api/AddSharedMailbox", + data: postData, + relatedQueryKeys: ["Mailboxes"], + }); + }; + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset({ + displayName: "", + username: "", + domain: null, + }); + }; + + return ( + <> + setDrawerVisible(true)} + startIcon={} + > + {buttonText} + + + + + + } + > + + + + + + + + + + + + + + + + + ); +}; diff --git a/src/pages/email/administration/mailboxes/index.js b/src/pages/email/administration/mailboxes/index.js index da5479b87fb4..3687c04b512e 100644 --- a/src/pages/email/administration/mailboxes/index.js +++ b/src/pages/email/administration/mailboxes/index.js @@ -1,9 +1,8 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import Link from "next/link"; -import { Button } from "@mui/material"; -import { Add } from "@mui/icons-material"; import CippExchangeActions from "../../../../components/CippComponents/CippExchangeActions"; +import { CippHVEUserDrawer } from "/src/components/CippComponents/CippHVEUserDrawer.jsx"; +import { CippSharedMailboxDrawer } from "/src/components/CippComponents/CippSharedMailboxDrawer.jsx"; const Page = () => { const pageTitle = "Mailboxes"; @@ -57,13 +56,8 @@ const Page = () => { filters={filterList} cardButton={ <> - + + } /> From 9e9d24cdc72fd0ba3ec9eb95eeb080f7e67ac737 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:57:47 +0200 Subject: [PATCH 09/86] alert added --- src/data/alerts.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/alerts.json b/src/data/alerts.json index 17794fa7b32a..bb336d180e10 100644 --- a/src/data/alerts.json +++ b/src/data/alerts.json @@ -14,7 +14,7 @@ "label": "Alert on license assignment errors", "recommendedRunInterval": "1d" }, - { + { "name": "AlertSmtpAuthSuccess", "label": "Alert on SMTP AUTH usage with success, helps to phase out SMTP AUTH (Entra P1 Required)", "recommendedRunInterval": "1d" @@ -178,6 +178,11 @@ "label": "Alert on (new) potentially breached passwords. Generates an alert if a password is found to be breached.", "recommendedRunInterval": "7d" }, + { + "name": "LicensedUsersWithRoles", + "label": "Alert on licensed users with any administrator roles", + "recommendedRunInterval": "7d" + }, { "name": "HuntressRogueApps", "label": "Alert on Huntress Rogue Apps detected", From 4e575a209d2a02ca4ae92ba96071fc36e1a000a1 Mon Sep 17 00:00:00 2001 From: Brian Simpson <50429915+bmsimp@users.noreply.github.com> Date: Thu, 21 Aug 2025 13:27:34 -0500 Subject: [PATCH 10/86] Update CippSAMDeploy.jsx Replace missing docs link Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com> --- src/components/CippWizard/CippSAMDeploy.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CippWizard/CippSAMDeploy.jsx b/src/components/CippWizard/CippSAMDeploy.jsx index a38a27bf8af6..2cb619fef7aa 100644 --- a/src/components/CippWizard/CippSAMDeploy.jsx +++ b/src/components/CippWizard/CippSAMDeploy.jsx @@ -85,7 +85,7 @@ export const CippSAMDeploy = (props) => {
  • A CIPP Service Account. For more information on how to create a service account, click{" "} From 7ea3d833347fedd42e6cd330778a327fc91287b1 Mon Sep 17 00:00:00 2001 From: Brian Simpson <50429915+bmsimp@users.noreply.github.com> Date: Thu, 21 Aug 2025 13:29:27 -0500 Subject: [PATCH 11/86] Update config.js Fix retention policies type Signed-off-by: Brian Simpson <50429915+bmsimp@users.noreply.github.com> --- src/layouts/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/config.js b/src/layouts/config.js index 5025b4558b87..98ce6f9b54f2 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -591,7 +591,7 @@ export const nativeMenuItems = [ permissions: ["Exchange.SpamFilter.*"], }, { - title: "Retention Polcies & Tags", + title: "Retention Policies & Tags", path: "/email/administration/exchange-retention/policies", permissions: ["Exchange.RetentionPolicies.*"], }, From e9d8c0cc12f597a9d00e3e6294cbdd0725c95d84 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 21 Aug 2025 15:46:26 -0400 Subject: [PATCH 12/86] audit log search improvements --- .../CippAuditLogSearchDrawer.jsx | 419 ++++++++++++++++ .../administration/audit-logs/searches.js | 459 +----------------- 2 files changed, 425 insertions(+), 453 deletions(-) create mode 100644 src/components/CippComponents/CippAuditLogSearchDrawer.jsx diff --git a/src/components/CippComponents/CippAuditLogSearchDrawer.jsx b/src/components/CippComponents/CippAuditLogSearchDrawer.jsx new file mode 100644 index 000000000000..f30a4c73d2d5 --- /dev/null +++ b/src/components/CippComponents/CippAuditLogSearchDrawer.jsx @@ -0,0 +1,419 @@ +import { useState } from "react"; +import { Button, Stack, Box } from "@mui/material"; +import { Add } from "@mui/icons-material"; +import { useForm } from "react-hook-form"; +import { CippOffCanvas } from "./CippOffCanvas"; +import { ApiPostCall } from "../../api/ApiCall"; +import CippFormComponent from "./CippFormComponent"; +import { CippApiResults } from "./CippApiResults"; + +export const CippAuditLogSearchDrawer = ({ + buttonText = "New Search", + relatedQueryKeys = ["AuditLogSearches"], +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const formControl = useForm(); + + const createSearchApi = ApiPostCall({ + datafromUrl: false, + relatedQueryKeys, + }); + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset(); + }; + + const handleCreateSearch = async (data) => { + const formattedData = { ...data }; + + // Extract value from TenantFilter autocomplete object + if (formattedData.TenantFilter?.value) { + formattedData.TenantFilter = formattedData.TenantFilter.value; + } + + // Handle KeywordFilter - extract values from array and join with spaces + if (Array.isArray(formattedData.KeywordFilter)) { + const keywords = formattedData.KeywordFilter.map((item) => + typeof item === "object" ? item.value : item + ).filter(Boolean); + formattedData.KeywordFilter = keywords.join(" "); + } + + // Extract values from RecordTypeFilters array + if (Array.isArray(formattedData.RecordTypeFilters)) { + formattedData.RecordTypeFilters = formattedData.RecordTypeFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from ServiceFilters array + if (Array.isArray(formattedData.ServiceFilters)) { + formattedData.ServiceFilters = formattedData.ServiceFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from OperationsFilters array + if (Array.isArray(formattedData.OperationsFilters)) { + formattedData.OperationsFilters = formattedData.OperationsFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from UserPrincipalNameFilters array + if (Array.isArray(formattedData.UserPrincipalNameFilters)) { + formattedData.UserPrincipalNameFilters = formattedData.UserPrincipalNameFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from IPAddressFilters array + if (Array.isArray(formattedData.IPAddressFilters)) { + formattedData.IPAddressFilters = formattedData.IPAddressFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from ObjectIdFilters array + if (Array.isArray(formattedData.ObjectIdFilters)) { + formattedData.ObjectIdFilters = formattedData.ObjectIdFilters.map((item) => + typeof item === "object" ? item.value : item + ); + } + + // Extract values from AdministrativeUnitFilters array + if (Array.isArray(formattedData.AdministrativeUnitFilters)) { + formattedData.AdministrativeUnitFilters = formattedData.AdministrativeUnitFilters.map( + (item) => (typeof item === "object" ? item.value : item) + ); + } + + // Remove empty arrays to avoid sending unnecessary data + Object.keys(formattedData).forEach((key) => { + if (Array.isArray(formattedData[key]) && formattedData[key].length === 0) { + delete formattedData[key]; + } + if ( + formattedData[key] === "" || + formattedData[key] === null || + formattedData[key] === undefined + ) { + delete formattedData[key]; + } + }); + + try { + await createSearchApi.mutateAsync({ + url: "/api/ExecAuditLogSearch", + data: formattedData, + }); + } catch (error) { + console.error("Error creating search:", error); + } + }; + + // Create Search Form Fields + const createSearchFields = [ + { + type: "textField", + name: "DisplayName", + label: "Search Name", + required: true, + validators: { required: "Search name is required" }, + }, + { + type: "autoComplete", + name: "TenantFilter", + label: "Tenant", + multiple: false, + creatable: false, + api: { + url: "/api/ListTenants?AllTenantSelector=false", + labelField: (option) => `${option.displayName} (${option.defaultDomainName})`, + valueField: "defaultDomainName", + queryKey: "ListTenants-FormnotAllTenants", + excludeTenantFilter: true, + }, + validators: { validate: (value) => !!value?.value || "Please select a tenant" }, + required: true, + }, + { + type: "datePicker", + name: "StartTime", + label: "Start Date & Time", + dateTimeType: "datetime-local", + validators: { required: "Start time is required" }, + required: true, + }, + { + type: "datePicker", + name: "EndTime", + label: "End Date & Time", + dateTimeType: "datetime-local", + validators: { required: "End time is required" }, + required: true, + }, + { + type: "autoComplete", + name: "ServiceFilters", + label: "Services", + multiple: true, + creatable: false, + options: [ + { label: "Azure Active Directory", value: "AzureActiveDirectory" }, + { label: "Dynamics 365", value: "CRM" }, + { label: "Exchange Online", value: "Exchange" }, + { label: "Microsoft Flow", value: "MicrosoftFlow" }, + { label: "Microsoft Teams", value: "MicrosoftTeams" }, + { label: "OneDrive for Business", value: "OneDrive" }, + { label: "Power BI", value: "PowerBI" }, + { label: "Security & Compliance", value: "ThreatIntelligence" }, + { label: "SharePoint Online", value: "SharePoint" }, + { label: "Yammer", value: "Yammer" }, + ], + validators: { + validate: (values) => values?.length > 0 || "Please select at least one service", + }, + }, + { + type: "autoComplete", + name: "RecordTypeFilters", + label: "Record Types", + multiple: true, + creatable: false, + options: [ + { label: "Azure Active Directory", value: "azureActiveDirectory" }, + { label: "Azure AD Account Logon", value: "azureActiveDirectoryAccountLogon" }, + { label: "Azure AD STS Logon", value: "azureActiveDirectoryStsLogon" }, + { label: "Compliance DLP Endpoint", value: "complianceDLPEndpoint" }, + { label: "Compliance DLP Exchange", value: "complianceDLPExchange" }, + { label: "Compliance DLP SharePoint", value: "complianceDLPSharePoint" }, + { label: "Data Governance", value: "dataGovernance" }, + { label: "Exchange Admin", value: "exchangeAdmin" }, + { label: "Exchange Item", value: "exchangeItem" }, + { label: "Exchange Item Group", value: "exchangeItemGroup" }, + { label: "Information Worker Protection", value: "informationWorkerProtection" }, + { label: "Label Content Explorer", value: "labelContentExplorer" }, + { label: "Microsoft Flow", value: "microsoftFlow" }, + { label: "Microsoft Forms", value: "microsoftForms" }, + { label: "Microsoft Stream", value: "microsoftStream" }, + { label: "Microsoft Teams", value: "microsoftTeams" }, + { label: "Microsoft Teams Admin", value: "microsoftTeamsAdmin" }, + { label: "Microsoft Teams Analytics", value: "microsoftTeamsAnalytics" }, + { label: "Microsoft Teams Device", value: "microsoftTeamsDevice" }, + { label: "Microsoft Teams Shifts", value: "microsoftTeamsShifts" }, + { label: "MIP Label", value: "mipLabel" }, + { label: "OneDrive", value: "oneDrive" }, + { label: "Power Apps App", value: "powerAppsApp" }, + { label: "Power Apps Plan", value: "powerAppsPlan" }, + { label: "Power BI Audit", value: "powerBIAudit" }, + { label: "Power BI DLP", value: "powerBIDlp" }, + { label: "Security & Compliance Alerts", value: "securityComplianceAlerts" }, + { label: "Security & Compliance Insights", value: "securityComplianceInsights" }, + { label: "Security & Compliance RBAC", value: "securityComplianceRBAC" }, + { label: "SharePoint", value: "sharePoint" }, + { label: "SharePoint File Operation", value: "sharePointFileOperation" }, + { label: "SharePoint List Operation", value: "sharePointListOperation" }, + { label: "SharePoint Sharing Operation", value: "sharePointSharingOperation" }, + { label: "Threat Intelligence", value: "threatIntelligence" }, + { label: "Threat Intelligence ATP Content", value: "threatIntelligenceAtpContent" }, + { label: "Threat Intelligence URL", value: "threatIntelligenceUrl" }, + { label: "Workplace Analytics", value: "workplaceAnalytics" }, + ], + }, + { + type: "autoComplete", + name: "KeywordFilter", + label: "Keywords", + multiple: true, + creatable: true, + freeSolo: true, + placeholder: "Enter keywords to search for", + options: [], + }, + { + type: "autoComplete", + name: "OperationsFilters", + label: "Operations", + multiple: true, + creatable: true, + placeholder: "Enter or select operations", + options: [ + // Authentication & User Operations + { label: "User Logged In", value: "UserLoggedIn" }, + { label: "Mailbox Login", value: "mailboxlogin" }, + + // User Management Operations + { label: "Add User", value: "add user." }, + { label: "Update User", value: "update user." }, + { label: "Delete User", value: "delete user." }, + { label: "Reset User Password", value: "reset user password." }, + { label: "Change User Password", value: "change user password." }, + { label: "Change User License", value: "change user license." }, + + // Group Management Operations + { label: "Add Group", value: "add group." }, + { label: "Update Group", value: "update group." }, + { label: "Delete Group", value: "delete group." }, + { label: "Add Member to Group", value: "add member to group." }, + { label: "Remove Member from Group", value: "remove member from group." }, + + // Mailbox Operations + { label: "New Mailbox", value: "New-Mailbox" }, + { label: "Set Mailbox", value: "Set-Mailbox" }, + { label: "Add Mailbox Permission", value: "add-mailboxpermission" }, + { label: "Remove Mailbox Permission", value: "remove-mailboxpermission" }, + { label: "Mail Items Accessed", value: "mailitemsaccessed" }, + + // Email Operations + { label: "Send Message", value: "send" }, + { label: "Send As", value: "sendas" }, + { label: "Send On Behalf", value: "sendonbehalf" }, + { label: "Create Item", value: "create" }, + { label: "Update Message", value: "update" }, + { label: "Copy Messages", value: "copy" }, + { label: "Move Messages", value: "move" }, + { label: "Move to Deleted Items", value: "movetodeleteditems" }, + { label: "Soft Delete", value: "softdelete" }, + { label: "Hard Delete", value: "harddelete" }, + + // Inbox Rules + { label: "New Inbox Rule", value: "new-inboxrule" }, + { label: "Set Inbox Rule", value: "set-inboxrule" }, + { label: "Update Inbox Rules", value: "updateinboxrules" }, + + // Folder Operations + { label: "Add Folder Permissions", value: "addfolderpermissions" }, + { label: "Remove Folder Permissions", value: "removefolderpermissions" }, + { label: "Update Folder Permissions", value: "updatefolderpermissions" }, + { label: "Update Calendar Delegation", value: "updatecalendardelegation" }, + + // SharePoint/OneDrive Operations (Common ones) + { label: "File Accessed", value: "FileAccessed" }, + { label: "File Modified", value: "FileModified" }, + { label: "File Deleted", value: "FileDeleted" }, + { label: "File Downloaded", value: "FileDownloaded" }, + { label: "File Uploaded", value: "FileUploaded" }, + { label: "Sharing Set", value: "SharingSet" }, + { label: "Anonymous Link Created", value: "AnonymousLinkCreated" }, + + // Role and Permission Operations + { label: "Add Member to Role", value: "add member to role." }, + { label: "Remove Member from Role", value: "remove member from role." }, + { label: "Add Service Principal", value: "add service principal." }, + { label: "Remove Service Principal", value: "remove service principal." }, + + // Company and Domain Operations + { label: "Add Domain to Company", value: "add domain to company." }, + { label: "Remove Domain from Company", value: "remove domain from company." }, + { label: "Verify Domain", value: "verify domain." }, + { label: "Set Company Information", value: "set company information." }, + + // Security Operations + { label: "Disable Strong Authentication", value: "Disable Strong Authentication." }, + { label: "Apply Record Label", value: "applyrecordlabel" }, + { label: "Update STS Refresh Token", value: "Update StsRefreshTokenValidFrom Timestamp." }, + ], + }, + { + type: "autoComplete", + name: "UserPrincipalNameFilters", + label: "User Principal Names", + multiple: true, + creatable: true, + freeSolo: true, + placeholder: "Enter user principal names", + options: [], + }, + { + type: "autoComplete", + name: "IPAddressFilters", + label: "IP Addresses", + multiple: true, + creatable: true, + freeSolo: true, + placeholder: "Enter IP addresses", + options: [], + }, + { + type: "autoComplete", + name: "ObjectIdFilters", + label: "Object IDs", + multiple: true, + creatable: true, + freeSolo: true, + placeholder: "Enter object IDs", + options: [], + }, + { + type: "autoComplete", + name: "AdministrativeUnitFilters", + label: "Administrative Units", + multiple: true, + creatable: true, + placeholder: "Enter administrative units", + api: { + url: "/api/ListGraphRequest", + queryKey: "AdministrativeUnits", + data: { + Endpoint: "directoryObjects/microsoft.graph.administrativeUnit", + $select: "id,displayName", + }, + dataKey: "Results", + labelField: "displayName", + valueField: "id", + addedField: { + id: "id", + displayName: "displayName", + }, + showRefresh: true, + }, + }, + { + type: "switch", + name: "ProcessLogs", + label: "Process Logs for Alerts", + helperText: "Enable to store this search for alert processing", + }, + ]; + + return ( + <> + + + + + + } + > + + + {createSearchFields.map((field, index) => ( + + + + ))} + + + + + + ); +}; diff --git a/src/pages/tenant/administration/audit-logs/searches.js b/src/pages/tenant/administration/audit-logs/searches.js index 3c5a92dcfbde..a16a4e3122e0 100644 --- a/src/pages/tenant/administration/audit-logs/searches.js +++ b/src/pages/tenant/administration/audit-logs/searches.js @@ -1,16 +1,9 @@ -import { useState, useEffect } from "react"; import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { TabbedLayout } from "/src/layouts/TabbedLayout"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import { CippApiDialog } from "/src/components/CippComponents/CippApiDialog.jsx"; -import { Button, Accordion, AccordionSummary, AccordionDetails, Typography } from "@mui/material"; -import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; -import { useForm } from "react-hook-form"; -import CippFormComponent from "/src/components/CippComponents/CippFormComponent"; +import { CippAuditLogSearchDrawer } from "/src/components/CippComponents/CippAuditLogSearchDrawer.jsx"; import { EyeIcon } from "@heroicons/react/24/outline"; -import { Grid } from "@mui/system"; -import { Add, ManageSearch } from "@mui/icons-material"; -import { useDialog } from "/src/hooks/use-dialog"; +import { ManageSearch } from "@mui/icons-material"; import tabOptions from "./tabOptions.json"; import { useSettings } from "/src/hooks/use-settings"; @@ -41,459 +34,19 @@ const actions = [ ]; const Page = () => { - const createSearchDialog = useDialog(); const currentTenant = useSettings().currentTenant; - - const filterControl = useForm({ - mode: "onChange", - defaultValues: { - StatusFilter: { label: "All", value: "" }, - DateFilter: { label: "All Time", value: "" }, - }, - }); - - const [expanded, setExpanded] = useState(false); - const [apiUrlWithFilters, setApiUrlWithFilters] = useState(apiUrl); - - // Watch for filter changes and update API URL - const statusFilter = filterControl.watch("StatusFilter"); - const dateFilter = filterControl.watch("DateFilter"); - - useEffect(() => { - const params = new URLSearchParams(); - params.set("Type", "Searches"); // Always set Type=Searches for this page - - if (statusFilter?.value) { - params.set("Status", statusFilter.value); - } - - if (dateFilter?.value) { - params.set("Days", dateFilter.value); - } - - setApiUrlWithFilters(`/api/ListAuditLogSearches?${params.toString()}`); - }, [statusFilter, dateFilter]); - - // Create Search Dialog Configuration - const createSearchFields = [ - { - type: "textField", - name: "DisplayName", - label: "Search Name", - }, - { - type: "autoComplete", - name: "TenantFilter", - label: "Tenant", - multiple: false, - creatable: false, - api: { - url: "/api/ListTenants?AllTenantSelector=false", - labelField: (option) => `${option.displayName} (${option.defaultDomainName})`, - valueField: "defaultDomainName", - queryKey: "ListTenants-FormnotAllTenants", - excludeTenantFilter: true, - }, - validators: { validate: (value) => !!value?.value || "Please select a tenant" }, - required: true, - }, - { - type: "datePicker", - name: "StartTime", - label: "Start Date & Time", - dateTimeType: "datetime-local", - validators: { required: "Start time is required" }, - required: true, - }, - { - type: "datePicker", - name: "EndTime", - label: "End Date & Time", - dateTimeType: "datetime-local", - validators: { required: "End time is required" }, - required: true, - }, - { - type: "autoComplete", - name: "ServiceFilters", - label: "Services", - multiple: true, - creatable: false, - options: [ - { label: "Azure Active Directory", value: "AzureActiveDirectory" }, - { label: "Dynamics 365", value: "CRM" }, - { label: "Exchange Online", value: "Exchange" }, - { label: "Microsoft Flow", value: "MicrosoftFlow" }, - { label: "Microsoft Teams", value: "MicrosoftTeams" }, - { label: "OneDrive for Business", value: "OneDrive" }, - { label: "Power BI", value: "PowerBI" }, - { label: "Security & Compliance", value: "ThreatIntelligence" }, - { label: "SharePoint Online", value: "SharePoint" }, - { label: "Yammer", value: "Yammer" }, - ], - validators: { - validate: (values) => values?.length > 0 || "Please select at least one service", - }, - }, - { - type: "autoComplete", - name: "RecordTypeFilters", - label: "Record Types", - multiple: true, - creatable: false, - options: [ - { label: "Azure Active Directory", value: "azureActiveDirectory" }, - { label: "Azure AD Account Logon", value: "azureActiveDirectoryAccountLogon" }, - { label: "Azure AD STS Logon", value: "azureActiveDirectoryStsLogon" }, - { label: "Compliance DLP Endpoint", value: "complianceDLPEndpoint" }, - { label: "Compliance DLP Exchange", value: "complianceDLPExchange" }, - { label: "Compliance DLP SharePoint", value: "complianceDLPSharePoint" }, - { label: "Data Governance", value: "dataGovernance" }, - { label: "Exchange Admin", value: "exchangeAdmin" }, - { label: "Exchange Item", value: "exchangeItem" }, - { label: "Exchange Item Group", value: "exchangeItemGroup" }, - { label: "Information Worker Protection", value: "informationWorkerProtection" }, - { label: "Label Content Explorer", value: "labelContentExplorer" }, - { label: "Microsoft Flow", value: "microsoftFlow" }, - { label: "Microsoft Forms", value: "microsoftForms" }, - { label: "Microsoft Stream", value: "microsoftStream" }, - { label: "Microsoft Teams", value: "microsoftTeams" }, - { label: "Microsoft Teams Admin", value: "microsoftTeamsAdmin" }, - { label: "Microsoft Teams Analytics", value: "microsoftTeamsAnalytics" }, - { label: "Microsoft Teams Device", value: "microsoftTeamsDevice" }, - { label: "Microsoft Teams Shifts", value: "microsoftTeamsShifts" }, - { label: "MIP Label", value: "mipLabel" }, - { label: "OneDrive", value: "oneDrive" }, - { label: "Power Apps App", value: "powerAppsApp" }, - { label: "Power Apps Plan", value: "powerAppsPlan" }, - { label: "Power BI Audit", value: "powerBIAudit" }, - { label: "Power BI DLP", value: "powerBIDlp" }, - { label: "Security & Compliance Alerts", value: "securityComplianceAlerts" }, - { label: "Security & Compliance Insights", value: "securityComplianceInsights" }, - { label: "Security & Compliance RBAC", value: "securityComplianceRBAC" }, - { label: "SharePoint", value: "sharePoint" }, - { label: "SharePoint File Operation", value: "sharePointFileOperation" }, - { label: "SharePoint List Operation", value: "sharePointListOperation" }, - { label: "SharePoint Sharing Operation", value: "sharePointSharingOperation" }, - { label: "Threat Intelligence", value: "threatIntelligence" }, - { label: "Threat Intelligence ATP Content", value: "threatIntelligenceAtpContent" }, - { label: "Threat Intelligence URL", value: "threatIntelligenceUrl" }, - { label: "Workplace Analytics", value: "workplaceAnalytics" }, - ], - }, - { - type: "autoComplete", - name: "KeywordFilter", - label: "Keywords", - multiple: true, - creatable: true, - freeSolo: true, - placeholder: "Enter keywords to search for", - options: [], - }, - { - type: "autoComplete", - name: "OperationsFilters", - label: "Operations", - multiple: true, - creatable: true, - placeholder: "Enter or select operations", - options: [ - // Authentication & User Operations - { label: "User Logged In", value: "UserLoggedIn" }, - { label: "Mailbox Login", value: "mailboxlogin" }, - - // User Management Operations - { label: "Add User", value: "add user." }, - { label: "Update User", value: "update user." }, - { label: "Delete User", value: "delete user." }, - { label: "Reset User Password", value: "reset user password." }, - { label: "Change User Password", value: "change user password." }, - { label: "Change User License", value: "change user license." }, - - // Group Management Operations - { label: "Add Group", value: "add group." }, - { label: "Update Group", value: "update group." }, - { label: "Delete Group", value: "delete group." }, - { label: "Add Member to Group", value: "add member to group." }, - { label: "Remove Member from Group", value: "remove member from group." }, - - // Mailbox Operations - { label: "New Mailbox", value: "New-Mailbox" }, - { label: "Set Mailbox", value: "Set-Mailbox" }, - { label: "Add Mailbox Permission", value: "add-mailboxpermission" }, - { label: "Remove Mailbox Permission", value: "remove-mailboxpermission" }, - { label: "Mail Items Accessed", value: "mailitemsaccessed" }, - - // Email Operations - { label: "Send Message", value: "send" }, - { label: "Send As", value: "sendas" }, - { label: "Send On Behalf", value: "sendonbehalf" }, - { label: "Create Item", value: "create" }, - { label: "Update Message", value: "update" }, - { label: "Copy Messages", value: "copy" }, - { label: "Move Messages", value: "move" }, - { label: "Move to Deleted Items", value: "movetodeleteditems" }, - { label: "Soft Delete", value: "softdelete" }, - { label: "Hard Delete", value: "harddelete" }, - - // Inbox Rules - { label: "New Inbox Rule", value: "new-inboxrule" }, - { label: "Set Inbox Rule", value: "set-inboxrule" }, - { label: "Update Inbox Rules", value: "updateinboxrules" }, - - // Folder Operations - { label: "Add Folder Permissions", value: "addfolderpermissions" }, - { label: "Remove Folder Permissions", value: "removefolderpermissions" }, - { label: "Update Folder Permissions", value: "updatefolderpermissions" }, - { label: "Update Calendar Delegation", value: "updatecalendardelegation" }, - - // SharePoint/OneDrive Operations (Common ones) - { label: "File Accessed", value: "FileAccessed" }, - { label: "File Modified", value: "FileModified" }, - { label: "File Deleted", value: "FileDeleted" }, - { label: "File Downloaded", value: "FileDownloaded" }, - { label: "File Uploaded", value: "FileUploaded" }, - { label: "Sharing Set", value: "SharingSet" }, - { label: "Anonymous Link Created", value: "AnonymousLinkCreated" }, - - // Role and Permission Operations - { label: "Add Member to Role", value: "add member to role." }, - { label: "Remove Member from Role", value: "remove member from role." }, - { label: "Add Service Principal", value: "add service principal." }, - { label: "Remove Service Principal", value: "remove service principal." }, - - // Company and Domain Operations - { label: "Add Domain to Company", value: "add domain to company." }, - { label: "Remove Domain from Company", value: "remove domain from company." }, - { label: "Verify Domain", value: "verify domain." }, - { label: "Set Company Information", value: "set company information." }, - - // Security Operations - { label: "Disable Strong Authentication", value: "Disable Strong Authentication." }, - { label: "Apply Record Label", value: "applyrecordlabel" }, - { label: "Update STS Refresh Token", value: "Update StsRefreshTokenValidFrom Timestamp." }, - ], - }, - { - type: "autoComplete", - name: "UserPrincipalNameFilters", - label: "User Principal Names", - multiple: true, - creatable: true, - freeSolo: true, - placeholder: "Enter user principal names", - options: [], - }, - { - type: "autoComplete", - name: "IPAddressFilters", - label: "IP Addresses", - multiple: true, - creatable: true, - freeSolo: true, - placeholder: "Enter IP addresses", - options: [], - }, - { - type: "autoComplete", - name: "ObjectIdFilters", - label: "Object IDs", - multiple: true, - creatable: true, - freeSolo: true, - placeholder: "Enter object IDs", - options: [], - }, - { - type: "autoComplete", - name: "AdministrativeUnitFilters", - label: "Administrative Units", - multiple: true, - creatable: true, - placeholder: "Enter administrative units", - api: { - url: "/api/ListGraphRequest", - queryKey: "AdministrativeUnits", - data: { - Endpoint: "directoryObjects/microsoft.graph.administrativeUnit", - $select: "id,displayName", - }, - dataKey: "Results", - labelField: "displayName", - valueField: "id", - addedField: { - id: "id", - displayName: "displayName", - }, - showRefresh: true, - }, - }, - { - type: "switch", - name: "ProcessLogs", - label: "Process Logs for Alerts", - helperText: "Enable to store this search for alert processing", - }, - ]; - - const createSearchApi = { - type: "POST", - url: "/api/ExecAuditLogSearch", - confirmText: - "Create this audit log search? This may take several minutes to hours to complete.", - relatedQueryKeys: ["AuditLogSearches"], - allowResubmit: true, - customDataformatter: (row, action, data) => { - const formattedData = { ...data }; - console.log("Formatted Data:", formattedData); - // Extract value from TenantFilter autocomplete object - if (formattedData.TenantFilter?.value) { - formattedData.TenantFilter = formattedData.TenantFilter.value; - } - - // Handle KeywordFilter - extract values from array and join with spaces - if (Array.isArray(formattedData.KeywordFilter)) { - const keywords = formattedData.KeywordFilter.map((item) => - typeof item === "object" ? item.value : item - ).filter(Boolean); - formattedData.KeywordFilter = keywords.join(" "); - } - - // Extract values from RecordTypeFilters array - if (Array.isArray(formattedData.RecordTypeFilters)) { - formattedData.RecordTypeFilters = formattedData.RecordTypeFilters.map((item) => - typeof item === "object" ? item.value : item - ); - } - - // Extract values from ServiceFilters array - if (Array.isArray(formattedData.ServiceFilters)) { - formattedData.ServiceFilters = formattedData.ServiceFilters.map((item) => - typeof item === "object" ? item.value : item - ); - } - - // Extract values from OperationsFilters array - if (Array.isArray(formattedData.OperationsFilters)) { - formattedData.OperationsFilters = formattedData.OperationsFilters.map((item) => - typeof item === "object" ? item.value : item - ); - } - - // Extract values from UserPrincipalNameFilters array - if (Array.isArray(formattedData.UserPrincipalNameFilters)) { - formattedData.UserPrincipalNameFilters = formattedData.UserPrincipalNameFilters.map( - (item) => (typeof item === "object" ? item.value : item) - ); - } - - // Extract values from IPAddressFilters array - if (Array.isArray(formattedData.IPAddressFilters)) { - formattedData.IPAddressFilters = formattedData.IPAddressFilters.map((item) => - typeof item === "object" ? item.value : item - ); - } - - // Extract values from ObjectIdFilters array - if (Array.isArray(formattedData.ObjectIdFilters)) { - formattedData.ObjectIdFilters = formattedData.ObjectIdFilters.map((item) => - typeof item === "object" ? item.value : item - ); - } - - // Extract values from AdministrativeUnitFilters array - if (Array.isArray(formattedData.AdministrativeUnitFilters)) { - formattedData.AdministrativeUnitFilters = formattedData.AdministrativeUnitFilters.map( - (item) => (typeof item === "object" ? item.value : item) - ); - } - - // Remove empty arrays to avoid sending unnecessary data - Object.keys(formattedData).forEach((key) => { - if (Array.isArray(formattedData[key]) && formattedData[key].length === 0) { - delete formattedData[key]; - } - if ( - formattedData[key] === "" || - formattedData[key] === null || - formattedData[key] === undefined - ) { - delete formattedData[key]; - } - }); - - return formattedData; - }, - }; + const queryKey = `AuditLogSearches-${currentTenant}`; return ( <> setExpanded(!expanded)}> - }> - Filter Search List - - - - {/* Status Filter */} - - - - - {/* Date Range Filter */} - - - - - - - } title={pageTitle} - apiUrl={apiUrlWithFilters} + apiUrl={apiUrl} apiDataKey="Results" simpleColumns={simpleColumns} - queryKey={`AuditLogSearches-${filterControl.getValues().StatusFilter?.value || "All"}-${ - filterControl.getValues().DateFilter?.value || "AllTime" - }-${currentTenant}`} + queryKey={queryKey} actions={actions} - cardButton={ - - } - /> - - } /> ); From d6501614adbdc4f76f4c04dcd13fe8fcad507a88 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 21 Aug 2025 16:31:09 -0400 Subject: [PATCH 13/86] more audit log search tweaks --- .../CippAuditLogSearchDrawer.jsx | 65 +++++++++++++++++-- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/src/components/CippComponents/CippAuditLogSearchDrawer.jsx b/src/components/CippComponents/CippAuditLogSearchDrawer.jsx index f30a4c73d2d5..2665715034ca 100644 --- a/src/components/CippComponents/CippAuditLogSearchDrawer.jsx +++ b/src/components/CippComponents/CippAuditLogSearchDrawer.jsx @@ -1,18 +1,59 @@ -import { useState } from "react"; +import { useState, useEffect } from "react"; import { Button, Stack, Box } from "@mui/material"; import { Add } from "@mui/icons-material"; import { useForm } from "react-hook-form"; import { CippOffCanvas } from "./CippOffCanvas"; -import { ApiPostCall } from "../../api/ApiCall"; +import { ApiPostCall, ApiGetCallWithPagination } from "../../api/ApiCall"; import CippFormComponent from "./CippFormComponent"; import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "/src/hooks/use-settings"; export const CippAuditLogSearchDrawer = ({ buttonText = "New Search", relatedQueryKeys = ["AuditLogSearches"], }) => { const [drawerVisible, setDrawerVisible] = useState(false); - const formControl = useForm(); + const currentTenantDomain = useSettings().currentTenant; + + // Fetch tenant list to get full tenant details + const tenantList = ApiGetCallWithPagination({ + url: "/api/ListTenants", + queryKey: "ListTenants-FormnotAllTenants", + data: { AllTenantSelector: false }, + }); + + // Find the current tenant from the list using the domain name - handle pagination data structure + const allTenants = tenantList.data?.pages?.flatMap((page) => page.Results || page) || []; + const currentTenant = allTenants.find( + (tenant) => tenant.defaultDomainName === currentTenantDomain + ); + + // Create default values with current tenant prefilled + const defaultValues = { + TenantFilter: currentTenant + ? { + label: `${currentTenant.displayName} (${currentTenant.defaultDomainName})`, + value: currentTenant.defaultDomainName, + } + : null, + }; + + const formControl = useForm({ + defaultValues, + }); + + // Update form defaults when tenant data is loaded + useEffect(() => { + if (currentTenant) { + const newDefaultValues = { + TenantFilter: { + label: `${currentTenant.displayName} (${currentTenant.defaultDomainName})`, + value: currentTenant.defaultDomainName, + }, + }; + formControl.reset(newDefaultValues); + } + }, [currentTenant, formControl]); const createSearchApi = ApiPostCall({ datafromUrl: false, @@ -21,7 +62,17 @@ export const CippAuditLogSearchDrawer = ({ const handleCloseDrawer = () => { setDrawerVisible(false); - formControl.reset(); + if (currentTenant) { + const resetValues = { + TenantFilter: { + label: `${currentTenant.displayName} (${currentTenant.defaultDomainName})`, + value: currentTenant.defaultDomainName, + }, + }; + formControl.reset(resetValues); + } else { + formControl.reset(); + } }; const handleCreateSearch = async (data) => { @@ -390,9 +441,6 @@ export const CippAuditLogSearchDrawer = ({ size="lg" footer={ - + } > From 9eac995108640aecb50fc094a3ec62d5bf83413c Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 21 Aug 2025 17:57:45 -0400 Subject: [PATCH 14/86] bringing back a long lost feature QUEUE TRACKING! --- src/api/ApiCall.jsx | 9 +- .../CippTable/CIPPTableToptoolbar.js | 178 ++++--- src/components/CippTable/CippDataTable.js | 1 + .../CippTable/CippGraphExplorerFilter.js | 3 +- src/components/CippTable/CippQueueTracker.js | 442 ++++++++++++++++++ 5 files changed, 553 insertions(+), 80 deletions(-) create mode 100644 src/components/CippTable/CippQueueTracker.js diff --git a/src/api/ApiCall.jsx b/src/api/ApiCall.jsx index 2081c91b2a11..e39aeb8718ee 100644 --- a/src/api/ApiCall.jsx +++ b/src/api/ApiCall.jsx @@ -1,9 +1,4 @@ -import { - useInfiniteQuery, - useMutation, - useQuery, - useQueryClient, -} from "@tanstack/react-query"; +import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import axios, { isAxiosError } from "axios"; import { useDispatch } from "react-redux"; import { showToast } from "../store/toasts"; @@ -25,6 +20,7 @@ export function ApiGetCall(props) { refetchOnMount = true, refetchOnReconnect = true, keepPreviousData = false, + refetchInterval = false, } = props; const queryClient = useQueryClient(); const dispatch = useDispatch(); @@ -113,6 +109,7 @@ export function ApiGetCall(props) { refetchOnMount: refetchOnMount, refetchOnReconnect: refetchOnReconnect, keepPreviousData: keepPreviousData, + refetchInterval: refetchInterval, retry: retryFn, }); return queryInfo; diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index 05e226b5aebd..b79767d6b73f 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -30,9 +30,11 @@ import { useRouter } from "next/router"; import { CippOffCanvas } from "../CippComponents/CippOffCanvas"; import { CippCodeBlock } from "../CippComponents/CippCodeBlock"; import { ApiGetCall } from "../../api/ApiCall"; +import { useQueryClient } from "@tanstack/react-query"; import GraphExplorerPresets from "/src/data/GraphExplorerPresets.json"; import CippGraphExplorerFilter from "./CippGraphExplorerFilter"; import { useMediaQuery } from "@mui/material"; +import { CippQueueTracker } from "./CippQueueTracker"; export const CIPPTableToptoolbar = ({ api, @@ -53,6 +55,7 @@ export const CIPPTableToptoolbar = ({ data, setGraphFilterData, setConfiguredSimpleColumns, + queueMetadata, }) => { const popover = usePopover(); const columnPopover = usePopover(); @@ -65,26 +68,40 @@ export const CIPPTableToptoolbar = ({ const [actionData, setActionData] = useState({ data: {}, action: {}, ready: false }); const [offcanvasVisible, setOffcanvasVisible] = useState(false); const [filterList, setFilterList] = useState(filters); + const [currentEffectiveQueryKey, setCurrentEffectiveQueryKey] = useState(queryKey || title); const [originalSimpleColumns, setOriginalSimpleColumns] = useState(simpleColumns); const [filterCanvasVisible, setFilterCanvasVisible] = useState(false); const pageName = router.pathname.split("/").slice(1).join("/"); const currentTenant = useSettings()?.currentTenant; + const queryClient = useQueryClient(); const [actionMenuAnchor, setActionMenuAnchor] = useState(null); const handleActionMenuOpen = (event) => setActionMenuAnchor(event.currentTarget); const handleActionMenuClose = () => setActionMenuAnchor(null); const getBulkActions = (actions, selectedRows) => { - return actions?.filter((action) => !action.link && !action?.hideBulk)?.map(action => ({ - ...action, - disabled: action.condition ? !selectedRows.every(row => action.condition(row.original)) : false - })) || []; + return ( + actions + ?.filter((action) => !action.link && !action?.hideBulk) + ?.map((action) => ({ + ...action, + disabled: action.condition + ? !selectedRows.every((row) => action.condition(row.original)) + : false, + })) || [] + ); }; useEffect(() => { //if usedData changes, deselect all rows table.toggleAllRowsSelected(false); }, [usedData]); + + // Sync currentEffectiveQueryKey with queryKey prop changes (e.g., tenant changes) + useEffect(() => { + setCurrentEffectiveQueryKey(queryKey || title); + }, [queryKey, title]); + //if the currentTenant Switches, remove Graph filters useEffect(() => { if (currentTenant) { @@ -112,7 +129,7 @@ export const CIPPTableToptoolbar = ({ data: { Endpoint: api?.data?.Endpoint ?? "", }, - waiting: api?.data?.Endpoint ? true : false, + waiting: !!api?.data?.Endpoint, }); const resetToDefaultVisibility = () => { @@ -193,6 +210,7 @@ export const CIPPTableToptoolbar = ({ setGraphFilterData({}); resetToDefaultVisibility(); } + setCurrentEffectiveQueryKey(queryKey || title); // Reset to original query key } if (filterType === "graph") { const filterProps = [ @@ -215,10 +233,12 @@ export const CIPPTableToptoolbar = ({ table.resetGlobalFilter(); table.resetColumnFilters(); //get api.data, merge with graphFilter, set api.data + const newQueryKey = `${queryKey ? queryKey : title}-${filterName}`; setGraphFilterData({ data: { ...mergeCaseInsensitive(api.data, graphFilter) }, - queryKey: `${queryKey ? queryKey : title}-${filterName}`, + queryKey: newQueryKey, }); + setCurrentEffectiveQueryKey(newQueryKey); if (filter?.$select) { let selectedColumns = []; if (Array.isArray(filter?.$select)) { @@ -258,6 +278,7 @@ export const CIPPTableToptoolbar = ({ var presetEndpoint = preset?.params?.endpoint?.replace(/^\//, ""); if (presetEndpoint === endpoint) { graphPresetList.push({ + id: preset?.id, filterName: preset?.name, value: preset?.params, type: "graph", @@ -269,6 +290,7 @@ export const CIPPTableToptoolbar = ({ var customPresetEndpoint = preset?.params?.endpoint?.replace(/^\//, ""); if (customPresetEndpoint === endpoint) { graphPresetList.push({ + id: preset?.id, filterName: preset?.name, value: preset?.params, type: "graph", @@ -456,6 +478,11 @@ export const CIPPTableToptoolbar = ({ + {mdDown && } { @@ -493,74 +520,78 @@ export const CIPPTableToptoolbar = ({ )} - {actions && getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( - <> - - - {getBulkActions(actions, table.getSelectedRowModel().rows).map((action, index) => ( - { - if (action.disabled) return; - setActionData({ - data: table.getSelectedRowModel().rows.map((row) => row.original), - action: action, - ready: true, - }); - - if (action?.noConfirm && action.customFunction) { - table - .getSelectedRowModel() - .rows.map((row) => - action.customFunction(row.original.original, action, {}) - ); - } else { - createDialog.handleOpen(); - popover.handleClose(); - } - }} - > - - {action.icon} + {actions && + getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && + (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( + <> + - - )} + } + variant="outlined" + sx={{ + flexShrink: 0, + whiteSpace: "nowrap", + }} + > + Bulk Actions + + + {getBulkActions(actions, table.getSelectedRowModel().rows).map( + (action, index) => ( + { + if (action.disabled) return; + setActionData({ + data: table.getSelectedRowModel().rows.map((row) => row.original), + action: action, + ready: true, + }); + + if (action?.noConfirm && action.customFunction) { + table + .getSelectedRowModel() + .rows.map((row) => + action.customFunction(row.original.original, action, {}) + ); + } else { + createDialog.handleOpen(); + popover.handleClose(); + } + }} + > + + {action.icon} + + {action.label} + + ) + )} + + + )} @@ -584,6 +615,7 @@ export const CIPPTableToptoolbar = ({ > { setTableFilter(filter, "graph", "Custom Filter"); if (filter?.$select) { diff --git a/src/components/CippTable/CippDataTable.js b/src/components/CippTable/CippDataTable.js index 3d2cc8a89f64..3e9c735a92d0 100644 --- a/src/components/CippTable/CippDataTable.js +++ b/src/components/CippTable/CippDataTable.js @@ -413,6 +413,7 @@ export const CippDataTable = (props) => { graphFilterData={graphFilterData} setGraphFilterData={setGraphFilterData} setConfiguredSimpleColumns={setConfiguredSimpleColumns} + queueMetadata={getRequestData.data?.pages?.[0]?.Metadata} /> )} diff --git a/src/components/CippTable/CippGraphExplorerFilter.js b/src/components/CippTable/CippGraphExplorerFilter.js index fd2cd79afa2c..5ce4ca6f1b16 100644 --- a/src/components/CippTable/CippGraphExplorerFilter.js +++ b/src/components/CippTable/CippGraphExplorerFilter.js @@ -28,6 +28,7 @@ const CippGraphExplorerFilter = ({ onSubmitFilter, onPresetChange, component = "accordion", + relatedQueryKeys = [], }) => { const [offCanvasOpen, setOffCanvasOpen] = useState(false); const [cardExpanded, setCardExpanded] = useState(true); @@ -162,7 +163,7 @@ const CippGraphExplorerFilter = ({ }, [currentEndpoint, debouncedRefetch]); const savePresetApi = ApiPostCall({ - relatedQueryKeys: ["ListGraphExplorerPresets", "ListGraphRequest"], + relatedQueryKeys: ["ListGraphExplorerPresets", "ListGraphRequest", ...relatedQueryKeys], }); // Save preset function diff --git a/src/components/CippTable/CippQueueTracker.js b/src/components/CippTable/CippQueueTracker.js new file mode 100644 index 000000000000..c8b8840a8341 --- /dev/null +++ b/src/components/CippTable/CippQueueTracker.js @@ -0,0 +1,442 @@ +import React, { useState, useEffect } from "react"; +import { IconButton, Tooltip, Badge, Typography, LinearProgress, Box, Stack } from "@mui/material"; +import { Timeline, Circle } from "@mui/icons-material"; +import { CippOffCanvas } from "../CippComponents/CippOffCanvas"; +import { ApiGetCall } from "../../api/ApiCall"; +import { useQueryClient } from "@tanstack/react-query"; + +export const CippQueueTracker = ({ queueId, queryKey, title, onQueueComplete }) => { + const queryClient = useQueryClient(); + const [queueCanvasVisible, setQueueCanvasVisible] = useState(false); + const [persistentQueueData, setPersistentQueueData] = useState(null); + const [lastProcessedQueueId, setLastProcessedQueueId] = useState(null); + const [queueQueryKey, setQueueQueryKey] = useState(null); + const [hasAutoRefreshed, setHasAutoRefreshed] = useState(false); + + const hasQueueData = !!queueId; + const currentQueryKey = queryKey || title; + + // Show queue if we have current queue data OR persistent queue data from the same query key + // If query key changed and we don't have an active queueId, don't show the tracker + const shouldShowQueue = + hasQueueData || (!!persistentQueueData && queueQueryKey === currentQueryKey); + + // Check if queue is in a completed state based on persistent data only (to avoid circular dependency) + const isQueueCompleted = + persistentQueueData?.Status === "Completed" || + persistentQueueData?.Status === "Failed" || + persistentQueueData?.Status === "Completed (with errors)"; + + const effectiveQueueId = queueId || lastProcessedQueueId; + + const queuePolling = ApiGetCall({ + url: `/api/ListCippQueue`, + data: { QueueId: effectiveQueueId }, + queryKey: `CippQueue-${effectiveQueueId || "unknown"}`, + waiting: shouldShowQueue && !!effectiveQueueId && !isQueueCompleted, + refetchInterval: (data) => { + // Check if the current data shows completion + const currentData = data?.[0]; + const isCurrentCompleted = + currentData?.Status === "Completed" || + currentData?.Status === "Failed" || + currentData?.Status === "Completed (with errors)"; + + // Also check persistent data + const isPersistentCompleted = + persistentQueueData?.Status === "Completed" || + persistentQueueData?.Status === "Failed" || + persistentQueueData?.Status === "Completed (with errors)"; + + // Stop polling if either shows completion + if (isCurrentCompleted || isPersistentCompleted || !shouldShowQueue || !effectiveQueueId) { + return false; + } + + return 3000; + }, + refetchOnMount: true, + refetchOnWindowFocus: false, + }); + + const queueData = queuePolling.data?.[0]; + + // Handle queue data persistence - only update persistent queue data when we get a new QueueId + // and ensure it's pinned to the current query key + useEffect(() => { + const currentQueryKey = queryKey || title; + + // If query key changed, clear all queue data + if (queueQueryKey && queueQueryKey !== currentQueryKey) { + setPersistentQueueData(null); + setLastProcessedQueueId(null); + setQueueQueryKey(currentQueryKey); + setHasAutoRefreshed(false); + return; + } + + // Set query key if not set + if (!queueQueryKey) { + setQueueQueryKey(currentQueryKey); + } + + // Only process new QueueId if we actually have one and it's different + if (queueId && queueId !== lastProcessedQueueId) { + // New QueueId detected, clear old persistent data and set new QueueId + setPersistentQueueData(null); + setLastProcessedQueueId(queueId); + setHasAutoRefreshed(false); // Reset auto-refresh flag for new queue + } + + // Don't clear persistent data if queueId is temporarily null (during table refresh) + // Only clear if we explicitly get a different QueueId or change query/page + }, [queueId, lastProcessedQueueId, queryKey, title, queueQueryKey]); + + // Update persistent queue data when new queue data is available + useEffect(() => { + const currentQueryKey = queryKey || title; + + // Only update if we're on the same query key where the queue was initiated + if (queueData && queueId === lastProcessedQueueId && queueQueryKey === currentQueryKey) { + setPersistentQueueData(queueData); + } + }, [queueData, queueId, lastProcessedQueueId, queryKey, title, queueQueryKey]); + + // Auto-refresh table when queue reaches 100% completion + useEffect(() => { + const currentQueryKey = queryKey || title; + + // Only auto-refresh if we're on the same query key where the queue was initiated + // and we haven't already auto-refreshed for this queue completion + if ( + !hasAutoRefreshed && + (persistentQueueData?.Status === "Completed" || + persistentQueueData?.Status === "Failed" || + persistentQueueData?.Status === "Completed (with errors)") && + queueQueryKey === currentQueryKey + ) { + // Queue is complete, invalidate the table query to refresh data + if (currentQueryKey) { + queryClient.invalidateQueries({ queryKey: [currentQueryKey] }); + setHasAutoRefreshed(true); // Mark that we've auto-refreshed + // Call callback if provided + if (onQueueComplete) { + onQueueComplete(); + } + } + } + }, [ + hasAutoRefreshed, + persistentQueueData?.PercentComplete, + persistentQueueData?.Status, + queryKey, + title, + queryClient, + queueQueryKey, + onQueueComplete, + ]); + + // Don't render anything if we don't have queue data to show + // Check for valid queueId or persistent queue data + if (!shouldShowQueue || (!queueId && !lastProcessedQueueId && !persistentQueueData)) { + return null; + } + + return ( + <> + + + ) : (persistentQueueData || queueData)?.Status === "Completed (with errors)" ? ( + + ) : (persistentQueueData || queueData)?.Status === "Failed" ? ( + + ) : (persistentQueueData || queueData)?.RunningTasks > 0 ? ( + + ) : ( + + ) + } + overlap="circular" + anchorOrigin={{ + vertical: "top", + horizontal: "right", + }} + > + setQueueCanvasVisible(true)} + sx={{ + animation: + (persistentQueueData || queueData)?.Status !== "Completed" && + (persistentQueueData || queueData)?.Status !== "Completed (with errors)" && + (persistentQueueData || queueData)?.Status !== "Failed" + ? "pulse 2s infinite" + : "none", + "@keyframes pulse": { + "0%": { + transform: "scale(1)", + opacity: 1, + }, + "50%": { + transform: "scale(1.1)", + opacity: 0.8, + }, + "100%": { + transform: "scale(1)", + opacity: 1, + }, + }, + color: + (persistentQueueData || queueData)?.Status === "Completed" + ? "success.main" + : (persistentQueueData || queueData)?.Status === "Completed (with errors)" + ? "warning.main" + : (persistentQueueData || queueData)?.Status === "Failed" + ? "error.main" + : (persistentQueueData || queueData)?.RunningTasks > 0 + ? "warning.main" + : "primary.main", + }} + > + + + + + + {/* Queue Status OffCanvas */} + setQueueCanvasVisible(false)} + > + + {persistentQueueData || queueData ? ( + <> + {(persistentQueueData || queueData).Name} + + + + Progress: {(persistentQueueData || queueData).PercentComplete?.toFixed(1)}% + complete + + + + + + + Total Tasks: {(persistentQueueData || queueData).TotalTasks || 0} + + + Completed:{" "} + {(persistentQueueData || queueData).CompletedTasks || 0} + + + Running: {(persistentQueueData || queueData).RunningTasks || 0} + + + Failed: {(persistentQueueData || queueData).FailedTasks || 0} + + + + + Status: {(persistentQueueData || queueData).Status} + + + {(persistentQueueData || queueData).Tasks && + (persistentQueueData || queueData).Tasks.length > 0 && ( + <> + + Task Details + + + + theme.palette.mode === "dark" + ? "rgba(255,255,255,0.1)" + : "rgba(0,0,0,0.1)", + borderRadius: 4, + }, + "&::-webkit-scrollbar-thumb": { + backgroundColor: (theme) => + theme.palette.mode === "dark" + ? "rgba(255,255,255,0.3)" + : "rgba(0,0,0,0.3)", + borderRadius: 4, + "&:hover": { + backgroundColor: (theme) => + theme.palette.mode === "dark" + ? "rgba(255,255,255,0.5)" + : "rgba(0,0,0,0.5)", + }, + }, + }} + > + {(persistentQueueData || queueData).Tasks.map((task, index) => ( + ({ + p: 2, + border: 1, + borderColor: + theme.palette.mode === "dark" + ? "rgba(255,255,255,0.12)" + : "divider", + borderRadius: 1, + backgroundColor: + task.Status === "Completed" + ? theme.palette.mode === "dark" + ? "rgba(102, 187, 106, 0.15)" + : "success.light" + : task.Status === "Failed" + ? theme.palette.mode === "dark" + ? "rgba(244, 67, 54, 0.15)" + : "error.light" + : task.Status === "Running" + ? theme.palette.mode === "dark" + ? "rgba(255, 152, 0, 0.15)" + : "warning.light" + : theme.palette.mode === "dark" + ? "rgba(255,255,255,0.05)" + : "grey.100", + transition: "all 0.2s ease-in-out", + "&:hover": { + transform: "translateY(-1px)", + boxShadow: + theme.palette.mode === "dark" + ? "0 4px 8px rgba(0,0,0,0.3)" + : "0 4px 8px rgba(0,0,0,0.1)", + }, + })} + > + + + {task.Name} + + ({ + px: 1.5, + py: 0.5, + borderRadius: 2, + backgroundColor: + theme.palette.mode === "dark" + ? "rgba(255,255,255,0.1)" + : "background.paper", + border: + theme.palette.mode === "dark" + ? "1px solid rgba(255,255,255,0.2)" + : "none", + fontWeight: "medium", + textTransform: "uppercase", + fontSize: "0.7rem", + letterSpacing: "0.5px", + color: + task.Status === "Completed" + ? "success.main" + : task.Status === "Failed" + ? "error.main" + : task.Status === "Running" + ? "warning.main" + : "text.secondary", + })} + > + {task.Status} + + + {task.Timestamp && ( + + {new Date(task.Timestamp).toLocaleDateString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric' + })} {new Date(task.Timestamp).toLocaleTimeString(undefined, { + hour: '2-digit', + minute: '2-digit', + second: '2-digit' + })} + + )} + + ))} + + + + )} + + ) : queuePolling.isLoading ? ( + Loading queue data... + ) : queuePolling.isError ? ( + + Error loading queue data: {queuePolling.error?.message} + + ) : ( + No queue data available + )} + + + + ); +}; From 435b1869a41fe86451251b556f0ca4661cd44ff9 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 21 Aug 2025 18:02:30 -0400 Subject: [PATCH 15/86] pretty timestamps --- src/components/CippTable/CippQueueTracker.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/CippTable/CippQueueTracker.js b/src/components/CippTable/CippQueueTracker.js index c8b8840a8341..7a336eb03014 100644 --- a/src/components/CippTable/CippQueueTracker.js +++ b/src/components/CippTable/CippQueueTracker.js @@ -409,13 +409,14 @@ export const CippQueueTracker = ({ queueId, queryKey, title, onQueueComplete }) }} > {new Date(task.Timestamp).toLocaleDateString(undefined, { - year: 'numeric', - month: 'short', - day: 'numeric' - })} {new Date(task.Timestamp).toLocaleTimeString(undefined, { - hour: '2-digit', - minute: '2-digit', - second: '2-digit' + year: "numeric", + month: "short", + day: "numeric", + })}{" "} + {new Date(task.Timestamp).toLocaleTimeString(undefined, { + hour: "2-digit", + minute: "2-digit", + second: "2-digit", })} )} From 234c095ed40ae4c2ac6784ca3fe622e65526d5e4 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 22 Aug 2025 11:29:29 +0200 Subject: [PATCH 16/86] fixes type based filtering --- .../CippTable/util-columnsFromAPI.js | 177 +++++++++--------- src/utils/get-cipp-filter-variant.js | 75 ++++++-- 2 files changed, 152 insertions(+), 100 deletions(-) diff --git a/src/components/CippTable/util-columnsFromAPI.js b/src/components/CippTable/util-columnsFromAPI.js index 5ec7dd733740..8aa091e4fb94 100644 --- a/src/components/CippTable/util-columnsFromAPI.js +++ b/src/components/CippTable/util-columnsFromAPI.js @@ -1,85 +1,92 @@ -import { getCippFilterVariant } from "../../utils/get-cipp-filter-variant"; -import { getCippFormatting } from "../../utils/get-cipp-formatting"; -import { getCippTranslation } from "../../utils/get-cipp-translation"; - -const skipRecursion = ["location", "ScheduledBackupValues", "Tenant"]; -// Function to merge keys from all objects in the array -const mergeKeys = (dataArray) => { - return dataArray.reduce((acc, item) => { - const mergeRecursive = (obj, base = {}) => { - Object.keys(obj).forEach((key) => { - if ( - typeof obj[key] === "object" && - obj[key] !== null && - !Array.isArray(obj[key]) && - !skipRecursion.includes(key) - ) { - if (typeof base[key] === "boolean") { - // Skip merging if base[key] is a boolean - return; - } - if (typeof base[key] !== "object" || Array.isArray(base[key])) { - // Re-initialize base[key] if it's not an object - base[key] = {}; - } - base[key] = mergeRecursive(obj[key], base[key]); - } else if (typeof obj[key] === "boolean") { - base[key] = obj[key]; - } else if (typeof obj[key] === "string" && obj[key].toUpperCase() === "FAILED") { - base[key] = base[key]; // Keep existing value if it's 'FAILED' - } else if (obj[key] !== undefined && obj[key] !== null) { - base[key] = obj[key]; // Assign valid primitive values - } - }); - return base; - }; - - return mergeRecursive(item, acc); - }, {}); -}; - -export const utilColumnsFromAPI = (dataArray) => { - const dataSample = mergeKeys(dataArray); - - const generateColumns = (obj, parentKey = "") => { - return Object.keys(obj) - .map((key) => { - const accessorKey = parentKey ? `${parentKey}.${key}` : key; - if ( - typeof obj[key] === "object" && - obj[key] !== null && - !Array.isArray(obj[key]) && - !skipRecursion.includes(key) - ) { - return generateColumns(obj[key], accessorKey); - } - - return { - header: getCippTranslation(accessorKey), - id: accessorKey, - accessorFn: (row) => { - let value; - if (accessorKey.includes("@odata")) { - value = row[accessorKey]; - } else { - value = accessorKey.split(".").reduce((acc, part) => acc && acc[part], row); - } - return getCippFormatting(value, accessorKey, "text"); - }, - ...getCippFilterVariant(key), - Cell: ({ row }) => { - let value; - if (accessorKey.includes("@odata")) { - value = row.original[accessorKey]; - } else { - value = accessorKey.split(".").reduce((acc, part) => acc && acc[part], row.original); - } - return getCippFormatting(value, accessorKey); - }, - }; - }) - .flat(); - }; - - return generateColumns(dataSample); -}; +import { getCippFilterVariant } from "../../utils/get-cipp-filter-variant"; +import { getCippFormatting } from "../../utils/get-cipp-formatting"; +import { getCippTranslation } from "../../utils/get-cipp-translation"; + +const skipRecursion = ["location", "ScheduledBackupValues", "Tenant"]; + +const getAtPath = (obj, path) => + path.split(".").reduce((acc, part) => (acc ? acc[part] : undefined), obj); + +// Function to merge keys from all objects in the array +const mergeKeys = (dataArray) => { + return dataArray.reduce((acc, item) => { + const mergeRecursive = (obj, base = {}) => { + Object.keys(obj).forEach((key) => { + if ( + typeof obj[key] === "object" && + obj[key] !== null && + !Array.isArray(obj[key]) && + !skipRecursion.includes(key) + ) { + if (typeof base[key] === "boolean") return; // don't merge into a boolean + if (typeof base[key] !== "object" || Array.isArray(base[key])) base[key] = {}; + base[key] = mergeRecursive(obj[key], base[key]); + } else if (typeof obj[key] === "boolean") { + base[key] = obj[key]; + } else if (typeof obj[key] === "string" && obj[key].toUpperCase() === "FAILED") { + // keep existing value if it's 'FAILED' + base[key] = base[key]; + } else if (obj[key] !== undefined && obj[key] !== null) { + base[key] = obj[key]; + } + }); + return base; + }; + + return mergeRecursive(item, acc); + }, {}); +}; + +export const utilColumnsFromAPI = (dataArray) => { + const dataSample = mergeKeys(dataArray); + + const generateColumns = (obj, parentKey = "") => { + return Object.keys(obj) + .map((key) => { + const accessorKey = parentKey ? `${parentKey}.${key}` : key; + + if ( + typeof obj[key] === "object" && + obj[key] !== null && + !Array.isArray(obj[key]) && + !skipRecursion.includes(key) + ) { + return generateColumns(obj[key], accessorKey); + } + + // Build a value resolver usable by both accessorFn/Cell and the filter util + const resolveValue = (rowLike) => + accessorKey.includes("@odata") ? rowLike?.[accessorKey] : getAtPath(rowLike, accessorKey); + + // Pre-compute some sample values for filter heuristics (optional) + const valuesForColumn = (Array.isArray(dataArray) ? dataArray : []) + .map((r) => resolveValue(r)) + .filter((v) => v !== undefined && v !== null); + + const sampleValue = valuesForColumn.length ? valuesForColumn[0] : undefined; + + const column = { + header: getCippTranslation(accessorKey), + id: accessorKey, + accessorFn: (row) => { + const value = resolveValue(row); + return getCippFormatting(value, accessorKey, "text"); + }, + ...getCippFilterVariant(accessorKey, { + sampleValue, + values: valuesForColumn, + getValue: (row) => resolveValue(row), + }), + Cell: ({ row }) => { + const value = resolveValue(row.original); + return getCippFormatting(value, accessorKey); + }, + }; + + return column; + }) + .flat(); + }; + + return generateColumns(dataSample); +}; diff --git a/src/utils/get-cipp-filter-variant.js b/src/utils/get-cipp-filter-variant.js index 541bc2db263c..8213b789c5a5 100644 --- a/src/utils/get-cipp-filter-variant.js +++ b/src/utils/get-cipp-filter-variant.js @@ -1,4 +1,16 @@ -export const getCippFilterVariant = (providedColumnKeys) => { +export const getCippFilterVariant = (providedColumnKeys, arg) => { + // Back-compat + new options mode + const isOptions = + arg && + typeof arg === "object" && + (Object.prototype.hasOwnProperty.call(arg, "sampleValue") || + Array.isArray(arg?.values) || + typeof arg?.getValue === "function"); + + const sampleValue = isOptions ? arg.sampleValue : arg; + const values = isOptions && Array.isArray(arg.values) ? arg.values : undefined; + const tailKey = providedColumnKeys?.split(".").pop() ?? providedColumnKeys; + const timeAgoArray = [ "ExecutedTime", "ScheduledTime", @@ -19,17 +31,14 @@ export const getCippFilterVariant = (providedColumnKeys) => { "WhenCreated", "WhenChanged", ]; - const matchDateTime = /[dD]ate[tT]ime/; - if (timeAgoArray.includes(providedColumnKeys) || matchDateTime.test(providedColumnKeys)) { - return { - filterVariant: "datetime-range", - sortingFn: "dateTimeNullsLast", - filterFn: "betweenInclusive", - }; - } + const matchDateTime = + /[dD]ate(?:[tT]ime)?|(?:^|\.)(?:updatedAt|createdAt|LastRun|LastRefresh|Expires)$/; - switch (providedColumnKeys) { + const typeOf = typeof sampleValue; + //First key based filters + switch (tailKey) { case "assignedLicenses": + console.log("Assigned Licenses Filter", sampleValue, values); return { filterVariant: "multi-select", sortingFn: "alphanumeric", @@ -38,14 +47,50 @@ export const getCippFilterVariant = (providedColumnKeys) => { case "accountEnabled": return { filterVariant: "select", + sortingFn: "boolean", + filterFn: "equals", }; case "primDomain": - return "select"; + return { + filterVariant: "select", + sortingFn: "alphanumeric", + filterFn: "includes", + }; case "number": - return "range"; + return { + filterVariant: "range", + sortingFn: "number", + filterFn: "betweenInclusive", + }; case "id": - return "text"; - default: - return { filterVariant: "text" }; + return { + filterVariant: "text", + sortingFn: "alphanumeric", + filterFn: "includes", + }; + } + //Type based filters + if (typeOf === "boolean") { + return { + filterVariant: "select", + sortingFn: "boolean", + filterFn: "equals", + }; + } + + if (typeOf === "number") { + return { + filterVariant: "range", + sortingFn: "number", + filterFn: "betweenInclusive", + }; + } + + if (timeAgoArray.includes(tailKey) || matchDateTime.test(providedColumnKeys)) { + return { + filterVariant: "datetime-range", + sortingFn: "dateTimeNullsLast", + filterFn: "betweenInclusive", + }; } }; From 5b3709fb69ec3cdeaf055f0eb4b5ebefa8f668e8 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 22 Aug 2025 12:10:12 +0200 Subject: [PATCH 17/86] move bulk user and add user to drawers --- .../CippComponents/CippAddUserDrawer.jsx | 150 +++++++++++ .../CippComponents/CippBulkUserDrawer.jsx | 247 ++++++++++++++++++ .../identity/administration/users/index.js | 24 +- 3 files changed, 405 insertions(+), 16 deletions(-) create mode 100644 src/components/CippComponents/CippAddUserDrawer.jsx create mode 100644 src/components/CippComponents/CippBulkUserDrawer.jsx diff --git a/src/components/CippComponents/CippAddUserDrawer.jsx b/src/components/CippComponents/CippAddUserDrawer.jsx new file mode 100644 index 000000000000..f97207215a68 --- /dev/null +++ b/src/components/CippComponents/CippAddUserDrawer.jsx @@ -0,0 +1,150 @@ +import React, { useState, useEffect } from "react"; +import { Button, Box } from "@mui/material"; +import { useForm, useWatch } from "react-hook-form"; +import { PersonAdd } from "@mui/icons-material"; +import { CippOffCanvas } from "./CippOffCanvas"; +import { CippFormUserSelector } from "./CippFormUserSelector"; +import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "../../hooks/use-settings"; +import { ApiPostCall } from "../../api/ApiCall"; +import CippAddEditUser from "../CippFormPages/CippAddEditUser"; + +export const CippAddUserDrawer = ({ + buttonText = "Add User", + requiredPermissions = [], + PermissionButton = Button, +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const userSettingsDefaults = useSettings(); + + const formControl = useForm({ + mode: "onBlur", + defaultValues: { + tenantFilter: userSettingsDefaults.currentTenant, + usageLocation: userSettingsDefaults.usageLocation, + }, + }); + + const createUser = ApiPostCall({ + urlFromData: true, + relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], + }); + + const formValues = useWatch({ control: formControl.control, name: "userProperties" }); + + useEffect(() => { + if (formValues) { + const { userPrincipalName, usageLocation, ...restFields } = formValues.addedFields || {}; + let newFields = { ...restFields }; + if (userPrincipalName) { + const [mailNickname, domainNamePart] = userPrincipalName.split("@"); + if (mailNickname) { + newFields.mailNickname = mailNickname; + } + if (domainNamePart) { + newFields.primDomain = { label: domainNamePart, value: domainNamePart }; + } + } + if (usageLocation) { + newFields.usageLocation = { label: usageLocation, value: usageLocation }; + } + newFields.tenantFilter = userSettingsDefaults.currentTenant; + + formControl.reset(newFields); + } + }, [formValues]); + + const handleSubmit = () => { + const formData = formControl.getValues(); + createUser.mutate({ + url: "/api/AddUser", + data: formData, + relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], + }); + }; + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset({ + tenantFilter: userSettingsDefaults.currentTenant, + usageLocation: userSettingsDefaults.usageLocation, + }); + }; + + return ( + <> + setDrawerVisible(true)} + startIcon={} + > + {buttonText} + + + + + + } + > + + + + + + + + + + ); +}; \ No newline at end of file diff --git a/src/components/CippComponents/CippBulkUserDrawer.jsx b/src/components/CippComponents/CippBulkUserDrawer.jsx new file mode 100644 index 000000000000..7718ae957138 --- /dev/null +++ b/src/components/CippComponents/CippBulkUserDrawer.jsx @@ -0,0 +1,247 @@ +import { useState } from "react"; +import { Button, Link, Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material"; +import { Grid } from "@mui/system"; +import { useForm, useWatch } from "react-hook-form"; +import { GroupAdd, Delete } from "@mui/icons-material"; +import { CippOffCanvas } from "./CippOffCanvas"; +import CippFormComponent from "./CippFormComponent"; +import { CippFormLicenseSelector } from "./CippFormLicenseSelector"; +import { CippDataTable } from "../CippTable/CippDataTable"; +import { CippApiResults } from "./CippApiResults"; +import { useSettings } from "../../hooks/use-settings"; +import { ApiPostCall } from "../../api/ApiCall"; +import { getCippTranslation } from "../../utils/get-cipp-translation"; +import countryList from "/src/data/countryList.json"; + +export const CippBulkUserDrawer = ({ + buttonText = "Bulk Add Users", + requiredPermissions = [], + PermissionButton = Button, +}) => { + const [drawerVisible, setDrawerVisible] = useState(false); + const [addRowDialogOpen, setAddRowDialogOpen] = useState(false); + const initialState = useSettings(); + + const addedFields = initialState?.defaultAttributes + ? initialState.userAttributes.map((item) => item.label) + : []; + + const fields = [ + "givenName", + "surName", + "displayName", + "mailNickName", + "domain", + "JobTitle", + "streetAddress", + "PostalCode", + "City", + "State", + "Department", + "MobilePhone", + "businessPhones", + ...addedFields, + ]; + + const formControl = useForm({ + mode: "onChange", + defaultValues: { + tenantFilter: initialState.currentTenant, + usageLocation: initialState.usageLocation || "US", + bulkUser: [], + licenses: [], + }, + }); + + const bulkUserData = useWatch({ control: formControl.control, name: "bulkUser" }); + + const createBulkUsers = ApiPostCall({ + urlFromData: true, + relatedQueryKeys: ["Users"], + }); + + // Register the bulkUser field with validation + formControl.register("bulkUser", { + validate: (value) => Array.isArray(value) && value.length > 0, + }); + + const handleRemoveItem = (row) => { + if (row === undefined) return false; + const currentData = formControl.getValues("bulkUser") || []; + const index = currentData.findIndex((item) => item === row); + const newData = [...currentData]; + newData.splice(index, 1); + formControl.setValue("bulkUser", newData, { shouldValidate: true }); + }; + + const handleAddItem = () => { + const newRowData = formControl.getValues("addrow"); + if (newRowData === undefined) return false; + const currentData = formControl.getValues("bulkUser") || []; + const newData = [...currentData, newRowData]; + formControl.setValue("bulkUser", newData, { shouldValidate: true }); + setAddRowDialogOpen(false); + formControl.reset({ + ...formControl.getValues(), + addrow: {}, + }); + }; + + const handleSubmit = () => { + const formData = formControl.getValues(); + createBulkUsers.mutate({ + url: "/api/AddUserBulk", + data: formData, + relatedQueryKeys: ["Users"], + }); + }; + + const handleCloseDrawer = () => { + setDrawerVisible(false); + formControl.reset({ + tenantFilter: initialState.currentTenant, + usageLocation: initialState.usageLocation || "US", + bulkUser: [], + licenses: [], + }); + }; + + const actions = [ + { + icon: , + label: "Delete Row", + confirmText: "Are you sure you want to delete this row?", + customFunction: handleRemoveItem, + noConfirm: true, + }, + ]; + + return ( + <> + setDrawerVisible(true)} + startIcon={} + > + {buttonText} + + + + + + } + > + + + ({ + label: Name, + value: Code, + }))} + formControl={formControl} + /> + + + + + + + + + Download Example CSV + + + + + + + + + + + + + + + + + + + setAddRowDialogOpen(false)} + maxWidth="md" + fullWidth + > + Add a new user + + + {fields.map((field) => ( + + + + ))} + + + + + + + + + + ); +}; diff --git a/src/pages/identity/administration/users/index.js b/src/pages/identity/administration/users/index.js index 34f03064e477..ee83d119b8d8 100644 --- a/src/pages/identity/administration/users/index.js +++ b/src/pages/identity/administration/users/index.js @@ -1,11 +1,11 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { Send, GroupAdd, PersonAdd } from "@mui/icons-material"; -import Link from "next/link"; import { useSettings } from "/src/hooks/use-settings.js"; import { PermissionButton } from "../../../../utils/permissions"; import { CippUserActions } from "/src/components/CippComponents/CippUserActions.jsx"; import { CippInviteGuestDrawer } from "/src/components/CippComponents/CippInviteGuestDrawer.jsx"; +import { CippBulkUserDrawer } from "/src/components/CippComponents/CippBulkUserDrawer.jsx"; +import { CippAddUserDrawer } from "/src/components/CippComponents/CippAddUserDrawer.jsx"; const Page = () => { const pageTitle = "Users"; @@ -57,22 +57,14 @@ const Page = () => { apiUrl="/api/ListGraphRequest" cardButton={ <> - } - > - Add User - - + } - > - Bulk Add Users - + PermissionButton={PermissionButton} + /> Date: Fri, 22 Aug 2025 12:20:06 +0200 Subject: [PATCH 18/86] null values proccessing --- .../CippComponents/CippAddUserDrawer.jsx | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/src/components/CippComponents/CippAddUserDrawer.jsx b/src/components/CippComponents/CippAddUserDrawer.jsx index f97207215a68..a0802bde5f5c 100644 --- a/src/components/CippComponents/CippAddUserDrawer.jsx +++ b/src/components/CippComponents/CippAddUserDrawer.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect } from "react"; import { Button, Box } from "@mui/material"; -import { useForm, useWatch } from "react-hook-form"; +import { useForm, useWatch, useFormState } from "react-hook-form"; import { PersonAdd } from "@mui/icons-material"; import { CippOffCanvas } from "./CippOffCanvas"; import { CippFormUserSelector } from "./CippFormUserSelector"; @@ -26,10 +26,12 @@ export const CippAddUserDrawer = ({ }); const createUser = ApiPostCall({ - urlFromData: true, + datafromUrl: true, relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], }); + const { isValid, isDirty } = useFormState({ control: formControl.control }); + const formValues = useWatch({ control: formControl.control, name: "userProperties" }); useEffect(() => { @@ -54,12 +56,29 @@ export const CippAddUserDrawer = ({ } }, [formValues]); + useEffect(() => { + if (createUser.isSuccess) { + formControl.reset({ + tenantFilter: userSettingsDefaults.currentTenant, + usageLocation: userSettingsDefaults.usageLocation, + }); + } + }, [createUser.isSuccess]); + const handleSubmit = () => { - const formData = formControl.getValues(); + formControl.trigger(); + if (!isValid) { + return; + } + const values = formControl.getValues(); + Object.keys(values).forEach((key) => { + if (values[key] === "" || values[key] === null) { + delete values[key]; + } + }); createUser.mutate({ url: "/api/AddUser", - data: formData, - relatedQueryKeys: [`Users-${userSettingsDefaults.currentTenant}`], + data: values, }); }; @@ -90,10 +109,10 @@ export const CippAddUserDrawer = ({ + ), + table: { + title: "Contact Permissions", + hideTitle: true, + data: + contactPermissions.data?.map((permission) => { + const userIdentifier = permission?.User; + const permissionInfo = getPermissionInfo(permission.User, groupsList); + return { + User: permissionInfo.displayName, + AccessRights: permission?.AccessRights?.join(", ") || "Unknown", + FolderName: permission?.FolderName || "Unknown", + Type: permissionInfo.type, + _raw: permission, + }; + }) || [], + refreshFunction: () => contactPermissions.refetch(), + isFetching: contactPermissions.isFetching, + simpleColumns: ["User", "AccessRights", "FolderName", "Type"], + actions: [ + { + label: "Remove Permission", + type: "POST", + icon: , + url: "/api/ExecModifyContactPerms", + customDataformatter: (row, action, formData) => { + var permissions = []; + if (Array.isArray(row)) { + row.forEach((item) => { + const originalUser = item._raw ? item._raw.User : item.User; + permissions.push({ + UserID: originalUser, // Use original identifier for API calls + PermissionLevel: item.AccessRights, + FolderName: item.FolderName, + Modification: "Remove", + }); + }); + } else { + const originalUser = row._raw ? row._raw.User : row.User; + permissions.push({ + UserID: originalUser, // Use original identifier for API calls + PermissionLevel: row.AccessRights, + FolderName: row.FolderName, + Modification: "Remove", + }); + } + return { + userID: graphUserRequest.data?.[0]?.userPrincipalName, + tenantFilter: userSettingsDefaults.currentTenant, + permissions: permissions, + }; + }, + confirmText: "Are you sure you want to remove this contact permission?", + multiPost: false, + relatedQueryKeys: `ContactPermissions-${userId}`, + condition: (row) => row.User !== "Default" && row.User !== "Anonymous", + }, + ], + offCanvas: { + children: (data) => { + const originalUser = data._raw ? data._raw.User : data.User; + const permissionInfo = getPermissionInfo(originalUser, groupsList); + return ( + , + url: "/api/ExecModifyCalPerms", + data: { + userID: graphUserRequest.data?.[0]?.userPrincipalName, + tenantFilter: userSettingsDefaults.currentTenant, + permissions: [ + { + UserID: originalUser, // Use original identifier for API calls + PermissionLevel: data.AccessRights, + FolderName: data.FolderName, + Modification: "Remove", + }, + ], + }, + confirmText: "Are you sure you want to remove this contact permission?", + multiPost: false, + relatedQueryKeys: `ContactPermissions-${userId}`, + }, + ]} + /> + ); + }, + }, + }, + }, + ]; + const mailboxRuleActions = [ { label: "Enable Mailbox Rule", @@ -1026,6 +1244,11 @@ const Page = () => { items={calCard} isCollapsible={true} /> + { /> )} + + + {({ formHook }) => ( + + )} + ); }; From 57558e971078f656adcb5a4a408491f63e6721e2 Mon Sep 17 00:00:00 2001 From: Zac Richards <107489668+Zacgoose@users.noreply.github.com> Date: Tue, 26 Aug 2025 22:59:48 +0800 Subject: [PATCH 29/86] Feat: Remove deprecated add-ins for "Report Phishing" and "Report Message" --- src/data/standards.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/data/standards.json b/src/data/standards.json index a5d6b5d6e3ee..8b2ae03509f4 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -4845,5 +4845,18 @@ "addedDate": "2025-08-22", "powershellEquivalent": "Set-OwaMailboxPolicy -Identity \"OwaMailboxPolicy-Default\" -ConditionalAccessPolicy ReadOnlyPlusAttachmentsBlocked", "recommendedBy": ["Microsoft Zero Trust", "CIPP"] + }, + { + "name": "standards.LegacyEmailReportAddins", + "cat": "Exchange Standards", + "tag": [], + "helpText": "Removes legacy Report Phishing and Report Message Outlook add-ins.", + "executiveText": "The legacy Report Phishing and Report Message Outlook add-ins are security issues with the add-in which makes them unsafe for the organization.", + "label": "Remove legacy Outlook Report add-ins", + "impact": "Low Impact", + "impactColour": "info", + "addedDate": "2025-08-26", + "powershellEquivalent": "None", + "recommendedBy": ["Microsoft"] } ] From 6f62151d81ff0c489fb5b1cae92d920f3bf6eef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= <31723128+kris6673@users.noreply.github.com> Date: Wed, 27 Aug 2025 13:24:23 +0200 Subject: [PATCH 30/86] Add handling for 503 error in PrivateRoute --- src/components/PrivateRoute.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/PrivateRoute.js b/src/components/PrivateRoute.js index c39642c0fa91..34db29fd7a1c 100644 --- a/src/components/PrivateRoute.js +++ b/src/components/PrivateRoute.js @@ -31,7 +31,8 @@ export const PrivateRoute = ({ children, routeType }) => { // Or other network errors that would indicate API is unavailable if ( apiRoles?.error?.response?.status === 404 || // API endpoint not found - apiRoles?.error?.response?.status === 502 || // Service unavailable + apiRoles?.error?.response?.status === 502 || // Bad Gateway + apiRoles?.error?.response?.status === 503 || // Service Unavailable (apiRoles?.isSuccess && !apiRoles?.data) // No client principal data, indicating API might be offline ) { return ; From 003733b28499831d478b6f72f6f1816f2445f881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Thu, 28 Aug 2025 22:22:49 +0200 Subject: [PATCH 31/86] Feat: add sync VPP button and dialog to applications page --- src/pages/endpoint/applications/list/index.js | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/src/pages/endpoint/applications/list/index.js b/src/pages/endpoint/applications/list/index.js index 570bc48dc625..b29acd56557d 100644 --- a/src/pages/endpoint/applications/list/index.js +++ b/src/pages/endpoint/applications/list/index.js @@ -1,11 +1,17 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { CippApiDialog } from "/src/components/CippComponents/CippApiDialog.jsx"; import { GlobeAltIcon, TrashIcon, UserIcon } from "@heroicons/react/24/outline"; -import { LaptopMac } from "@mui/icons-material"; +import { LaptopMac, Sync } from "@mui/icons-material"; import { CippApplicationDeployDrawer } from "/src/components/CippComponents/CippApplicationDeployDrawer"; +import { Button, Box } from "@mui/material"; +import { useSettings } from "/src/hooks/use-settings.js"; +import { useDialog } from "../../../../hooks/use-dialog"; const Page = () => { const pageTitle = "Applications"; + const syncDialog = useDialog(); + const tenant = useSettings().currentTenant; const actions = [ { @@ -82,18 +88,33 @@ const Page = () => { ]; return ( - - - - } - /> + <> + + + + + } + /> + + ); }; From 479ef740007bd2f8e6c31093a8bbf1145cd2d665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Thu, 28 Aug 2025 22:25:41 +0200 Subject: [PATCH 32/86] fix: update import path for useDialog hook --- src/pages/endpoint/applications/list/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/endpoint/applications/list/index.js b/src/pages/endpoint/applications/list/index.js index b29acd56557d..9822447c7151 100644 --- a/src/pages/endpoint/applications/list/index.js +++ b/src/pages/endpoint/applications/list/index.js @@ -6,7 +6,7 @@ import { LaptopMac, Sync } from "@mui/icons-material"; import { CippApplicationDeployDrawer } from "/src/components/CippComponents/CippApplicationDeployDrawer"; import { Button, Box } from "@mui/material"; import { useSettings } from "/src/hooks/use-settings.js"; -import { useDialog } from "../../../../hooks/use-dialog"; +import { useDialog } from "/src/hooks/use-dialog.js"; const Page = () => { const pageTitle = "Applications"; From 70bde072df5bb597eadd055be1b61475c96dc685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Fri, 29 Aug 2025 15:05:03 +0200 Subject: [PATCH 33/86] Feat: Mdo alerts page Add incident actions and update field names for consistency rename to MDO --- src/layouts/config.js | 5 + .../incidents/list-mdo-alerts/index.js | 121 ++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 src/pages/security/incidents/list-mdo-alerts/index.js diff --git a/src/layouts/config.js b/src/layouts/config.js index 98ce6f9b54f2..2add01700bb5 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -302,6 +302,11 @@ export const nativeMenuItems = [ path: "/security/incidents/list-alerts", permissions: ["Security.Alert.*"], }, + { + title: "MDO Alerts", + path: "/security/incidents/list-mdo-alerts", + permissions: ["Security.Alert.*"], + }, ], }, { diff --git a/src/pages/security/incidents/list-mdo-alerts/index.js b/src/pages/security/incidents/list-mdo-alerts/index.js new file mode 100644 index 000000000000..2bd7601faefa --- /dev/null +++ b/src/pages/security/incidents/list-mdo-alerts/index.js @@ -0,0 +1,121 @@ +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { PersonAdd, PlayArrow, Assignment, Done } from "@mui/icons-material"; + +const Page = () => { + const pageTitle = "Email & Collaboration Alerts"; + + // Define actions for incidents + const actions = [ + { + label: "Assign to self", + type: "POST", + icon: , + url: "/api/ExecSetMdoAlert", + data: { + GUID: "id", + }, + confirmText: "Are you sure you want to assign this incident to yourself?", + }, + { + label: "Set status to active", + type: "POST", + icon: , + url: "/api/ExecSetMdoAlert", + data: { + GUID: "id", + Status: "!active", + Assigned: "assignedTo", + }, + confirmText: "Are you sure you want to set the status to active?", + }, + { + label: "Set status to in progress", + type: "POST", + icon: , + url: "/api/ExecSetMdoAlert", + data: { + GUID: "id", + Status: "!inProgress", + Assigned: "assignedTo", + }, + confirmText: "Are you sure you want to set the status to in progress?", + }, + { + label: "Set status to resolved", + type: "POST", + icon: , + url: "/api/ExecSetMdoAlert", + data: { + GUID: "id", + Status: "!resolved", + Assigned: "assignedTo", + }, + confirmText: "Are you sure you want to set the status to resolved?", + }, + ]; + + // Define off-canvas details + const offCanvas = { + extendedInfoFields: [ + "createdDateTime", + "title", + "description", + "category", + "status", + "severity", + "classification", + "determination", + "serviceSource", + "evidence", + "detectionSource", + "tenant", + "providerAlertId", + "incidentId", + "affectedResources", + "involvedUsers", + "mitreTechniques", + "threatDisplayName", + "threatFamilyName", + "actorDisplayName", + "recommendedActions", + "firstActivityDateTime", + "lastActivityDateTime", + "lastUpdateDateTime", + "resolvedDateTime", + "alertWebUrl", + "incidentWebUrl", + ], + actions: actions, + }; + + // Simplified columns for the table + const simpleColumns = [ + "createdDateTime", + "status", + "severity", + "title", + "category", + "classification", + "affectedResources", + "evidence", + "assignedTo", + "incidentWebUrl", + "tenant", + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => {page}; + +export default Page; From 1e970bc59285677c9f9948d9e4eca20a46f794b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sat, 30 Aug 2025 23:03:52 +0200 Subject: [PATCH 34/86] Feat: correct capitalization for BitLocker keys in confirmation messages --- src/pages/endpoint/MEM/devices/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/endpoint/MEM/devices/index.js b/src/pages/endpoint/MEM/devices/index.js index 283259e5dec3..14b4c6feae12 100644 --- a/src/pages/endpoint/MEM/devices/index.js +++ b/src/pages/endpoint/MEM/devices/index.js @@ -144,14 +144,14 @@ const Page = () => { confirmText: "Are you sure you want to rotate the password for this device?", }, { - label: "Retrieve Bitlocker Keys", + label: "Retrieve BitLocker Keys", type: "POST", icon: , url: "/api/ExecGetRecoveryKey", data: { GUID: "azureADDeviceId", }, - confirmText: "Are you sure you want to retrieve the Bitlocker keys?", + confirmText: "Are you sure you want to retrieve the BitLocker keys?", }, { label: "Windows Defender Full Scan", From 253d62be2a924a1d58ebed5f2918a8f5b0700adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sun, 31 Aug 2025 15:00:11 +0200 Subject: [PATCH 35/86] add clarification about POP and IMAP --- src/data/standards.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/standards.json b/src/data/standards.json index a5d6b5d6e3ee..261b58154769 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -336,8 +336,8 @@ "name": "standards.DisableBasicAuthSMTP", "cat": "Global Standards", "tag": ["CIS M365 5.0 (6.5.4)", "NIST CSF 2.0 (PR.IR-01)"], - "helpText": "Disables SMTP AUTH for the organization and all users. This is the default for new tenants.", - "docsDescription": "Disables SMTP basic authentication for the tenant and all users with it explicitly enabled.", + "helpText": "Disables SMTP AUTH organization-wide, impacting POP and IMAP clients that rely on SMTP for sending emails. Default for new tenants. For more information, see the [Microsoft documentation](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission)", + "docsDescription": "Disables tenant-wide SMTP basic authentication, including for all explicitly enabled users, impacting POP and IMAP clients that rely on SMTP for sending emails. For more information, see the [Microsoft documentation](https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission).", "executiveText": "Disables outdated email authentication methods that are vulnerable to security attacks, forcing applications and devices to use modern, more secure authentication protocols. This reduces the risk of email-based security breaches and credential theft.", "addedComponent": [], "label": "Disable SMTP Basic Authentication", From 7eff98ef1e9f52c0cfda20438f7b773e94010ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sun, 31 Aug 2025 16:04:20 +0200 Subject: [PATCH 36/86] change some spacings to standards to increase information density Also add add a word --- cspell.json | 5 ++-- .../CippStandards/CippStandardAccordion.jsx | 10 ++++---- src/pages/tenant/standards/template.jsx | 23 +++++++++++-------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/cspell.json b/cspell.json index 69e05ddee5f8..fe7d6143946f 100644 --- a/cspell.json +++ b/cspell.json @@ -14,6 +14,7 @@ "CIPP", "CIPP-API", "Datto", + "DMARC", "Entra", "ESET", "GDAP", @@ -31,8 +32,8 @@ "Sherweb", "Syncro", "TERRL", - "Yubikey", - "DMARC" + "unconfigured", + "Yubikey" ], "ignoreWords": [ "Addins", diff --git a/src/components/CippStandards/CippStandardAccordion.jsx b/src/components/CippStandards/CippStandardAccordion.jsx index e5ad67d6f925..fe8477bc47f6 100644 --- a/src/components/CippStandards/CippStandardAccordion.jsx +++ b/src/components/CippStandards/CippStandardAccordion.jsx @@ -136,9 +136,7 @@ const CippStandardAccordion = ({ // Set default autoRemediate if not set if (currentValues.autoRemediate === undefined) { formControl.setValue(`${standardName}.autoRemediate`, false); - formControl.setValue(`${standardName}.action`, [ - { label: "Report", value: "Report" }, - ]); + formControl.setValue(`${standardName}.action`, [{ label: "Report", value: "Report" }]); } }); } @@ -667,9 +665,9 @@ const CippStandardAccordion = ({ direction="row" justifyContent="space-between" alignItems="center" - sx={{ p: 3 }} + sx={{ p: 2 }} > - + {standard.cat === "Global Standards" ? ( @@ -687,7 +685,7 @@ const CippStandardAccordion = ({ {accordionTitle} - + {/* Hide action chips in drift mode */} {!isDriftMode && selectedActions && selectedActions?.length > 0 && ( <> diff --git a/src/pages/tenant/standards/template.jsx b/src/pages/tenant/standards/template.jsx index 0262b6a6e1ad..f9673ef77639 100644 --- a/src/pages/tenant/standards/template.jsx +++ b/src/pages/tenant/standards/template.jsx @@ -31,7 +31,7 @@ const Page = () => { const [currentStep, setCurrentStep] = useState(0); const [hasDriftConflict, setHasDriftConflict] = useState(false); const initialStandardsRef = useRef({}); - + // Check if this is drift mode const isDriftMode = router.query.type === "drift"; @@ -264,9 +264,9 @@ const Page = () => { // Determine if save button should be disabled based on configuration const isSaveDisabled = isDriftMode ? currentStep < 3 || hasDriftConflict // For drift mode, only require steps 1, 3, and 4 (skip tenant requirement) and no drift conflicts - : (!_.get(watchForm, "tenantFilter") || - !_.get(watchForm, "tenantFilter").length || - currentStep < 3); + : !_.get(watchForm, "tenantFilter") || + !_.get(watchForm, "tenantFilter").length || + currentStep < 3; const actions = []; @@ -291,9 +291,9 @@ const Page = () => { }; return ( - + - + + color="muted" + style={{ paddingLeft: 0 }} + size="small" + href={`https://entra.microsoft.com/${userSettingsDefaults.currentTenant}/#view/Microsoft_AAD_UsersAndTenants/UserProfileMenuBlade/~/overview/userId/${userId}`} + target="_blank" + rel="noopener noreferrer" + > + View in Entra + ), }, ] @@ -313,7 +313,11 @@ const Page = () => { {becPollingCall.data.NewRules.map((rule, index) => ( - + ))} @@ -355,8 +359,8 @@ const Page = () => { {becPollingCall.data.NewUsers.map((user, index) => ( ))} @@ -399,8 +403,8 @@ const Page = () => { {becPollingCall.data.AddedApps.map((app, index) => ( ))} @@ -488,7 +492,7 @@ const Page = () => { ))} @@ -530,8 +534,8 @@ const Page = () => { {becPollingCall.data.ChangedPasswords.map((permission, index) => ( ))} From f1cbe70ae680d350498da5685a5ee501053018f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 2 Sep 2025 23:25:43 +0200 Subject: [PATCH 39/86] Feat: Add delete profile action to Autopilot Profiles page --- .../endpoint/autopilot/list-profiles/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pages/endpoint/autopilot/list-profiles/index.js b/src/pages/endpoint/autopilot/list-profiles/index.js index 66a0656254a2..6564cb6d5f7d 100644 --- a/src/pages/endpoint/autopilot/list-profiles/index.js +++ b/src/pages/endpoint/autopilot/list-profiles/index.js @@ -2,14 +2,25 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; import { Button } from "@mui/material"; import Link from "next/link"; -import { AccountCircle } from "@mui/icons-material"; +import { AccountCircle, Delete } from "@mui/icons-material"; import CippJsonView from "../../../../components/CippFormPages/CippJSONView"; import { CippAutopilotProfileDrawer } from "/src/components/CippComponents/CippAutopilotProfileDrawer"; const Page = () => { const pageTitle = "Autopilot Profiles"; - const actions = []; + const actions = [ + { + label: "Delete Profile", + icon: , + type: "POST", + url: "/api/RemoveAutopilotConfig", + data: { ID: "id", displayName: "displayName", assignments: "assignments" }, + confirmText: + "Are you sure you want to delete this Autopilot profile? This action cannot be undone.", + color: "danger", + }, + ]; const offCanvas = { children: (row) => , From c728f5d0bda6ff24e997752662c849e19bae954f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 2 Sep 2025 23:30:20 +0200 Subject: [PATCH 40/86] Remove unused imports --- src/pages/endpoint/autopilot/list-profiles/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/endpoint/autopilot/list-profiles/index.js b/src/pages/endpoint/autopilot/list-profiles/index.js index 6564cb6d5f7d..c1dc97e21c84 100644 --- a/src/pages/endpoint/autopilot/list-profiles/index.js +++ b/src/pages/endpoint/autopilot/list-profiles/index.js @@ -1,8 +1,6 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import { Button } from "@mui/material"; -import Link from "next/link"; -import { AccountCircle, Delete } from "@mui/icons-material"; +import { Delete } from "@mui/icons-material"; import CippJsonView from "../../../../components/CippFormPages/CippJSONView"; import { CippAutopilotProfileDrawer } from "/src/components/CippComponents/CippAutopilotProfileDrawer"; From 797530fa2e03058e20c098ad2ea19b2196777715 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 2 Sep 2025 20:18:57 -0400 Subject: [PATCH 41/86] table filter persistence --- .../CippComponents/CippSettingsSideBar.jsx | 38 +++--- .../CippTable/CIPPTableToptoolbar.js | 119 +++++++++++++++++- src/contexts/settings-context.js | 16 +++ src/pages/cipp/preferences.js | 86 ++++++++----- 4 files changed, 205 insertions(+), 54 deletions(-) diff --git a/src/components/CippComponents/CippSettingsSideBar.jsx b/src/components/CippComponents/CippSettingsSideBar.jsx index 715d8bf8bf6b..03621be6b25f 100644 --- a/src/components/CippComponents/CippSettingsSideBar.jsx +++ b/src/components/CippComponents/CippSettingsSideBar.jsx @@ -33,16 +33,17 @@ export const CippSettingsSideBar = (props) => { // Set the correct default value once we have the initial user type and current user data useEffect(() => { if (initialUserType && currentUser.data?.clientPrincipal?.userDetails) { - const defaultUserOption = initialUserType === "currentUser" - ? { - label: "Current User", - value: currentUser.data.clientPrincipal.userDetails, - } - : { - label: "All Users", - value: "allUsers" - }; - + const defaultUserOption = + initialUserType === "currentUser" + ? { + label: "Current User", + value: currentUser.data.clientPrincipal.userDetails, + } + : { + label: "All Users", + value: "allUsers", + }; + // Only set if not already set to avoid infinite loops const currentUserValue = formcontrol.getValues("user"); if (!currentUserValue || currentUserValue.value !== defaultUserOption.value) { @@ -61,6 +62,9 @@ export const CippSettingsSideBar = (props) => { tablePageSize: formValues.tablePageSize, userAttributes: formValues.userAttributes, + // Table Filter Preferences + persistFilters: formValues.persistFilters, + // Portal Links Configuration portalLinks: { M365_Portal: formValues.portalLinks?.M365_Portal, @@ -108,15 +112,15 @@ export const CippSettingsSideBar = (props) => { if (!currentUser.data?.clientPrincipal?.userDetails) { return []; } - + return [ - { - label: "Current User", - value: currentUser.data.clientPrincipal.userDetails + { + label: "Current User", + value: currentUser.data.clientPrincipal.userDetails, }, - { - label: "All Users", - value: "allUsers" + { + label: "All Users", + value: "allUsers", }, ]; }; diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index d8d65bc92cb3..d16bc6939c24 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -22,7 +22,7 @@ import { ChevronDownIcon, ExclamationCircleIcon } from "@heroicons/react/24/outl import { usePopover } from "../../hooks/use-popover"; import { CSVExportButton } from "../csvExportButton"; import { useDialog } from "../../hooks/use-dialog"; -import { useEffect, useState } from "react"; +import { useEffect, useState, useRef } from "react"; import { CippApiDialog } from "../CippComponents/CippApiDialog"; import { getCippTranslation } from "../../utils/get-cipp-translation"; import { useSettings } from "../../hooks/use-settings"; @@ -73,9 +73,12 @@ export const CIPPTableToptoolbar = ({ const [filterCanvasVisible, setFilterCanvasVisible] = useState(false); const [activeFilterName, setActiveFilterName] = useState(null); const pageName = router.pathname.split("/").slice(1).join("/"); - const currentTenant = useSettings()?.currentTenant; + const currentTenant = settings?.currentTenant; const queryClient = useQueryClient(); + // Track if we've restored filters for this page to prevent infinite loops + const restoredFiltersRef = useRef(new Set()); + const [actionMenuAnchor, setActionMenuAnchor] = useState(null); const handleActionMenuOpen = (event) => setActionMenuAnchor(event.currentTarget); const handleActionMenuClose = () => setActionMenuAnchor(null); @@ -111,8 +114,11 @@ export const CIPPTableToptoolbar = ({ setGraphFilterData({}); // Clear active filter name when tenant changes setActiveFilterName(null); + // Clear restoration tracking so saved filters can be re-applied + const restorationKey = `${pageName}-graph`; + restoredFiltersRef.current.delete(restorationKey); } - }, [currentTenant]); + }, [currentTenant, pageName]); //useEffect to set the column visibility to the preferred columns if they exist useEffect(() => { @@ -128,6 +134,104 @@ export const CIPPTableToptoolbar = ({ setOriginalSimpleColumns(simpleColumns); }, [simpleColumns]); + // Early restoration of graph filters (before API call) - run only once per page + useEffect(() => { + const restorationKey = `${pageName}-graph`; + + if ( + settings.persistFilters && + settings.lastUsedFilters && + settings.lastUsedFilters[pageName] && + api?.url === "/api/ListGraphRequest" && // Only for graph requests + !restoredFiltersRef.current.has(restorationKey) // Only if not already restored + ) { + const last = settings.lastUsedFilters[pageName]; + if (last.type === "graph") { + console.log("Early restoring graph filter:", last, "for page:", pageName); + + // Mark as restored to prevent infinite loops + restoredFiltersRef.current.add(restorationKey); + + // Directly set the graph filter data without calling setTableFilter to avoid loops + const filterProps = [ + "$filter", + "$select", + "$expand", + "$orderby", + "$count", + "$search", + "ReverseTenantLookup", + "ReverseTenantLookupProperty", + "AsApp", + ]; + const graphFilter = filterProps.reduce((acc, prop) => { + if (last.value[prop]) { + acc[prop] = last.value[prop]; + } + return acc; + }, {}); + + const newQueryKey = `${queryKey ? queryKey : title}-${last.name}`; + setGraphFilterData({ + data: { ...mergeCaseInsensitive(api.data, graphFilter) }, + queryKey: newQueryKey, + }); + setCurrentEffectiveQueryKey(newQueryKey); + setActiveFilterName(last.name); + } + } + }, [settings.persistFilters, settings.lastUsedFilters, pageName, api?.url, queryKey, title]); + + // Clear restoration tracking when page changes + useEffect(() => { + restoredFiltersRef.current.clear(); + }, [pageName]); + + // Restore last used filter on mount if persistFilters is enabled (non-graph filters) + useEffect(() => { + // Wait for table to be initialized and data to be available + if ( + settings.persistFilters && + settings.lastUsedFilters && + settings.lastUsedFilters[pageName] && + table && + usedColumns.length > 0 && + !getRequestData?.isFetching + ) { + // Use setTimeout to ensure the table is fully rendered + const timeoutId = setTimeout(() => { + const last = settings.lastUsedFilters[pageName]; + console.log("Restoring filter:", last, "for page:", pageName); + + if (last.type === "global") { + table.setGlobalFilter(last.value); + setActiveFilterName(last.name); + } else if (last.type === "column") { + // Only apply if all filter columns exist in the current table + const allColumns = table.getAllColumns().map((col) => col.id); + const filterColumns = Array.isArray(last.value) ? last.value.map((f) => f.id) : []; + const allExist = filterColumns.every((colId) => allColumns.includes(colId)); + console.log("Column filter check:", { allColumns, filterColumns, allExist }); + if (allExist) { + table.setShowColumnFilters(true); + table.setColumnFilters(last.value); + setActiveFilterName(last.name); + } + } + // Note: graph filters are handled in the earlier useEffect + }, 100); + + return () => clearTimeout(timeoutId); + } + }, [ + settings.persistFilters, + settings.lastUsedFilters, + pageName, + table, + usedColumns, + getRequestData?.isFetching, + ]); + const presetList = ApiGetCall({ url: "/api/ListGraphExplorerPresets", queryKey: `ListGraphExplorerPresets${api?.data?.Endpoint ?? ""}`, @@ -204,11 +308,17 @@ export const CIPPTableToptoolbar = ({ if (filterType === "global" || filterType === undefined) { table.setGlobalFilter(filter); setActiveFilterName(filterName); + if (settings.persistFilters && settings.setLastUsedFilter) { + settings.setLastUsedFilter(pageName, { type: "global", value: filter, name: filterName }); + } } if (filterType === "column") { table.setShowColumnFilters(true); table.setColumnFilters(filter); setActiveFilterName(filterName); + if (settings.persistFilters && settings.setLastUsedFilter) { + settings.setLastUsedFilter(pageName, { type: "column", value: filter, name: filterName }); + } } if (filterType === "reset") { table.resetGlobalFilter(); @@ -248,6 +358,9 @@ export const CIPPTableToptoolbar = ({ }); setCurrentEffectiveQueryKey(newQueryKey); setActiveFilterName(filterName); // Track active graph filter + if (settings.persistFilters && settings.setLastUsedFilter) { + settings.setLastUsedFilter(pageName, { type: "graph", value: filter, name: filterName }); + } if (filter?.$select) { let selectedColumns = []; if (Array.isArray(filter?.$select)) { diff --git a/src/contexts/settings-context.js b/src/contexts/settings-context.js index e85cd2574530..35c87c90d658 100644 --- a/src/contexts/settings-context.js +++ b/src/contexts/settings-context.js @@ -78,6 +78,8 @@ const initialSettings = { colour: "#F77F00", logo: null, }, + persistFilters: false, + lastUsedFilters: {}, }; const initialState = { @@ -90,6 +92,7 @@ export const SettingsContext = createContext({ handleReset: () => {}, handleUpdate: () => {}, isCustom: false, + setLastUsedFilter: () => {}, }); export const SettingsProvider = (props) => { @@ -150,6 +153,19 @@ export const SettingsProvider = (props) => { handleReset, handleUpdate, isCustom, + setLastUsedFilter: (page, filter) => { + setState((prevState) => { + const updated = { + ...prevState, + lastUsedFilters: { + ...prevState.lastUsedFilters, + [page]: filter, + }, + }; + storeSettings(updated); + return updated; + }); + }, }} > {children} diff --git a/src/pages/cipp/preferences.js b/src/pages/cipp/preferences.js index c7d79feb6dea..fdc8bc94fd36 100644 --- a/src/pages/cipp/preferences.js +++ b/src/pages/cipp/preferences.js @@ -17,7 +17,7 @@ import { useEffect, useState } from "react"; const Page = () => { const settings = useSettings(); const [initialUserType, setInitialUserType] = useState(null); - + // Default portal links configuration const defaultPortalLinks = { M365_Portal: true, @@ -32,7 +32,7 @@ const Page = () => { Power_Platform_Portal: true, Power_BI_Portal: true, }; - + const auth = ApiGetCall({ url: "/api/me", queryKey: "authmecipp", @@ -48,9 +48,10 @@ const Page = () => { // Determine if we have user-specific settings and set initial user type useEffect(() => { if (cleanedSettings && auth.data?.clientPrincipal?.userDetails && initialUserType === null) { - const hasUserSpecificSettings = cleanedSettings.UserSpecificSettings && + const hasUserSpecificSettings = + cleanedSettings.UserSpecificSettings && Object.keys(cleanedSettings.UserSpecificSettings).length > 0; - + setInitialUserType(hasUserSpecificSettings ? "currentUser" : "allUsers"); } }, [cleanedSettings, auth.data?.clientPrincipal?.userDetails, initialUserType]); @@ -66,7 +67,7 @@ const Page = () => { // Merge with defaults to ensure all keys exist return { ...defaultPortalLinks, ...cleanedSettings.UserSpecificSettings.portalLinks }; } - + // Use global settings or defaults return { ...defaultPortalLinks, ...cleanedSettings.portalLinks }; }; @@ -74,44 +75,48 @@ const Page = () => { // Set up initial form values with proper user selector default const initialFormValues = { ...cleanedSettings, - user: initialUserType === "currentUser" ? { - label: "Current User", - value: auth.data?.clientPrincipal?.userDetails || "currentUser", - } : { - label: "All Users", - value: "allUsers" - }, - portalLinks: getInitialPortalLinks() + user: + initialUserType === "currentUser" + ? { + label: "Current User", + value: auth.data?.clientPrincipal?.userDetails || "currentUser", + } + : { + label: "All Users", + value: "allUsers", + }, + portalLinks: getInitialPortalLinks(), }; - const formcontrol = useForm({ - mode: "onChange", - defaultValues: initialFormValues + const formcontrol = useForm({ + mode: "onChange", + defaultValues: initialFormValues, }); // Watch the user selector to determine which settings to show - const selectedUser = useWatch({ - control: formcontrol.control, - name: "user" + const selectedUser = useWatch({ + control: formcontrol.control, + name: "user", }); // Update form when initial user type is determined useEffect(() => { if (initialUserType !== null && auth.data?.clientPrincipal?.userDetails) { - const userValue = initialUserType === "currentUser" - ? { - label: "Current User", - value: auth.data.clientPrincipal.userDetails, - } - : { - label: "All Users", - value: "allUsers" - }; - + const userValue = + initialUserType === "currentUser" + ? { + label: "Current User", + value: auth.data.clientPrincipal.userDetails, + } + : { + label: "All Users", + value: "allUsers", + }; + const newFormValues = { ...cleanedSettings, user: userValue, - portalLinks: getInitialPortalLinks() + portalLinks: getInitialPortalLinks(), }; // Reset the entire form with new values @@ -136,14 +141,14 @@ const Page = () => { const newPortalLinks = getPortalLinksForUserType(); const currentPortalLinks = formcontrol.getValues("portalLinks"); - + // Only update if the portal links actually changed if (JSON.stringify(currentPortalLinks) !== JSON.stringify(newPortalLinks)) { // Reset form with updated portal links but preserve other values const currentValues = formcontrol.getValues(); formcontrol.reset({ ...currentValues, - portalLinks: newPortalLinks + portalLinks: newPortalLinks, }); } } @@ -169,7 +174,7 @@ const Page = () => { { value: "100", label: "100" }, { value: "250", label: "250" }, ]; - + const languageListOptions = countryList.map((language) => { return { value: language.Code, label: language.Name }; }); @@ -294,6 +299,16 @@ const Page = () => { /> ), }, + { + label: "Save last used table filter", + value: ( + + ), + }, ]} /> @@ -312,7 +327,10 @@ const Page = () => { showDivider={false} /> - + Date: Wed, 3 Sep 2025 21:06:51 +0200 Subject: [PATCH 42/86] Fix: also send ID to backend as backup if the user is a guest --- .../CippComponents/CippExchangeActions.jsx | 70 +++++++++---------- .../CippComponents/CippUserActions.jsx | 2 +- .../identity/reports/mfa-report/index.js | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/components/CippComponents/CippExchangeActions.jsx b/src/components/CippComponents/CippExchangeActions.jsx index 1f7a5cf402d6..1a4be9744d55 100644 --- a/src/components/CippComponents/CippExchangeActions.jsx +++ b/src/components/CippComponents/CippExchangeActions.jsx @@ -22,21 +22,24 @@ import { useMemo } from "react"; export const CippExchangeActions = () => { const tenant = useSettings().currentTenant; - + // API configuration for all user selection fields - const userApiConfig = useMemo(() => ({ - url: "/api/ListGraphRequest", - dataKey: "Results", - labelField: (option) => `${option.displayName} (${option.userPrincipalName})`, - valueField: "userPrincipalName", - queryKey: `users-${tenant}`, - data: { - Endpoint: "users", - tenantFilter: tenant, - $select: "id,displayName,userPrincipalName,mail", - $top: 999, - }, - }), [tenant]); + const userApiConfig = useMemo( + () => ({ + url: "/api/ListGraphRequest", + dataKey: "Results", + labelField: (option) => `${option.displayName} (${option.userPrincipalName})`, + valueField: "userPrincipalName", + queryKey: `users-${tenant}`, + data: { + Endpoint: "users", + tenantFilter: tenant, + $select: "id,displayName,userPrincipalName,mail", + $top: 999, + }, + }), + [tenant] + ); return [ { @@ -49,8 +52,7 @@ export const CippExchangeActions = () => { }, confirmText: "Add the specified permissions to selected mailboxes?", multiPost: false, - data: { - }, + data: {}, fields: [ { type: "autoComplete", @@ -85,19 +87,18 @@ export const CippExchangeActions = () => { }, ], customDataformatter: (rows, action, formData) => { - const mailboxArray = Array.isArray(rows) ? rows : [rows]; - + // Create bulk request array - one object per mailbox - const bulkRequestData = mailboxArray.map(mailbox => { + const bulkRequestData = mailboxArray.map((mailbox) => { const permissions = []; const autoMap = formData.autoMap === undefined ? true : formData.autoMap; // Add type: "user" to match format const addTypeToUsers = (users) => { - return users.map(user => ({ + return users.map((user) => ({ ...user, - type: "user" + type: "user", })); }; @@ -111,11 +112,11 @@ export const CippExchangeActions = () => { }); } - // Handle SendAs - formData.sendAsUser is an array since multiple: true + // Handle SendAs - formData.sendAsUser is an array since multiple: true if (formData.sendAsUser && formData.sendAsUser.length > 0) { permissions.push({ UserID: addTypeToUsers(formData.sendAsUser), - PermissionLevel: "SendAs", + PermissionLevel: "SendAs", Modification: "Add", }); } @@ -125,7 +126,7 @@ export const CippExchangeActions = () => { permissions.push({ UserID: addTypeToUsers(formData.sendOnBehalfUser), PermissionLevel: "SendOnBehalf", - Modification: "Add", + Modification: "Add", }); } @@ -134,10 +135,10 @@ export const CippExchangeActions = () => { permissions: permissions, }; }); - - return { + + return { mailboxRequests: bulkRequestData, - tenantFilter: tenant + tenantFilter: tenant, }; }, color: "primary", @@ -226,19 +227,18 @@ export const CippExchangeActions = () => { ], customDataformatter: (rows, action, formData) => { const mailboxArray = Array.isArray(rows) ? rows : [rows]; - + // Extract mailbox identities - using UPN as the identifier - const mailboxes = mailboxArray.map(mailbox => mailbox.UPN); - + const mailboxes = mailboxArray.map((mailbox) => mailbox.UPN); + // Handle autocomplete selection - could be string or object - const policyName = typeof formData.policyName === 'object' - ? formData.policyName.value - : formData.policyName; - + const policyName = + typeof formData.policyName === "object" ? formData.policyName.value : formData.policyName; + return { PolicyName: policyName, Mailboxes: mailboxes, - tenantFilter: tenant + tenantFilter: tenant, }; }, color: "primary", diff --git a/src/components/CippComponents/CippUserActions.jsx b/src/components/CippComponents/CippUserActions.jsx index 40e53ff24ea9..e90b89fba2a6 100644 --- a/src/components/CippComponents/CippUserActions.jsx +++ b/src/components/CippComponents/CippUserActions.jsx @@ -115,7 +115,7 @@ export const CippUserActions = () => { type: "POST", icon: , url: "/api/ExecPerUserMFA", - data: { userId: "userPrincipalName", tenantFilter: "Tenant" }, + data: { userId: "id", userPrincipalName: "userPrincipalName" }, fields: [ { type: "autoComplete", diff --git a/src/pages/identity/reports/mfa-report/index.js b/src/pages/identity/reports/mfa-report/index.js index 206e8337e2ef..b29cacdb046f 100644 --- a/src/pages/identity/reports/mfa-report/index.js +++ b/src/pages/identity/reports/mfa-report/index.js @@ -52,7 +52,7 @@ const Page = () => { type: "POST", icon: , url: "/api/ExecPerUserMFA", - data: { userId: "UPN" }, + data: { userId: "ID", userPrincipalName: "UPN" }, fields: [ { type: "autoComplete", From 510ee5f48f211ddd85485639da0c531187203cfe Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 4 Sep 2025 12:29:58 -0400 Subject: [PATCH 43/86] allow for displaying pre-translated licenses --- src/utils/get-cipp-license-translation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/get-cipp-license-translation.js b/src/utils/get-cipp-license-translation.js index 8ab4f402c980..4a85312eb95b 100644 --- a/src/utils/get-cipp-license-translation.js +++ b/src/utils/get-cipp-license-translation.js @@ -6,6 +6,10 @@ export const getCippLicenseTranslation = (licenseArray) => { const M365Licenses = [...M365LicensesDefault, ...M365LicensesAdditional]; let licenses = []; + if (Array.isArray(licenseArray) && typeof licenseArray[0] === "string") { + return licenseArray; + } + if (!Array.isArray(licenseArray) && typeof licenseArray === "object") { licenseArray = [licenseArray]; } From 10476c6e8c1df1e8dbb7a8904280c01bf6c429ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Thu, 4 Sep 2025 18:45:04 +0200 Subject: [PATCH 44/86] Fix: update default usage location handling in user forms Rephrase setting label to better reflect change --- src/components/CippFormPages/CippAddEditUser.jsx | 2 +- src/pages/cipp/preferences.js | 2 +- src/pages/identity/administration/users/user/edit.jsx | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/CippFormPages/CippAddEditUser.jsx b/src/components/CippFormPages/CippAddEditUser.jsx index 6749d78ff445..fbe3f7537b30 100644 --- a/src/components/CippFormPages/CippAddEditUser.jsx +++ b/src/components/CippFormPages/CippAddEditUser.jsx @@ -164,7 +164,7 @@ const CippAddEditUser = (props) => { label="Usage Location" name="usageLocation" multiple={false} - defaultValue="US" + defaultValue={userSettingsDefaults?.usageLocation || "US"} options={countryList.map(({ Code, Name }) => ({ label: Name, value: Code, diff --git a/src/pages/cipp/preferences.js b/src/pages/cipp/preferences.js index fdc8bc94fd36..011acfb4c724 100644 --- a/src/pages/cipp/preferences.js +++ b/src/pages/cipp/preferences.js @@ -254,7 +254,7 @@ const Page = () => { title="General Settings" propertyItems={[ { - label: "Default new user usage location", + label: "Default usage location for users", value: ( { defaultAttributes[attribute.label] = { Value: user?.[attribute.label] }; }); } + + // Use fallback for usageLocation if user's usageLocation is null/undefined + const usageLocation = user?.usageLocation || userSettingsDefaults?.usageLocation || null; + formControl.reset({ ...user, + usageLocation: usageLocation, defaultAttributes: defaultAttributes, tenantFilter: userSettingsDefaults.currentTenant, licenses: user.assignedLicenses.map((license) => ({ @@ -104,7 +109,8 @@ const Page = () => { > {userRequest.isSuccess && userRequest.data?.[0]?.onPremisesSyncEnabled && ( - This user is synced from on-premises Active Directory. Changes should be made in the on-premises environment instead. + This user is synced from on-premises Active Directory. Changes should be made in the + on-premises environment instead. )} Date: Thu, 4 Sep 2025 22:13:58 -0400 Subject: [PATCH 45/86] fix query key --- .../gdap-management/relationships/relationship/mappings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tenant/gdap-management/relationships/relationship/mappings.js b/src/pages/tenant/gdap-management/relationships/relationship/mappings.js index b026e502e202..229637399653 100644 --- a/src/pages/tenant/gdap-management/relationships/relationship/mappings.js +++ b/src/pages/tenant/gdap-management/relationships/relationship/mappings.js @@ -56,9 +56,9 @@ const Page = () => { url: `/api/ListGDAPAccessAssignments`, data: { id }, dataKey: "Results", - queryKey: `AccessAssignments-${id}`, }} simpleColumns={["group.displayName", "status", "createdDateTime", "roles", "members"]} + queryKey={`AccessAssignments-${id}`} maxHeightOffset="550px" /> )} From 1a6b6da50d4570980f7c41bcf9542b2a91547e7f Mon Sep 17 00:00:00 2001 From: Zacgoose <107489668+Zacgoose@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:23:45 +0800 Subject: [PATCH 46/86] Add SPO portal link to default shown links of tenant overview page --- src/pages/tenant/administration/tenants/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/tenant/administration/tenants/index.js b/src/pages/tenant/administration/tenants/index.js index 6458468d9b26..f3688b658de0 100644 --- a/src/pages/tenant/administration/tenants/index.js +++ b/src/pages/tenant/administration/tenants/index.js @@ -13,6 +13,7 @@ const Page = () => { "portal_m365", "portal_exchange", "portal_entra", + "portal_sharepoint", "portal_teams", "portal_azure", "portal_intune", From 8fa1e17eee627fcfa9597ca3282d9a3660fa142b Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 5 Sep 2025 14:43:12 -0400 Subject: [PATCH 47/86] enable email outside org on dynamic and distribution --- src/components/CippFormPages/CippAddGroupTemplateForm.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx index 7f52b810b81c..5dbed2e89aa4 100644 --- a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx +++ b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx @@ -69,8 +69,8 @@ const CippAddGroupTemplateForm = (props) => { Date: Fri, 5 Sep 2025 15:04:46 -0400 Subject: [PATCH 48/86] add allow external support on dynamic distro --- src/components/CippFormPages/CippAddGroupForm.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CippFormPages/CippAddGroupForm.jsx b/src/components/CippFormPages/CippAddGroupForm.jsx index 8918adc90999..88d02af900ab 100644 --- a/src/components/CippFormPages/CippAddGroupForm.jsx +++ b/src/components/CippFormPages/CippAddGroupForm.jsx @@ -103,8 +103,8 @@ const CippAddGroupForm = (props) => { Date: Mon, 8 Sep 2025 11:51:43 +0200 Subject: [PATCH 49/86] return old license and CLA files for pretty tabs on github pages --- CLA.md | 83 +++++ CONTRIBUTING.md | 47 +++ LICENSE.CustomLicenses.md | 14 + LICENSE.md | 661 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 805 insertions(+) create mode 100644 CLA.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.CustomLicenses.md create mode 100644 LICENSE.md diff --git a/CLA.md b/CLA.md new file mode 100644 index 000000000000..1f94b337f7bf --- /dev/null +++ b/CLA.md @@ -0,0 +1,83 @@ +# Contributor License Agreement (CLA) + +This Contributor License Agreement ("Agreement") is entered into by the individual or entity ("You") submitting a Contribution to this project. By submitting a Contribution, You agree to the following terms and conditions: + +--- + +## 1. Definitions + +1. **"Contribution"** means any original work of authorship, including modifications or additions to existing works, submitted in any form (including source code, object code, documentation, or other materials) to this repository. +2. **"CyberDrain"** means the maintainers, owners, or legal rights holders of this repository, including successors and assigns. +3. **"Project License"** refers to the **GNU Affero General Public License, version 3 (AGPL-3.0)** under which this project is distributed, unless CyberDrain elects to relicense under a custom license. + +--- + +## 2. Copyright Assignment + +You hereby assign to CyberDrain, effective on submission of any Contribution, **all right, title, and interest worldwide in and to the copyright** of Your Contributions. + +This assignment includes, without limitation, the exclusive rights to: + +* Reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Contributions in any medium, and +* Relicense the Contributions under the AGPL-3.0 license, any future versions of that license, or under custom/commercial licenses as CyberDrain deems appropriate. + +To the extent that applicable law prohibits the assignment of certain moral rights or similar rights, You hereby irrevocably waive those rights to the maximum extent permitted by law. + +--- + +## 3. Patent Grant + +You hereby grant to CyberDrain, its successors, assigns, and licensees a **perpetual, worldwide, non-exclusive, transferable, irrevocable, royalty-free, fully paid-up license** under any patents that You own or control, to make, have made, use, offer to sell, sell, import, and otherwise transfer Your Contributions. + +This patent license extends only to the combination of Your Contributions with the Project to which they were submitted. + +--- + +## 4. License Grant Back to You + +CyberDrain hereby grants You a non-exclusive, worldwide, royalty-free, irrevocable license to use, reproduce, and prepare derivative works of Your Contributions for any purpose, **provided such use does not conflict with the licensing terms applied by CyberDrain** (including AGPL-3.0 or custom licenses). + +--- + +## 5. Representations and Warranties + +By submitting a Contribution, You represent and warrant that: + +1. The Contribution is Your original creation, or You have sufficient rights to submit it. +2. The Contribution does not knowingly violate or infringe any third-party intellectual property rights. +3. You are legally entitled to assign copyright and grant the licenses described herein. +4. The Contribution is submitted free of any encumbrances, liens, or claims by any third party. + +--- + +## 6. Custom Licensing + +CyberDrain reserves the right to distribute the Project, including Your Contributions, under: + +* The **AGPL-3.0 license**, and/or +* **Custom or commercial licenses**, including licenses granted to sponsors via GitHub Sponsorships. + +Contributors acknowledge and agree that: + +* Their Contributions may be included under such custom licenses. +* No royalties, fees, or other compensation shall be due to Contributors in connection with such relicensing. + +--- + +## 7. Disclaimer of Warranty + +Except as expressly stated in this Agreement, You provide Contributions **“AS IS”**, without warranties or conditions of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement. + +--- + +## 8. Limitation of Liability + +In no event shall You be liable for any direct, indirect, incidental, special, exemplary, or consequential damages arising out of or in connection with Your Contributions, even if advised of the possibility of such damages. + +--- + +## 9. Acceptance + +By submitting a Contribution to this repository, You acknowledge that You have read and understood this Agreement, and that You agree to be legally bound by its terms. + +No signature is required — **submission of a Contribution constitutes acceptance**. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000000..219f861658e2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,47 @@ +# Contributing to This Project + +First of all – thank you for considering contributing! 🎉 Contributions help improve this project for everyone, and we welcome issues, discussions, and pull requests. + +Please read through this document before contributing. + +--- + +## Contributor License Agreement (CLA) + +By contributing to this repository, you agree to the terms of our **Contributor License Agreement (CLA):** + +* **Copyright Transfer**: All contributions (commits, pull requests, issues, or code reviews) are automatically assigned to **CyberDrain**. +* Contributors give up ownership rights of their contributions and transfer them fully to CyberDrain. +* CyberDrain may use, modify, distribute, sublicense, or relicense the contributions under any terms it deems fit, including custom or commercial licenses. +* **You do not need to sign anything** – the act of contributing implies agreement with this CLA. + +--- + +## Custom Licenses + +This project is generally open source, but we also provide **custom licensing options**: + +* Custom licenses are available **upon agreement**. +* Sponsors who arrange a custom license are **not required** to publish their license terms in this repository. +* Since copyright of contributions is transferred to CyberDrain, CyberDrain has full authority to include contributions under such custom licensing terms. + + +--- + +## How to Contribute + +As this project is ever evolving, we recommend checking out the contributions docs on our doc page here: + +- https://docs.cipp.app/dev-documentation/contributing-to-the-code +- https://docs.cipp.app/dev-documentation/cipp-dev-guide +- https://docs.cipp.app/dev-documentation/contributing-to-the-documentation + +--- + +## Code of Conduct + +We expect all contributors to follow respectful, inclusive, and collaborative practices. +Please help keep this project a safe and welcoming place for everyone. + +👉 By contributing to this repository, you acknowledge that your contributions are automatically and irrevocably transferred in copyright to **CyberDrain**, and that they are covered by the CLA described above. + diff --git a/LICENSE.CustomLicenses.md b/LICENSE.CustomLicenses.md new file mode 100644 index 000000000000..2c8ebfbe3dea --- /dev/null +++ b/LICENSE.CustomLicenses.md @@ -0,0 +1,14 @@ +1. Availability of Custom Licenses +Custom licenses are available to sponsors via GitHub Sponsorships. Upon mutual agreement between the project maintainers and the sponsor, such licenses shall apply to the sponsored party. + +2. Publication Exemption +Custom licenses granted through GitHub Sponsorships are exempt from publication in this repository. Sponsors and maintainers may keep such agreements private. + +3. Contributor License Agreement (CLA) +By contributing to this repository in any form (including but not limited to commits, pull requests, and code reviews), contributors explicitly agree to the terms of this Contributor License Agreement. + +4. Coverage of Contributions +Any and all commits made to this repository are automatically considered covered under this CLA. Contributors retain copyright to their individual contributions, while granting the maintainers the necessary rights to use, modify, distribute, and sublicense such contributions in accordance with the terms of the project. + +5. Automatic Acceptance +All contributors to this repository, by the act of contribution, automatically and irrevocably agree to the provisions of this CLA and the terms herein. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000000..29ebfa545f55 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file From 485a3730cba692604644a1651a4ae28ea61cfcab Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 8 Sep 2025 14:37:03 +0200 Subject: [PATCH 50/86] move actions out of code --- .../tenant/standards/manage-drift/compare.js | 46 +++------------- .../manage-drift/driftManagementActions.js | 55 +++++++++++++++++++ .../tenant/standards/manage-drift/history.js | 44 ++------------- .../tenant/standards/manage-drift/index.js | 52 ++++-------------- .../manage-drift/policies-deployed.js | 48 +++------------- .../manage-drift/recover-policies.js | 47 +++------------- 6 files changed, 94 insertions(+), 198 deletions(-) create mode 100644 src/pages/tenant/standards/manage-drift/driftManagementActions.js diff --git a/src/pages/tenant/standards/manage-drift/compare.js b/src/pages/tenant/standards/manage-drift/compare.js index 8ddc70251193..6145783049a8 100644 --- a/src/pages/tenant/standards/manage-drift/compare.js +++ b/src/pages/tenant/standards/manage-drift/compare.js @@ -22,12 +22,10 @@ import { Cancel, Info, Microsoft, - Sync, FilterAlt, Close, Search, FactCheck, - PlayArrow, } from "@mui/icons-material"; import { ArrowLeftIcon } from "@mui/x-date-pickers"; import standards from "/src/data/standards.json"; @@ -43,6 +41,7 @@ import DOMPurify from "dompurify"; import { ClockIcon } from "@heroicons/react/24/outline"; import ReactMarkdown from "react-markdown"; import tabOptions from "./tabOptions.json"; +import { createDriftManagementActions } from "./driftManagementActions"; const Page = () => { const router = useRouter(); @@ -543,44 +542,13 @@ const Page = () => { ]; // Actions for the header - const actions = [ - { - label: "Refresh Data", - icon: , - noConfirm: true, - customFunction: () => { - comparisonApi.refetch(); - templateDetails.refetch(); - }, + const actions = createDriftManagementActions({ + templateId, + onRefresh: () => { + comparisonApi.refetch(); + templateDetails.refetch(); }, - ...(templateId - ? [ - { - label: "Run Standard Now (Currently Selected Tenant only)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - { - label: "Run Standard Now (All Tenants in Template)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - tenantFilter: "allTenants", - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - ] - : []), - ]; + }); return ( { + const actions = [ + { + label: "Refresh Data", + icon: , + noConfirm: true, + customFunction: onRefresh, + }, + ]; + + // Add template-specific actions if templateId is available + if (templateId) { + actions.push( + { + label: "Run Standard Now (Currently Selected Tenant only)", + type: "GET", + url: "/api/ExecStandardsRun", + icon: , + data: { + TemplateId: templateId, + }, + confirmText: "Are you sure you want to force a run of this standard?", + multiPost: false, + }, + { + label: "Run Standard Now (All Tenants in Template)", + type: "GET", + url: "/api/ExecStandardsRun", + icon: , + data: { + TemplateId: templateId, + tenantFilter: "allTenants", + }, + confirmText: "Are you sure you want to force a run of this standard?", + multiPost: false, + } + ); + } + + return actions; +}; + +/** + * Default export for backward compatibility + */ +export default createDriftManagementActions; \ No newline at end of file diff --git a/src/pages/tenant/standards/manage-drift/history.js b/src/pages/tenant/standards/manage-drift/history.js index d7729022430b..f003d50c3107 100644 --- a/src/pages/tenant/standards/manage-drift/history.js +++ b/src/pages/tenant/standards/manage-drift/history.js @@ -26,8 +26,6 @@ import { ApiGetCall } from "/src/api/ApiCall"; import { useRouter } from "next/router"; import { Policy, - Sync, - PlayArrow, Error as ErrorIcon, Warning as WarningIcon, Info as InfoIcon, @@ -36,6 +34,7 @@ import { } from "@mui/icons-material"; import tabOptions from "./tabOptions.json"; import { useSettings } from "../../../../hooks/use-settings"; +import { createDriftManagementActions } from "./driftManagementActions"; const Page = () => { const router = useRouter(); @@ -126,43 +125,12 @@ const Page = () => { }; // Actions for the ActionsMenu - const actions = [ - { - label: "Refresh Data", - icon: , - noConfirm: true, - customFunction: () => { - logsData.refetch(); - }, + const actions = createDriftManagementActions({ + templateId, + onRefresh: () => { + logsData.refetch(); }, - ...(templateId - ? [ - { - label: "Run Standard Now (Currently Selected Tenant only)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - { - label: "Run Standard Now (All Tenants in Template)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - tenantFilter: "allTenants", - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - ] - : []), - ]; + }); const title = "Manage Drift"; const subtitle = [ diff --git a/src/pages/tenant/standards/manage-drift/index.js b/src/pages/tenant/standards/manage-drift/index.js index 39a4f03b312a..98a139dc4215 100644 --- a/src/pages/tenant/standards/manage-drift/index.js +++ b/src/pages/tenant/standards/manage-drift/index.js @@ -5,7 +5,6 @@ import { Warning, ExpandMore, CheckCircle, - Sync, Block, Science, CheckBox, @@ -14,7 +13,6 @@ import { Error, Info, FactCheck, - PlayArrow, } from "@mui/icons-material"; import { Box, Stack, Typography, Button, Menu, MenuItem, Chip, SvgIcon } from "@mui/material"; import { Grid } from "@mui/system"; @@ -29,6 +27,7 @@ import { CippApiDialog } from "/src/components/CippComponents/CippApiDialog"; import { useDialog } from "/src/hooks/use-dialog"; import tabOptions from "./tabOptions.json"; import standardsData from "/src/data/standards.json"; +import { createDriftManagementActions } from "./driftManagementActions"; const ManageDriftPage = () => { const router = useRouter(); @@ -496,47 +495,16 @@ const ManageDriftPage = () => { }; // Actions for the ActionsMenu - const actions = [ - { - label: "Refresh Data", - icon: , - noConfirm: true, - customFunction: () => { - driftApi.refetch(); - standardsApi.refetch(); - if (templateId) { - comparisonApi.refetch(); - } - }, + const actions = createDriftManagementActions({ + templateId, + onRefresh: () => { + driftApi.refetch(); + standardsApi.refetch(); + if (templateId) { + comparisonApi.refetch(); + } }, - ...(templateId - ? [ - { - label: "Run Standard Now (Currently Selected Tenant only)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - { - label: "Run Standard Now (All Tenants in Template)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - tenantFilter: "allTenants", - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - ] - : []), - ]; + }); // Add action buttons to each deviation item const deviationItemsWithActions = deviationItems.map((item) => { diff --git a/src/pages/tenant/standards/manage-drift/policies-deployed.js b/src/pages/tenant/standards/manage-drift/policies-deployed.js index 909b19a733f4..cf7c8dca75b0 100644 --- a/src/pages/tenant/standards/manage-drift/policies-deployed.js +++ b/src/pages/tenant/standards/manage-drift/policies-deployed.js @@ -7,8 +7,6 @@ import { AdminPanelSettings, Devices, ExpandMore, - Sync, - PlayArrow, } from "@mui/icons-material"; import { Box, @@ -25,6 +23,7 @@ import { CippDataTable } from "/src/components/CippTable/CippDataTable"; import { CippHead } from "/src/components/CippComponents/CippHead"; import { ApiGetCall } from "/src/api/ApiCall"; import standardsData from "/src/data/standards.json"; +import { createDriftManagementActions } from "./driftManagementActions"; const PoliciesDeployedPage = () => { const userSettingsDefaults = useSettings(); @@ -233,45 +232,14 @@ const PoliciesDeployedPage = () => { }; } ); - const actions = [ - { - label: "Refresh Data", - icon: , - noConfirm: true, - customFunction: () => { - standardsApi.refetch(); - comparisonApi.refetch(); - driftApi.refetch(); - }, + const actions = createDriftManagementActions({ + templateId, + onRefresh: () => { + standardsApi.refetch(); + comparisonApi.refetch(); + driftApi.refetch(); }, - ...(templateId - ? [ - { - label: "Run Standard Now (Currently Selected Tenant only)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - { - label: "Run Standard Now (All Tenants in Template)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - tenantFilter: "allTenants", - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - ] - : []), - ]; + }); const title = "Manage Drift"; const subtitle = [ { diff --git a/src/pages/tenant/standards/manage-drift/recover-policies.js b/src/pages/tenant/standards/manage-drift/recover-policies.js index 32b2a059a474..bd44ba03f38a 100644 --- a/src/pages/tenant/standards/manage-drift/recover-policies.js +++ b/src/pages/tenant/standards/manage-drift/recover-policies.js @@ -1,7 +1,6 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { useSettings } from "/src/hooks/use-settings"; import { useRouter } from "next/router"; -import { Policy, Restore, ExpandMore, Sync, PlayArrow } from "@mui/icons-material"; +import { Policy, Restore, ExpandMore } from "@mui/icons-material"; import { Box, Stack, @@ -13,7 +12,7 @@ import { Button, } from "@mui/material"; import { Grid } from "@mui/system"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { useForm } from "react-hook-form"; import { HeaderedTabbedLayout } from "/src/layouts/HeaderedTabbedLayout"; import tabOptions from "./tabOptions.json"; @@ -22,6 +21,7 @@ import { CippHead } from "/src/components/CippComponents/CippHead"; import { CippFormComponent } from "/src/components/CippComponents/CippFormComponent"; import { ApiPostCall } from "/src/api/ApiCall"; import { CippApiResults } from "/src/components/CippComponents/CippApiResults"; +import { createDriftManagementActions } from "./driftManagementActions"; const RecoverPoliciesPage = () => { const router = useRouter(); @@ -78,43 +78,12 @@ const RecoverPoliciesPage = () => { }; // Actions for the ActionsMenu - const actions = [ - { - label: "Refresh Data", - icon: , - noConfirm: true, - customFunction: () => { - // Refresh any relevant data here - }, + const actions = createDriftManagementActions({ + templateId, + onRefresh: () => { + // Refresh any relevant data here }, - ...(templateId - ? [ - { - label: "Run Standard Now (Currently Selected Tenant only)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - { - label: "Run Standard Now (All Tenants in Template)", - type: "GET", - url: "/api/ExecStandardsRun", - icon: , - data: { - TemplateId: templateId, - tenantFilter: "allTenants", - }, - confirmText: "Are you sure you want to force a run of this standard?", - multiPost: false, - }, - ] - : []), - ]; + }); const title = "Manage Drift"; const subtitle = [ From a7320903cbe935f11f1c483b0277193870250e55 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:02:36 +0200 Subject: [PATCH 51/86] start of adding drift management to executive reports --- .../manage-drift/driftManagementActions.js | 22 +++++++-- .../tenant/standards/manage-drift/index.js | 46 ++++++++++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/pages/tenant/standards/manage-drift/driftManagementActions.js b/src/pages/tenant/standards/manage-drift/driftManagementActions.js index 94329350bb38..e193e7bb6463 100644 --- a/src/pages/tenant/standards/manage-drift/driftManagementActions.js +++ b/src/pages/tenant/standards/manage-drift/driftManagementActions.js @@ -1,13 +1,19 @@ -import { Sync, PlayArrow } from "@mui/icons-material"; +import React from "react"; +import { Sync, PlayArrow, PictureAsPdf } from "@mui/icons-material"; /** * Creates the standard drift management actions array * @param {Object} options - Configuration options * @param {string} options.templateId - The template ID for conditional actions * @param {Function} options.onRefresh - Function to call when refresh is triggered + * @param {Function} options.onGenerateReport - Function to call when generate report is triggered (optional) * @returns {Array} Array of action objects */ -export const createDriftManagementActions = ({ templateId, onRefresh }) => { +export const createDriftManagementActions = ({ + templateId, + onRefresh, + onGenerateReport, +}) => { const actions = [ { label: "Refresh Data", @@ -17,6 +23,16 @@ export const createDriftManagementActions = ({ templateId, onRefresh }) => { }, ]; + // Add Generate Report action if handler is provided + if (onGenerateReport) { + actions.push({ + label: "Generate Report", + icon: , + noConfirm: true, + customFunction: onGenerateReport, + }); + } + // Add template-specific actions if templateId is available if (templateId) { actions.push( @@ -52,4 +68,4 @@ export const createDriftManagementActions = ({ templateId, onRefresh }) => { /** * Default export for backward compatibility */ -export default createDriftManagementActions; \ No newline at end of file +export default createDriftManagementActions; diff --git a/src/pages/tenant/standards/manage-drift/index.js b/src/pages/tenant/standards/manage-drift/index.js index 98a139dc4215..f890e2f7c936 100644 --- a/src/pages/tenant/standards/manage-drift/index.js +++ b/src/pages/tenant/standards/manage-drift/index.js @@ -6,7 +6,6 @@ import { ExpandMore, CheckCircle, Block, - Science, CheckBox, Cancel, Policy, @@ -16,7 +15,7 @@ import { } from "@mui/icons-material"; import { Box, Stack, Typography, Button, Menu, MenuItem, Chip, SvgIcon } from "@mui/material"; import { Grid } from "@mui/system"; -import { useState } from "react"; +import { useState, useEffect, useRef } from "react"; import { CippChartCard } from "/src/components/CippCards/CippChartCard"; import { CippBannerListCard } from "/src/components/CippCards/CippBannerListCard"; import { CippHead } from "/src/components/CippComponents/CippHead"; @@ -28,6 +27,7 @@ import { useDialog } from "/src/hooks/use-dialog"; import tabOptions from "./tabOptions.json"; import standardsData from "/src/data/standards.json"; import { createDriftManagementActions } from "./driftManagementActions"; +import { ExecutiveReportButton } from "/src/components/ExecutiveReportButton"; const ManageDriftPage = () => { const router = useRouter(); @@ -38,6 +38,8 @@ const ManageDriftPage = () => { const [bulkActionsAnchorEl, setBulkActionsAnchorEl] = useState(null); const createDialog = useDialog(); const [actionData, setActionData] = useState({ data: {}, ready: false }); + const [triggerReport, setTriggerReport] = useState(false); + const reportButtonRef = useRef(null); // API calls for drift data const driftApi = ApiGetCall({ @@ -494,6 +496,17 @@ const ManageDriftPage = () => { setBulkActionsAnchorEl(null); }; + // Get current tenant info for report generation + const currentTenantInfo = ApiGetCall({ + url: "/api/ListTenants", + queryKey: "ListTenants", + }); + + // Find current tenant data + const currentTenantData = currentTenantInfo.data?.find( + (tenant) => tenant.defaultDomainName === tenantFilter + ); + // Actions for the ActionsMenu const actions = createDriftManagementActions({ templateId, @@ -504,8 +517,20 @@ const ManageDriftPage = () => { comparisonApi.refetch(); } }, + onGenerateReport: () => { + setTriggerReport(true); + }, }); + // Effect to trigger the ExecutiveReportButton when needed + useEffect(() => { + if (triggerReport && reportButtonRef.current) { + // Trigger the button click to open the dialog + reportButtonRef.current.click(); + setTriggerReport(false); + } + }, [triggerReport]); + // Add action buttons to each deviation item const deviationItemsWithActions = deviationItems.map((item) => { // Check if this is a template that supports delete action @@ -927,6 +952,23 @@ const ManageDriftPage = () => { relatedQueryKeys={[`TenantDrift-${tenantFilter}`]} /> )} + + {/* Hidden ExecutiveReportButton that gets triggered programmatically */} + + + ); }; From 74251c9b39774312dbcd2ff3819cef0a07f72d15 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:24:52 +0200 Subject: [PATCH 52/86] fix eo error --- src/components/ExecutiveReportButton.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ExecutiveReportButton.js b/src/components/ExecutiveReportButton.js index a92e1d950174..7469e8b38a07 100644 --- a/src/components/ExecutiveReportButton.js +++ b/src/components/ExecutiveReportButton.js @@ -2330,6 +2330,7 @@ export const ExecutiveReportButton = (props) => { ) : reportDocument ? ( Date: Mon, 8 Sep 2025 16:19:17 +0200 Subject: [PATCH 53/86] Feat: enhance form validation Feat: Update default values in CippAutopilotStatusPageDrawer Feat:Add windows updates option Fix: Remove invalid Allowretry value --- .../CippAutopilotStatusPageDrawer.jsx | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/CippComponents/CippAutopilotStatusPageDrawer.jsx b/src/components/CippComponents/CippAutopilotStatusPageDrawer.jsx index f8c254fcf198..3f0739ec4874 100644 --- a/src/components/CippComponents/CippAutopilotStatusPageDrawer.jsx +++ b/src/components/CippComponents/CippAutopilotStatusPageDrawer.jsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Divider, Button } from "@mui/material"; import { Grid } from "@mui/system"; -import { useForm } from "react-hook-form"; +import { useForm, useFormState } from "react-hook-form"; import { PostAdd } from "@mui/icons-material"; import { CippOffCanvas } from "./CippOffCanvas"; import CippFormComponent from "./CippFormComponent"; @@ -20,16 +20,19 @@ export const CippAutopilotStatusPageDrawer = ({ defaultValues: { TimeOutInMinutes: "", ErrorMessage: "", - ShowProgress: false, - EnableLog: false, + ShowProgress: true, + EnableLog: true, OBEEOnly: false, - blockDevice: false, - Allowretry: false, - AllowReset: false, + blockDevice: true, + AllowReset: true, AllowFail: false, + InstallWindowsUpdates: true, }, }); + // Get form state for validation + const { isValid } = useFormState({ control: formControl.control }); + const createStatusPage = ApiPostCall({ urlFromData: true, relatedQueryKeys: ["Autopilot Status Pages"], @@ -69,7 +72,7 @@ export const CippAutopilotStatusPageDrawer = ({ variant="contained" color="primary" onClick={handleSubmit} - disabled={createStatusPage.isLoading} + disabled={!isValid || createStatusPage.isLoading} > {createStatusPage.isLoading ? "Creating..." @@ -145,14 +148,14 @@ export const CippAutopilotStatusPageDrawer = ({ /> ); -}; \ No newline at end of file +}; From 26748abdc78825b07c91a623ef89c37273de884c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Mon, 8 Sep 2025 16:39:39 +0200 Subject: [PATCH 54/86] fix: update switch names and labels in AutopilotStatusPage settings --- src/data/standards.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/standards.json b/src/data/standards.json index 028e595eee0c..fa3ed48854c9 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -4437,14 +4437,14 @@ }, { "type": "switch", - "name": "standards.AutopilotStatusPage.BlockDevice", - "label": "Block device usage during setup", + "name": "standards.AutopilotStatusPage.InstallWindowsUpdates", + "label": "Install Windows Updates during setup", "defaultValue": true }, { "type": "switch", - "name": "standards.AutopilotStatusPage.AllowRetry", - "label": "Allow retry", + "name": "standards.AutopilotStatusPage.BlockDevice", + "label": "Block device usage during setup", "defaultValue": true }, { From daa94e987dda543fc6356b406ddcb19310d822c5 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:28:23 +0200 Subject: [PATCH 55/86] remove unused import --- src/pages/tenant/standards/manage-drift/compare.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/tenant/standards/manage-drift/compare.js b/src/pages/tenant/standards/manage-drift/compare.js index 6145783049a8..2b08790b8c02 100644 --- a/src/pages/tenant/standards/manage-drift/compare.js +++ b/src/pages/tenant/standards/manage-drift/compare.js @@ -27,7 +27,6 @@ import { Search, FactCheck, } from "@mui/icons-material"; -import { ArrowLeftIcon } from "@mui/x-date-pickers"; import standards from "/src/data/standards.json"; import { CippApiDialog } from "../../../../components/CippComponents/CippApiDialog"; import { SvgIcon } from "@mui/material"; From b6ec7bd41820d00129a34780b70f391aa4ee5bb0 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 8 Sep 2025 14:11:47 -0400 Subject: [PATCH 56/86] Update Extensions.json --- src/data/Extensions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/Extensions.json b/src/data/Extensions.json index 0b56cc72dfde..f778868c163b 100644 --- a/src/data/Extensions.json +++ b/src/data/Extensions.json @@ -29,8 +29,8 @@ "mappingRequired": true, "links": [ { - "name": "Sherweb Cloud Services for MSPs", - "url": "https://info.sherweb.com/sherweb-cloud-services-for-msps" + "name": "Sherweb CIPP Integration", + "url": "https://info.sherweb.com/sherweb-cipp-integration" } ], "SettingOptions": [ From 0f0a49702e26a5ffb3c58d51689f16b83ae54620 Mon Sep 17 00:00:00 2001 From: AS NetSec <230309695+AS-NetSec@users.noreply.github.com> Date: Mon, 8 Sep 2025 23:31:29 +0200 Subject: [PATCH 57/86] Update to UK spelling Signed-off-by: AS NetSec <230309695+AS-NetSec@users.noreply.github.com> --- .../reports/list-csp-licenses/index.jsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/tenant/reports/list-csp-licenses/index.jsx b/src/pages/tenant/reports/list-csp-licenses/index.jsx index b046b6ea275c..e23c22114264 100644 --- a/src/pages/tenant/reports/list-csp-licenses/index.jsx +++ b/src/pages/tenant/reports/list-csp-licenses/index.jsx @@ -6,30 +6,30 @@ import { Button } from "@mui/material"; import Link from "next/link"; const Page = () => { - const pageTitle = "CSP Licenses Report"; + const pageTitle = "CSP Licences Report"; const apiUrl = "/api/listCSPLicenses"; const actions = [ { - label: "Increase license count by 1", + label: "Increase licence count by 1", type: "POST", icon: , url: "/api/ExecCSPLicense", data: { Action: "!Add", sku: "sku", add: 1 }, - confirmText: "Are you sure you want to buy 1 extra license?", + confirmText: "Are you sure you want to buy 1 extra licence?", multiPost: false, }, { - label: "Decrease license count by 1", + label: "Decrease licence count by 1", type: "POST", icon: , url: "/api/ExecCSPLicense", data: { Action: "!Remove", sku: "sku", Remove: 1 }, - confirmText: "Are you sure you want to decrease the license count by 1?", + confirmText: "Are you sure you want to decrease the licence count by 1?", multiPost: false, }, { - label: "Increase license count", + label: "Increase licence count", type: "POST", icon: , url: "/api/ExecCSPLicense", @@ -38,15 +38,15 @@ const Page = () => { { type: "textField", name: "add", - label: "The number of licenses to add", + label: "The number of licences to add", multiple: false, }, ], - confirmText: "Enter the amount of licenses to buy, and press confirm.", + confirmText: "Enter the amount of licences to buy, and press confirm.", multiPost: false, }, { - label: "Decrease license count", + label: "Decrease licence count", type: "POST", icon: , url: "/api/ExecCSPLicense", @@ -59,7 +59,7 @@ const Page = () => { }, ], data: { Action: "!Remove", sku: "sku" }, - confirmText: "Enter the number of licenses to remove. This must be a number greater than 0.", + confirmText: "Enter the number of licences to remove. This must be a number greater than 0.", multiPost: false, }, { From 47c0a38401f2254ccc3bc46ebd2ef75d17a68c05 Mon Sep 17 00:00:00 2001 From: AS NetSec <230309695+AS-NetSec@users.noreply.github.com> Date: Mon, 8 Sep 2025 23:32:02 +0200 Subject: [PATCH 58/86] Update to UK spelling Signed-off-by: AS NetSec <230309695+AS-NetSec@users.noreply.github.com> --- src/pages/tenant/reports/list-licenses/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/tenant/reports/list-licenses/index.js b/src/pages/tenant/reports/list-licenses/index.js index 417e1ef16910..f8fbd3b0a803 100644 --- a/src/pages/tenant/reports/list-licenses/index.js +++ b/src/pages/tenant/reports/list-licenses/index.js @@ -2,7 +2,7 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; const Page = () => { - const pageTitle = "Licenses Report"; + const pageTitle = "Licences Report"; const apiUrl = "/api/ListLicenses"; const simpleColumns = [ From 3d7a28aa2cc53dd94d84db4439d0f9430fb77c68 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 8 Sep 2025 18:08:10 -0400 Subject: [PATCH 59/86] chore: refactor groups/group templates --- .../CippFormPages/CippAddGroupForm.jsx | 4 +- .../CippAddGroupTemplateForm.jsx | 4 +- .../CippWizard/CippWizardGroupTemplates.jsx | 52 ++++++++----------- .../administration/group-templates/edit.jsx | 42 +++------------ 4 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/components/CippFormPages/CippAddGroupForm.jsx b/src/components/CippFormPages/CippAddGroupForm.jsx index 88d02af900ab..83d64df292b2 100644 --- a/src/components/CippFormPages/CippAddGroupForm.jsx +++ b/src/components/CippFormPages/CippAddGroupForm.jsx @@ -94,7 +94,7 @@ const CippAddGroupForm = (props) => { { label: "Security Group", value: "generic" }, { label: "Microsoft 365 Group", value: "m365" }, { label: "Dynamic Group", value: "dynamic" }, - { label: "Dynamic Distribution Group", value: "dynamicDistribution" }, + { label: "Dynamic Distribution Group", value: "dynamicdistribution" }, { label: "Distribution List", value: "distribution" }, { label: "Mail Enabled Security Group", value: "security" }, ]} @@ -104,7 +104,7 @@ const CippAddGroupForm = (props) => { formControl={formControl} field="groupType" compareType="isOneOf" - compareValue={["distribution", "dynamicDistribution"]} + compareValue={["distribution", "dynamicdistribution"]} > { { label: "Security Group", value: "generic" }, { label: "Microsoft 365 Group", value: "m365" }, { label: "Dynamic Group", value: "dynamic" }, - { label: "Dynamic Distribution Group", value: "dynamicdistribution" }, + { label: "Dynamic Distribution Group", value: "dynamicDistribution" }, { label: "Distribution List", value: "distribution" }, { label: "Mail Enabled Security Group", value: "security" }, ]} @@ -70,7 +70,7 @@ const CippAddGroupTemplateForm = (props) => { formControl={formControl} field="groupType" compareType="isOneOf" - compareValue={["distribution", "dynamicdistribution"]} + compareValue={["distribution", "dynamicDistribution"]} > { const watcher = useWatch({ control: formControl.control, name: "TemplateList" }); const groupOptions = [ { label: "Dynamic Group", value: "dynamic" }, - { label: "Dynamic Distribution Group", value: "dynamicdistribution" }, + { label: "Dynamic Distribution Group", value: "dynamicDistribution" }, { label: "Security Group", value: "generic" }, { label: "Distribution Group", value: "distribution" }, - { label: "Azure Role Group", value: "azurerole" }, + { label: "Azure Role Group", value: "azureRole" }, { label: "Mail Enabled Security Group", value: "security" }, ]; useEffect(() => { if (watcher?.value) { - console.log(watcher); + console.log("Loading template:", watcher); + + // Set groupType first to ensure conditional fields are visible formControl.setValue("groupType", watcher.addedFields.groupType); - formControl.setValue("Displayname", watcher.addedFields.Displayname); - formControl.setValue("Description", watcher.addedFields.Description); - formControl.setValue("username", watcher.addedFields.username); - formControl.setValue("allowExternal", watcher.addedFields.allowExternal); - formControl.setValue("membershipRules", watcher.addedFields.membershipRules); + + // Use setTimeout to ensure the DOM updates with the groupType before setting other fields + setTimeout(() => { + formControl.setValue("displayName", watcher.addedFields.displayName); + formControl.setValue("description", watcher.addedFields.description); + formControl.setValue("username", watcher.addedFields.username); + formControl.setValue("allowExternal", watcher.addedFields.allowExternal); + formControl.setValue("membershipRules", watcher.addedFields.membershipRules); + + console.log("Set membershipRules to:", watcher.addedFields.membershipRules); + }, 100); } }, [watcher]); return ( @@ -48,8 +56,8 @@ export const CippWizardGroupTemplates = (props) => { valueField: "GUID", addedField: { groupType: "groupType", - Displayname: "displayName", - Description: "description", + displayName: "displayName", + description: "description", username: "username", allowExternal: "allowExternal", membershipRules: "membershipRules", @@ -71,7 +79,7 @@ export const CippWizardGroupTemplates = (props) => { { @@ -110,24 +118,8 @@ export const CippWizardGroupTemplates = (props) => { - - - - - diff --git a/src/pages/identity/administration/group-templates/edit.jsx b/src/pages/identity/administration/group-templates/edit.jsx index 96c7572ab709..6bcf87af7c0a 100644 --- a/src/pages/identity/administration/group-templates/edit.jsx +++ b/src/pages/identity/administration/group-templates/edit.jsx @@ -28,39 +28,6 @@ const Page = () => { }); // Map groupType values to valid radio options - const mapGroupType = (type) => { - // Map of group types to the corresponding option value - const groupTypeMap = { - // Standard mappings - azurerole: "azurerole", - generic: "generic", - m365: "m365", - dynamic: "dynamic", - dynamicdistribution: "dynamicdistribution", - distribution: "distribution", - security: "security", - - // Additional mappings from possible backend values - Unified: "m365", - Security: "generic", - Distribution: "distribution", - "Mail-enabled security": "security", - "Mail Enabled Security": "security", - "Azure Role Group": "azurerole", - "Azure Active Directory Role Group": "azurerole", - "Security Group": "generic", - "Microsoft 365 Group": "m365", - "Microsoft 365 (Unified)": "m365", - "Dynamic Group": "dynamic", - DynamicMembership: "dynamic", - "Dynamic Distribution Group": "dynamicdistribution", - DynamicDistribution: "dynamicdistribution", - "Distribution List": "distribution", - }; - - // Return just the value for the radio group, not the label/value pair - return groupTypeMap[type] || "generic"; // Default to generic if no mapping exists - }; // Set form values when template data is loaded useEffect(() => { @@ -70,8 +37,13 @@ const Page = () => { // Make sure we have the necessary data before proceeding if (templateData) { formControl.reset({ - ...templateData, - groupType: mapGroupType(templateData.groupType), + GUID: templateData.GUID, + displayName: templateData.displayName, + description: templateData.description, + username: templateData.username, + groupType: templateData.groupType, + membershipRules: templateData.membershipRules, + allowExternal: templateData.allowExternal, tenantFilter: userSettingsDefaults.currentTenant, }); } From ea1760e208e56f5f3a9c4cd42f1c89a3eb32541f Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 8 Sep 2025 18:15:39 -0400 Subject: [PATCH 60/86] update helper text --- src/components/CippFormPages/CippAddGroupTemplateForm.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx index c3534e9940b1..0b668b8c2d47 100644 --- a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx +++ b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx @@ -40,7 +40,8 @@ const CippAddGroupTemplateForm = (props) => { Date: Mon, 8 Sep 2025 18:17:04 -0400 Subject: [PATCH 61/86] Update CippAddGroupTemplateForm.jsx --- src/components/CippFormPages/CippAddGroupTemplateForm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx index 0b668b8c2d47..cb331c9457dd 100644 --- a/src/components/CippFormPages/CippAddGroupTemplateForm.jsx +++ b/src/components/CippFormPages/CippAddGroupTemplateForm.jsx @@ -41,7 +41,7 @@ const CippAddGroupTemplateForm = (props) => { Date: Mon, 8 Sep 2025 18:50:03 -0400 Subject: [PATCH 62/86] fix query key --- src/pages/identity/administration/groups/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/identity/administration/groups/index.js b/src/pages/identity/administration/groups/index.js index 453b4661d4e5..f14a52e6f795 100644 --- a/src/pages/identity/administration/groups/index.js +++ b/src/pages/identity/administration/groups/index.js @@ -14,10 +14,12 @@ import { } from "@mui/icons-material"; import { Stack } from "@mui/system"; import { useState } from "react"; +import { useSettings } from "../../../../hooks/use-settings"; const Page = () => { const pageTitle = "Groups"; const [showMembers, setShowMembers] = useState(false); + const { currentTenant } = useSettings(); const handleMembersToggle = () => { setShowMembers(!showMembers); @@ -145,7 +147,11 @@ const Page = () => { } apiUrl="/api/ListGroups" apiData={{ expandMembers: showMembers }} - queryKey={showMembers ? "groups-with-members" : "groups-without-members"} + queryKey={ + showMembers + ? `groups-with-members-${currentTenant}` + : `groups-without-members-${currentTenant}` + } actions={actions} offCanvas={offCanvas} simpleColumns={[ From f3df2921e24404a376e25944f315998f07b2c1a0 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Tue, 9 Sep 2025 11:34:23 +0200 Subject: [PATCH 63/86] package upgrades --- package.json | 58 +- .../CippComponents/CippFormComponent.jsx | 1 + src/pages/_app.js | 2 +- yarn.lock | 3893 +++++++++-------- 4 files changed, 2005 insertions(+), 1949 deletions(-) diff --git a/package.json b/package.json index 437a7553b68a..f816b31d5d71 100644 --- a/package.json +++ b/package.json @@ -27,38 +27,38 @@ "@emotion/cache": "11.14.0", "@emotion/react": "11.14.0", "@emotion/server": "11.11.0", - "@emotion/styled": "11.14.0", + "@emotion/styled": "11.14.1", "@heroicons/react": "2.2.0", "@monaco-editor/react": "^4.6.0", - "@mui/icons-material": "6.4.7", - "@mui/lab": "6.0.0-beta.30", - "@mui/material": "6.4.7", - "@mui/system": "6.4.7", - "@mui/x-date-pickers": "7.27.3", + "@mui/icons-material": "7.3.2", + "@mui/lab": "7.0.0-beta.17", + "@mui/material": "7.3.2", + "@mui/system": "7.3.2", + "@mui/x-date-pickers": "^8.11.1", "@musement/iso-duration": "^1.0.0", "@react-pdf/renderer": "^4.3.0", - "@reduxjs/toolkit": "2.6.1", + "@reduxjs/toolkit": "2.9.0", "@tanstack/query-sync-storage-persister": "^5.76.0", "@tanstack/react-query": "^5.51.11", "@tanstack/react-query-devtools": "^5.51.11", "@tanstack/react-query-persist-client": "^5.76.0", "@tanstack/react-table": "^8.19.2", - "@tiptap/core": "^2.9.1", - "@tiptap/extension-heading": "^2.9.1", - "@tiptap/extension-image": "^2.9.1", - "@tiptap/extension-table": "^2.9.1", - "@tiptap/pm": "^2.9.1", - "@tiptap/react": "^2.9.1", - "@tiptap/starter-kit": "^2.9.1", + "@tiptap/core": "^3.4.1", + "@tiptap/extension-heading": "^3.4.1", + "@tiptap/extension-image": "^3.4.1", + "@tiptap/extension-table": "^3.4.1", + "@tiptap/pm": "^3.4.1", + "@tiptap/react": "^3.4.1", + "@tiptap/starter-kit": "^3.4.1", "@uiw/react-json-view": "^2.0.0-alpha.30", - "apexcharts": "4.5.0", + "apexcharts": "5.3.5", "axios": "^1.7.2", "date-fns": "4.1.0", "eml-parse-js": "^1.2.0-beta.0", "export-to-csv": "^1.3.0", "formik": "2.4.6", "gray-matter": "4.0.3", - "i18next": "24.2.3", + "i18next": "25.5.2", "javascript-time-ago": "^2.5.11", "jspdf": "^3.0.0", "jspdf-autotable": "^5.0.2", @@ -67,25 +67,25 @@ "leaflet.markercluster": "^1.5.3", "lodash.isequal": "4.5.0", "material-react-table": "^3.0.1", - "monaco-editor": "^0.52.0", + "monaco-editor": "^0.53.0", "mui-tiptap": "^1.14.0", "next": "^15.2.2", "nprogress": "0.2.0", "numeral": "2.0.6", "prop-types": "15.8.1", "punycode": "^2.3.1", - "react": "19.0.0", + "react": "19.1.1", "react-apexcharts": "1.7.0", "react-beautiful-dnd": "13.1.1", "react-copy-to-clipboard": "^5.1.0", - "react-dom": "19.0.0", + "react-dom": "19.1.1", "react-dropzone": "14.3.8", - "react-error-boundary": "^5.0.0", + "react-error-boundary": "^6.0.0", "react-grid-layout": "^1.5.0", "react-hook-form": "^7.53.0", - "react-hot-toast": "2.5.2", + "react-hot-toast": "2.6.0", "react-html-parser": "^2.0.2", - "react-i18next": "15.4.1", + "react-i18next": "15.7.3", "react-leaflet": "5.0.0", "react-leaflet-markercluster": "^5.0.0-rc.0", "react-markdown": "10.1.0", @@ -96,20 +96,20 @@ "react-syntax-highlighter": "^15.6.1", "react-time-ago": "^7.3.3", "react-virtuoso": "^4.12.8", - "react-window": "^1.8.10", + "react-window": "^2.1.0", "redux": "5.0.1", "redux-devtools-extension": "2.13.9", "redux-persist": "^6.0.0", "redux-thunk": "3.1.0", - "simplebar": "6.3.0", - "simplebar-react": "3.3.0", + "simplebar": "6.3.2", + "simplebar-react": "3.3.2", "stylis-plugin-rtl": "2.1.1", - "typescript": "5.8.2", - "yup": "1.6.1" + "typescript": "5.9.2", + "yup": "1.7.0" }, "devDependencies": { "@svgr/webpack": "8.1.0", - "eslint": "9.22.0", - "eslint-config-next": "15.2.2" + "eslint": "9.35.0", + "eslint-config-next": "15.5.2" } } diff --git a/src/components/CippComponents/CippFormComponent.jsx b/src/components/CippComponents/CippFormComponent.jsx index ca794759d40d..d56ff5417221 100644 --- a/src/components/CippComponents/CippFormComponent.jsx +++ b/src/components/CippComponents/CippFormComponent.jsx @@ -374,6 +374,7 @@ export const CippFormComponent = (props) => { {label} =3.1.1 <6", memoize-one@^5.1.1: +memoize-one@^5.1.1: version "5.2.1" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== @@ -5253,10 +5316,12 @@ minimist@^1.2.0, minimist@^1.2.6, minimist@~1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== -monaco-editor@^0.52.0: - version "0.52.2" - resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.52.2.tgz#53c75a6fcc6802684e99fd1b2700299857002205" - integrity sha512-GEQWEZmfkOGLdd3XK8ryrfWz3AIP8YymVXiPHEdewrUq7mh0qrKrfHLNCXcbB6sTnMLnOZ3ztSiKcciFUkIJwQ== +monaco-editor@^0.53.0: + version "0.53.0" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.53.0.tgz#2f485492e0ee822be13b1b45e3092922963737ae" + integrity sha512-0WNThgC6CMWNXXBxTbaYYcunj08iB5rnx4/G56UOPeL9UVIUGGHA1GR0EWIh9Ebabj7NpCRawQ5b0hfN1jQmYQ== + dependencies: + "@types/trusted-types" "^1.0.6" ms@^2.1.1, ms@^2.1.3: version "2.1.3" @@ -5264,14 +5329,14 @@ ms@^2.1.1, ms@^2.1.3: integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== mui-tiptap@^1.14.0: - version "1.18.0" - resolved "https://registry.yarnpkg.com/mui-tiptap/-/mui-tiptap-1.18.0.tgz#99f42928638d4cce0a396c713c49454cadbc8441" - integrity sha512-SW4PS4jJuOXQHdS96eGq1dkNiLOOTP8yiBnOH6c49SF+Sg6Bowd1hnrDmqRR+l8t6Uer5O7DWhYpYuixvrrlYw== + version "1.24.0" + resolved "https://registry.yarnpkg.com/mui-tiptap/-/mui-tiptap-1.24.0.tgz#47ced97f4c70f36fda16ee88f2d7032f5a7cccf0" + integrity sha512-DMyYX0JZaSYmdUzwVCvlieE0B/RHnTeQPwsWrO+lAiGg/x/uiDydqiZ5egcpu6awFFFAleozIgnarZs1BWO0tQ== dependencies: - encodeurl "^1.0.2" + clsx "^2.1.1" + encodeurl "^2.0.0" lodash "^4.17.21" react-colorful "^5.6.1" - tss-react "^4.8.3" type-fest "^3.12.0" multipipe@^1.0.2: @@ -5287,33 +5352,36 @@ nanoid@^3.3.6: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== +napi-postinstall@^0.3.0: + version "0.3.3" + resolved "https://registry.yarnpkg.com/napi-postinstall/-/napi-postinstall-0.3.3.tgz#93d045c6b576803ead126711d3093995198c6eb9" + integrity sha512-uTp172LLXSxuSYHv/kou+f6KW3SMppU9ivthaVTXian9sOt3XM/zHYHpRZiLgQoxeWfYUnslNWQHF1+G71xcow== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== next@^15.2.2: - version "15.2.4" - resolved "https://registry.yarnpkg.com/next/-/next-15.2.4.tgz#e05225e9511df98e3b2edc713e17f4c970bff961" - integrity sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ== + version "15.5.2" + resolved "https://registry.yarnpkg.com/next/-/next-15.5.2.tgz#5e50102443fb0328a9dfcac2d82465c7bac93693" + integrity sha512-H8Otr7abj1glFhbGnvUt3gz++0AF1+QoCXEBmd/6aKbfdFwrn0LpA836Ed5+00va/7HQSDD+mOoVhn3tNy3e/Q== dependencies: - "@next/env" "15.2.4" - "@swc/counter" "0.1.3" + "@next/env" "15.5.2" "@swc/helpers" "0.5.15" - busboy "1.6.0" caniuse-lite "^1.0.30001579" postcss "8.4.31" styled-jsx "5.1.6" optionalDependencies: - "@next/swc-darwin-arm64" "15.2.4" - "@next/swc-darwin-x64" "15.2.4" - "@next/swc-linux-arm64-gnu" "15.2.4" - "@next/swc-linux-arm64-musl" "15.2.4" - "@next/swc-linux-x64-gnu" "15.2.4" - "@next/swc-linux-x64-musl" "15.2.4" - "@next/swc-win32-arm64-msvc" "15.2.4" - "@next/swc-win32-x64-msvc" "15.2.4" - sharp "^0.33.5" + "@next/swc-darwin-arm64" "15.5.2" + "@next/swc-darwin-x64" "15.5.2" + "@next/swc-linux-arm64-gnu" "15.5.2" + "@next/swc-linux-arm64-musl" "15.5.2" + "@next/swc-linux-x64-gnu" "15.5.2" + "@next/swc-linux-x64-musl" "15.5.2" + "@next/swc-win32-arm64-msvc" "15.5.2" + "@next/swc-win32-x64-msvc" "15.5.2" + sharp "^0.34.3" no-case@^3.0.4: version "3.0.4" @@ -5324,9 +5392,9 @@ no-case@^3.0.4: tslib "^2.0.3" node-releases@^2.0.19: - version "2.0.19" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" - integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== + version "2.0.20" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.20.tgz#e26bb79dbdd1e64a146df389c699014c611cbc27" + integrity sha512-7gK6zSXEH6neM212JgfYFXe+GmZQM+fia5SsusuBIUgnPheLFBmIPhtFoAQRj8/7wASYQnbDlHPVwY0BefoFgA== normalize-svg-path@^1.1.0: version "1.1.0" @@ -5357,7 +5425,7 @@ object-assign@^4.1.0, object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.13.3: +object-inspect@^1.13.3, object-inspect@^1.13.4: version "1.13.4" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== @@ -5392,7 +5460,7 @@ object.assign@^4.1.4, object.assign@^4.1.7: has-symbols "^1.1.0" object-keys "^1.1.1" -object.entries@^1.1.8: +object.entries@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.9.tgz#e4770a6a1444afb61bd39f984018b5bede25f8b3" integrity sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw== @@ -5421,7 +5489,7 @@ object.groupby@^1.0.3: define-properties "^1.2.1" es-abstract "^1.23.2" -object.values@^1.1.6, object.values@^1.2.0, object.values@^1.2.1: +object.values@^1.1.6, object.values@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.2.1.tgz#deed520a50809ff7f75a7cfd4bc64c7a038c6216" integrity sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA== @@ -5476,15 +5544,20 @@ pako@^0.2.5: resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" integrity sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA== +pako@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== papaparse@^5.4.1: - version "5.5.2" - resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.5.2.tgz#fb67cc5a03ba8930cb435dc4641a25d6804bd4d7" - integrity sha512-PZXg8UuAc4PcVwLosEEDYjPyfWnTEhOrUfdv+3Bx+NuAb+5NhDmXzg5fHWmdCh1mP5p7JAZfFr3IMQfcntNAdA== + version "5.5.3" + resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.5.3.tgz#07f8994dec516c6dab266e952bed68e1de59fa9a" + integrity sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A== parchment@^1.1.2, parchment@^1.1.4: version "1.1.4" @@ -5573,10 +5646,10 @@ picomatch@^2.3.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== possible-typed-array-names@^1.0.0: version "1.1.0" @@ -5602,7 +5675,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prismjs@^1.27.0: +prismjs@^1.30.0: version "1.30.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9" integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw== @@ -5639,14 +5712,14 @@ property-information@^5.0.0: xtend "^4.0.0" property-information@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-7.0.0.tgz#3508a6d6b0b8eb3ca6eb2c6623b164d2ed2ab112" - integrity sha512-7D/qOz/+Y4X/rzSB6jKxKUsQnphO046ei8qxG59mtM3RG3DHgTK81HrxrmoDVINJb8NKT5ZsRbwHvQ6B68Iyhg== + version "7.1.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-7.1.0.tgz#b622e8646e02b580205415586b40804d3e8bfd5d" + integrity sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ== -prosemirror-changeset@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prosemirror-changeset/-/prosemirror-changeset-2.2.1.tgz#dae94b63aec618fac7bb9061648e6e2a79988383" - integrity sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ== +prosemirror-changeset@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz#eee3299cfabc7a027694e9abdc4e85505e9dd5e7" + integrity sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ== dependencies: prosemirror-transform "^1.0.0" @@ -5658,18 +5731,18 @@ prosemirror-collab@^1.3.1: prosemirror-state "^1.0.0" prosemirror-commands@^1.0.0, prosemirror-commands@^1.6.2: - version "1.7.0" - resolved "https://registry.yarnpkg.com/prosemirror-commands/-/prosemirror-commands-1.7.0.tgz#c0a60c808f51157caa146922494fc59fe257f27c" - integrity sha512-6toodS4R/Aah5pdsrIwnTYPEjW70SlO5a66oo5Kk+CIrgJz3ukOoS+FYDGqvQlAX5PxoGWDX1oD++tn5X3pyRA== + version "1.7.1" + resolved "https://registry.yarnpkg.com/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz#d101fef85618b1be53d5b99ea17bee5600781b38" + integrity sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w== dependencies: prosemirror-model "^1.0.0" prosemirror-state "^1.0.0" prosemirror-transform "^1.10.2" prosemirror-dropcursor@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.1.tgz#49b9fb2f583e0d0f4021ff87db825faa2be2832d" - integrity sha512-M30WJdJZLyXHi3N8vxN6Zh5O8ZBbQCz0gURTfPmTIBNQ5pxrdU7A58QkNqfa98YEjSAL1HUyyU34f6Pm5xBSGw== + version "1.8.2" + resolved "https://registry.yarnpkg.com/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz#2ed30c4796109ddeb1cf7282372b3850528b7228" + integrity sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw== dependencies: prosemirror-state "^1.0.0" prosemirror-transform "^1.1.0" @@ -5704,9 +5777,9 @@ prosemirror-inputrules@^1.4.0: prosemirror-transform "^1.0.0" prosemirror-keymap@^1.0.0, prosemirror-keymap@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/prosemirror-keymap/-/prosemirror-keymap-1.2.2.tgz#14a54763a29c7b2704f561088ccf3384d14eb77e" - integrity sha512-EAlXoksqC6Vbocqc0GtzCruZEzYgrn+iiGnNjsJsH4mrnIGex4qbLdWWNza3AW5W36ZRrlBID0eM6bdKH4OStQ== + version "1.2.3" + resolved "https://registry.yarnpkg.com/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz#c0f6ab95f75c0b82c97e44eb6aaf29cbfc150472" + integrity sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw== dependencies: prosemirror-state "^1.0.0" w3c-keyname "^2.2.0" @@ -5721,19 +5794,19 @@ prosemirror-markdown@^1.13.1: prosemirror-model "^1.25.0" prosemirror-menu@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/prosemirror-menu/-/prosemirror-menu-1.2.4.tgz#3cfdc7c06d10f9fbd1bce29082c498bd11a0a79a" - integrity sha512-S/bXlc0ODQup6aiBbWVsX/eM+xJgCTAfMq/nLqaO5ID/am4wS0tTCIkzwytmao7ypEtjj39i7YbJjAgO20mIqA== + version "1.2.5" + resolved "https://registry.yarnpkg.com/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz#dea00e7b623cea89f4d76963bee22d2ac2343250" + integrity sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ== dependencies: crelt "^1.0.0" prosemirror-commands "^1.0.0" prosemirror-history "^1.0.0" prosemirror-state "^1.0.0" -prosemirror-model@^1.0.0, prosemirror-model@^1.20.0, prosemirror-model@^1.21.0, prosemirror-model@^1.23.0, prosemirror-model@^1.24.1, prosemirror-model@^1.25.0: - version "1.25.0" - resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.25.0.tgz#c147113edc0718a14f03881e4c20367d0221f7af" - integrity sha512-/8XUmxWf0pkj2BmtqZHYJipTBMHIdVjuvFzMvEoxrtyGNmfvdhBiRwYt/eFwy2wA9DtBW3RLqvZnjurEkHaFCw== +prosemirror-model@^1.0.0, prosemirror-model@^1.20.0, prosemirror-model@^1.21.0, prosemirror-model@^1.24.1, prosemirror-model@^1.25.0: + version "1.25.3" + resolved "https://registry.yarnpkg.com/prosemirror-model/-/prosemirror-model-1.25.3.tgz#c657c60a361cb1e9c9f683d19118c0af50a6f7a9" + integrity sha512-dY2HdaNXlARknJbrManZ1WyUtos+AP97AmvqdOQtWtrrC5g4mohVX5DTi9rXNFSk09eczLq9GuNTtq3EfMeMGA== dependencies: orderedmap "^2.0.0" @@ -5744,7 +5817,7 @@ prosemirror-schema-basic@^1.2.3: dependencies: prosemirror-model "^1.25.0" -prosemirror-schema-list@^1.4.1: +prosemirror-schema-list@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz#5869c8f749e8745c394548bb11820b0feb1e32f5" integrity sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q== @@ -5762,16 +5835,16 @@ prosemirror-state@^1.0.0, prosemirror-state@^1.2.2, prosemirror-state@^1.4.3: prosemirror-transform "^1.0.0" prosemirror-view "^1.27.0" -prosemirror-tables@^1.6.3: - version "1.6.4" - resolved "https://registry.yarnpkg.com/prosemirror-tables/-/prosemirror-tables-1.6.4.tgz#e36ebca70d9e398c4a3b99b122ba86bfc985293d" - integrity sha512-TkDY3Gw52gRFRfRn2f4wJv5WOgAOXLJA2CQJYIJ5+kdFbfj3acR4JUW6LX2e1hiEBiUwvEhzH5a3cZ5YSztpIA== +prosemirror-tables@^1.6.4: + version "1.8.1" + resolved "https://registry.yarnpkg.com/prosemirror-tables/-/prosemirror-tables-1.8.1.tgz#896a234e3e18240b629b747a871369dae78c8a9a" + integrity sha512-DAgDoUYHCcc6tOGpLVPSU1k84kCUWTWnfWX3UDy2Delv4ryH0KqTD6RBI6k4yi9j9I8gl3j8MkPpRD/vWPZbug== dependencies: prosemirror-keymap "^1.2.2" - prosemirror-model "^1.24.1" + prosemirror-model "^1.25.0" prosemirror-state "^1.4.3" - prosemirror-transform "^1.10.2" - prosemirror-view "^1.37.2" + prosemirror-transform "^1.10.3" + prosemirror-view "^1.39.1" prosemirror-trailing-node@^3.0.0: version "3.0.0" @@ -5781,17 +5854,17 @@ prosemirror-trailing-node@^3.0.0: "@remirror/core-constants" "3.0.0" escape-string-regexp "^4.0.0" -prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.10.2, prosemirror-transform@^1.7.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.10.3.tgz#fae660bd7ffef3159aff44bc21e9e044aa31b67d" - integrity sha512-Nhh/+1kZGRINbEHmVu39oynhcap4hWTs/BlU7NnxWj3+l0qi8I1mu67v6mMdEe/ltD8hHvU4FV6PHiCw2VSpMw== +prosemirror-transform@^1.0.0, prosemirror-transform@^1.1.0, prosemirror-transform@^1.10.2, prosemirror-transform@^1.10.3, prosemirror-transform@^1.7.3: + version "1.10.4" + resolved "https://registry.yarnpkg.com/prosemirror-transform/-/prosemirror-transform-1.10.4.tgz#56419eac14f9f56612c806ae46f9238648f3f02e" + integrity sha512-pwDy22nAnGqNR1feOQKHxoFkkUtepoFAd3r2hbEDsnf4wp57kKA36hXsB3njA9FtONBEwSDnDeCiJe+ItD+ykw== dependencies: prosemirror-model "^1.21.0" -prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.27.0, prosemirror-view@^1.31.0, prosemirror-view@^1.37.0, prosemirror-view@^1.37.2: - version "1.38.1" - resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.38.1.tgz#566d30cc8b00a68d6b4c60f5d8a6ab97c82990b3" - integrity sha512-4FH/uM1A4PNyrxXbD+RAbAsf0d/mM0D/wAKSVVWK7o0A9Q/oOXJBrw786mBf2Vnrs/Edly6dH6Z2gsb7zWwaUw== +prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.27.0, prosemirror-view@^1.31.0, prosemirror-view@^1.38.1, prosemirror-view@^1.39.1: + version "1.41.0" + resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.41.0.tgz#1cb683c56ec11178834f47a53599dae9c3c1bf64" + integrity sha512-FatMIIl0vRHMcNc3sPy3cMw5MMyWuO1nWQxqvYpJvXAruucGvmQ2tyyjT2/Lbok77T9a/qZqBVCq4sj43V2ihw== dependencies: prosemirror-model "^1.20.0" prosemirror-state "^1.0.0" @@ -5890,19 +5963,19 @@ react-copy-to-clipboard@^5.1.0: copy-to-clipboard "^3.3.1" prop-types "^15.8.1" -react-dom@19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57" - integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ== +react-dom@19.1.1: + version "19.1.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.1.tgz#2daa9ff7f3ae384aeb30e76d5ee38c046dc89893" + integrity sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw== dependencies: - scheduler "^0.25.0" + scheduler "^0.26.0" -react-draggable@^4.0.3, react-draggable@^4.4.5: - version "4.4.6" - resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.4.6.tgz#63343ee945770881ca1256a5b6fa5c9f5983fe1e" - integrity sha512-LtY5Xw1zTPqHkVmtM3X8MUOxNDOUhv/khTgBgrUvwaS064bwVvxT+q5El0uUFNx5IEPKXuRejr7UqLwBIg5pdw== +react-draggable@^4.0.3, react-draggable@^4.4.6: + version "4.5.0" + resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.5.0.tgz#0b274ccb6965fcf97ed38fcf7e3cc223bc48cdf5" + integrity sha512-VC+HBLEZ0XJxnOxVAZsdRi8rD04Iz3SiiKOoYzamjylUcju/hP9np/aZdLHf/7WOD268WMoNJMvYfB5yAK45cw== dependencies: - clsx "^1.1.1" + clsx "^2.1.1" prop-types "^15.8.1" react-dropzone@14.3.8: @@ -5914,10 +5987,10 @@ react-dropzone@14.3.8: file-selector "^2.1.0" prop-types "^15.8.1" -react-error-boundary@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-5.0.0.tgz#6b6c7e075c922afb0283147e5b084efa44e68570" - integrity sha512-tnjAxG+IkpLephNcePNA7v6F/QpWLH8He65+DmedchDwg162JZqx4NmbXj0mlAYVVEd81OW7aFhmbsScYfiAFQ== +react-error-boundary@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-6.0.0.tgz#a9e552146958fa77d873b587aa6a5e97544ee954" + integrity sha512-gdlJjD7NWr0IfkPlaREN2d9uUZUlksrfOx7SX62VRerwXbMY6ftGCIZua1VG1aXFNOimhISsTq+Owp725b9SiA== dependencies: "@babel/runtime" "^7.12.5" @@ -5927,26 +6000,26 @@ react-fast-compare@^2.0.1: integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== react-grid-layout@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/react-grid-layout/-/react-grid-layout-1.5.1.tgz#800899fb17aa568e5f32574d07c12579f3d76fb2" - integrity sha512-4Fr+kKMk0+m1HL/BWfHxi/lRuaOmDNNKQDcu7m12+NEYcen20wIuZFo789u3qWCyvUsNUxCiyf0eKq4WiJSNYw== + version "1.5.2" + resolved "https://registry.yarnpkg.com/react-grid-layout/-/react-grid-layout-1.5.2.tgz#d5a6775446ce540c0df3985c41b5d64622fc6f87" + integrity sha512-vT7xmQqszTT+sQw/LfisrEO4le1EPNnSEMVHy6sBZyzS3yGkMywdOd+5iEFFwQwt0NSaGkxuRmYwa1JsP6OJdw== dependencies: - clsx "^2.0.0" + clsx "^2.1.1" fast-equals "^4.0.3" prop-types "^15.8.1" - react-draggable "^4.4.5" + react-draggable "^4.4.6" react-resizable "^3.0.5" resize-observer-polyfill "^1.5.1" react-hook-form@^7.53.0: - version "7.54.2" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.54.2.tgz#8c26ed54c71628dff57ccd3c074b1dd377cfb211" - integrity sha512-eHpAUgUjWbZocoQYUHposymRb4ZP6d0uwUnooL2uOybA9/3tPUvoAKqEWK1WaSiTxxOfTpffNZP7QwlnM3/gEg== + version "7.62.0" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.62.0.tgz#2d81e13c2c6b6d636548e440818341ca753218d0" + integrity sha512-7KWFejc98xqG/F4bAxpL41NB3o1nnvQO1RWZT3TqRZYL8RryQETGfEdVnJN2fy1crCiBLLjkRBVK05j24FxJGA== -react-hot-toast@2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/react-hot-toast/-/react-hot-toast-2.5.2.tgz#b55328966a26add56513e2dc1682e2cb4753c244" - integrity sha512-Tun3BbCxzmXXM7C+NI4qiv6lT0uwGh4oAfeJyNOjYUejTsm35mK9iCaYLGv8cBz9L5YxZLx/2ii7zsIwPtPUdw== +react-hot-toast@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/react-hot-toast/-/react-hot-toast-2.6.0.tgz#4ada6ed3c75c5e42a90d562f55665ff37ee1442b" + integrity sha512-bH+2EBMZ4sdyou/DPrfgIouFpcRLCJ+HoCA32UoAYHn6T3Ur5yfcDCeSr5mwldl6pFOsiocmrXMuoCJ1vV8bWg== dependencies: csstype "^3.1.3" goober "^2.1.16" @@ -5958,12 +6031,12 @@ react-html-parser@^2.0.2: dependencies: htmlparser2 "^3.9.0" -react-i18next@15.4.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-15.4.1.tgz#33f3e89c2f6c68e2bfcbf9aa59986ad42fe78758" - integrity sha512-ahGab+IaSgZmNPYXdV1n+OYky95TGpFwnKRflX/16dY04DsYYKHtVLjeny7sBSCREEcoMbAgSkFiGLF5g5Oofw== +react-i18next@15.7.3: + version "15.7.3" + resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-15.7.3.tgz#2eba235247dff0cbf9f0338e2ab85e10e127aa54" + integrity sha512-AANws4tOE+QSq/IeMF/ncoHlMNZaVLxpa5uUGW1wjike68elVYr0018L9xYoqBr1OFO7G7boDPrbn0HpMCJxTw== dependencies: - "@babel/runtime" "^7.25.0" + "@babel/runtime" "^7.27.6" html-parse-stringify "^3.0.1" react-is@^16.13.1, react-is@^16.7.0: @@ -5976,10 +6049,10 @@ react-is@^17.0.2: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== -react-is@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-19.0.0.tgz#d6669fd389ff022a9684f708cf6fa4962d1fea7a" - integrity sha512-H91OHcwjZsbq3ClIDHMzBShc1rotbfACdWENsmEf0IFvZ3FgGPtdHMcsv45bQ1hAbgdfiA8SnxTKfDS+x/8m2g== +react-is@^19.1.1: + version "19.1.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-19.1.1.tgz#038ebe313cf18e1fd1235d51c87360eb87f7c36a" + integrity sha512-tr41fA15Vn8p4X9ntI+yCyeGSf1TlYaY5vlTZfQmeLBrFo3psOPX6HhTDnFNL9uj3EhP0KAQ80cugCl4b4BERA== react-leaflet-markercluster@^5.0.0-rc.0: version "5.0.0-rc.0" @@ -6016,9 +6089,9 @@ react-markdown@10.1.0: vfile "^6.0.0" react-media-hook@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/react-media-hook/-/react-media-hook-0.5.0.tgz#f830231f31ea80049f8cbaf8058da90ab71e7150" - integrity sha512-OupDgOSCjUUWPiXq3HMoRwpsQry4cGf4vKzh2E984Xtm4I01ZFbq8JwCG/RPqXB9h0qxgzoYLbABC+LIZH8deQ== + version "0.5.1" + resolved "https://registry.yarnpkg.com/react-media-hook/-/react-media-hook-0.5.1.tgz#ca81e10083aa63a27f9840f96cb9ed8c29a5ddce" + integrity sha512-ByvCUelMp25zliJR0gXRFvY86jpNrYRyvlUSeQ3l3N/5kUvRwInJmtJQTt3dfr6gKNjjQbkIwne99C4SoYqQ1g== react-papaparse@^4.4.0: version "4.4.0" @@ -6066,15 +6139,15 @@ react-resizable@^3.0.5: react-draggable "^4.0.3" react-syntax-highlighter@^15.6.1: - version "15.6.1" - resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.6.1.tgz#fa567cb0a9f96be7bbccf2c13a3c4b5657d9543e" - integrity sha512-OqJ2/vL7lEeV5zTJyG7kmARppUjiB9h9udl4qHQjjgEos66z00Ia0OckwYfRxCSFrW8RJIBnsBwQsHZbVPspqg== + version "15.6.6" + resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.6.6.tgz#77417c81ebdc554300d0332800a2e1efe5b1190b" + integrity sha512-DgXrc+AZF47+HvAPEmn7Ua/1p10jNoVZVI/LoPiYdtY+OM+/nG5yefLHKJwdKqY1adMuHFbeyBaG9j64ML7vTw== dependencies: "@babel/runtime" "^7.3.1" highlight.js "^10.4.1" highlightjs-vue "^1.0.0" lowlight "^1.17.0" - prismjs "^1.27.0" + prismjs "^1.30.0" refractor "^3.6.0" react-time-ago@^7.3.3: @@ -6097,22 +6170,19 @@ react-transition-group@^4.4.5: prop-types "^15.6.2" react-virtuoso@^4.12.8: - version "4.12.8" - resolved "https://registry.yarnpkg.com/react-virtuoso/-/react-virtuoso-4.12.8.tgz#db1dbba617f91c1dcd760aa90e09ef991e65a356" - integrity sha512-NMMKfDBr/+xZZqCQF3tN1SZsh6FwOJkYgThlfnsPLkaEhdyQo0EuWUzu3ix6qjnI7rYwJhMwRGoJBi+aiDfGsA== + version "4.14.0" + resolved "https://registry.yarnpkg.com/react-virtuoso/-/react-virtuoso-4.14.0.tgz#6998631cb0a86efc2b15e551f55e7199a0f25c7a" + integrity sha512-fR+eiCvirSNIRvvCD7ueJPRsacGQvUbjkwgWzBZXVq+yWypoH7mRUvWJzGHIdoRaCZCT+6mMMMwIG2S1BW3uwA== -react-window@^1.8.10: - version "1.8.11" - resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.11.tgz#a857b48fa85bd77042d59cc460964ff2e0648525" - integrity sha512-+SRbUVT2scadgFSWx+R1P754xHPEqvcfSfVX10QYg6POOz+WNgkN48pS+BtZNIMGiL1HYrSEiCkwsMS15QogEQ== - dependencies: - "@babel/runtime" "^7.0.0" - memoize-one ">=3.1.1 <6" +react-window@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/react-window/-/react-window-2.1.0.tgz#66f175398bb864dc21d70af55d53ec677032158a" + integrity sha512-STMrsd6t3pN/XFa5cblpwTLpsEDtrtdeNY+71QsEaY0m7Fhbn9R4XXYzYAyKDpeYbjmBpAflqHBdDDKW928m3Q== -react@19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd" - integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== +react@19.1.1: + version "19.1.1" + resolved "https://registry.yarnpkg.com/react/-/react-19.1.1.tgz#06d9149ec5e083a67f9a1e39ce97b06a03b644af" + integrity sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ== readable-stream@^2.0.2: version "2.3.8" @@ -6213,19 +6283,7 @@ regenerator-runtime@^0.13.7: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - -regenerator-transform@^0.15.2: - version "0.15.2" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.2.tgz#5bbae58b522098ebdf09bca2f83838929001c7a4" - integrity sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg== - dependencies: - "@babel/runtime" "^7.8.4" - -regexp.prototype.flags@^1.5.1, regexp.prototype.flags@^1.5.3: +regexp.prototype.flags@^1.5.1, regexp.prototype.flags@^1.5.3, regexp.prototype.flags@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== @@ -6277,9 +6335,9 @@ remark-parse@^11.0.0: unified "^11.0.0" remark-rehype@^11.0.0: - version "11.1.1" - resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-11.1.1.tgz#f864dd2947889a11997c0a2667cd6b38f685bca7" - integrity sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ== + version "11.1.2" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-11.1.2.tgz#2addaadda80ca9bd9aa0da763e74d16327683b37" + integrity sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw== dependencies: "@types/hast" "^3.0.0" "@types/mdast" "^4.0.0" @@ -6297,7 +6355,7 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -reselect@^5.1.0: +reselect@^5.1.0, reselect@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/reselect/-/reselect-5.1.1.tgz#c766b1eb5d558291e5e550298adb0becc24bb72e" integrity sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w== @@ -6317,7 +6375,7 @@ resolve-pkg-maps@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== -resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.4: +resolve@^1.19.0, resolve@^1.22.10, resolve@^1.22.4: version "1.22.10" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== @@ -6405,10 +6463,10 @@ scheduler@0.25.0-rc-603e6108-20241029: resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0-rc-603e6108-20241029.tgz#684dd96647e104d23e0d29a37f18937daf82df19" integrity sha512-pFwF6H1XrSdYYNLfOcGlM28/j8CGLu8IvdrxqhjWULe2bPcKiKW4CV+OWqR/9fT52mywx65l7ysNkjLKBda7eA== -scheduler@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015" - integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA== +scheduler@^0.26.0: + version "0.26.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.26.0.tgz#4ce8a8c2a2095f13ea11bf9a445be50c555d6337" + integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== section-matter@^1.0.0: version "1.0.0" @@ -6423,10 +6481,10 @@ semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.6.0, semver@^7.6.3, semver@^7.7.1: - version "7.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" - integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== +semver@^7.6.0, semver@^7.7.1, semver@^7.7.2: + version "7.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58" + integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA== set-function-length@^1.2.2: version "1.2.2" @@ -6459,34 +6517,37 @@ set-proto@^1.0.0: es-errors "^1.3.0" es-object-atoms "^1.0.0" -sharp@^0.33.5: - version "0.33.5" - resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.33.5.tgz#13e0e4130cc309d6a9497596715240b2ec0c594e" - integrity sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw== +sharp@^0.34.3: + version "0.34.3" + resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.34.3.tgz#10a03bcd15fb72f16355461af0b9245ccb8a5da3" + integrity sha512-eX2IQ6nFohW4DbvHIOLRB3MHFpYqaqvXd3Tp5e/T/dSH83fxaNJQRvDMhASmkNTsNTVF2/OOopzRCt7xokgPfg== dependencies: color "^4.2.3" - detect-libc "^2.0.3" - semver "^7.6.3" + detect-libc "^2.0.4" + semver "^7.7.2" optionalDependencies: - "@img/sharp-darwin-arm64" "0.33.5" - "@img/sharp-darwin-x64" "0.33.5" - "@img/sharp-libvips-darwin-arm64" "1.0.4" - "@img/sharp-libvips-darwin-x64" "1.0.4" - "@img/sharp-libvips-linux-arm" "1.0.5" - "@img/sharp-libvips-linux-arm64" "1.0.4" - "@img/sharp-libvips-linux-s390x" "1.0.4" - "@img/sharp-libvips-linux-x64" "1.0.4" - "@img/sharp-libvips-linuxmusl-arm64" "1.0.4" - "@img/sharp-libvips-linuxmusl-x64" "1.0.4" - "@img/sharp-linux-arm" "0.33.5" - "@img/sharp-linux-arm64" "0.33.5" - "@img/sharp-linux-s390x" "0.33.5" - "@img/sharp-linux-x64" "0.33.5" - "@img/sharp-linuxmusl-arm64" "0.33.5" - "@img/sharp-linuxmusl-x64" "0.33.5" - "@img/sharp-wasm32" "0.33.5" - "@img/sharp-win32-ia32" "0.33.5" - "@img/sharp-win32-x64" "0.33.5" + "@img/sharp-darwin-arm64" "0.34.3" + "@img/sharp-darwin-x64" "0.34.3" + "@img/sharp-libvips-darwin-arm64" "1.2.0" + "@img/sharp-libvips-darwin-x64" "1.2.0" + "@img/sharp-libvips-linux-arm" "1.2.0" + "@img/sharp-libvips-linux-arm64" "1.2.0" + "@img/sharp-libvips-linux-ppc64" "1.2.0" + "@img/sharp-libvips-linux-s390x" "1.2.0" + "@img/sharp-libvips-linux-x64" "1.2.0" + "@img/sharp-libvips-linuxmusl-arm64" "1.2.0" + "@img/sharp-libvips-linuxmusl-x64" "1.2.0" + "@img/sharp-linux-arm" "0.34.3" + "@img/sharp-linux-arm64" "0.34.3" + "@img/sharp-linux-ppc64" "0.34.3" + "@img/sharp-linux-s390x" "0.34.3" + "@img/sharp-linux-x64" "0.34.3" + "@img/sharp-linuxmusl-arm64" "0.34.3" + "@img/sharp-linuxmusl-x64" "0.34.3" + "@img/sharp-wasm32" "0.34.3" + "@img/sharp-win32-arm64" "0.34.3" + "@img/sharp-win32-ia32" "0.34.3" + "@img/sharp-win32-x64" "0.34.3" shebang-command@^2.0.0: version "2.0.0" @@ -6547,26 +6608,27 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" -simplebar-core@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/simplebar-core/-/simplebar-core-1.3.0.tgz#166cfbb4c1a2dc0a60833fe8e1fd590cdb32158b" - integrity sha512-LpWl3w0caz0bl322E68qsrRPpIn+rWBGAaEJ0lUJA7Xpr2sw92AkIhg6VWj988IefLXYh50ILatfAnbNoCFrlA== +simplebar-core@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/simplebar-core/-/simplebar-core-1.3.2.tgz#e249caf38625afb7c316b2d219b66afd6227e301" + integrity sha512-qKgTTuTqapjsFGkNhCjyPhysnbZGpQqNmjk0nOYjFN5ordC/Wjvg+RbYCyMSnW60l/Z0ZS82GbNltly6PMUH1w== dependencies: lodash "^4.17.21" + lodash-es "^4.17.21" -simplebar-react@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/simplebar-react/-/simplebar-react-3.3.0.tgz#7170f29f0ea785c6881db81a8447c408fbc9056e" - integrity sha512-sxzy+xRuU41He4tT4QLGYutchtOuye/xxVeq7xhyOiwMiHNK1ZpvbOTyy+7P0i7gfpXLGTJ8Bep8+4Mhdgtz/g== +simplebar-react@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/simplebar-react/-/simplebar-react-3.3.2.tgz#699c9837f4ada71335b3eca9f8a2b788a559bda1" + integrity sha512-ZsgcQhKLtt5ra0BRIJeApfkTBQCa1vUPA/WXI4HcYReFt+oCEOvdVz6rR/XsGJcKxTlCRPmdGx1uJIUChupo+A== dependencies: - simplebar-core "^1.3.0" + simplebar-core "^1.3.2" -simplebar@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/simplebar/-/simplebar-6.3.0.tgz#5581558e532d9ecf6e42faef932d81537f94d3ca" - integrity sha512-SQJfKSvUPJxlOhYCpswEn5ke5WQGsgDZNmpScWL+MKXgYpCDTq1bGiv6uWXwSHMYTkMco32fDUL35sVwCMmzCw== +simplebar@6.3.2: + version "6.3.2" + resolved "https://registry.yarnpkg.com/simplebar/-/simplebar-6.3.2.tgz#df27f47836c126736b38f9703fdcaa50ab0ae077" + integrity sha512-l4P1Oma0nply0g+pkrkwfC1SF5WDnIHrgiQDXSDzIdjngUDLkPgZcPGKrOvuFeXoSensfKijjIjDlUJSEp+mLQ== dependencies: - simplebar-core "^1.3.0" + simplebar-core "^1.3.2" snake-case@^3.0.4: version "3.0.4" @@ -6616,10 +6678,13 @@ state-local@^1.0.6: resolved "https://registry.yarnpkg.com/state-local/-/state-local-1.0.7.tgz#da50211d07f05748d53009bee46307a37db386d5" integrity sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w== -streamsearch@^1.1.0: +stop-iteration-iterator@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz#f481ff70a548f6124d0312c3aa14cbfa7aa542ad" + integrity sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ== + dependencies: + es-errors "^1.3.0" + internal-slot "^1.1.0" string.prototype.includes@^2.0.1: version "2.0.1" @@ -6670,7 +6735,7 @@ string.prototype.trim@^1.2.10: es-object-atoms "^1.0.0" has-property-descriptors "^1.0.2" -string.prototype.trimend@^1.0.8, string.prototype.trimend@^1.0.9: +string.prototype.trimend@^1.0.9: version "1.0.9" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz#62e2731272cd285041b36596054e9f66569b6942" integrity sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ== @@ -6732,16 +6797,16 @@ strip-json-comments@^3.1.1: integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== style-to-js@^1.0.0: - version "1.1.16" - resolved "https://registry.yarnpkg.com/style-to-js/-/style-to-js-1.1.16.tgz#e6bd6cd29e250bcf8fa5e6591d07ced7575dbe7a" - integrity sha512-/Q6ld50hKYPH3d/r6nr117TZkHR0w0kGGIVfpG9N6D8NymRPM9RqCUv4pRpJ62E5DqOYx2AFpbZMyCPnjQCnOw== + version "1.1.17" + resolved "https://registry.yarnpkg.com/style-to-js/-/style-to-js-1.1.17.tgz#488b1558a8c1fd05352943f088cc3ce376813d83" + integrity sha512-xQcBGDxJb6jjFCTzvQtfiPn6YvvP2O8U1MDIPNfJQlWMYfktPy+iGsHE7cssjs7y84d9fQaK4UF3RIJaAHSoYA== dependencies: - style-to-object "1.0.8" + style-to-object "1.0.9" -style-to-object@1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.8.tgz#67a29bca47eaa587db18118d68f9d95955e81292" - integrity sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g== +style-to-object@1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.9.tgz#35c65b713f4a6dba22d3d0c61435f965423653f0" + integrity sha512-G4qppLgKu/k6FwRpHiGiKPaPTFcG3g4wNVX/Qsfu+RqQM30E7Tyu/TEgxcL9PNLF5pdRLwQdE3YKKf+KF2Dzlw== dependencies: inline-style-parser "0.2.4" @@ -6844,20 +6909,13 @@ tiny-warning@^1.0.2: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tinyglobby@^0.2.12: - version "0.2.12" - resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.12.tgz#ac941a42e0c5773bd0b5d08f32de82e74a1a61b5" - integrity sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww== - dependencies: - fdir "^6.4.3" - picomatch "^4.0.2" - -tippy.js@^6.3.7: - version "6.3.7" - resolved "https://registry.yarnpkg.com/tippy.js/-/tippy.js-6.3.7.tgz#8ccfb651d642010ed9a32ff29b0e9e19c5b8c61c" - integrity sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ== +tinyglobby@^0.2.13: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== dependencies: - "@popperjs/core" "^2.9.0" + fdir "^6.5.0" + picomatch "^4.0.3" to-regex-range@^5.0.1: version "5.0.1" @@ -6886,7 +6944,7 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f" integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw== -ts-api-utils@^2.0.1: +ts-api-utils@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91" integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ== @@ -6906,15 +6964,6 @@ tslib@^2.0.0, tslib@^2.0.3, tslib@^2.4.0, tslib@^2.7.0, tslib@^2.8.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== -tss-react@^4.8.3: - version "4.9.15" - resolved "https://registry.yarnpkg.com/tss-react/-/tss-react-4.9.15.tgz#a26fc24889a462ab4858094bc5b33cdda36e45ab" - integrity sha512-rLiEmDwUtln9RKTUR/ZPYBrufF0Tq/PFggO1M7P8M3/FAcodPQ746Ug9MCEFkURKDlntN17+Oja0DMMz5yBnsQ== - dependencies: - "@emotion/cache" "*" - "@emotion/serialize" "*" - "@emotion/utils" "*" - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -6977,10 +7026,10 @@ typed-array-length@^1.0.7: possible-typed-array-names "^1.0.0" reflect.getprototypeof "^1.0.6" -typescript@5.8.2: - version "5.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4" - integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ== +typescript@5.9.2: + version "5.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6" + integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A== uc.micro@^2.0.0, uc.micro@^2.1.0: version "2.1.0" @@ -6997,10 +7046,10 @@ unbox-primitive@^1.1.0: has-symbols "^1.1.0" which-boxed-primitive "^1.1.1" -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.1" @@ -7092,28 +7141,34 @@ unist-util-visit@^5.0.0: unist-util-is "^6.0.0" unist-util-visit-parents "^6.0.0" -unrs-resolver@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/unrs-resolver/-/unrs-resolver-1.3.2.tgz#7c1dc0adabb1c3971c8c5cbdd8c1c2f742286e6d" - integrity sha512-ZKQBC351Ubw0PY8xWhneIfb6dygTQeUHtCcNGd0QB618zabD/WbFMYdRyJ7xeVT+6G82K5v/oyZO0QSHFtbIuw== +unrs-resolver@^1.6.2: + version "1.11.1" + resolved "https://registry.yarnpkg.com/unrs-resolver/-/unrs-resolver-1.11.1.tgz#be9cd8686c99ef53ecb96df2a473c64d304048a9" + integrity sha512-bSjt9pjaEBnNiGgc9rUiHGKv5l4/TGzDmYw3RhnkJGtLhbnnA/5qJj7x3dNDCRx/PJxu774LlH8lCOlB4hEfKg== + dependencies: + napi-postinstall "^0.3.0" optionalDependencies: - "@unrs/resolver-binding-darwin-arm64" "1.3.2" - "@unrs/resolver-binding-darwin-x64" "1.3.2" - "@unrs/resolver-binding-freebsd-x64" "1.3.2" - "@unrs/resolver-binding-linux-arm-gnueabihf" "1.3.2" - "@unrs/resolver-binding-linux-arm-musleabihf" "1.3.2" - "@unrs/resolver-binding-linux-arm64-gnu" "1.3.2" - "@unrs/resolver-binding-linux-arm64-musl" "1.3.2" - "@unrs/resolver-binding-linux-ppc64-gnu" "1.3.2" - "@unrs/resolver-binding-linux-s390x-gnu" "1.3.2" - "@unrs/resolver-binding-linux-x64-gnu" "1.3.2" - "@unrs/resolver-binding-linux-x64-musl" "1.3.2" - "@unrs/resolver-binding-wasm32-wasi" "1.3.2" - "@unrs/resolver-binding-win32-arm64-msvc" "1.3.2" - "@unrs/resolver-binding-win32-ia32-msvc" "1.3.2" - "@unrs/resolver-binding-win32-x64-msvc" "1.3.2" - -update-browserslist-db@^1.1.1: + "@unrs/resolver-binding-android-arm-eabi" "1.11.1" + "@unrs/resolver-binding-android-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-arm64" "1.11.1" + "@unrs/resolver-binding-darwin-x64" "1.11.1" + "@unrs/resolver-binding-freebsd-x64" "1.11.1" + "@unrs/resolver-binding-linux-arm-gnueabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm-musleabihf" "1.11.1" + "@unrs/resolver-binding-linux-arm64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-arm64-musl" "1.11.1" + "@unrs/resolver-binding-linux-ppc64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-riscv64-musl" "1.11.1" + "@unrs/resolver-binding-linux-s390x-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-gnu" "1.11.1" + "@unrs/resolver-binding-linux-x64-musl" "1.11.1" + "@unrs/resolver-binding-wasm32-wasi" "1.11.1" + "@unrs/resolver-binding-win32-arm64-msvc" "1.11.1" + "@unrs/resolver-binding-win32-ia32-msvc" "1.11.1" + "@unrs/resolver-binding-win32-x64-msvc" "1.11.1" + +update-browserslist-db@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz#348377dd245216f9e7060ff50b15a1b740b75420" integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== @@ -7133,10 +7188,10 @@ use-memo-one@^1.1.1: resolved "https://registry.yarnpkg.com/use-memo-one/-/use-memo-one-1.1.3.tgz#2fd2e43a2169eabc7496960ace8c79efef975e99" integrity sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ== -use-sync-external-store@^1, use-sync-external-store@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz#adbc795d8eeb47029963016cefdf89dc799fcebc" - integrity sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw== +use-sync-external-store@^1.4.0, use-sync-external-store@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz#55122e2a3edd2a6c106174c27485e0fd59bcfca0" + integrity sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A== util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" @@ -7151,9 +7206,9 @@ utrie@^1.0.2: base64-arraybuffer "^1.0.2" vfile-message@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.2.tgz#c883c9f677c72c166362fd635f21fc165a7d1181" - integrity sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw== + version "4.0.3" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.3.tgz#87b44dddd7b70f0641c2e3ed0864ba73e2ea8df4" + integrity sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw== dependencies: "@types/unist" "^3.0.0" unist-util-stringify-position "^4.0.0" @@ -7225,7 +7280,7 @@ which-collection@^1.0.2: is-weakmap "^2.0.2" is-weakset "^2.0.3" -which-typed-array@^1.1.16, which-typed-array@^1.1.18: +which-typed-array@^1.1.16, which-typed-array@^1.1.19: version "1.1.19" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== @@ -7282,10 +7337,10 @@ yoga-layout@^3.2.1: resolved "https://registry.yarnpkg.com/yoga-layout/-/yoga-layout-3.2.1.tgz#d2d1ba06f0e81c2eb650c3e5ad8b0b4adde1e843" integrity sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ== -yup@1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/yup/-/yup-1.6.1.tgz#8defcff9daaf9feac178029c0e13b616563ada4b" - integrity sha512-JED8pB50qbA4FOkDol0bYF/p60qSEDQqBD0/qeIrUCG1KbPBIQ776fCUNb9ldbPcSTxA69g/47XTo4TqWiuXOA== +yup@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/yup/-/yup-1.7.0.tgz#5d2feeccc1725c39bfed6ec677cc0622527dafaf" + integrity sha512-VJce62dBd+JQvoc+fCVq+KZfPHr+hXaxCcVgotfwWvlR0Ja3ffYKaJBT8rptPOSKOGJDCUnW2C2JWpud7aRP6Q== dependencies: property-expr "^2.0.5" tiny-case "^1.0.3" From db93603c447b8b8c720df26c8cd98cacdad8d793 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:59:34 +0200 Subject: [PATCH 64/86] table ux improvements --- .../CippTable/CIPPTableToptoolbar.js | 800 +++++++++++------- 1 file changed, 497 insertions(+), 303 deletions(-) diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index d16bc6939c24..1a59e591751d 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -1,30 +1,47 @@ -import { DeveloperMode, FilterList, SevereCold, Sync, Tune, ViewColumn } from "@mui/icons-material"; + +import React, { useState, useEffect, useRef } from "react"; import { + Box, Button, - Checkbox, - Divider, - IconButton, - ListItemText, Menu, MenuItem, - SvgIcon, + ListItemText, + ListItemIcon, + Divider, + IconButton, Tooltip, Typography, + InputBase, + Paper, + Checkbox, + SvgIcon, } from "@mui/material"; -import { Box, Stack } from "@mui/system"; import { - MRT_GlobalFilterTextField, - MRT_ToggleFiltersButton, - MRT_ToggleFullScreenButton, -} from "material-react-table"; + Search as SearchIcon, + FilterList as FilterListIcon, + ViewColumn as ViewColumnIcon, + FileDownload as ExportIcon, + KeyboardArrowDown as ArrowDownIcon, + Visibility as VisibilityIcon, + VisibilityOff as VisibilityOffIcon, + Code as CodeIcon, + PictureAsPdf as PdfIcon, + TableChart as CsvIcon, + SevereCold, + Sync, + Check as CheckIcon, +} from "@mui/icons-material"; +import { ExclamationCircleIcon, ChevronDownIcon } from "@heroicons/react/24/outline"; +import { styled, alpha } from "@mui/material/styles"; +import { MRT_ToggleFullScreenButton } from "material-react-table"; import { PDFExportButton } from "../pdfExportButton"; -import { ChevronDownIcon, ExclamationCircleIcon } from "@heroicons/react/24/outline"; -import { usePopover } from "../../hooks/use-popover"; import { CSVExportButton } from "../csvExportButton"; +import { getCippTranslation } from "../../utils/get-cipp-translation"; +import { useMediaQuery } from "@mui/material"; +import { CippQueueTracker } from "./CippQueueTracker"; +import { usePopover } from "../../hooks/use-popover"; import { useDialog } from "../../hooks/use-dialog"; -import { useEffect, useState, useRef } from "react"; import { CippApiDialog } from "../CippComponents/CippApiDialog"; -import { getCippTranslation } from "../../utils/get-cipp-translation"; import { useSettings } from "../../hooks/use-settings"; import { useRouter } from "next/router"; import { CippOffCanvas } from "../CippComponents/CippOffCanvas"; @@ -33,8 +50,73 @@ import { ApiGetCall } from "../../api/ApiCall"; import { useQueryClient } from "@tanstack/react-query"; import GraphExplorerPresets from "/src/data/GraphExplorerPresets.json"; import CippGraphExplorerFilter from "./CippGraphExplorerFilter"; -import { useMediaQuery } from "@mui/material"; -import { CippQueueTracker } from "./CippQueueTracker"; +import { Stack } from "@mui/system"; + +// Styled components for modern design +const ModernSearchContainer = styled(Paper)(({ theme }) => ({ + display: "flex", + alignItems: "center", + width: "300px", + height: "40px", + backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", + border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, + borderRadius: "8px", + padding: "0 12px", + "&:hover": { + borderColor: theme.palette.primary.main, + }, + "&:focus-within": { + borderColor: theme.palette.primary.main, + boxShadow: `0 0 0 2px ${alpha(theme.palette.primary.main, 0.2)}`, + }, +})); + +const ModernSearchInput = styled(InputBase)(({ theme }) => ({ + marginLeft: theme.spacing(1), + flex: 1, + fontSize: "14px", + "& .MuiInputBase-input": { + padding: "8px 0", + "&::placeholder": { + color: theme.palette.text.secondary, + opacity: 0.7, + }, + }, +})); + +const ModernButton = styled(Button)(({ theme }) => ({ + height: "40px", + borderRadius: "8px", + textTransform: "none", + fontWeight: 500, + fontSize: "14px", + padding: "8px 16px", + backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", + border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, + color: theme.palette.text.primary, + "&:hover": { + backgroundColor: theme.palette.mode === "dark" ? "#363A4A" : "#F0F0F0", + borderColor: theme.palette.primary.main, + }, + "& .MuiButton-startIcon": { + marginRight: "8px", + }, + "& .MuiButton-endIcon": { + marginLeft: "8px", + }, +})); + +const RefreshButton = styled(IconButton)(({ theme }) => ({ + height: "40px", + width: "40px", + borderRadius: "8px", + backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", + border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, + "&:hover": { + backgroundColor: theme.palette.mode === "dark" ? "#363A4A" : "#F0F0F0", + borderColor: theme.palette.primary.main, + }, +})); export const CIPPTableToptoolbar = ({ api, @@ -58,8 +140,10 @@ export const CIPPTableToptoolbar = ({ queueMetadata, }) => { const popover = usePopover(); - const columnPopover = usePopover(); - const filterPopover = usePopover(); + const [filtersAnchor, setFiltersAnchor] = useState(null); + const [columnsAnchor, setColumnsAnchor] = useState(null); + const [exportAnchor, setExportAnchor] = useState(null); + const [searchValue, setSearchValue] = useState(""); const mdDown = useMediaQuery((theme) => theme.breakpoints.down("md")); const settings = useSettings(); @@ -79,10 +163,6 @@ export const CIPPTableToptoolbar = ({ // Track if we've restored filters for this page to prevent infinite loops const restoredFiltersRef = useRef(new Set()); - const [actionMenuAnchor, setActionMenuAnchor] = useState(null); - const handleActionMenuOpen = (event) => setActionMenuAnchor(event.currentTarget); - const handleActionMenuClose = () => setActionMenuAnchor(null); - const getBulkActions = (actions, selectedRows) => { return ( actions @@ -241,6 +321,19 @@ export const CIPPTableToptoolbar = ({ waiting: !!api?.data?.Endpoint, }); + // Handle search input changes + const handleSearchChange = (event) => { + const value = event.target.value; + setSearchValue(value); + table.setGlobalFilter(value); + }; + + // Handle column filters toggle + const handleColumnFiltersToggle = () => { + const currentState = table.getState().showColumnFilters; + table.setShowColumnFilters(!currentState); + }; + const resetToDefaultVisibility = () => { setColumnVisibility((prevVisibility) => { const updatedVisibility = {}; @@ -257,7 +350,7 @@ export const CIPPTableToptoolbar = ({ [pageName]: {}, }, }); - columnPopover.handleClose(); + setColumnsAnchor(null); }; const resetToPreferedVisibility = () => { @@ -277,7 +370,7 @@ export const CIPPTableToptoolbar = ({ return updatedVisibility; }); } - columnPopover.handleClose(); + setColumnsAnchor(null); }; const saveAsPreferedColumns = () => { @@ -287,7 +380,7 @@ export const CIPPTableToptoolbar = ({ [pageName]: columnVisibility, }, }); - columnPopover.handleClose(); + setColumnsAnchor(null); }; const mergeCaseInsensitive = (obj1, obj2) => { @@ -428,315 +521,416 @@ export const CIPPTableToptoolbar = ({ return ( <> ({ + sx={{ display: "flex", - gap: "0.5rem", - p: "8px", + gap: 2, + p: 2, justifyContent: "space-between", - })} + alignItems: "center", + backgroundColor: "background.paper", + }} > - - <> - + {/* Refresh Button */} + + { + if (typeof refreshFunction === "object") { + refreshFunction.refetch(); + } else if (typeof refreshFunction === "function") { + refreshFunction(); + } else if (data && !getRequestData.isFetched) { + // do nothing because data was sent native. + } else if (getRequestData) { + getRequestData.refetch(); + } + }} + disabled={ + getRequestData?.isLoading || getRequestData?.isFetching || refreshFunction?.isFetching } > -
    + {getRequestData?.isFetchNextPageError ? ( + + ) : ( + + )} + + + + + {/* Search Input */} + + + + + + {/* Filters Button */} + } + endIcon={} + onClick={(event) => setFiltersAnchor(event.currentTarget)} + sx={{ + color: activeFilterName ? "primary.main" : "text.primary", + borderColor: activeFilterName ? "primary.main" : undefined, + }} + > + Filters + + setFiltersAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 200, + }, + }} + > + { + handleColumnFiltersToggle(); + setFiltersAnchor(null); + }} + > + + {table.getState().showColumnFilters ? : } + + + {table.getState().showColumnFilters ? "Hide Column Filters" : "Show Column Filters"} + + + + setTableFilter("", "reset", "")}> + + + {api?.url === "/api/ListGraphRequest" && ( + { - if (typeof refreshFunction === "object") { - refreshFunction.refetch(); - } else if (typeof refreshFunction === "function") { - refreshFunction(); - } else if (data && !getRequestData.isFetched) { - //do nothing because data was sent native. - } else if (getRequestData) { - getRequestData.refetch(); - } + setFiltersAnchor(null); + setFilterCanvasVisible(true); }} > - + + )} + {filterList?.length > 0 && } + {filterList?.map((filter) => ( + { + setFiltersAnchor(null); + setTableFilter(filter.value, filter.type, filter.filterName); + }} + > + + {activeFilterName === filter.filterName && ( + + )} + {filter.filterName} + + } + /> + + ))} + + + {/* Columns Button */} + } + endIcon={} + onClick={(event) => setColumnsAnchor(event.currentTarget)} + > + Columns + + setColumnsAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 250, + maxHeight: 400, + }, + }} + > + + + + + + + + + + + {table + .getAllColumns() + .filter((column) => !column.id.startsWith("mrt-")) + .map((column) => ( + + setColumnVisibility({ + ...columnVisibility, + [column.id]: !column.getIsVisible(), + }) } > - - {getRequestData?.isFetchNextPageError ? ( - - ) : ( - - )} - - -
    -
    - - - + + + ))} + + + {/* Export Button */} + {exportEnabled && ( + <> + } + endIcon={} + onClick={(event) => setExportAnchor(event.currentTarget)} + > + Export + + setExportAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 180, + }, }} > - - - - - - - setTableFilter("", "reset", "")}> - - - {api?.url === "/api/ListGraphRequest" && ( { - filterPopover.handleClose(); - setFilterCanvasVisible(true); + // Trigger CSV export + const csvButton = document.querySelector("[data-csv-export]"); + if (csvButton) csvButton.click(); + setExportAnchor(null); }} > - + + + + - )} - - {filterList?.map((filter) => ( { - filterPopover.handleClose(); - setTableFilter(filter.value, filter.type, filter.filterName); + // Trigger PDF export + const pdfButton = document.querySelector("[data-pdf-export]"); + if (pdfButton) pdfButton.click(); + setExportAnchor(null); }} > - + + + + - ))} - - - - - - + { + setOffcanvasVisible(true); + setExportAnchor(null); + }} + > + + + + + + + + )} +
    + + {/* Right side - Additional controls */} + + {/* Selected rows indicator */} + {(table.getIsAllRowsSelected() || table.getIsSomeRowsSelected()) && ( + + {table.getSelectedRowModel().rows.length} rows selected + + )} + + {/* Cold start indicator */} + {getRequestData?.data?.pages?.[0].Metadata?.ColdStart === true && ( + + + )} + + {/* Queue tracker */} + + + {/* Full screen toggle for mobile */} + {mdDown && } + + + {/* Hidden export buttons for triggering */} + + + + +
    + + {/* Bulk Actions Menu */} + {actions && + getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && + (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( + + - - - - - - - - - - {table - .getAllColumns() - .filter((column) => !column.id.startsWith("mrt-")) - .map((column) => ( + {getBulkActions(actions, table.getSelectedRowModel().rows).map( + (action, index) => ( - setColumnVisibility({ - ...columnVisibility, - [column.id]: !column.getIsVisible(), - }) - } - > - - - - ))} - + key={index} + disabled={action.disabled} + onClick={() => { + if (action.disabled) return; + setActionData({ + data: table.getSelectedRowModel().rows.map((row) => row.original), + action: action, + ready: true, + }); - <> - {exportEnabled && ( - <> - - - - )} - - setOffcanvasVisible(true)}> - - - - - {mdDown && } - - { - //add a little icon with how many rows are selected - (table.getIsAllRowsSelected() || table.getIsSomeRowsSelected()) && ( - - {table.getSelectedRowModel().rows.length} rows selected - - ) - } - { - setOffcanvasVisible(false); - }} - > - - API Response - - - - - - - - {getRequestData?.data?.pages?.[0].Metadata?.ColdStart === true && ( - - - - )} - {actions && - getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && - (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( - <> - - + action.customFunction(row.original.original, action, {}) + ); + } else { + createDialog.handleOpen(); + popover.handleClose(); + } }} > - {getBulkActions(actions, table.getSelectedRowModel().rows).map( - (action, index) => ( - { - if (action.disabled) return; - setActionData({ - data: table.getSelectedRowModel().rows.map((row) => row.original), - action: action, - ready: true, - }); - - if (action?.noConfirm && action.customFunction) { - table - .getSelectedRowModel() - .rows.map((row) => - action.customFunction(row.original.original, action, {}) - ); - } else { - createDialog.handleOpen(); - popover.handleClose(); - } - }} - > - - {action.icon} - - {action.label} - - ) - )} - - + + {action.icon} + + {action.label} + + ) )} + - -
    - - {actionData.ready && ( - )} - + + {/* API Response Off-Canvas */} + { + setOffcanvasVisible(false); + }} + > + + API Response + + + + + {/* Action Dialog */} + {actionData.ready && ( + + )} + + {/* Graph Filter Off-Canvas */} Date: Tue, 9 Sep 2025 14:44:42 +0200 Subject: [PATCH 65/86] light mode css improvements --- src/theme/light/create-components.js | 20 +++++++++++--------- src/theme/light/create-palette.js | 6 +++--- src/theme/light/create-shadows.js | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/theme/light/create-components.js b/src/theme/light/create-components.js index ea98aad0e13b..c985fd94b8f9 100644 --- a/src/theme/light/create-components.js +++ b/src/theme/light/create-components.js @@ -42,7 +42,7 @@ export const createComponents = ({ palette }) => { styleOverrides: { root: { [`&.${paperClasses.elevation1}`]: { - boxShadow: `0px 0px 1px ${palette.neutral[200]}, 0px 1px 3px ${alpha( + boxShadow: `0px 0px 1px ${alpha(palette.neutral[400], 0.3)}, 0px 1px 4px ${alpha( palette.neutral[800], 0.08 )}`, @@ -70,14 +70,15 @@ export const createComponents = ({ palette }) => { styleOverrides: { root: { backgroundColor: palette.background.paper, - borderColor: palette.neutral[300], - boxShadow: `0px 1px 2px 0px ${alpha(palette.neutral[800], 0.08)}`, + borderColor: alpha(palette.neutral[400], 0.2), + boxShadow: `0px 1px 3px 0px ${alpha(palette.neutral[800], 0.06)}`, "&:hover": { backgroundColor: palette.background.paper, + borderColor: alpha(palette.neutral[400], 0.3), }, [`&.${filledInputClasses.disabled}`]: { - backgroundColor: palette.action.disabledBackground, - borderColor: palette.neutral[300], + backgroundColor: alpha(palette.neutral[100], 0.5), + borderColor: alpha(palette.neutral[300], 0.2), boxShadow: "none", }, [`&.${filledInputClasses.focused}`]: { @@ -150,7 +151,7 @@ export const createComponents = ({ palette }) => { MuiSkeleton: { styleOverrides: { root: { - backgroundColor: palette.neutral[100], + backgroundColor: palette.neutral[200], }, }, }, @@ -191,12 +192,13 @@ export const createComponents = ({ palette }) => { MuiTableHead: { styleOverrides: { root: { - backgroundColor: palette.neutral[50], + backgroundColor: alpha(palette.neutral[200], 0.4), borderBottomWidth: 1, borderBottomStyle: "solid", borderBottomColor: palette.divider, [`.${tableCellClasses.root}`]: { - color: palette.text.secondary, + color: palette.text.primary, + fontWeight: 600, }, }, }, @@ -206,7 +208,7 @@ export const createComponents = ({ palette }) => { root: { [`&.${tableRowClasses.hover}`]: { "&:hover": { - backgroundColor: palette.neutral[50], + backgroundColor: alpha(palette.neutral[200], 0.3), }, }, }, diff --git a/src/theme/light/create-palette.js b/src/theme/light/create-palette.js index 5626cc6bdc69..39c3af0cbee6 100644 --- a/src/theme/light/create-palette.js +++ b/src/theme/light/create-palette.js @@ -16,10 +16,10 @@ export const createPalette = (config) => { selected: alpha(neutral[900], 0.12) }, background: { - default: contrast === 'high' ? '#FCFCFD' : common.white, - paper: common.white + default: contrast === 'high' ? '#F4F5F7' : '#F0F2F5', + paper: '#FAFBFC' }, - divider: '#F2F4F7', + divider: alpha(neutral[400], 0.2), error, info, mode: 'light', diff --git a/src/theme/light/create-shadows.js b/src/theme/light/create-shadows.js index fea93a0be27f..71af131a402d 100644 --- a/src/theme/light/create-shadows.js +++ b/src/theme/light/create-shadows.js @@ -2,8 +2,8 @@ import { alpha } from '@mui/material/styles'; export const createShadows = (config) => { const { palette } = config; - const layer1Color = palette.neutral[200]; - const layer2Color = alpha(palette.neutral[800], 0.08); + const layer1Color = palette.neutral[250] || alpha(palette.neutral[300], 0.7); + const layer2Color = alpha(palette.neutral[800], 0.06); return [ 'none', From 31ef2f2d884259c0ee81a6aab9c8e12cf6c6fe10 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:51:29 +0200 Subject: [PATCH 66/86] adaptiveness toolbar --- .../CippTable/CIPPTableToptoolbar.js | 236 +++++++++++------- 1 file changed, 149 insertions(+), 87 deletions(-) diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index 1a59e591751d..94373316ebb5 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -1,4 +1,3 @@ - import React, { useState, useEffect, useRef } from "react"; import { Box, @@ -56,7 +55,9 @@ import { Stack } from "@mui/system"; const ModernSearchContainer = styled(Paper)(({ theme }) => ({ display: "flex", alignItems: "center", - width: "300px", + width: "100%", + maxWidth: "300px", + minWidth: "200px", height: "40px", backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, @@ -69,6 +70,14 @@ const ModernSearchContainer = styled(Paper)(({ theme }) => ({ borderColor: theme.palette.primary.main, boxShadow: `0 0 0 2px ${alpha(theme.palette.primary.main, 0.2)}`, }, + [theme.breakpoints.down("md")]: { + minWidth: "150px", + maxWidth: "200px", + }, + [theme.breakpoints.down("sm")]: { + minWidth: "120px", + maxWidth: "150px", + }, })); const ModernSearchInput = styled(InputBase)(({ theme }) => ({ @@ -94,6 +103,8 @@ const ModernButton = styled(Button)(({ theme }) => ({ backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, color: theme.palette.text.primary, + minWidth: "auto", + whiteSpace: "nowrap", "&:hover": { backgroundColor: theme.palette.mode === "dark" ? "#363A4A" : "#F0F0F0", borderColor: theme.palette.primary.main, @@ -104,6 +115,26 @@ const ModernButton = styled(Button)(({ theme }) => ({ "& .MuiButton-endIcon": { marginLeft: "8px", }, + [theme.breakpoints.down("md")]: { + padding: "8px 12px", + fontSize: "13px", + "& .MuiButton-startIcon": { + marginRight: "6px", + }, + "& .MuiButton-endIcon": { + marginLeft: "6px", + }, + }, + [theme.breakpoints.down("sm")]: { + padding: "8px 10px", + fontSize: "12px", + "& .MuiButton-startIcon": { + marginRight: "4px", + }, + "& .MuiButton-endIcon": { + marginLeft: "4px", + }, + }, })); const RefreshButton = styled(IconButton)(({ theme }) => ({ @@ -523,15 +554,25 @@ export const CIPPTableToptoolbar = ({ {/* Left side - Main controls */} - + {/* Refresh Button */} @@ -620,9 +663,6 @@ export const CIPPTableToptoolbar = ({ setFiltersAnchor(null); }} > - - {table.getState().showColumnFilters ? : } - {table.getState().showColumnFilters ? "Hide Column Filters" : "Show Column Filters"} @@ -650,9 +690,9 @@ export const CIPPTableToptoolbar = ({ setTableFilter(filter.value, filter.type, filter.filterName); }} > - + {activeFilterName === filter.filterName && ( )} @@ -779,14 +819,60 @@ export const CIPPTableToptoolbar = ({ {/* Right side - Additional controls */} - + {/* Selected rows indicator */} {(table.getIsAllRowsSelected() || table.getIsSomeRowsSelected()) && ( - + {table.getSelectedRowModel().rows.length} rows selected )} + {/* Bulk Actions - inline with toolbar */} + {actions && + getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && + (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( + + )} + {/* Cold start indicator */} {getRequestData?.data?.pages?.[0].Metadata?.ColdStart === true && ( @@ -823,80 +909,56 @@ export const CIPPTableToptoolbar = ({ /> - - {/* Bulk Actions Menu */} - {actions && - getBulkActions(actions, table.getSelectedRowModel().rows).length > 0 && - (table.getIsSomeRowsSelected() || table.getIsAllRowsSelected()) && ( - - - - {getBulkActions(actions, table.getSelectedRowModel().rows).map( - (action, index) => ( - { - if (action.disabled) return; - setActionData({ - data: table.getSelectedRowModel().rows.map((row) => row.original), - action: action, - ready: true, - }); - - if (action?.noConfirm && action.customFunction) { - table - .getSelectedRowModel() - .rows.map((row) => - action.customFunction(row.original.original, action, {}) - ); - } else { - createDialog.handleOpen(); - popover.handleClose(); - } - }} - > - - {action.icon} - - {action.label} - - ) - )} - - - )} + }} + > + + {action.icon} + + {action.label} + + ))} + {/* API Response Off-Canvas */} Date: Tue, 9 Sep 2025 19:59:23 +0200 Subject: [PATCH 67/86] table toolbar --- .../CippTable/CIPPTableToptoolbar.js | 72 ++++++++----------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index 94373316ebb5..6c97949fbca7 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -137,17 +137,7 @@ const ModernButton = styled(Button)(({ theme }) => ({ }, })); -const RefreshButton = styled(IconButton)(({ theme }) => ({ - height: "40px", - width: "40px", - borderRadius: "8px", - backgroundColor: theme.palette.mode === "dark" ? "#2A2D3A" : "#F8F9FA", - border: `1px solid ${theme.palette.mode === "dark" ? "#404040" : "#E0E0E0"}`, - "&:hover": { - backgroundColor: theme.palette.mode === "dark" ? "#363A4A" : "#F0F0F0", - borderColor: theme.palette.primary.main, - }, -})); +const RefreshButton = styled(IconButton)(({ theme }) => ({})); export const CIPPTableToptoolbar = ({ api, @@ -189,7 +179,6 @@ export const CIPPTableToptoolbar = ({ const [activeFilterName, setActiveFilterName] = useState(null); const pageName = router.pathname.split("/").slice(1).join("/"); const currentTenant = settings?.currentTenant; - const queryClient = useQueryClient(); // Track if we've restored filters for this page to prevent infinite loops const restoredFiltersRef = useRef(new Set()); @@ -556,7 +545,7 @@ export const CIPPTableToptoolbar = ({ display: "flex", flexDirection: { xs: "column", md: "row" }, gap: { xs: 1, md: 2 }, - p: 2, + p: 0.5, justifyContent: "space-between", alignItems: { xs: "stretch", md: "center" }, backgroundColor: "background.paper", @@ -928,36 +917,35 @@ export const CIPPTableToptoolbar = ({ vertical: "top", }} > - {actions && getBulkActions(actions, table.getSelectedRowModel().rows).map((action, index) => ( - { - if (action.disabled) return; - setActionData({ - data: table.getSelectedRowModel().rows.map((row) => row.original), - action: action, - ready: true, - }); + {actions && + getBulkActions(actions, table.getSelectedRowModel().rows).map((action, index) => ( + { + if (action.disabled) return; + setActionData({ + data: table.getSelectedRowModel().rows.map((row) => row.original), + action: action, + ready: true, + }); - if (action?.noConfirm && action.customFunction) { - table - .getSelectedRowModel() - .rows.map((row) => - action.customFunction(row.original.original, action, {}) - ); - } else { - createDialog.handleOpen(); - popover.handleClose(); - } - }} - > - - {action.icon} - - {action.label} - - ))} + if (action?.noConfirm && action.customFunction) { + table + .getSelectedRowModel() + .rows.map((row) => action.customFunction(row.original.original, action, {})); + } else { + createDialog.handleOpen(); + popover.handleClose(); + } + }} + > + + {action.icon} + + {action.label} + + ))} {/* API Response Off-Canvas */} From 073c2464d32f9c53789f6fcf5ed06692f4211430 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Tue, 9 Sep 2025 23:17:17 -0400 Subject: [PATCH 68/86] mobile friendly table menu --- .../CippTable/CIPPTableToptoolbar.js | 360 +++++++++++++----- 1 file changed, 275 insertions(+), 85 deletions(-) diff --git a/src/components/CippTable/CIPPTableToptoolbar.js b/src/components/CippTable/CIPPTableToptoolbar.js index 6c97949fbca7..c14da5ce3467 100644 --- a/src/components/CippTable/CIPPTableToptoolbar.js +++ b/src/components/CippTable/CIPPTableToptoolbar.js @@ -29,6 +29,8 @@ import { SevereCold, Sync, Check as CheckIcon, + MoreVert as MoreVertIcon, + Fullscreen as FullscreenIcon, } from "@mui/icons-material"; import { ExclamationCircleIcon, ChevronDownIcon } from "@heroicons/react/24/outline"; import { styled, alpha } from "@mui/material/styles"; @@ -71,12 +73,9 @@ const ModernSearchContainer = styled(Paper)(({ theme }) => ({ boxShadow: `0 0 0 2px ${alpha(theme.palette.primary.main, 0.2)}`, }, [theme.breakpoints.down("md")]: { - minWidth: "150px", - maxWidth: "200px", - }, - [theme.breakpoints.down("sm")]: { - minWidth: "120px", - maxWidth: "150px", + minWidth: "0", + maxWidth: "none", + flex: 1, }, })); @@ -164,6 +163,7 @@ export const CIPPTableToptoolbar = ({ const [filtersAnchor, setFiltersAnchor] = useState(null); const [columnsAnchor, setColumnsAnchor] = useState(null); const [exportAnchor, setExportAnchor] = useState(null); + const [actionMenuAnchor, setActionMenuAnchor] = useState(null); const [searchValue, setSearchValue] = useState(""); const mdDown = useMediaQuery((theme) => theme.breakpoints.down("md")); @@ -558,7 +558,7 @@ export const CIPPTableToptoolbar = ({ gap: { xs: 1, md: 2 }, alignItems: "center", flex: 1, - flexWrap: { xs: "wrap", md: "nowrap" }, + flexWrap: { xs: "nowrap", md: "nowrap" }, minWidth: 0, }} > @@ -622,18 +622,209 @@ export const CIPPTableToptoolbar = ({ /> - {/* Filters Button */} - } - endIcon={} - onClick={(event) => setFiltersAnchor(event.currentTarget)} - sx={{ - color: activeFilterName ? "primary.main" : "text.primary", - borderColor: activeFilterName ? "primary.main" : undefined, + {/* Desktop Buttons */} + {!mdDown && ( + <> + {/* Filters Button */} + } + endIcon={} + onClick={(event) => setFiltersAnchor(event.currentTarget)} + sx={{ + color: activeFilterName ? "primary.main" : "text.primary", + borderColor: activeFilterName ? "primary.main" : undefined, + }} + > + Filters + + setFiltersAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 200, + }, + }} + > + { + handleColumnFiltersToggle(); + setFiltersAnchor(null); + }} + > + + {table.getState().showColumnFilters + ? "Hide Column Filters" + : "Show Column Filters"} + + + + setTableFilter("", "reset", "")}> + + + {api?.url === "/api/ListGraphRequest" && ( + { + setFiltersAnchor(null); + setFilterCanvasVisible(true); + }} + > + + + )} + {filterList?.length > 0 && } + {filterList?.map((filter) => ( + { + setFiltersAnchor(null); + setTableFilter(filter.value, filter.type, filter.filterName); + }} + > + + {activeFilterName === filter.filterName && ( + + )} + {filter.filterName} + + } + /> + + ))} + + + {/* Columns Button */} + } + endIcon={} + onClick={(event) => setColumnsAnchor(event.currentTarget)} + > + Columns + + setColumnsAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 250, + maxHeight: 400, + }, + }} + > + + + + + + + + + + + {table + .getAllColumns() + .filter((column) => !column.id.startsWith("mrt-")) + .map((column) => ( + + setColumnVisibility({ + ...columnVisibility, + [column.id]: !column.getIsVisible(), + }) + } + > + + + + ))} + + + {/* Export Button */} + {exportEnabled && ( + } + endIcon={} + onClick={(event) => setExportAnchor(event.currentTarget)} + > + Export + + )} + + )} + + {/* Mobile Action Menu */} + setActionMenuAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 180, + }, }} > - Filters - + { + setFiltersAnchor(event.currentTarget); + setActionMenuAnchor(null); + }} + > + + + + Filters + + { + setColumnsAnchor(event.currentTarget); + setActionMenuAnchor(null); + }} + > + + + + Columns + + {exportEnabled && ( + { + setExportAnchor(event.currentTarget); + setActionMenuAnchor(null); + }} + > + + + + Export + + )} + { + table.setIsFullScreen(!table.getState().isFullScreen); + setActionMenuAnchor(null); + }} + > + + + + + {table.getState().isFullScreen ? "Exit Fullscreen" : "Fullscreen"} + + + + + {/* Filters Menu */} - {/* Columns Button */} - } - endIcon={} - onClick={(event) => setColumnsAnchor(event.currentTarget)} - > - Columns - + {/* Columns Menu */} - {/* Export Button */} + {/* Export Menu */} {exportEnabled && ( - <> - } - endIcon={} - onClick={(event) => setExportAnchor(event.currentTarget)} + setExportAnchor(null)} + PaperProps={{ + sx: { + mt: 1, + borderRadius: 2, + minWidth: 180, + }, + }} + > + { + // Trigger CSV export + const csvButton = document.querySelector("[data-csv-export]"); + if (csvButton) csvButton.click(); + setExportAnchor(null); + }} > - Export - - setExportAnchor(null)} - PaperProps={{ - sx: { - mt: 1, - borderRadius: 2, - minWidth: 180, - }, + + + + + + { + // Trigger PDF export + const pdfButton = document.querySelector("[data-pdf-export]"); + if (pdfButton) pdfButton.click(); + setExportAnchor(null); }} > - { - // Trigger CSV export - const csvButton = document.querySelector("[data-csv-export]"); - if (csvButton) csvButton.click(); - setExportAnchor(null); - }} - > - - - - - - { - // Trigger PDF export - const pdfButton = document.querySelector("[data-pdf-export]"); - if (pdfButton) pdfButton.click(); - setExportAnchor(null); - }} - > - - - - - - { - setOffcanvasVisible(true); - setExportAnchor(null); - }} - > - - - - - - - + + + + + + { + setOffcanvasVisible(true); + setExportAnchor(null); + }} + > + + + + + + + )} + + {/* Mobile Action Menu */} + {mdDown && ( + setActionMenuAnchor(event.currentTarget)} + size="small" + sx={{ + height: "40px", + width: "40px", + border: "1px solid", + borderColor: "divider", + borderRadius: "8px", + ml: "auto", + }} + > + + )} @@ -875,9 +1068,6 @@ export const CIPPTableToptoolbar = ({ queryKey={currentEffectiveQueryKey} title={title} /> - - {/* Full screen toggle for mobile */} - {mdDown && } {/* Hidden export buttons for triggering */} From e8cb81b06cb8790d4a53f84c2701e16f4ee2c432 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Wed, 10 Sep 2025 22:59:18 +0200 Subject: [PATCH 69/86] drift report added --- src/components/ExecutiveReportButton.js | 827 +++++++++++++++++++++--- 1 file changed, 725 insertions(+), 102 deletions(-) diff --git a/src/components/ExecutiveReportButton.js b/src/components/ExecutiveReportButton.js index 7469e8b38a07..da34559bf8d9 100644 --- a/src/components/ExecutiveReportButton.js +++ b/src/components/ExecutiveReportButton.js @@ -1,4 +1,4 @@ -import React, { useState, useMemo } from "react"; +import { useState, useMemo } from "react"; import { Button, Tooltip, @@ -13,16 +13,14 @@ import { Grid, Paper, IconButton, - Divider, } from "@mui/material"; -import { PictureAsPdf, Visibility, Download, Close, Settings } from "@mui/icons-material"; +import { PictureAsPdf, Download, Close, Settings } from "@mui/icons-material"; import { Document, Page, Text, View, StyleSheet, - PDFDownloadLink, PDFViewer, Image, Svg, @@ -45,9 +43,11 @@ const ExecutiveReportDocument = ({ deviceData, conditionalAccessData, standardsCompareData, + driftComplianceData, sectionConfig = { executiveSummary: true, securityStandards: true, + driftCompliance: false, secureScore: true, licenseManagement: true, deviceManagement: true, @@ -418,7 +418,7 @@ const ExecutiveReportDocument = ({ }, headerName: { - width: 100, + flex: 2, }, headerDesc: { @@ -442,7 +442,7 @@ const ExecutiveReportDocument = ({ }, cellName: { - width: 100, + flex: 1, fontSize: 8, fontWeight: "bold", color: "#2D3748", @@ -746,7 +746,133 @@ const ExecutiveReportDocument = ({ return processedStandards; }; + // PROCESS DRIFT COMPLIANCE DATA + const processDriftComplianceData = (driftData, standardsCompareData) => { + if (!driftData || !Array.isArray(driftData) || driftData.length === 0) { + return { + acceptedDeviationsCount: 0, + currentDeviationsCount: 0, + deniedDeviationsCount: 0, + customerSpecificDeviationsCount: 0, + alignedCount: 0, + acceptedDeviations: [], + currentDeviations: [], + deniedDeviations: [], + customerSpecificDeviations: [], + appliedStandards: [], + }; + } + + // Get standards data for pretty names + let standardsData = null; + try { + standardsData = require("../data/standards.json"); + } catch (error) {} + + // Helper function to get pretty name from standards.json (same as manage-drift) + const getStandardPrettyName = (standardName) => { + if (!standardName) return "Unknown Standard"; + const standard = standardsData?.find((s) => s.name === standardName); + if (standard && standard.label) { + return standard.label; + } + return null; + }; + + // Helper function to process deviations with pretty names + const processDeviations = (deviations) => { + return (deviations || []).map((deviation) => ({ + ...deviation, + prettyName: + deviation.standardDisplayName || + getStandardPrettyName(deviation.standardName) || + deviation.standardName || + "Unknown Standard", + })); + }; + + // Aggregate data across all standards for this tenant + const aggregatedData = driftData.reduce( + (acc, item) => { + acc.acceptedDeviationsCount += item.acceptedDeviationsCount || 0; + acc.currentDeviationsCount += item.currentDeviationsCount || 0; + acc.alignedCount += item.alignedCount || 0; + acc.customerSpecificDeviationsCount += item.customerSpecificDeviationsCount || 0; + acc.deniedDeviationsCount += item.deniedDeviationsCount || 0; + + // Collect deviations with pretty names + if (item.currentDeviations && Array.isArray(item.currentDeviations)) { + acc.currentDeviations.push( + ...processDeviations(item.currentDeviations.filter((dev) => dev !== null)) + ); + } + if (item.acceptedDeviations && Array.isArray(item.acceptedDeviations)) { + acc.acceptedDeviations.push( + ...processDeviations(item.acceptedDeviations.filter((dev) => dev !== null)) + ); + } + if (item.customerSpecificDeviations && Array.isArray(item.customerSpecificDeviations)) { + acc.customerSpecificDeviations.push( + ...processDeviations(item.customerSpecificDeviations.filter((dev) => dev !== null)) + ); + } + if (item.deniedDeviations && Array.isArray(item.deniedDeviations)) { + acc.deniedDeviations.push( + ...processDeviations(item.deniedDeviations.filter((dev) => dev !== null)) + ); + } + + return acc; + }, + { + acceptedDeviationsCount: 0, + currentDeviationsCount: 0, + alignedCount: 0, + customerSpecificDeviationsCount: 0, + deniedDeviationsCount: 0, + currentDeviations: [], + acceptedDeviations: [], + customerSpecificDeviations: [], + deniedDeviations: [], + appliedStandards: [], + } + ); + + // Get complete list of applied standards from standards comparison data (like policies-deployed) + if ( + standardsData && + standardsCompareData && + Array.isArray(standardsCompareData) && + standardsCompareData.length > 0 + ) { + const tenantData = standardsCompareData[0]; + const appliedStandards = []; + + // Process each standard from the API response + Object.keys(tenantData).forEach((key) => { + if (key.startsWith("standards.") && key !== "tenantFilter") { + const standardKey = key; + const standardDef = standardsData.find((std) => std.name === standardKey); + + if (standardDef) { + appliedStandards.push({ + name: standardDef.label || standardKey, + executiveDescription: + standardDef.executiveText || standardDef.helpText || "No description available", + category: standardDef.cat || "General", + }); + } + } + }); + + aggregatedData.appliedStandards = appliedStandards; + } + + return aggregatedData; + }; + let securityControls = processStandardsData(standardsCompareData); + let driftComplianceInfo = processDriftComplianceData(driftComplianceData, standardsCompareData); const getBadgeStyle = (status) => { switch (status) { @@ -882,8 +1008,9 @@ const ExecutiveReportDocument = ({ )} - {/* SECURITY CONTROLS - Only show if standards data is available and enabled */} + {/* SECURITY CONTROLS - Only show if standards data is available and enabled and drift compliance is disabled */} {sectionConfig.securityStandards && + !sectionConfig.driftCompliance && (() => { return securityControls && securityControls.length > 0; })() && ( @@ -925,25 +1052,17 @@ const ExecutiveReportDocument = ({ {securityControls.map((control, index) => ( - + - {control.name} + {control.name.length > 100 + ? control.name.substring(0, 100) + "..." + : control.name} {control.description} - - {(() => { - if (typeof control.tags === "object") { - console.log( - "DEBUG: control.tags is an object:", - control.tags, - "for control:", - control.name - ); - } - return control.tags; - })()} + + {control.tags.length > 0 ? control.tags : "No tags"} {control.status} @@ -997,6 +1116,532 @@ const ExecutiveReportDocument = ({ )} + {/* DRIFT COMPLIANCE - Only show if drift compliance is enabled and security standards is disabled */} + {sectionConfig.driftCompliance && + !sectionConfig.securityStandards && + driftComplianceInfo && + (driftComplianceInfo.currentDeviationsCount > 0 || + driftComplianceInfo.acceptedDeviationsCount > 0 || + driftComplianceInfo.deniedDeviationsCount > 0 || + driftComplianceInfo.customerSpecificDeviationsCount > 0 || + driftComplianceInfo.appliedStandards.length > 0) && ( + <> + + + + Drift Compliance Assessment + + Detailed evaluation of policy drift and compliance deviations + + + {brandingSettings?.logo && ( + + )} + + + + + Your drift compliance assessment shows how your current security policies compare + to your organization's approved standards. This analysis helps identify where + configurations have drifted from intended baselines and provides insights into + policy compliance across your Microsoft 365 environment. + + + + {/* Drift Overview Chart */} + + Drift Compliance Overview + + + Policy Deviation Distribution + + + {(() => { + const chartData = [ + driftComplianceInfo.alignedCount, + driftComplianceInfo.acceptedDeviationsCount, + driftComplianceInfo.customerSpecificDeviationsCount, + driftComplianceInfo.currentDeviationsCount, + driftComplianceInfo.deniedDeviationsCount, + ]; + const chartLabels = [ + "Aligned Policies", + "Accepted Deviations", + "Client Specific Deviations", + "Current Deviations", + "Denied Deviations", + ]; + const chartColors = ["#10B981", "#3B82F6", "#8B5CF6", "#F59E0B", "#EF4444"]; + + const total = chartData.reduce((sum, value) => sum + value, 0); + if (total === 0) return null; + + const centerX = 200; + const centerY = 100; + const outerRadius = 60; + const innerRadius = 25; // For donut effect + + let currentAngle = 0; + + return ( + <> + {/* Donut Chart */} + {chartData.map((value, index) => { + if (value === 0) return null; + + const angle = (value / total) * 360; + const startAngle = currentAngle; + const endAngle = currentAngle + angle; + + // Outer arc points + const outerStartX = centerX + outerRadius * Math.cos((startAngle * Math.PI) / 180); + const outerStartY = centerY + outerRadius * Math.sin((startAngle * Math.PI) / 180); + const outerEndX = centerX + outerRadius * Math.cos((endAngle * Math.PI) / 180); + const outerEndY = centerY + outerRadius * Math.sin((endAngle * Math.PI) / 180); + + // Inner arc points + const innerStartX = centerX + innerRadius * Math.cos((startAngle * Math.PI) / 180); + const innerStartY = centerY + innerRadius * Math.sin((startAngle * Math.PI) / 180); + const innerEndX = centerX + innerRadius * Math.cos((endAngle * Math.PI) / 180); + const innerEndY = centerY + innerRadius * Math.sin((endAngle * Math.PI) / 180); + + const largeArcFlag = angle > 180 ? 1 : 0; + + // Create donut path + const pathData = [ + `M ${outerStartX} ${outerStartY}`, + `A ${outerRadius} ${outerRadius} 0 ${largeArcFlag} 1 ${outerEndX} ${outerEndY}`, + `L ${innerEndX} ${innerEndY}`, + `A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 0 ${innerStartX} ${innerStartY}`, + 'Z' + ].join(' '); + + currentAngle += angle; + + return ( + + ); + })} + + {/* Center text */} + + {total} + + + Total Policies + + + {/* Clean Horizontal Legend at Bottom */} + {(() => { + const visibleItems = chartData + .map((value, index) => ({ + value, + index, + label: chartLabels[index].replace(" Deviations", "").replace(" Policies", ""), + color: chartColors[index] + })) + .filter(item => item.value > 0); + + return visibleItems.map((item, displayIndex) => { + const legendX = 30 + displayIndex * 90; + const legendY = 175; + + return ( + + + + {item.label} ({item.value}) + + + ); + }); + })()} + + ); + })()} + + + + + + {/* Deviation Statistics */} + + Deviation Statistics + + + + + {driftComplianceInfo.acceptedDeviationsCount} + + Accepted Deviations + + + + {driftComplianceInfo.customerSpecificDeviationsCount} + + Client Specific + + + + {driftComplianceInfo.deniedDeviationsCount} + + Denied Deviations + + + + {driftComplianceInfo.currentDeviationsCount} + + Current Deviations + + + + + {/* Chart Legend Explanations */} + + Deviation Types Explained + + + + + + Aligned: Policies that match + the approved template exactly with no deviations + + + + + + Accepted Deviations: Policy + differences that have been reviewed and approved by administrators + + + + + + Client Specific Deviations:{" "} + Policy configurations approved as customer-specific business requirements + + + + + + Current Deviations: Policy + differences that require review and administrative action + + + + + + Denied Deviations: Policy + differences that have been rejected and require remediation + + + + + + + `Page ${pageNumber} of ${totalPages}`} + /> + + + + {/* Deviations Detail Page */} + {(driftComplianceInfo.currentDeviations.length > 0 || + driftComplianceInfo.acceptedDeviations.length > 0 || + driftComplianceInfo.deniedDeviations.length > 0 || + driftComplianceInfo.customerSpecificDeviations.length > 0) && ( + + + + Policy Deviations Detail + + Comprehensive list of all policy deviations and their status + + + {brandingSettings?.logo && ( + + )} + + + + + The following table shows all identified policy deviations, their current + status, and executive descriptions of what each deviation means for your + organization's security posture and compliance requirements. + + + + + Policy Deviations + + + + Policy + + Description + + Status + + + {/* Current Deviations */} + {driftComplianceInfo.currentDeviations.slice(0, 5).map((deviation, index) => { + let standardsData = null; + try { + standardsData = require("../data/standards.json"); + } catch (error) {} + + const standardDef = standardsData?.find( + (std) => std.name === deviation.standardName + ); + const description = + standardDef?.executiveText || + standardDef?.helpText || + "Policy deviation detected"; + + return ( + + + {deviation.prettyName || "Unknown Policy"} + + + {description} + + + Current + + + ); + })} + + {/* Accepted Deviations */} + {driftComplianceInfo.acceptedDeviations.slice(0, 3).map((deviation, index) => { + let standardsData = null; + try { + standardsData = require("../data/standards.json"); + } catch (error) {} + + const standardDef = standardsData?.find( + (std) => std.name === deviation.standardName + ); + const description = + standardDef?.executiveText || + standardDef?.helpText || + "Accepted policy deviation"; + + return ( + + + {deviation.prettyName || "Unknown Policy"} + + + {description} + + + + Accepted + + + + ); + })} + + {/* Customer Specific Deviations */} + {driftComplianceInfo.customerSpecificDeviations + .slice(0, 3) + .map((deviation, index) => { + let standardsData = null; + try { + standardsData = require("../data/standards.json"); + } catch (error) {} + + const standardDef = standardsData?.find( + (std) => std.name === deviation.standardName + ); + const description = + standardDef?.executiveText || + standardDef?.helpText || + "Customer-specific policy configuration"; + + return ( + + + {deviation.prettyName || "Unknown Policy"} + + + {description} + + + + Client Specific + + + + ); + })} + + {/* Denied Deviations */} + {driftComplianceInfo.deniedDeviations.slice(0, 2).map((deviation, index) => { + let standardsData = null; + try { + standardsData = require("../data/standards.json"); + } catch (error) {} + + const standardDef = standardsData?.find( + (std) => std.name === deviation.standardName + ); + const description = + standardDef?.executiveText || + standardDef?.helpText || + "Denied policy deviation"; + + return ( + + + {deviation.prettyName || "Unknown Policy"} + + + {description} + + + Denied + + + ); + })} + + + + + `Page ${pageNumber} of ${totalPages}`} + /> + + + )} + + {/* Applied Standards Page */} + {driftComplianceInfo.appliedStandards.length > 0 && ( + + + + Applied Standards + + Security standards currently implemented in your environment + + + {brandingSettings?.logo && ( + + )} + + + + + These are the security standards that have been applied to your Microsoft 365 + environment. Each standard represents a specific security control or policy + designed to protect your organization's data and systems. + + + + {/* Group standards by category */} + {(() => { + const groupedStandards = driftComplianceInfo.appliedStandards.reduce( + (acc, standard) => { + const category = standard.category || "General"; + if (!acc[category]) acc[category] = []; + acc[category].push(standard); + return acc; + }, + {} + ); + + return Object.entries(groupedStandards).map(([category, standards]) => ( + + {category} + + {standards.map((standard, index) => ( + + + + {standard.name}:{" "} + {standard.executiveDescription} + + + ))} + + + )); + })()} + + + Compliance Summary + + + Overall Compliance Status + + Your organization has {driftComplianceInfo.appliedStandards.length} security + standards implemented with {driftComplianceInfo.alignedCount} policies fully + aligned,{" "} + {driftComplianceInfo.acceptedDeviationsCount + + driftComplianceInfo.customerSpecificDeviationsCount}{" "} + approved deviations, and {driftComplianceInfo.currentDeviationsCount}{" "} + deviations requiring attention. + + + + + + `Page ${pageNumber} of ${totalPages}`} + /> + + + )} + + )} + {/* STATISTIC PAGE 2 - CHAPTER SPLITTER - Only show if secure score data is available and enabled */} {sectionConfig.infographics && sectionConfig.secureScore && @@ -1326,12 +1971,6 @@ const ExecutiveReportDocument = ({ {(() => { const licenseValue = license.License || license.license || "N/A"; if (typeof licenseValue === "object") { - console.log( - "DEBUG: license name is an object:", - licenseValue, - "full license:", - license - ); } return licenseValue; })()} @@ -1362,12 +2001,6 @@ const ExecutiveReportDocument = ({ const countAvailable = license.CountAvailable || license.countAvailable || "0"; if (typeof countAvailable === "object") { - console.log( - "DEBUG: license.CountAvailable is an object:", - countAvailable, - "full license:", - license - ); } return countAvailable; })()} @@ -1382,12 +2015,6 @@ const ExecutiveReportDocument = ({ const totalLicenses = license.TotalLicenses || license.totalLicenses || "0"; if (typeof totalLicenses === "object") { - console.log( - "DEBUG: license.TotalLicenses is an object:", - totalLicenses, - "full license:", - license - ); } return totalLicenses; })()} @@ -1559,12 +2186,6 @@ const ExecutiveReportDocument = ({ {(() => { const deviceName = device.deviceName || "N/A"; if (typeof deviceName === "object") { - console.log( - "DEBUG: device.deviceName is an object:", - deviceName, - "full device:", - device - ); } return deviceName; })()} @@ -1573,12 +2194,6 @@ const ExecutiveReportDocument = ({ {(() => { const operatingSystem = device.operatingSystem || "N/A"; if (typeof operatingSystem === "object") { - console.log( - "DEBUG: device.operatingSystem is an object:", - operatingSystem, - "full device:", - device - ); } return operatingSystem; })()} @@ -1595,12 +2210,6 @@ const ExecutiveReportDocument = ({ {(() => { const complianceState = device.complianceState || "Unknown"; if (typeof complianceState === "object") { - console.log( - "DEBUG: device.complianceState is an object:", - complianceState, - "full device:", - device - ); } return complianceState; })()} @@ -1777,12 +2386,6 @@ const ExecutiveReportDocument = ({ {(() => { const displayName = policy.displayName || "N/A"; if (typeof displayName === "object") { - console.log( - "DEBUG: policy.displayName is an object:", - displayName, - "full policy:", - policy - ); } return displayName; })()} @@ -1796,12 +2399,6 @@ const ExecutiveReportDocument = ({ {(() => { const includeApplications = policy.includeApplications || "All"; if (typeof includeApplications === "object") { - console.log( - "DEBUG: policy.includeApplications is an object:", - includeApplications, - "full policy:", - policy - ); } return includeApplications; })()} @@ -1927,7 +2524,6 @@ const ExecutiveReportDocument = ({ export const ExecutiveReportButton = (props) => { const { tenantName, tenantId, userStats, standardsData, organizationData, ...other } = props; - console.log(props); const settings = useSettings(); const brandingSettings = settings.customBranding; @@ -1936,6 +2532,7 @@ export const ExecutiveReportButton = (props) => { const [sectionConfig, setSectionConfig] = useState({ executiveSummary: true, securityStandards: true, + driftCompliance: false, secureScore: true, licenseManagement: true, deviceManagement: true, @@ -1955,7 +2552,7 @@ export const ExecutiveReportButton = (props) => { queryKey: `licenses-report-${settings.currentTenant}`, waiting: previewOpen, }); - + // Get real device data - only when preview is open const deviceData = ApiGetCall({ url: "/api/ListDevices", @@ -1986,22 +2583,34 @@ export const ExecutiveReportButton = (props) => { waiting: previewOpen, }); - // Check if all data is loaded (either successful or failed) - only relevant when preview is open - const isDataLoading = previewOpen && ( - secureScore.isFetching || - licenseData.isFetching || - deviceData.isFetching || - conditionalAccessData.isFetching || - standardsCompareData.isFetching - ); + // Get drift compliance data - only when preview is open + const driftComplianceData = ApiGetCall({ + url: "/api/listTenantDrift", + data: { + TenantFilter: settings.currentTenant, + }, + queryKey: `drift-compliance-report-${settings.currentTenant}`, + waiting: previewOpen, + }); - const hasAllDataFinished = !previewOpen || ( - (secureScore.isSuccess || secureScore.isError) && - (licenseData.isSuccess || licenseData.isError) && - (deviceData.isSuccess || deviceData.isError) && - (conditionalAccessData.isSuccess || conditionalAccessData.isError) && - (standardsCompareData.isSuccess || standardsCompareData.isError) - ); + // Check if all data is loaded (either successful or failed) - only relevant when preview is open + const isDataLoading = + previewOpen && + (secureScore.isFetching || + licenseData.isFetching || + deviceData.isFetching || + conditionalAccessData.isFetching || + standardsCompareData.isFetching || + driftComplianceData.isFetching); + + const hasAllDataFinished = + !previewOpen || + ((secureScore.isSuccess || secureScore.isError) && + (licenseData.isSuccess || licenseData.isError) && + (deviceData.isSuccess || deviceData.isError) && + (conditionalAccessData.isSuccess || conditionalAccessData.isError) && + (standardsCompareData.isSuccess || standardsCompareData.isError) && + (driftComplianceData.isSuccess || driftComplianceData.isError)); // Button is always available now since we don't need to wait for data const shouldShowButton = true; @@ -2030,21 +2639,6 @@ export const ExecutiveReportButton = (props) => { ); } - console.log("Creating report document with:", { - tenantName, - tenantId, - userStats, - standardsData, - organizationData, - brandingSettings, - secureScore: secureScore.isSuccess ? secureScore : null, - licensingData: licenseData.isSuccess ? licenseData?.data : null, - deviceData: deviceData.isSuccess ? deviceData?.data : null, - conditionalAccessData: conditionalAccessData.isSuccess ? conditionalAccessData?.data : null, - standardsCompareData: standardsCompareData.isSuccess ? standardsCompareData?.data : null, - sectionConfig, - }); - try { return ( { conditionalAccessData.isSuccess ? conditionalAccessData?.data : null } standardsCompareData={standardsCompareData.isSuccess ? standardsCompareData?.data : null} + driftComplianceData={driftComplianceData.isSuccess ? driftComplianceData?.data : null} sectionConfig={sectionConfig} /> ); @@ -2090,10 +2685,11 @@ export const ExecutiveReportButton = (props) => { deviceData?.isSuccess, conditionalAccessData?.isSuccess, standardsCompareData?.isSuccess, + driftComplianceData?.isSuccess, JSON.stringify(sectionConfig), // Stringify to prevent reference issues ]); - // Handle section toggle + // Handle section toggle with mutual exclusion logic const handleSectionToggle = (sectionKey) => { setSectionConfig((prev) => { // Count currently enabled sections @@ -2104,6 +2700,25 @@ export const ExecutiveReportButton = (props) => { return prev; // Don't change state } + // Mutual exclusion logic for Security Standards and Drift Compliance + if (sectionKey === "securityStandards" && !prev[sectionKey]) { + // Enabling Security Standards, disable Drift Compliance + return { + ...prev, + securityStandards: true, + driftCompliance: false, + }; + } + + if (sectionKey === "driftCompliance" && !prev[sectionKey]) { + // Enabling Drift Compliance, disable Security Standards + return { + ...prev, + driftCompliance: true, + securityStandards: false, + }; + } + return { ...prev, [sectionKey]: !prev[sectionKey], @@ -2128,6 +2743,11 @@ export const ExecutiveReportButton = (props) => { label: "Security Standards", description: "Compliance assessment and standards evaluation", }, + { + key: "driftCompliance", + label: "Drift Compliance", + description: "Policy drift analysis and deviation management", + }, { key: "secureScore", label: "Microsoft Secure Score", @@ -2389,6 +3009,9 @@ export const ExecutiveReportButton = (props) => { standardsCompareData={ standardsCompareData.isSuccess ? standardsCompareData?.data : null } + driftComplianceData={ + driftComplianceData.isSuccess ? driftComplianceData?.data : null + } sectionConfig={sectionConfig} /> ); From 6e2569cd3a448e3028f9b8cfe059fe89be913257 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Wed, 10 Sep 2025 23:23:56 +0200 Subject: [PATCH 70/86] standards drift --- src/pages/index.js | 95 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 20 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index a898b2b73c28..4aaa3606a4f1 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,6 +1,6 @@ import Head from "next/head"; import { useEffect, useState } from "react"; -import { Box, Container, Button, Card, CardContent, Tooltip } from "@mui/material"; +import { Box, Container, Button, Card, CardContent } from "@mui/material"; import { Grid } from "@mui/system"; import { CippInfoBar } from "../components/CippCards/CippInfoBar"; import { CippChartCard } from "../components/CippCards/CippChartCard"; @@ -14,13 +14,11 @@ import { CippUniversalSearch } from "../components/CippCards/CippUniversalSearch import { ApiGetCall } from "../api/ApiCall.jsx"; import { CippCopyToClipBoard } from "../components/CippComponents/CippCopyToClipboard.jsx"; import { ExecutiveReportButton } from "../components/ExecutiveReportButton.js"; -import { CippStandardsDialog } from "../components/CippCards/CippStandardsDialog.jsx"; const Page = () => { const settings = useSettings(); const { currentTenant } = settings; const [domainVisible, setDomainVisible] = useState(false); - const [standardsDialogOpen, setStandardsDialogOpen] = useState(false); const organization = ApiGetCall({ url: "/api/ListOrg", @@ -55,6 +53,14 @@ const Page = () => { queryKey: `${currentTenant}-ListStandardTemplates`, }); + const driftApi = ApiGetCall({ + url: "/api/listTenantDrift", + data: { + TenantFilter: currentTenant, + }, + queryKey: `TenantDrift-${currentTenant}`, + }); + const partners = ApiGetCall({ url: "/api/ListGraphRequest", queryKey: `${currentTenant}-ListPartners`, @@ -100,6 +106,45 @@ const Page = () => { }, ]; + // Process drift data for chart - filter by current tenant and aggregate + const processDriftDataForTenant = (driftData, currentTenant) => { + if (!driftData) { + return { + alignedCount: 0, + acceptedDeviationsCount: 0, + currentDeviationsCount: 0, + customerSpecificDeviations: 0, + hasData: false, + }; + } + + const rawDriftData = driftData || []; + const tenantDriftData = Array.isArray(rawDriftData) + ? rawDriftData.filter((item) => item.tenantFilter === currentTenant) + : []; + + const hasData = tenantDriftData.length > 0; + + // Aggregate data across all standards for this tenant + const aggregatedData = tenantDriftData.reduce( + (acc, item) => { + acc.acceptedDeviationsCount += item.acceptedDeviationsCount || 0; + acc.currentDeviationsCount += item.currentDeviationsCount || 0; + acc.alignedCount += item.alignedCount || 0; + acc.customerSpecificDeviations += item.customerSpecificDeviationsCount || 0; + return acc; + }, + { + acceptedDeviationsCount: 0, + currentDeviationsCount: 0, + alignedCount: 0, + customerSpecificDeviations: 0, + } + ); + + return { ...aggregatedData, hasData }; + }; + function getActionCountsForTenant(standardsData, currentTenant) { if (!standardsData) { return { @@ -161,6 +206,7 @@ const Page = () => { return { remediateCount, alertCount, reportCount, total }; } + const driftData = processDriftDataForTenant(driftApi.data, currentTenant); const { remediateCount, alertCount, reportCount, total } = getActionCountsForTenant( standards.data, currentTenant @@ -253,7 +299,7 @@ const Page = () => { guests: dashboard.data?.Guests || 0, globalAdmins: GlobalAdminList.data?.Results?.length || 0 }} - standardsData={standards.data} + standardsData={driftApi.data} organizationData={organization.data} disabled={organization.isFetching || dashboard.isFetching} /> @@ -293,16 +339,31 @@ const Page = () => { - - setStandardsDialogOpen(true)} - /> - + @@ -400,12 +461,6 @@ const Page = () => { - setStandardsDialogOpen(false)} - standardsData={standards.data} - currentTenant={currentTenant} - /> ); }; From 59579263d6cbafdaf1d674f1ce5a996edbca4fef Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 11 Sep 2025 00:29:39 +0200 Subject: [PATCH 71/86] Add package ability --- .../endpoint/MEM/list-templates/index.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pages/endpoint/MEM/list-templates/index.js b/src/pages/endpoint/MEM/list-templates/index.js index d5e8fa18e5e5..458f090ba53c 100644 --- a/src/pages/endpoint/MEM/list-templates/index.js +++ b/src/pages/endpoint/MEM/list-templates/index.js @@ -1,7 +1,7 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; import { PencilIcon, TrashIcon } from "@heroicons/react/24/outline"; -import { Edit, GitHub } from "@mui/icons-material"; +import { Edit, GitHub, LocalOffer } from "@mui/icons-material"; import CippJsonView from "../../../../components/CippFormPages/CippJSONView"; import { ApiGetCall } from "/src/api/ApiCall"; import { CippPolicyImportDrawer } from "/src/components/CippComponents/CippPolicyImportDrawer.jsx"; @@ -47,6 +47,27 @@ const Page = () => { icon: , color: "info", }, + { + label: "Add to package", + type: "POST", + url: "/api/ExecSetPackageTag", + data: { GUID: "GUID" }, + fields: [ + { + type: "textField", + name: "Package", + label: "Package Name", + required: true, + validators: { + required: { value: true, message: "Package name is required" }, + }, + }, + ], + confirmText: "Enter the package name to assign to the selected template(s).", + multiPost: true, + icon: , + color: "info", + }, { label: "Save to GitHub", type: "POST", @@ -108,7 +129,7 @@ const Page = () => { size: "lg", }; - const simpleColumns = ["displayName", "description", "Type"]; + const simpleColumns = ["displayName", "package", "description", "Type"]; return ( <> From 9ea72f2dfde7f3b4e1d480c043934d50e13a5a27 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 11 Sep 2025 22:16:03 +0200 Subject: [PATCH 72/86] Add catalog button --- .../CippComponents/CippPolicyImportDrawer.jsx | 4 +++- .../CippStandards/CippStandardAccordion.jsx | 12 ++++++++++++ src/data/standards.json | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/CippComponents/CippPolicyImportDrawer.jsx b/src/components/CippComponents/CippPolicyImportDrawer.jsx index be1435efaeb2..9ba29343b7da 100644 --- a/src/components/CippComponents/CippPolicyImportDrawer.jsx +++ b/src/components/CippComponents/CippPolicyImportDrawer.jsx @@ -70,7 +70,9 @@ export const CippPolicyImportDrawer = ({ const importPolicy = ApiPostCall({ urlFromData: true, relatedQueryKeys: - mode === "ConditionalAccess" ? ["ListCATemplates-table"] : ["ListIntuneTemplates-table"], + mode === "ConditionalAccess" + ? ["ListCATemplates-table"] + : ["ListIntuneTemplates-table", "ListIntuneTemplates-autcomplete"], }); const viewPolicyQuery = ApiPostCall({ diff --git a/src/components/CippStandards/CippStandardAccordion.jsx b/src/components/CippStandards/CippStandardAccordion.jsx index fe8477bc47f6..95ddcf55d63f 100644 --- a/src/components/CippStandards/CippStandardAccordion.jsx +++ b/src/components/CippStandards/CippStandardAccordion.jsx @@ -41,6 +41,7 @@ import GDAPRoles from "/src/data/GDAPRoles"; import timezoneList from "/src/data/timezoneList"; import standards from "/src/data/standards.json"; import { CippFormCondition } from "../CippComponents/CippFormCondition"; +import { CippPolicyImportDrawer } from "../CippComponents/CippPolicyImportDrawer"; import ReactMarkdown from "react-markdown"; const getAvailableActions = (disabledFeatures) => { @@ -855,6 +856,17 @@ const CippStandardAccordion = ({ {hasAddedComponents && ( + {/* Add catalog button for Intune Template standard - appears first */} + {standardName.startsWith("standards.IntuneTemplate") && ( + + + + + + )} {standard.addedComponent?.map((component, idx) => component?.condition ? ( Date: Thu, 11 Sep 2025 22:20:32 -0400 Subject: [PATCH 73/86] extend deploy ca template drawer allow for using as an action adding to ca templates page --- .../CippComponents/CippCADeployDrawer.jsx | 47 ++++++++++++---- .../tenant/conditional/list-template/index.js | 54 +++++++++++++------ 2 files changed, 76 insertions(+), 25 deletions(-) diff --git a/src/components/CippComponents/CippCADeployDrawer.jsx b/src/components/CippComponents/CippCADeployDrawer.jsx index 85d059d914dd..403c4657fa03 100644 --- a/src/components/CippComponents/CippCADeployDrawer.jsx +++ b/src/components/CippComponents/CippCADeployDrawer.jsx @@ -14,14 +14,21 @@ export const CippCADeployDrawer = ({ buttonText = "Deploy CA Policy", requiredPermissions = [], PermissionButton = Button, + templateId = null, // New prop for pre-supplying template ID + open = null, // External control for drawer visibility + onClose = null, // External close handler }) => { - const [drawerVisible, setDrawerVisible] = useState(false); + const [internalDrawerVisible, setInternalDrawerVisible] = useState(false); const formControl = useForm(); const tenantFilter = useSettings()?.tenantFilter; const CATemplates = ApiGetCall({ url: "/api/ListCATemplates", queryKey: "CATemplates" }); const [JSONData, setJSONData] = useState(); const watcher = useWatch({ control: formControl.control, name: "TemplateList" }); + // Use external open state if provided, otherwise use internal state + const drawerVisible = open !== null ? open : internalDrawerVisible; + const isExternallyControlled = open !== null && onClose !== null; + const updateTemplate = useCallback( (templateGuid) => { if (CATemplates.isSuccess && templateGuid) { @@ -35,6 +42,19 @@ export const CippCADeployDrawer = ({ [CATemplates.isSuccess, CATemplates.data, formControl.setValue] ); + // Effect to set template when templateId prop is provided + useEffect(() => { + if (templateId && CATemplates.isSuccess) { + // Find the template to get the display name + const template = CATemplates.data.find((template) => template.GUID === templateId); + if (template) { + // Pre-select the template when drawer opens + formControl.setValue("TemplateList", { value: templateId, label: template.displayName }); + updateTemplate(templateId); + } + } + }, [templateId, CATemplates.isSuccess, formControl, updateTemplate]); + useEffect(() => { updateTemplate(watcher?.value); }, [updateTemplate, watcher?.value]); @@ -55,19 +75,25 @@ export const CippCADeployDrawer = ({ }; const handleCloseDrawer = () => { - setDrawerVisible(false); + if (isExternallyControlled) { + onClose(); + } else { + setInternalDrawerVisible(false); + } formControl.reset(); }; return ( <> - setDrawerVisible(true)} - startIcon={} - > - {buttonText} - + {!isExternallyControlled && ( + setInternalDrawerVisible(true)} + startIcon={} + > + {buttonText} + + )} ({ diff --git a/src/pages/tenant/conditional/list-template/index.js b/src/pages/tenant/conditional/list-template/index.js index e5387c6ee264..fde706523691 100644 --- a/src/pages/tenant/conditional/list-template/index.js +++ b/src/pages/tenant/conditional/list-template/index.js @@ -2,20 +2,37 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; import { Button } from "@mui/material"; import CippJsonView from "../../../../components/CippFormPages/CippJSONView"; -import { Delete, GitHub, Edit } from "@mui/icons-material"; +import { Delete, GitHub, Edit, RocketLaunch } from "@mui/icons-material"; import { ApiGetCall } from "/src/api/ApiCall"; import Link from "next/link"; import { CippPolicyImportDrawer } from "/src/components/CippComponents/CippPolicyImportDrawer.jsx"; +import { CippCADeployDrawer } from "/src/components/CippComponents/CippCADeployDrawer.jsx"; +import { useState } from "react"; const Page = () => { const pageTitle = "Available Conditional Access Templates"; + const [deployDrawerOpen, setDeployDrawerOpen] = useState(false); + const [selectedTemplateId, setSelectedTemplateId] = useState(null); + const integrations = ApiGetCall({ url: "/api/ListExtensionsConfig", queryKey: "Integrations", refetchOnMount: false, refetchOnReconnect: false, }); + + const handleDeployTemplate = (row) => { + setSelectedTemplateId(row.GUID); + setDeployDrawerOpen(true); + }; const actions = [ + { + label: "Deploy Template", + customFunction: handleDeployTemplate, + noConfirm: true, + icon: , + color: "success", + }, { label: "Edit Template", link: "/tenant/conditional/list-template/edit?GUID=[GUID]", @@ -82,20 +99,27 @@ const Page = () => { size: "xl", }; return ( - - + {/* Drift management actions */} + {driftActions.length > 0 && } From 75f7501b01ad3802e9669bd92f7e5129418fc0d3 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 11 Sep 2025 23:39:32 -0400 Subject: [PATCH 75/86] improve oujt of office action fix hook issue with user actions --- .../CippComponents/CippUserActions.jsx | 115 +++++++++++++++--- .../identity/administration/users/index.js | 7 +- .../administration/users/user/index.jsx | 5 +- src/pages/tenant/standards/template.jsx | 9 +- 4 files changed, 112 insertions(+), 24 deletions(-) diff --git a/src/components/CippComponents/CippUserActions.jsx b/src/components/CippComponents/CippUserActions.jsx index e90b89fba2a6..d08c19ca69d0 100644 --- a/src/components/CippComponents/CippUserActions.jsx +++ b/src/components/CippComponents/CippUserActions.jsx @@ -22,8 +22,97 @@ import { import { getCippLicenseTranslation } from "../../utils/get-cipp-license-translation"; import { useSettings } from "/src/hooks/use-settings.js"; import { usePermissions } from "../../hooks/use-permissions"; +import { Stack, Grid, Tooltip, Box } from "@mui/material"; +import CippFormComponent from "./CippFormComponent"; +import { useForm, useWatch } from "react-hook-form"; -export const CippUserActions = () => { +// Separate component for Out of Office form to avoid hook issues +const OutOfOfficeForm = ({ formControl }) => { + // Watch the Auto Reply State value + const autoReplyState = useWatch({ + control: formControl.control, + name: "ooo.AutoReplyState", + }); + + // Calculate if date fields should be disabled + const areDateFieldsDisabled = autoReplyState?.value !== "Scheduled"; + + return ( + <> + + + + + + + + + + + + + + + + + + + ); +}; + +export const useCippUserActions = () => { const tenant = useSettings().currentTenant; const { checkPermissions } = usePermissions(); @@ -179,28 +268,13 @@ export const CippUserActions = () => { url: "/api/ExecSetOoO", data: { userId: "userPrincipalName", - AutoReplyState: { value: "Enabled" }, tenantFilter: "Tenant", }, - fields: [{ type: "richText", name: "input", label: "Out of Office Message" }], + children: ({ formHook: formControl }) => , confirmText: "Are you sure you want to set the out of office?", multiPost: false, condition: () => canWriteMailbox, }, - - { - label: "Disable Out of Office", - type: "POST", - icon: , - url: "/api/ExecSetOoO", - data: { - userId: "userPrincipalName", - AutoReplyState: { value: "Disabled" }, - }, - confirmText: "Are you sure you want to disable the out of office for [userPrincipalName]?", - multiPost: false, - condition: () => canWriteMailbox, - }, { label: "Add to Group", type: "POST", @@ -484,4 +558,11 @@ export const CippUserActions = () => { ]; }; +// Legacy wrapper function for backward compatibility - but this should not be used +// Instead, components should use the useCippUserActions hook +export const CippUserActions = () => { + console.warn("CippUserActions() function is deprecated. Use useCippUserActions() hook instead."); + return useCippUserActions(); +}; + export default CippUserActions; diff --git a/src/pages/identity/administration/users/index.js b/src/pages/identity/administration/users/index.js index ee83d119b8d8..8baf9eaaf76b 100644 --- a/src/pages/identity/administration/users/index.js +++ b/src/pages/identity/administration/users/index.js @@ -2,12 +2,13 @@ import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx" import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { useSettings } from "/src/hooks/use-settings.js"; import { PermissionButton } from "../../../../utils/permissions"; -import { CippUserActions } from "/src/components/CippComponents/CippUserActions.jsx"; +import { useCippUserActions } from "/src/components/CippComponents/CippUserActions.jsx"; import { CippInviteGuestDrawer } from "/src/components/CippComponents/CippInviteGuestDrawer.jsx"; import { CippBulkUserDrawer } from "/src/components/CippComponents/CippBulkUserDrawer.jsx"; import { CippAddUserDrawer } from "/src/components/CippComponents/CippAddUserDrawer.jsx"; const Page = () => { + const userActions = useCippUserActions(); const pageTitle = "Users"; const tenant = useSettings().currentTenant; const cardButtonPermissions = ["Identity.User.ReadWrite"]; @@ -48,7 +49,7 @@ const Page = () => { "onPremisesDistinguishedName", // OnPrem DN "otherMails", // Alternate Email Addresses ], - actions: CippUserActions(), + actions: userActions, }; return ( @@ -81,7 +82,7 @@ const Page = () => { $top: 999, }} apiDataKey="Results" - actions={CippUserActions()} + actions={userActions} offCanvas={offCanvas} simpleColumns={[ "accountEnabled", diff --git a/src/pages/identity/administration/users/user/index.jsx b/src/pages/identity/administration/users/user/index.jsx index a49b54631195..5d23c20d5e6c 100644 --- a/src/pages/identity/administration/users/user/index.jsx +++ b/src/pages/identity/administration/users/user/index.jsx @@ -15,7 +15,7 @@ import { SvgIcon, Typography } from "@mui/material"; import { CippBannerListCard } from "../../../../../components/CippCards/CippBannerListCard"; import { CippTimeAgo } from "../../../../../components/CippComponents/CippTimeAgo"; import { useEffect, useState } from "react"; -import CippUserActions from "/src/components/CippComponents/CippUserActions"; +import { useCippUserActions } from "/src/components/CippComponents/CippUserActions"; import { EyeIcon, PencilIcon } from "@heroicons/react/24/outline"; import { CippDataTable } from "/src/components/CippTable/CippDataTable"; import dynamic from "next/dynamic"; @@ -73,6 +73,7 @@ const Page = () => { const { userId } = router.query; const [waiting, setWaiting] = useState(false); const [signInLogsDialogOpen, setSignInLogsDialogOpen] = useState(false); + const userActions = useCippUserActions(); useEffect(() => { if (userId) { @@ -558,7 +559,7 @@ const Page = () => { { // Filter out the refresh action return allActions.filter((action) => action.label !== "Refresh Data"); - }, [editMode, router.query.id]); + }, [editMode, router.query.id, currentTenant]); const actions = []; @@ -367,7 +367,12 @@ const Page = () => { Add Standard to Template {/* Drift management actions */} - {driftActions.length > 0 && } + {driftActions.length > 0 && ( + + )} From 6e44407f1451c9a98ea1f820ff1c681deff07b42 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 11 Sep 2025 23:55:39 -0400 Subject: [PATCH 76/86] fix datepicker padding --- src/components/CippComponents/CippFormComponent.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/CippComponents/CippFormComponent.jsx b/src/components/CippComponents/CippFormComponent.jsx index d56ff5417221..c41a7ce8ac89 100644 --- a/src/components/CippComponents/CippFormComponent.jsx +++ b/src/components/CippComponents/CippFormComponent.jsx @@ -479,6 +479,12 @@ export const CippFormComponent = (props) => { Date: Thu, 11 Sep 2025 23:55:49 -0400 Subject: [PATCH 77/86] formatting --- src/pages/identity/administration/users/user/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/identity/administration/users/user/index.jsx b/src/pages/identity/administration/users/user/index.jsx index 5d23c20d5e6c..db748f8facc5 100644 --- a/src/pages/identity/administration/users/user/index.jsx +++ b/src/pages/identity/administration/users/user/index.jsx @@ -82,7 +82,9 @@ const Page = () => { }, [userId]); const userRequest = ApiGetCall({ - url: `/api/ListUsers?UserId=${userId}&tenantFilter=${router.query.tenantFilter ?? userSettingsDefaults.currentTenant}`, + url: `/api/ListUsers?UserId=${userId}&tenantFilter=${ + router.query.tenantFilter ?? userSettingsDefaults.currentTenant + }`, queryKey: `ListUsers-${userId}`, waiting: waiting, }); From 5fba6b4bbe241daa51cbd026863a2e218bab4cc3 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 12 Sep 2025 11:52:30 +0200 Subject: [PATCH 78/86] fixes license filtering. --- .../CippTable/util-columnsFromAPI.js | 1 + src/utils/get-cipp-filter-variant.js | 26 +++++- src/utils/get-cipp-unique-licenses.js | 88 +++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 src/utils/get-cipp-unique-licenses.js diff --git a/src/components/CippTable/util-columnsFromAPI.js b/src/components/CippTable/util-columnsFromAPI.js index 011b9ef5539c..407268873538 100644 --- a/src/components/CippTable/util-columnsFromAPI.js +++ b/src/components/CippTable/util-columnsFromAPI.js @@ -105,6 +105,7 @@ export const utilColumnsFromAPI = (dataArray) => { sampleValue, values: valuesForColumn, getValue: (row) => resolveValue(row), + dataArray: dataArray, // Pass the full data array for processing if needed }), Cell: ({ row }) => { const value = resolveValue(row.original); diff --git a/src/utils/get-cipp-filter-variant.js b/src/utils/get-cipp-filter-variant.js index 8213b789c5a5..e60d933636e5 100644 --- a/src/utils/get-cipp-filter-variant.js +++ b/src/utils/get-cipp-filter-variant.js @@ -1,3 +1,5 @@ +import { getCippUniqueLicenses } from "./get-cipp-unique-licenses"; + export const getCippFilterVariant = (providedColumnKeys, arg) => { // Back-compat + new options mode const isOptions = @@ -39,10 +41,32 @@ export const getCippFilterVariant = (providedColumnKeys, arg) => { switch (tailKey) { case "assignedLicenses": console.log("Assigned Licenses Filter", sampleValue, values); + + // Extract unique licenses from the data if available + let filterSelectOptions = []; + if (isOptions && arg.dataArray && Array.isArray(arg.dataArray)) { + const uniqueLicenses = getCippUniqueLicenses(arg.dataArray); + filterSelectOptions = uniqueLicenses.map((license) => ({ + label: license.displayName, + value: license.skuId, + })); + } + return { filterVariant: "multi-select", sortingFn: "alphanumeric", - filterFn: "arrIncludesSome", + filterFn: (row, columnId, filterValue) => { + const userLicenses = row.original.assignedLicenses; + if (!filterValue || !Array.isArray(filterValue) || filterValue.length === 0) { + return true; + } + if (!userLicenses || !Array.isArray(userLicenses) || userLicenses.length === 0) { + return false; + } + const userSkuIds = userLicenses.map((license) => license.skuId).filter(Boolean); + return filterValue.every((selectedSkuId) => userSkuIds.includes(selectedSkuId)); + }, + filterSelectOptions: filterSelectOptions, }; case "accountEnabled": return { diff --git a/src/utils/get-cipp-unique-licenses.js b/src/utils/get-cipp-unique-licenses.js new file mode 100644 index 000000000000..eb48d16edf02 --- /dev/null +++ b/src/utils/get-cipp-unique-licenses.js @@ -0,0 +1,88 @@ +import { getCippLicenseTranslation } from "./get-cipp-license-translation"; + +/** + * Extracts unique licenses from assignedLicenses data + * @param {Array} dataArray - Array of user data containing assignedLicenses + * @returns {Array} Array of unique license objects with skuId and translated name + */ +export const getCippUniqueLicenses = (dataArray) => { + if (!Array.isArray(dataArray) || dataArray.length === 0) { + return []; + } + + const uniqueLicensesMap = new Map(); + + // Iterate through all users and their assigned licenses + dataArray.forEach((user) => { + if (user.assignedLicenses && Array.isArray(user.assignedLicenses)) { + user.assignedLicenses.forEach((license) => { + if (license && license.skuId) { + // Use skuId as the unique key + if (!uniqueLicensesMap.has(license.skuId)) { + // Get the translated name for this license + const translatedName = getCippLicenseTranslation([license]); + const displayName = Array.isArray(translatedName) ? translatedName[0] : translatedName; + + uniqueLicensesMap.set(license.skuId, { + skuId: license.skuId, + displayName: displayName, + // Store the original license object for reference + originalLicense: license + }); + } + } + }); + } + }); + + // Convert map to array and sort by display name + return Array.from(uniqueLicensesMap.values()).sort((a, b) => + a.displayName.localeCompare(b.displayName) + ); +}; + +/** + * Checks if a user has all the specified licenses + * @param {Array} userLicenses - User's assigned licenses array + * @param {Array} requiredLicenseSkuIds - Array of required license skuIds + * @returns {boolean} True if user has all required licenses + */ +export const userHasAllLicenses = (userLicenses, requiredLicenseSkuIds) => { + if (!Array.isArray(userLicenses) || !Array.isArray(requiredLicenseSkuIds)) { + return false; + } + + if (requiredLicenseSkuIds.length === 0) { + return true; // No licenses required + } + + const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean); + + // Check if user has all required licenses + return requiredLicenseSkuIds.every(requiredSkuId => + userSkuIds.includes(requiredSkuId) + ); +}; + +/** + * Checks if a user has any of the specified licenses + * @param {Array} userLicenses - User's assigned licenses array + * @param {Array} licenseSkuIds - Array of license skuIds to check + * @returns {boolean} True if user has any of the specified licenses + */ +export const userHasAnyLicense = (userLicenses, licenseSkuIds) => { + if (!Array.isArray(userLicenses) || !Array.isArray(licenseSkuIds)) { + return false; + } + + if (licenseSkuIds.length === 0) { + return true; // No licenses specified + } + + const userSkuIds = userLicenses.map(license => license.skuId).filter(Boolean); + + // Check if user has any of the specified licenses + return licenseSkuIds.some(licenseSkuId => + userSkuIds.includes(licenseSkuId) + ); +}; \ No newline at end of file From 01cbfad1787fb043f45993ae9f143e2b809f4bbc Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 12 Sep 2025 13:40:32 +0200 Subject: [PATCH 79/86] add tag support --- src/data/standards.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/data/standards.json b/src/data/standards.json index 0ab35e15ac40..2eaa0433e0b4 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -4587,6 +4587,7 @@ "type": "autoComplete", "multiple": false, "creatable": false, + "required": false, "name": "TemplateList", "label": "Select Intune Template", "api": { @@ -4596,6 +4597,20 @@ "valueField": "GUID" } }, + { + "type": "autoComplete", + "multiple": false, + "required": false, + "creatable": false, + "name": "TemplateList-Tags", + "label": "Or select a package of Intune Templates", + "api": { + "queryKey": "ListIntuneTemplates-tag-autcomplete", + "url": "/api/ListIntuneTemplates?mode=Tag", + "labelField": "label", + "valueField": "value" + } + }, { "name": "AssignTo", "label": "Who should this template be assigned to?", From 51ecc2bc376d0b43de71ed29e9824ef37680614b Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 12 Sep 2025 09:55:19 -0400 Subject: [PATCH 80/86] blocked endpoint support --- .../CippSettings/CippRoleAddEdit.jsx | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/src/components/CippSettings/CippRoleAddEdit.jsx b/src/components/CippSettings/CippRoleAddEdit.jsx index b7fb9e7a2b27..abc605f34df7 100644 --- a/src/components/CippSettings/CippRoleAddEdit.jsx +++ b/src/components/CippSettings/CippRoleAddEdit.jsx @@ -24,6 +24,7 @@ import { useForm, useFormState, useWatch } from "react-hook-form"; import { InformationCircleIcon } from "@heroicons/react/24/outline"; import { CippApiResults } from "../CippComponents/CippApiResults"; import cippRoles from "../../data/cipp-roles.json"; +import { GroupHeader, GroupItems } from "../CippComponents/CippAutocompleteGrouping"; export const CippRoleAddEdit = ({ selectedRole }) => { const updatePermissions = ApiPostCall({ @@ -57,6 +58,7 @@ export const CippRoleAddEdit = ({ selectedRole }) => { const selectedTenant = useWatch({ control: formControl.control, name: "allowedTenants" }); const blockedTenants = useWatch({ control: formControl.control, name: "blockedTenants" }); + const blockedEndpoints = useWatch({ control: formControl.control, name: "BlockedEndpoints" }); const setDefaults = useWatch({ control: formControl.control, name: "Defaults" }); const selectedPermissions = useWatch({ control: formControl.control, name: "Permissions" }); const selectedEntraGroup = useWatch({ control: formControl.control, name: "EntraGroup" }); @@ -225,6 +227,13 @@ export const CippRoleAddEdit = ({ selectedRole }) => { return processed; }; + // Process blocked endpoints + const processedBlockedEndpoints = + currentPermissions?.BlockedEndpoints?.map((endpoint) => ({ + label: endpoint, + value: endpoint, + })) || []; + formControl.reset({ Permissions: basePermissions && Object.keys(basePermissions).length > 0 @@ -233,6 +242,7 @@ export const CippRoleAddEdit = ({ selectedRole }) => { RoleName: selectedRole ?? currentPermissions?.RowKey, allowedTenants: newAllowedTenants, blockedTenants: newBlockedTenants, + BlockedEndpoints: processedBlockedEndpoints, EntraGroup: currentPermissions?.EntraGroup, }); } @@ -318,6 +328,12 @@ export const CippRoleAddEdit = ({ selectedRole }) => { }) .filter(Boolean) || []; + const processedBlockedEndpoints = + values?.["BlockedEndpoints"]?.map((endpoint) => { + // Extract the endpoint value + return endpoint.value || endpoint; + }) || []; + updatePermissions.mutate({ url: "/api/ExecCustomRole?Action=AddUpdate", data: { @@ -326,6 +342,7 @@ export const CippRoleAddEdit = ({ selectedRole }) => { EntraGroup: selectedEntraGroup, AllowedTenants: processedAllowedTenants, BlockedTenants: processedBlockedTenants, + BlockedEndpoints: processedBlockedEndpoints, }, }); }; @@ -498,6 +515,60 @@ export const CippRoleAddEdit = ({ selectedRole }) => { /> )} + + {/* Blocked Endpoints */} + + { + const allEndpoints = []; + Object.keys(apiPermissions) + .sort() + .forEach((cat) => { + Object.keys(apiPermissions[cat]) + .sort() + .forEach((obj) => { + Object.keys(apiPermissions[cat][obj]).forEach((type) => { + Object.keys(apiPermissions[cat][obj][type]).forEach( + (apiKey) => { + allEndpoints.push({ + label: apiPermissions[cat][obj][type][apiKey], + value: apiPermissions[cat][obj][type][apiKey], + category: cat, + }); + } + ); + }); + }); + }); + // Sort endpoints alphabetically within each category + return allEndpoints.sort((a, b) => { + if (a.category !== b.category) { + return a.category.localeCompare(b.category); + } + return a.label.localeCompare(b.label); + }); + })() + : [] + } + formControl={formControl} + fullWidth={true} + multiple={true} + creatable={false} + groupBy={(option) => option.category} + renderGroup={(params) => ( +
  • + {params.group} + {params.children} +
  • + )} + /> +
    )} {apiPermissionFetching && } @@ -590,6 +661,18 @@ export const CippRoleAddEdit = ({ selectedRole }) => { )} + {blockedEndpoints?.length > 0 && ( + <> +
    Blocked Endpoints
    +
      + {blockedEndpoints.map((endpoint, idx) => ( +
    • + {endpoint?.label || endpoint?.value || endpoint} +
    • + ))} +
    + + )} {selectedPermissions && apiPermissionSuccess && ( <>
    Selected Permissions
    From 3977bdab282e78713a6f344a8af41dfabe162956 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 12 Sep 2025 10:07:33 -0400 Subject: [PATCH 81/86] fix compile error --- .../manage-drift/policies-deployed.js | 82 ++++++++++--------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/src/pages/tenant/standards/manage-drift/policies-deployed.js b/src/pages/tenant/standards/manage-drift/policies-deployed.js index 5e8e97041462..4eeb5ca24927 100644 --- a/src/pages/tenant/standards/manage-drift/policies-deployed.js +++ b/src/pages/tenant/standards/manage-drift/policies-deployed.js @@ -1,13 +1,7 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { useSettings } from "/src/hooks/use-settings"; import { useRouter } from "next/router"; -import { - Policy, - Security, - AdminPanelSettings, - Devices, - ExpandMore, -} from "@mui/icons-material"; +import { Policy, Security, AdminPanelSettings, Devices, ExpandMore } from "@mui/icons-material"; import { Box, Stack, @@ -24,7 +18,6 @@ import { CippHead } from "/src/components/CippComponents/CippHead"; import { ApiGetCall } from "/src/api/ApiCall"; import standardsData from "/src/data/standards.json"; import { createDriftManagementActions } from "./driftManagementActions"; -import { useSettings } from "../../../../hooks/use-settings"; const PoliciesDeployedPage = () => { const userSettingsDefaults = useSettings(); @@ -81,10 +74,7 @@ const PoliciesDeployedPage = () => { const driftData = driftApi.data || []; // For templates, we need to match against the full template path - let searchKeys = [ - standardKey, - `standards.${standardKey}`, - ]; + let searchKeys = [standardKey, `standards.${standardKey}`]; // Add template-specific search keys if (templateValue && templateType) { @@ -95,12 +85,13 @@ const PoliciesDeployedPage = () => { ); } - const deviation = driftData.find(item => - searchKeys.some(key => - item.standardName === key || - item.policyName === key || - item.standardName?.includes(key) || - item.policyName?.includes(key) + const deviation = driftData.find((item) => + searchKeys.some( + (key) => + item.standardName === key || + item.policyName === key || + item.standardName?.includes(key) || + item.policyName?.includes(key) ) ); @@ -117,10 +108,7 @@ const PoliciesDeployedPage = () => { const driftData = driftApi.data || []; // For templates, we need to match against the full template path - let searchKeys = [ - standardKey, - `standards.${standardKey}`, - ]; + let searchKeys = [standardKey, `standards.${standardKey}`]; // Add template-specific search keys if (templateValue && templateType) { @@ -131,12 +119,13 @@ const PoliciesDeployedPage = () => { ); } - const deviation = driftData.find(item => - searchKeys.some(key => - item.standardName === key || - item.policyName === key || - item.standardName?.includes(key) || - item.policyName?.includes(key) + const deviation = driftData.find((item) => + searchKeys.some( + (key) => + item.standardName === key || + item.policyName === key || + item.standardName?.includes(key) || + item.policyName?.includes(key) ) ); @@ -153,7 +142,7 @@ const PoliciesDeployedPage = () => { // Helper function to get standard name from standards.json const getStandardName = (standardKey) => { const standardName = `standards.${standardKey}`; - const standard = standardsData.find(s => s.name === standardName); + const standard = standardsData.find((s) => s.name === standardName); return standard?.label || standardKey.replace(/([A-Z])/g, " $1").trim(); }; @@ -166,7 +155,9 @@ const PoliciesDeployedPage = () => { // Look for the template in the specific type array if (allTemplates[templateType] && Array.isArray(allTemplates[templateType])) { - const template = allTemplates[templateType].find(t => t.TemplateList?.value === templateValue); + const template = allTemplates[templateType].find( + (t) => t.TemplateList?.value === templateValue + ); if (template?.TemplateList?.label) { return template.TemplateList.label; } @@ -175,7 +166,7 @@ const PoliciesDeployedPage = () => { // If not found in the specific type, search through all template types for (const [key, templates] of Object.entries(allTemplates)) { if (Array.isArray(templates)) { - const template = templates.find(t => t.TemplateList?.value === templateValue); + const template = templates.find((t) => t.TemplateList?.value === templateValue); if (template?.TemplateList?.label) { return template.TemplateList.label; } @@ -200,7 +191,11 @@ const PoliciesDeployedPage = () => { // Process Intune Templates const intunePolices = (templateStandards.IntuneTemplate || []).map((template, index) => { const standardKey = `IntuneTemplate.${template.TemplateList?.value}`; - const driftDisplayName = getDisplayNameFromDrift(standardKey, template.TemplateList?.value, "IntuneTemplate"); + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + template.TemplateList?.value, + "IntuneTemplate" + ); const templateLabel = getTemplateLabel(template.TemplateList?.value, "IntuneTemplate"); return { @@ -219,8 +214,15 @@ const PoliciesDeployedPage = () => { const conditionalAccessPolicies = (templateStandards.ConditionalAccessTemplate || []).map( (template, index) => { const standardKey = `ConditionalAccessTemplate.${template.TemplateList?.value}`; - const driftDisplayName = getDisplayNameFromDrift(standardKey, template.TemplateList?.value, "ConditionalAccessTemplate"); - const templateLabel = getTemplateLabel(template.TemplateList?.value, "ConditionalAccessTemplate"); + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + template.TemplateList?.value, + "ConditionalAccessTemplate" + ); + const templateLabel = getTemplateLabel( + template.TemplateList?.value, + "ConditionalAccessTemplate" + ); return { id: index + 1, @@ -278,7 +280,9 @@ const PoliciesDeployedPage = () => { data={deployedStandards} simpleColumns={["name", "category", "status", "lastModified"]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> @@ -305,7 +309,9 @@ const PoliciesDeployedPage = () => { "assignedGroups", ]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> @@ -332,7 +338,9 @@ const PoliciesDeployedPage = () => { "lastModified", ]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> From 77874f170907c170f93c7793c850566d757c20c5 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:21:50 +0200 Subject: [PATCH 82/86] new tags --- src/data/standards.json | 5 +- .../tenant/standards/manage-drift/compare.js | 385 +++++++++++++----- .../manage-drift/policies-deployed.js | 188 ++++++--- 3 files changed, 413 insertions(+), 165 deletions(-) diff --git a/src/data/standards.json b/src/data/standards.json index 2eaa0433e0b4..785cdcb8ef4c 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -4608,7 +4608,10 @@ "queryKey": "ListIntuneTemplates-tag-autcomplete", "url": "/api/ListIntuneTemplates?mode=Tag", "labelField": "label", - "valueField": "value" + "valueField": "value", + "addedField": { + "templates": "templates" + } } }, { diff --git a/src/pages/tenant/standards/manage-drift/compare.js b/src/pages/tenant/standards/manage-drift/compare.js index 3905adfc9ed8..1aafbf0651d5 100644 --- a/src/pages/tenant/standards/manage-drift/compare.js +++ b/src/pages/tenant/standards/manage-drift/compare.js @@ -106,70 +106,155 @@ const Page = () => { const allStandards = []; if (selectedTemplate.standards) { Object.entries(selectedTemplate.standards).forEach(([standardKey, standardConfig]) => { - // Special handling for IntuneTemplate which is an array of items if (standardKey === "IntuneTemplate" && Array.isArray(standardConfig)) { - // Process each IntuneTemplate item separately standardConfig.forEach((templateItem, index) => { - const templateId = templateItem.TemplateList?.value; - if (templateId) { - const standardId = `standards.IntuneTemplate.${templateId}`; - const standardInfo = standards.find((s) => s.name === `standards.IntuneTemplate`); - - // Find the tenant's value for this specific template - const currentTenantStandard = currentTenantData.find( - (s) => s.standardId === standardId + console.log("Processing IntuneTemplate item:", templateItem); + if ( + templateItem["TemplateList-Tags"]?.value && + templateItem["TemplateList-Tags"]?.addedFields?.templates + ) { + console.log( + "Found TemplateList-Tags for IntuneTemplate:", + templateItem["TemplateList-Tags"] ); + console.log( + "Templates to expand:", + templateItem["TemplateList-Tags"].addedFields.templates + ); + templateItem["TemplateList-Tags"].addedFields.templates.forEach( + (expandedTemplate) => { + console.log("Expanding IntuneTemplate:", expandedTemplate); + const templateId = expandedTemplate.GUID; + const standardId = `standards.IntuneTemplate.${templateId}`; + const standardInfo = standards.find( + (s) => s.name === `standards.IntuneTemplate` + ); + + // Find the tenant's value for this specific template + const currentTenantStandard = currentTenantData.find( + (s) => s.standardId === standardId + ); + + // Get the standard object and its value from the tenant object + const standardObject = currentTenantObj?.[standardId]; + const directStandardValue = standardObject?.Value; + + // Determine compliance status + let isCompliant = false; + + // For IntuneTemplate, the value is true if compliant, or an object with comparison data if not compliant + if (directStandardValue === true) { + isCompliant = true; + } else if ( + directStandardValue !== undefined && + typeof directStandardValue !== "object" + ) { + isCompliant = true; + } else if (currentTenantStandard) { + isCompliant = currentTenantStandard.value === true; + } - // Get the standard object and its value from the tenant object - const standardObject = currentTenantObj?.[standardId]; - const directStandardValue = standardObject?.Value; - - // Determine compliance status - let isCompliant = false; - - // For IntuneTemplate, the value is true if compliant, or an object with comparison data if not compliant - if (directStandardValue === true) { - isCompliant = true; - } else if ( - directStandardValue !== undefined && - typeof directStandardValue !== "object" - ) { - isCompliant = true; - } else if (currentTenantStandard) { - isCompliant = currentTenantStandard.value === true; + // Create a standardValue object that contains the template settings + const templateSettings = { + templateId, + Template: + expandedTemplate.displayName || + expandedTemplate.name || + "Unknown Template", + "Assign to": templateItem.AssignTo || "On", + "Excluded Group": templateItem.excludeGroup || "", + "Included Group": templateItem.customGroup || "", + }; + + allStandards.push({ + standardId, + standardName: `Intune Template: ${ + expandedTemplate.displayName || expandedTemplate.name || templateId + } (via ${templateItem['TemplateList-Tags'].value})`, + currentTenantValue: + standardObject !== undefined + ? { + Value: directStandardValue, + LastRefresh: standardObject?.LastRefresh, + } + : currentTenantStandard?.value, + standardValue: templateSettings, + complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", + complianceDetails: + standardInfo?.docsDescription || standardInfo?.helpText || "", + standardDescription: standardInfo?.helpText || "", + standardImpact: standardInfo?.impact || "Medium Impact", + standardImpactColour: standardInfo?.impactColour || "warning", + templateName: selectedTemplate?.templateName || "Standard Template", + templateActions: templateItem.action || [], + }); + } + ); + } else { + // Regular TemplateList processing + const templateId = templateItem.TemplateList?.value; + if (templateId) { + const standardId = `standards.IntuneTemplate.${templateId}`; + const standardInfo = standards.find( + (s) => s.name === `standards.IntuneTemplate` + ); + + // Find the tenant's value for this specific template + const currentTenantStandard = currentTenantData.find( + (s) => s.standardId === standardId + ); + + // Get the standard object and its value from the tenant object + const standardObject = currentTenantObj?.[standardId]; + const directStandardValue = standardObject?.Value; + + // Determine compliance status + let isCompliant = false; + + // For IntuneTemplate, the value is true if compliant, or an object with comparison data if not compliant + if (directStandardValue === true) { + isCompliant = true; + } else if ( + directStandardValue !== undefined && + typeof directStandardValue !== "object" + ) { + isCompliant = true; + } else if (currentTenantStandard) { + isCompliant = currentTenantStandard.value === true; + } + + // Create a standardValue object that contains the template settings + const templateSettings = { + templateId, + Template: templateItem.TemplateList?.label || "Unknown Template", + "Assign to": templateItem.AssignTo || "On", + "Excluded Group": templateItem.excludeGroup || "", + "Included Group": templateItem.customGroup || "", + }; + + allStandards.push({ + standardId, + standardName: `Intune Template: ${ + templateItem.TemplateList?.label || templateId + }`, + currentTenantValue: + standardObject !== undefined + ? { + Value: directStandardValue, + LastRefresh: standardObject?.LastRefresh, + } + : currentTenantStandard?.value, + standardValue: templateSettings, // Use the template settings object instead of true + complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", + complianceDetails: + standardInfo?.docsDescription || standardInfo?.helpText || "", + standardDescription: standardInfo?.helpText || "", + standardImpact: standardInfo?.impact || "Medium Impact", + standardImpactColour: standardInfo?.impactColour || "warning", + templateName: selectedTemplate?.templateName || "Standard Template", + templateActions: templateItem.action || [], + }); } - - // Create a standardValue object that contains the template settings - const templateSettings = { - templateId, - Template: templateItem.TemplateList?.label || "Unknown Template", - "Assign to": templateItem.AssignTo || "On", - "Excluded Group": templateItem.excludeGroup || "", - "Included Group": templateItem.customGroup || "", - }; - - allStandards.push({ - standardId, - standardName: `Intune Template: ${ - templateItem.TemplateList?.label || templateId - }`, - currentTenantValue: - standardObject !== undefined - ? { - Value: directStandardValue, - LastRefresh: standardObject?.LastRefresh, - } - : currentTenantStandard?.value, - standardValue: templateSettings, // Use the template settings object instead of true - complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", - complianceDetails: - standardInfo?.docsDescription || standardInfo?.helpText || "", - standardDescription: standardInfo?.helpText || "", - standardImpact: standardInfo?.impact || "Medium Impact", - standardImpactColour: standardInfo?.impactColour || "warning", - templateName: selectedTemplate?.templateName || "Standard Template", - templateActions: templateItem.action || [], - }); } }); } else if ( @@ -178,56 +263,130 @@ const Page = () => { ) { // Process each ConditionalAccessTemplate item separately standardConfig.forEach((templateItem, index) => { - const templateId = templateItem.TemplateList?.value; - if (templateId) { - const standardId = `standards.ConditionalAccessTemplate.${templateId}`; - const standardInfo = standards.find( - (s) => s.name === `standards.ConditionalAccessTemplate` + // Check if this item has TemplateList-Tags and expand them + if ( + templateItem["TemplateList-Tags"]?.value && + templateItem["TemplateList-Tags"]?.addedFields?.templates + ) { + console.log( + "Found TemplateList-Tags for ConditionalAccessTemplate:", + templateItem["TemplateList-Tags"] ); + console.log( + "Templates to expand:", + templateItem["TemplateList-Tags"].addedFields.templates + ); + // Expand TemplateList-Tags into multiple template items + templateItem["TemplateList-Tags"].addedFields.templates.forEach( + (expandedTemplate) => { + console.log("Expanding ConditionalAccessTemplate:", expandedTemplate); + const templateId = expandedTemplate.GUID; + const standardId = `standards.ConditionalAccessTemplate.${templateId}`; + const standardInfo = standards.find( + (s) => s.name === `standards.ConditionalAccessTemplate` + ); + + // Find the tenant's value for this specific template + const currentTenantStandard = currentTenantData.find( + (s) => s.standardId === standardId + ); + const standardObject = currentTenantObj?.[standardId]; + const directStandardValue = standardObject?.Value; + let isCompliant = false; + + // For ConditionalAccessTemplate, the value is true if compliant, or an object with comparison data if not compliant + if (directStandardValue === true) { + isCompliant = true; + } else { + isCompliant = false; + } - // Find the tenant's value for this specific template - const currentTenantStandard = currentTenantData.find( - (s) => s.standardId === standardId + // Create a standardValue object that contains the template settings + const templateSettings = { + templateId, + Template: + expandedTemplate.displayName || + expandedTemplate.name || + "Unknown Template", + }; + + allStandards.push({ + standardId, + standardName: `Conditional Access Template: ${ + expandedTemplate.displayName || expandedTemplate.name || templateId + } (via ${templateItem['TemplateList-Tags'].value})`, + currentTenantValue: + standardObject !== undefined + ? { + Value: directStandardValue, + LastRefresh: standardObject?.LastRefresh, + } + : currentTenantStandard?.value, + standardValue: templateSettings, + complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", + complianceDetails: + standardInfo?.docsDescription || standardInfo?.helpText || "", + standardDescription: standardInfo?.helpText || "", + standardImpact: standardInfo?.impact || "Medium Impact", + standardImpactColour: standardInfo?.impactColour || "warning", + templateName: selectedTemplate?.templateName || "Standard Template", + templateActions: templateItem.action || [], + }); + } ); - const standardObject = currentTenantObj?.[standardId]; - const directStandardValue = standardObject?.Value; - let isCompliant = false; - - // For ConditionalAccessTemplate, the value is true if compliant, or an object with comparison data if not compliant - if (directStandardValue === true) { - isCompliant = true; - } else { - isCompliant = false; + } else { + // Regular TemplateList processing + const templateId = templateItem.TemplateList?.value; + if (templateId) { + const standardId = `standards.ConditionalAccessTemplate.${templateId}`; + const standardInfo = standards.find( + (s) => s.name === `standards.ConditionalAccessTemplate` + ); + + // Find the tenant's value for this specific template + const currentTenantStandard = currentTenantData.find( + (s) => s.standardId === standardId + ); + const standardObject = currentTenantObj?.[standardId]; + const directStandardValue = standardObject?.Value; + let isCompliant = false; + + // For ConditionalAccessTemplate, the value is true if compliant, or an object with comparison data if not compliant + if (directStandardValue === true) { + isCompliant = true; + } else { + isCompliant = false; + } + + // Create a standardValue object that contains the template settings + const templateSettings = { + templateId, + Template: templateItem.TemplateList?.label || "Unknown Template", + }; + + allStandards.push({ + standardId, + standardName: `Conditional Access Template: ${ + templateItem.TemplateList?.label || templateId + }`, + currentTenantValue: + standardObject !== undefined + ? { + Value: directStandardValue, + LastRefresh: standardObject?.LastRefresh, + } + : currentTenantStandard?.value, + standardValue: templateSettings, // Use the template settings object instead of true + complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", + complianceDetails: + standardInfo?.docsDescription || standardInfo?.helpText || "", + standardDescription: standardInfo?.helpText || "", + standardImpact: standardInfo?.impact || "Medium Impact", + standardImpactColour: standardInfo?.impactColour || "warning", + templateName: selectedTemplate?.templateName || "Standard Template", + templateActions: templateItem.action || [], + }); } - - // Create a standardValue object that contains the template settings - const templateSettings = { - templateId, - Template: templateItem.TemplateList?.label || "Unknown Template", - }; - - allStandards.push({ - standardId, - standardName: `Conditional Access Template: ${ - templateItem.TemplateList?.label || templateId - }`, - currentTenantValue: - standardObject !== undefined - ? { - Value: directStandardValue, - LastRefresh: standardObject?.LastRefresh, - } - : currentTenantStandard?.value, - standardValue: templateSettings, // Use the template settings object instead of true - complianceStatus: isCompliant ? "Compliant" : "Non-Compliant", - complianceDetails: - standardInfo?.docsDescription || standardInfo?.helpText || "", - standardDescription: standardInfo?.helpText || "", - standardImpact: standardInfo?.impact || "Medium Impact", - standardImpactColour: standardInfo?.impactColour || "warning", - templateName: selectedTemplate?.templateName || "Standard Template", - templateActions: templateItem.action || [], - }); } }); } else { @@ -808,10 +967,13 @@ const Page = () => { sx={{ width: 40, height: 40, + minWidth: 40, + minHeight: 40, borderRadius: "50%", display: "flex", alignItems: "center", justifyContent: "center", + flexShrink: 0, bgcolor: standard.complianceStatus === "Compliant" ? "success.main" @@ -828,8 +990,17 @@ const Page = () => { )} - - {standard?.standardName} + + + {standard?.standardName} + { const driftData = driftApi.data || []; // For templates, we need to match against the full template path - let searchKeys = [ - standardKey, - `standards.${standardKey}`, - ]; + let searchKeys = [standardKey, `standards.${standardKey}`]; // Add template-specific search keys if (templateValue && templateType) { @@ -95,12 +85,13 @@ const PoliciesDeployedPage = () => { ); } - const deviation = driftData.find(item => - searchKeys.some(key => - item.standardName === key || - item.policyName === key || - item.standardName?.includes(key) || - item.policyName?.includes(key) + const deviation = driftData.find((item) => + searchKeys.some( + (key) => + item.standardName === key || + item.policyName === key || + item.standardName?.includes(key) || + item.policyName?.includes(key) ) ); @@ -117,10 +108,7 @@ const PoliciesDeployedPage = () => { const driftData = driftApi.data || []; // For templates, we need to match against the full template path - let searchKeys = [ - standardKey, - `standards.${standardKey}`, - ]; + let searchKeys = [standardKey, `standards.${standardKey}`]; // Add template-specific search keys if (templateValue && templateType) { @@ -131,12 +119,13 @@ const PoliciesDeployedPage = () => { ); } - const deviation = driftData.find(item => - searchKeys.some(key => - item.standardName === key || - item.policyName === key || - item.standardName?.includes(key) || - item.policyName?.includes(key) + const deviation = driftData.find((item) => + searchKeys.some( + (key) => + item.standardName === key || + item.policyName === key || + item.standardName?.includes(key) || + item.policyName?.includes(key) ) ); @@ -153,7 +142,7 @@ const PoliciesDeployedPage = () => { // Helper function to get standard name from standards.json const getStandardName = (standardKey) => { const standardName = `standards.${standardKey}`; - const standard = standardsData.find(s => s.name === standardName); + const standard = standardsData.find((s) => s.name === standardName); return standard?.label || standardKey.replace(/([A-Z])/g, " $1").trim(); }; @@ -166,7 +155,9 @@ const PoliciesDeployedPage = () => { // Look for the template in the specific type array if (allTemplates[templateType] && Array.isArray(allTemplates[templateType])) { - const template = allTemplates[templateType].find(t => t.TemplateList?.value === templateValue); + const template = allTemplates[templateType].find( + (t) => t.TemplateList?.value === templateValue + ); if (template?.TemplateList?.label) { return template.TemplateList.label; } @@ -175,7 +166,7 @@ const PoliciesDeployedPage = () => { // If not found in the specific type, search through all template types for (const [key, templates] of Object.entries(allTemplates)) { if (Array.isArray(templates)) { - const template = templates.find(t => t.TemplateList?.value === templateValue); + const template = templates.find((t) => t.TemplateList?.value === templateValue); if (template?.TemplateList?.label) { return template.TemplateList.label; } @@ -198,32 +189,109 @@ const PoliciesDeployedPage = () => { })); // Process Intune Templates - const intunePolices = (templateStandards.IntuneTemplate || []).map((template, index) => { - const standardKey = `IntuneTemplate.${template.TemplateList?.value}`; - const driftDisplayName = getDisplayNameFromDrift(standardKey, template.TemplateList?.value, "IntuneTemplate"); - const templateLabel = getTemplateLabel(template.TemplateList?.value, "IntuneTemplate"); - - return { - id: index + 1, - name: driftDisplayName || `Intune - ${templateLabel}`, - category: "Intune Template", - platform: "Multi-Platform", - status: getStatus(standardKey, template.TemplateList?.value, "IntuneTemplate"), - lastModified: getLastRefresh(standardKey), - assignedGroups: template.AssignTo || "N/A", - templateValue: template.TemplateList?.value, - }; + const intunePolices = []; + (templateStandards.IntuneTemplate || []).forEach((template, index) => { + console.log('Processing IntuneTemplate in policies-deployed:', template); + + // Check if this template has TemplateList-Tags and expand them + if (template['TemplateList-Tags']?.value && template['TemplateList-Tags']?.addedFields?.templates) { + console.log('Found TemplateList-Tags for IntuneTemplate in policies-deployed:', template['TemplateList-Tags']); + console.log('Templates to expand:', template['TemplateList-Tags'].addedFields.templates); + + // Expand TemplateList-Tags into multiple template items + template['TemplateList-Tags'].addedFields.templates.forEach((expandedTemplate, expandedIndex) => { + console.log('Expanding IntuneTemplate in policies-deployed:', expandedTemplate); + const standardKey = `IntuneTemplate.${expandedTemplate.GUID}`; + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + expandedTemplate.GUID, + "IntuneTemplate" + ); + const packageTagName = template['TemplateList-Tags'].value; + const templateName = expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; + + intunePolices.push({ + id: intunePolices.length + 1, + name: `${driftDisplayName || templateName} (via ${packageTagName})`, + category: "Intune Template", + platform: "Multi-Platform", + status: getStatus(standardKey, expandedTemplate.GUID, "IntuneTemplate"), + lastModified: getLastRefresh(standardKey), + assignedGroups: template.AssignTo || "N/A", + templateValue: expandedTemplate.GUID, + }); + }); + } else { + // Regular TemplateList processing + const standardKey = `IntuneTemplate.${template.TemplateList?.value}`; + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + template.TemplateList?.value, + "IntuneTemplate" + ); + const templateLabel = getTemplateLabel(template.TemplateList?.value, "IntuneTemplate"); + + intunePolices.push({ + id: intunePolices.length + 1, + name: driftDisplayName || `Intune - ${templateLabel}`, + category: "Intune Template", + platform: "Multi-Platform", + status: getStatus(standardKey, template.TemplateList?.value, "IntuneTemplate"), + lastModified: getLastRefresh(standardKey), + assignedGroups: template.AssignTo || "N/A", + templateValue: template.TemplateList?.value, + }); + } }); // Process Conditional Access Templates - const conditionalAccessPolicies = (templateStandards.ConditionalAccessTemplate || []).map( - (template, index) => { + const conditionalAccessPolicies = []; + (templateStandards.ConditionalAccessTemplate || []).forEach((template, index) => { + console.log('Processing ConditionalAccessTemplate in policies-deployed:', template); + + // Check if this template has TemplateList-Tags and expand them + if (template['TemplateList-Tags']?.value && template['TemplateList-Tags']?.addedFields?.templates) { + console.log('Found TemplateList-Tags for ConditionalAccessTemplate in policies-deployed:', template['TemplateList-Tags']); + console.log('Templates to expand:', template['TemplateList-Tags'].addedFields.templates); + + // Expand TemplateList-Tags into multiple template items + template['TemplateList-Tags'].addedFields.templates.forEach((expandedTemplate, expandedIndex) => { + console.log('Expanding ConditionalAccessTemplate in policies-deployed:', expandedTemplate); + const standardKey = `ConditionalAccessTemplate.${expandedTemplate.GUID}`; + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + expandedTemplate.GUID, + "ConditionalAccessTemplate" + ); + const packageTagName = template['TemplateList-Tags'].value; + const templateName = expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; + + conditionalAccessPolicies.push({ + id: conditionalAccessPolicies.length + 1, + name: `${driftDisplayName || templateName} (via ${packageTagName})`, + state: template.state || "Unknown", + conditions: "Conditional Access Policy", + controls: "Access Control", + lastModified: getLastRefresh(standardKey), + status: getStatus(standardKey, expandedTemplate.GUID, "ConditionalAccessTemplate"), + templateValue: expandedTemplate.GUID, + }); + }); + } else { + // Regular TemplateList processing const standardKey = `ConditionalAccessTemplate.${template.TemplateList?.value}`; - const driftDisplayName = getDisplayNameFromDrift(standardKey, template.TemplateList?.value, "ConditionalAccessTemplate"); - const templateLabel = getTemplateLabel(template.TemplateList?.value, "ConditionalAccessTemplate"); + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + template.TemplateList?.value, + "ConditionalAccessTemplate" + ); + const templateLabel = getTemplateLabel( + template.TemplateList?.value, + "ConditionalAccessTemplate" + ); - return { - id: index + 1, + conditionalAccessPolicies.push({ + id: conditionalAccessPolicies.length + 1, name: driftDisplayName || `Conditional Access - ${templateLabel}`, state: template.state || "Unknown", conditions: "Conditional Access Policy", @@ -231,9 +299,9 @@ const PoliciesDeployedPage = () => { lastModified: getLastRefresh(standardKey), status: getStatus(standardKey, template.TemplateList?.value, "ConditionalAccessTemplate"), templateValue: template.TemplateList?.value, - }; + }); } - ); + }); const actions = createDriftManagementActions({ templateId, onRefresh: () => { @@ -278,7 +346,9 @@ const PoliciesDeployedPage = () => { data={deployedStandards} simpleColumns={["name", "category", "status", "lastModified"]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> @@ -305,7 +375,9 @@ const PoliciesDeployedPage = () => { "assignedGroups", ]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> @@ -332,7 +404,9 @@ const PoliciesDeployedPage = () => { "lastModified", ]} noCard={true} - isFetching={standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching} + isFetching={ + standardsApi.isFetching || comparisonApi.isFetching || driftApi.isFetching + } /> From 39fb942887f468b87f57ccbdf21c5101e25cb7d5 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 12 Sep 2025 10:21:58 -0400 Subject: [PATCH 83/86] set selected tenant name --- .../standards/list-standards/classic-standards/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/tenant/standards/list-standards/classic-standards/index.js b/src/pages/tenant/standards/list-standards/classic-standards/index.js index c160d449526b..aa5f940a561a 100644 --- a/src/pages/tenant/standards/list-standards/classic-standards/index.js +++ b/src/pages/tenant/standards/list-standards/classic-standards/index.js @@ -9,6 +9,7 @@ import { Grid } from "@mui/system"; import { CippApiResults } from "../../../../../components/CippComponents/CippApiResults"; import { EyeIcon } from "@heroicons/react/24/outline"; import tabOptions from "../tabOptions.json"; +import { useSettings } from "/src/hooks/use-settings.js"; const Page = () => { const oldStandards = ApiGetCall({ url: "/api/ListStandards", queryKey: "ListStandards-legacy" }); @@ -18,6 +19,8 @@ const Page = () => { refetchOnMount: false, refetchOnReconnect: false, }); + + const currentTenant = useSettings().currentTenant; const pageTitle = "Templates"; const actions = [ { @@ -51,11 +54,12 @@ const Page = () => { data: { id: "GUID", }, - confirmText: "Are you sure you want to create a drift clone of [templateName]? This will create a new drift template based on this template.", + confirmText: + "Are you sure you want to create a drift clone of [templateName]? This will create a new drift template based on this template.", multiPost: false, }, { - label: "Run Template Now (Currently Selected Tenant only)", + label: `Run Template Now (${currentTenant || "Currently Selected Tenant"})`, type: "GET", url: "/api/ExecStandardsRun", icon: , From 75e90e8c275b3534f031366a7320054fdc0f41e9 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:34:18 +0200 Subject: [PATCH 84/86] drift --- .../manage-drift/policies-deployed.js | 135 ++++++++++-------- 1 file changed, 78 insertions(+), 57 deletions(-) diff --git a/src/pages/tenant/standards/manage-drift/policies-deployed.js b/src/pages/tenant/standards/manage-drift/policies-deployed.js index b1dd99606d0a..72c5c08616ca 100644 --- a/src/pages/tenant/standards/manage-drift/policies-deployed.js +++ b/src/pages/tenant/standards/manage-drift/policies-deployed.js @@ -1,7 +1,6 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { useRouter } from "next/router"; import { Policy, Security, AdminPanelSettings, Devices, ExpandMore } from "@mui/icons-material"; -import { Policy, Security, AdminPanelSettings, Devices, ExpandMore } from "@mui/icons-material"; import { Box, Stack, @@ -18,6 +17,7 @@ import { CippHead } from "/src/components/CippComponents/CippHead"; import { ApiGetCall } from "/src/api/ApiCall"; import standardsData from "/src/data/standards.json"; import { createDriftManagementActions } from "./driftManagementActions"; +import { useSettings } from "../../../../hooks/use-settings"; const PoliciesDeployedPage = () => { const userSettingsDefaults = useSettings(); @@ -191,36 +191,45 @@ const PoliciesDeployedPage = () => { // Process Intune Templates const intunePolices = []; (templateStandards.IntuneTemplate || []).forEach((template, index) => { - console.log('Processing IntuneTemplate in policies-deployed:', template); - + console.log("Processing IntuneTemplate in policies-deployed:", template); + // Check if this template has TemplateList-Tags and expand them - if (template['TemplateList-Tags']?.value && template['TemplateList-Tags']?.addedFields?.templates) { - console.log('Found TemplateList-Tags for IntuneTemplate in policies-deployed:', template['TemplateList-Tags']); - console.log('Templates to expand:', template['TemplateList-Tags'].addedFields.templates); - + if ( + template["TemplateList-Tags"]?.value && + template["TemplateList-Tags"]?.addedFields?.templates + ) { + console.log( + "Found TemplateList-Tags for IntuneTemplate in policies-deployed:", + template["TemplateList-Tags"] + ); + console.log("Templates to expand:", template["TemplateList-Tags"].addedFields.templates); + // Expand TemplateList-Tags into multiple template items - template['TemplateList-Tags'].addedFields.templates.forEach((expandedTemplate, expandedIndex) => { - console.log('Expanding IntuneTemplate in policies-deployed:', expandedTemplate); - const standardKey = `IntuneTemplate.${expandedTemplate.GUID}`; - const driftDisplayName = getDisplayNameFromDrift( - standardKey, - expandedTemplate.GUID, - "IntuneTemplate" - ); - const packageTagName = template['TemplateList-Tags'].value; - const templateName = expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; - - intunePolices.push({ - id: intunePolices.length + 1, - name: `${driftDisplayName || templateName} (via ${packageTagName})`, - category: "Intune Template", - platform: "Multi-Platform", - status: getStatus(standardKey, expandedTemplate.GUID, "IntuneTemplate"), - lastModified: getLastRefresh(standardKey), - assignedGroups: template.AssignTo || "N/A", - templateValue: expandedTemplate.GUID, - }); - }); + template["TemplateList-Tags"].addedFields.templates.forEach( + (expandedTemplate, expandedIndex) => { + console.log("Expanding IntuneTemplate in policies-deployed:", expandedTemplate); + const standardKey = `IntuneTemplate.${expandedTemplate.GUID}`; + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + expandedTemplate.GUID, + "IntuneTemplate" + ); + const packageTagName = template["TemplateList-Tags"].value; + const templateName = + expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; + + intunePolices.push({ + id: intunePolices.length + 1, + name: `${driftDisplayName || templateName} (via ${packageTagName})`, + category: "Intune Template", + platform: "Multi-Platform", + status: getStatus(standardKey, expandedTemplate.GUID, "IntuneTemplate"), + lastModified: getLastRefresh(standardKey), + assignedGroups: template.AssignTo || "N/A", + templateValue: expandedTemplate.GUID, + }); + } + ); } else { // Regular TemplateList processing const standardKey = `IntuneTemplate.${template.TemplateList?.value}`; @@ -247,36 +256,48 @@ const PoliciesDeployedPage = () => { // Process Conditional Access Templates const conditionalAccessPolicies = []; (templateStandards.ConditionalAccessTemplate || []).forEach((template, index) => { - console.log('Processing ConditionalAccessTemplate in policies-deployed:', template); - + console.log("Processing ConditionalAccessTemplate in policies-deployed:", template); + // Check if this template has TemplateList-Tags and expand them - if (template['TemplateList-Tags']?.value && template['TemplateList-Tags']?.addedFields?.templates) { - console.log('Found TemplateList-Tags for ConditionalAccessTemplate in policies-deployed:', template['TemplateList-Tags']); - console.log('Templates to expand:', template['TemplateList-Tags'].addedFields.templates); - + if ( + template["TemplateList-Tags"]?.value && + template["TemplateList-Tags"]?.addedFields?.templates + ) { + console.log( + "Found TemplateList-Tags for ConditionalAccessTemplate in policies-deployed:", + template["TemplateList-Tags"] + ); + console.log("Templates to expand:", template["TemplateList-Tags"].addedFields.templates); + // Expand TemplateList-Tags into multiple template items - template['TemplateList-Tags'].addedFields.templates.forEach((expandedTemplate, expandedIndex) => { - console.log('Expanding ConditionalAccessTemplate in policies-deployed:', expandedTemplate); - const standardKey = `ConditionalAccessTemplate.${expandedTemplate.GUID}`; - const driftDisplayName = getDisplayNameFromDrift( - standardKey, - expandedTemplate.GUID, - "ConditionalAccessTemplate" - ); - const packageTagName = template['TemplateList-Tags'].value; - const templateName = expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; - - conditionalAccessPolicies.push({ - id: conditionalAccessPolicies.length + 1, - name: `${driftDisplayName || templateName} (via ${packageTagName})`, - state: template.state || "Unknown", - conditions: "Conditional Access Policy", - controls: "Access Control", - lastModified: getLastRefresh(standardKey), - status: getStatus(standardKey, expandedTemplate.GUID, "ConditionalAccessTemplate"), - templateValue: expandedTemplate.GUID, - }); - }); + template["TemplateList-Tags"].addedFields.templates.forEach( + (expandedTemplate, expandedIndex) => { + console.log( + "Expanding ConditionalAccessTemplate in policies-deployed:", + expandedTemplate + ); + const standardKey = `ConditionalAccessTemplate.${expandedTemplate.GUID}`; + const driftDisplayName = getDisplayNameFromDrift( + standardKey, + expandedTemplate.GUID, + "ConditionalAccessTemplate" + ); + const packageTagName = template["TemplateList-Tags"].value; + const templateName = + expandedTemplate.displayName || expandedTemplate.name || "Unknown Template"; + + conditionalAccessPolicies.push({ + id: conditionalAccessPolicies.length + 1, + name: `${driftDisplayName || templateName} (via ${packageTagName})`, + state: template.state || "Unknown", + conditions: "Conditional Access Policy", + controls: "Access Control", + lastModified: getLastRefresh(standardKey), + status: getStatus(standardKey, expandedTemplate.GUID, "ConditionalAccessTemplate"), + templateValue: expandedTemplate.GUID, + }); + } + ); } else { // Regular TemplateList processing const standardKey = `ConditionalAccessTemplate.${template.TemplateList?.value}`; From cf2a1188dd8108d1f4f28bdf39d5912f6c5273b6 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:43:53 +0200 Subject: [PATCH 85/86] interface updates --- .../CippStandards/CippStandardAccordion.jsx | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/components/CippStandards/CippStandardAccordion.jsx b/src/components/CippStandards/CippStandardAccordion.jsx index 95ddcf55d63f..aec6d0fbda94 100644 --- a/src/components/CippStandards/CippStandardAccordion.jsx +++ b/src/components/CippStandards/CippStandardAccordion.jsx @@ -560,13 +560,33 @@ const CippStandardAccordion = ({ selectedActions = [selectedActions]; } + // Get template name for Intune Templates + let templateDisplayName = ""; + if (standardName.startsWith("standards.IntuneTemplate")) { + // Check for TemplateList selection + const templateList = _.get(watchedValues, `${standardName}.TemplateList`); + if (templateList && templateList.label) { + templateDisplayName = templateList.label; + } + + // Check for TemplateList-Tags selection (takes priority) + const templateListTags = _.get(watchedValues, `${standardName}.TemplateList-Tags`); + if (templateListTags && templateListTags.label) { + templateDisplayName = templateListTags.label; + } + } + + // For multiple standards, check the first added component const selectedTemplateName = standard.multiple ? _.get(watchedValues, `${standardName}.${standard.addedComponent?.[0]?.name}`) : ""; - const accordionTitle = - selectedTemplateName && _.get(selectedTemplateName, "label") - ? `${standard.label} - ${_.get(selectedTemplateName, "label")}` - : standard.label; + + // Build accordion title with template name if available + const accordionTitle = templateDisplayName + ? `${standard.label} - ${templateDisplayName}` + : selectedTemplateName && _.get(selectedTemplateName, "label") + ? `${standard.label} - ${_.get(selectedTemplateName, "label")}` + : standard.label; // Get current values and check if they differ from saved values const current = _.get(watchedValues, standardName); @@ -809,6 +829,17 @@ const CippStandardAccordion = ({ {/* Additional components take full width */} {hasAddedComponents && ( <> + {/* Add catalog button for Intune Template standard - appears first */} + {standardName.startsWith("standards.IntuneTemplate") && ( + + + + + + )} {standard.addedComponent?.map((component, idx) => component?.condition ? ( Date: Fri, 12 Sep 2025 16:49:27 +0200 Subject: [PATCH 86/86] up version --- public/version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/version.json b/public/version.json index 711bdd5d11ca..f9d9abd8b211 100644 --- a/public/version.json +++ b/public/version.json @@ -1,3 +1,3 @@ { - "version": "8.3.2" -} \ No newline at end of file + "version": "8.4.0" +}