From 0870beb390d5c9178e61192ef1d6f6c3e26b9f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sat, 21 Jun 2025 23:27:23 +0200 Subject: [PATCH 1/5] Add "Autopilot Deployments" report to native menu items --- src/layouts/config.js | 1 + .../reports/autopilot-deployment/index.js | 136 ++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 src/pages/endpoint/reports/autopilot-deployment/index.js diff --git a/src/layouts/config.js b/src/layouts/config.js index e51850cee974..3e00ca524df3 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -264,6 +264,7 @@ export const nativeMenuItems = [ items: [ { title: "Analytics Device Score", path: "/endpoint/reports/analyticsdevicescore" }, { title: "Work from anywhere", path: "/endpoint/reports/workfromanywhere" }, + { title: "Autopilot Deployments", path: "/endpoint/reports/autopilot-deployment" }, ], }, ], diff --git a/src/pages/endpoint/reports/autopilot-deployment/index.js b/src/pages/endpoint/reports/autopilot-deployment/index.js new file mode 100644 index 000000000000..48e75389f7e1 --- /dev/null +++ b/src/pages/endpoint/reports/autopilot-deployment/index.js @@ -0,0 +1,136 @@ +import { EyeIcon, DocumentTextIcon } from "@heroicons/react/24/outline"; +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { useSettings } from "/src/hooks/use-settings"; +import { CheckCircle, Error, Warning, Refresh } from "@mui/icons-material"; + +const Page = () => { + const pageTitle = "Autopilot Deployments"; + const tenantFilter = useSettings().currentTenant; + + // Actions for viewing device in Intune and deployment details + const actions = [ + { + label: "View Device in Intune", + link: `https://intune.microsoft.com/${tenantFilter}/#view/Microsoft_Intune_Devices/DeviceSettingsMenuBlade/~/overview/mdmDeviceId/[deviceId]`, + color: "info", + icon: , + target: "_blank", + multiPost: false, + external: true, + }, + { + label: "View Deployment Details", + link: `https://intune.microsoft.com/${tenantFilter}/#view/Microsoft_Intune_DeviceSettings/DeploymentOverviewMenuBlade/~/autopilotDeployment/deploymentProfileId/[windowsAutopilotDeploymentProfileDisplayName]`, + color: "info", + icon: , + target: "_blank", + multiPost: false, + external: true, + }, + ]; + + // Extended info fields for the off-canvas panel + const offCanvas = { + extendedInfoFields: [ + "id", + "deviceId", + "userId", + "eventDateTime", + "deviceRegisteredDateTime", + "enrollmentStartDateTime", + "enrollmentType", + "deviceSerialNumber", + "managedDeviceName", + "userPrincipalName", + "windowsAutopilotDeploymentProfileDisplayName", + "enrollmentState", + "windows10EnrollmentCompletionPageConfigurationDisplayName", + "deploymentState", + "deviceSetupStatus", + "accountSetupStatus", + "osVersion", + "deploymentDuration", + "deploymentTotalDuration", + "deviceSetupDuration", + "accountSetupDuration", + "deploymentStartDateTime", + "deploymentEndDateTime", + "enrollmentFailureDetails", + ], + actions: actions, + }; + + // Columns to be displayed in the table (most important first) + const simpleColumns = [ + "managedDeviceName", + "eventDateTime", + "deviceSerialNumber", + "userPrincipalName", + "deploymentState", + "enrollmentState", + "enrollmentType", + "deploymentTotalDuration", + "windowsAutopilotDeploymentProfileDisplayName", + "enrollmentFailureDetails", + ]; + + // Predefined filters for common deployment scenarios + const filterList = [ + { + filterName: "Failed Deployments", + value: [{ id: "deploymentState", value: "failed" }], + type: "column", + }, + { + filterName: "Successful Deployments", + value: [{ id: "deploymentState", value: "success" }], + type: "column", + }, + { + filterName: "In Progress Deployments", + value: [{ id: "deploymentState", value: "inProgress" }], + type: "column", + }, + { + filterName: "Device Setup Failed", + value: [{ id: "deviceSetupStatus", value: "failed" }], + type: "column", + }, + { + filterName: "Account Setup Failed", + value: [{ id: "accountSetupStatus", value: "failed" }], + type: "column", + }, + { + filterName: "Enrollment Completed", + value: [{ id: "enrollmentState", value: "enrolled" }], + type: "column", + }, + { + filterName: "Self-Deploying Mode", + value: [{ id: "enrollmentType", value: "azureADJoinedWithoutAutopilotProfile" }], + type: "column", + }, + { + filterName: "User-Driven Mode", + value: [{ id: "enrollmentType", value: "azureADJoinedWithAutopilotProfile" }], + type: "column", + }, + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => {page}; + +export default Page; \ No newline at end of file From 7d3688321aea17805c333cd28c3413a4d1f4174c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sun, 22 Jun 2025 00:20:50 +0200 Subject: [PATCH 2/5] Remove unused filters from Autopilot Deployment report --- .../reports/autopilot-deployment/index.js | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/src/pages/endpoint/reports/autopilot-deployment/index.js b/src/pages/endpoint/reports/autopilot-deployment/index.js index 48e75389f7e1..e22bf4f96fbe 100644 --- a/src/pages/endpoint/reports/autopilot-deployment/index.js +++ b/src/pages/endpoint/reports/autopilot-deployment/index.js @@ -87,36 +87,6 @@ const Page = () => { value: [{ id: "deploymentState", value: "success" }], type: "column", }, - { - filterName: "In Progress Deployments", - value: [{ id: "deploymentState", value: "inProgress" }], - type: "column", - }, - { - filterName: "Device Setup Failed", - value: [{ id: "deviceSetupStatus", value: "failed" }], - type: "column", - }, - { - filterName: "Account Setup Failed", - value: [{ id: "accountSetupStatus", value: "failed" }], - type: "column", - }, - { - filterName: "Enrollment Completed", - value: [{ id: "enrollmentState", value: "enrolled" }], - type: "column", - }, - { - filterName: "Self-Deploying Mode", - value: [{ id: "enrollmentType", value: "azureADJoinedWithoutAutopilotProfile" }], - type: "column", - }, - { - filterName: "User-Driven Mode", - value: [{ id: "enrollmentType", value: "azureADJoinedWithAutopilotProfile" }], - type: "column", - }, ]; return ( From 37762f77cd8e6efb4fac7f2f5d2ec5da1621311e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sun, 22 Jun 2025 12:28:12 +0200 Subject: [PATCH 3/5] Add ISO 8601 duration formatting for multiple properties in getCippFormatting function --- src/utils/get-cipp-formatting.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils/get-cipp-formatting.js b/src/utils/get-cipp-formatting.js index 11987b14bd2d..8aad5e92d653 100644 --- a/src/utils/get-cipp-formatting.js +++ b/src/utils/get-cipp-formatting.js @@ -645,7 +645,17 @@ export const getCippFormatting = (data, cellName, type, canReceive, flatten = tr ); } - const durationArray = ["autoExtendDuration"]; + // ISO 8601 Duration Formatting + // Add property names here to automatically format ISO 8601 duration strings (e.g., "PT1H23M30S") + // into human-readable format (e.g., "1 hour 23 minutes 30 seconds") across all CIPP tables. + // This works for any API response property that contains ISO 8601 duration format. + const durationArray = [ + "autoExtendDuration", // GDAP page + "deploymentDuration", // AutoPilot deployments + "deploymentTotalDuration", // AutoPilot deployments + "deviceSetupDuration", // AutoPilot deployments + "accountSetupDuration" // AutoPilot deployments + ]; if (durationArray.includes(cellName)) { isoDuration.setLocales( { From 07a0fc2e59ae38c680cbdd11d77fda02767fcfeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Sun, 22 Jun 2025 15:58:21 +0200 Subject: [PATCH 4/5] Update comments --- src/utils/get-cipp-formatting.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/get-cipp-formatting.js b/src/utils/get-cipp-formatting.js index 8aad5e92d653..9f1b07f4769d 100644 --- a/src/utils/get-cipp-formatting.js +++ b/src/utils/get-cipp-formatting.js @@ -650,11 +650,11 @@ export const getCippFormatting = (data, cellName, type, canReceive, flatten = tr // into human-readable format (e.g., "1 hour 23 minutes 30 seconds") across all CIPP tables. // This works for any API response property that contains ISO 8601 duration format. const durationArray = [ - "autoExtendDuration", // GDAP page - "deploymentDuration", // AutoPilot deployments - "deploymentTotalDuration", // AutoPilot deployments - "deviceSetupDuration", // AutoPilot deployments - "accountSetupDuration" // AutoPilot deployments + "autoExtendDuration", // GDAP page (/tenant/gdap-management/relationships) + "deploymentDuration", // AutoPilot deployments (/endpoint/reports/autopilot-deployment) + "deploymentTotalDuration", // AutoPilot deployments (/endpoint/reports/autopilot-deployment) + "deviceSetupDuration", // AutoPilot deployments (/endpoint/reports/autopilot-deployment) + "accountSetupDuration" // AutoPilot deployments (/endpoint/reports/autopilot-deployment) ]; if (durationArray.includes(cellName)) { isoDuration.setLocales( From 9b67a2fbee200e67230c167dfcc1def8bf401b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Mon, 23 Jun 2025 18:19:42 +0200 Subject: [PATCH 5/5] Update API endpoint and data configuration for Autopilot Deployment report --- src/pages/endpoint/reports/autopilot-deployment/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/endpoint/reports/autopilot-deployment/index.js b/src/pages/endpoint/reports/autopilot-deployment/index.js index e22bf4f96fbe..28db44474ea8 100644 --- a/src/pages/endpoint/reports/autopilot-deployment/index.js +++ b/src/pages/endpoint/reports/autopilot-deployment/index.js @@ -92,7 +92,13 @@ const Page = () => { return (