From c7a87f2b5c97f59fa16a977abe48818800e3002b Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 8 Oct 2025 12:14:41 -0400 Subject: [PATCH 1/4] add clear cache button --- src/pages/_app.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/pages/_app.js b/src/pages/_app.js index 0b7c0620638e..760f2fa1c865 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -27,6 +27,7 @@ import { AutoStories, Gavel, Celebration, + ClearAll as ClearAllIcon, } from "@mui/icons-material"; import { SvgIcon } from "@mui/material"; import discordIcon from "../../public/discord-mark-blue.svg"; @@ -196,6 +197,29 @@ const App = (props) => { }, ] : []), // toRemove + { + // add clear cache action that removes the persisted query cache from local storage and reloads the page + id: "clearCache", + icon: , + name: "Clear Cache", + onClick: () => { + // Clear the TanStack Query cache + queryClient.clear(); + + // Remove persisted cache from localStorage + if (typeof window !== "undefined") { + // Remove the persisted query cache keys + Object.keys(localStorage).forEach((key) => { + if (key.startsWith("REACT_QUERY_OFFLINE_CACHE")) { + localStorage.removeItem(key); + } + }); + } + + // Reload the page to ensure clean state + window.location.reload(); + }, + }, { id: "license", icon: , From 5a4349cc680be8065078555a1fe38cb3641985fb Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 8 Oct 2025 12:17:43 -0400 Subject: [PATCH 2/4] filter tweak --- src/utils/get-cipp-filter-variant.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/utils/get-cipp-filter-variant.js b/src/utils/get-cipp-filter-variant.js index eb668bdbeee5..ab59e94bcc32 100644 --- a/src/utils/get-cipp-filter-variant.js +++ b/src/utils/get-cipp-filter-variant.js @@ -115,11 +115,4 @@ export const getCippFilterVariant = (providedColumnKeys, arg) => { filterFn: "betweenInclusive", }; } - - // Default fallback for any remaining cases - use text filter to avoid localeCompare issues - return { - filterVariant: "text", - sortingFn: "alphanumeric", - filterFn: "includes", - }; }; From 0e7882279fb19d96564fcaa37bd3ea2b38cb8d0a Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 8 Oct 2025 13:50:18 -0400 Subject: [PATCH 3/4] autopilot tweaks add cache clear button to speed dial --- .../CippAutopilotProfileDrawer.jsx | 82 +++++++++++++------ src/pages/_app.js | 6 +- 2 files changed, 62 insertions(+), 26 deletions(-) diff --git a/src/components/CippComponents/CippAutopilotProfileDrawer.jsx b/src/components/CippComponents/CippAutopilotProfileDrawer.jsx index 9ac21d1fd858..f5b48ae54040 100644 --- a/src/components/CippComponents/CippAutopilotProfileDrawer.jsx +++ b/src/components/CippComponents/CippAutopilotProfileDrawer.jsx @@ -1,7 +1,7 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { Divider, Button } from "@mui/material"; import { Grid } from "@mui/system"; -import { useForm } from "react-hook-form"; +import { useForm, useWatch, useFormState } from "react-hook-form"; import { AccountCircle } from "@mui/icons-material"; import { CippOffCanvas } from "./CippOffCanvas"; import CippFormComponent from "./CippFormComponent"; @@ -23,9 +23,9 @@ export const CippAutopilotProfileDrawer = ({ Description: "", DeviceNameTemplate: "", languages: null, - CollectHash: true, + CollectHash: false, Assignto: true, - DeploymentMode: true, + DeploymentMode: false, HideTerms: true, HidePrivacy: true, HideChangeAccount: true, @@ -37,15 +37,36 @@ export const CippAutopilotProfileDrawer = ({ const createProfile = ApiPostCall({ urlFromData: true, - relatedQueryKeys: ["Autopilot Profiles"], + relatedQueryKeys: ["Autopilot Profiles*"], }); + // Watch the deployment mode to conditionally disable white glove + const deploymentMode = useWatch({ + control: formControl.control, + name: "DeploymentMode", + }); + + // Watch form state for validation + const { isValid, isDirty } = useFormState({ + control: formControl.control, + }); + + // Automatically disable white glove when self-deploying mode (shared) is enabled + useEffect(() => { + if (deploymentMode === true) { + // Self-deploying mode is enabled (shared mode), disable white glove + formControl.setValue("allowWhiteglove", false); + } + }, [deploymentMode, formControl]); + const handleSubmit = () => { const formData = formControl.getValues(); + // Always set HideChangeAccount to true regardless of form state + formData.HideChangeAccount = true; createProfile.mutate({ url: "/api/AddAutopilotConfig", data: formData, - relatedQueryKeys: ["Autopilot Profiles"], + relatedQueryKeys: ["Autopilot Profiles*"], }); }; @@ -69,22 +90,32 @@ export const CippAutopilotProfileDrawer = ({ onClose={handleCloseDrawer} size="lg" footer={ -
- - + + +
} > @@ -114,6 +145,7 @@ export const CippAutopilotProfileDrawer = ({ name="DisplayName" formControl={formControl} validators={{ required: "Display Name is required" }} + required={true} /> @@ -202,6 +234,12 @@ export const CippAutopilotProfileDrawer = ({ label="Allow White Glove OOBE" name="allowWhiteglove" formControl={formControl} + disabled={deploymentMode === true} + helperText={ + deploymentMode === true + ? "White Glove is not supported with Self-deploying mode (shared devices)" + : undefined + } /> - - diff --git a/src/pages/_app.js b/src/pages/_app.js index 760f2fa1c865..3623d863d18a 100644 --- a/src/pages/_app.js +++ b/src/pages/_app.js @@ -201,7 +201,7 @@ const App = (props) => { // add clear cache action that removes the persisted query cache from local storage and reloads the page id: "clearCache", icon: , - name: "Clear Cache", + name: "Clear Cache and Reload", onClick: () => { // Clear the TanStack Query cache queryClient.clear(); @@ -216,8 +216,8 @@ const App = (props) => { }); } - // Reload the page to ensure clean state - window.location.reload(); + // Force refresh the page to bypass browser cache and reload JavaScript + window.location.reload(true); }, }, { From 0d5fbb365e6f63290b4896eb6109708252c0bd9f Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 8 Oct 2025 13:50:25 -0400 Subject: [PATCH 4/4] up version --- package.json | 4 ++-- public/version.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1a5926d62bfe..f58b604c130a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cipp", - "version": "8.5.0", + "version": "8.5.1", "author": "CIPP Contributors", "homepage": "https://cipp.app/", "bugs": { @@ -112,4 +112,4 @@ "eslint": "9.35.0", "eslint-config-next": "15.5.2" } -} +} \ No newline at end of file diff --git a/public/version.json b/public/version.json index 5cf63fb43067..f39cee3866d5 100644 --- a/public/version.json +++ b/public/version.json @@ -1,3 +1,3 @@ { - "version": "8.5.0" + "version": "8.5.1" }