Skip to content

feat: Work from anywhere report #4062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/layouts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const nativeMenuItems = [
path: "/endpoint/reports",
items: [
{ title: "Analytics Device Score", path: "/endpoint/reports/analyticsdevicescore" },
{ title: "Work from anywhere", path: "/endpoint/reports/workfromanywhere" },
],
},
],
Expand Down
87 changes: 87 additions & 0 deletions src/pages/endpoint/reports/workfromanywhere/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { EyeIcon } 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";

const Page = () => {
const pageTitle = "Work from anywhere Report";
const tenantFilter = useSettings().currentTenant;

// Actions from the source file
const actions = [
{
label: "View in Intune",
link: `https://intune.microsoft.com/${tenantFilter}/#view/Microsoft_Intune_Devices/DeviceSettingsMenuBlade/~/overview/mdmDeviceId/[id]`,
color: "info",
icon: <EyeIcon />,
target: "_blank",
multiPost: false,
external: true,
},
];

// OffCanvas details based on the source file
const offCanvas = {
extendedInfoFields: [
"id",
"deviceName",
"serialNumber",
"model",
"manufacturer",
"ownership",
"upgradeEligibility",
],
actions: actions,
};

// Columns to be displayed in the table
const simpleColumns = [
"deviceName",
"serialNumber",
"model",
"manufacturer",
"ownership",
"managedBy",
"osVersion",
"upgradeEligibility",
"ramCheckFailed",
"storageCheckFailed",
"processorCoreCountCheckFailed",
"processorSpeedCheckFailed",
"tpmCheckFailed",
"secureBootCheckFailed",
"processorFamilyCheckFailed",
"processor64BitCheckFailed",
"osCheckFailed",
];

// Predefined filters to be applied to the table
const filterList = [
{
filterName: "Upgrade not eligible",
value: [{ id: "upgradeEligibility", value: "notCapable" }],
type: "column",
},
];

return (
<CippTablePage
title={pageTitle}
apiUrl="/api/ListGraphRequest"
apiData={{
Endpoint: "deviceManagement/userExperienceAnalyticsWorkFromAnywhereMetrics('allDevices')/metricDevices",
manualPagination: true,
$top: 999,
}}
apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
simpleColumns={simpleColumns}
filters={filterList}
/>
);
};

Page.getLayout = (page) => <DashboardLayout>{page}</DashboardLayout>;

export default Page;
Loading