From ff1928192988ffb11aa57a798a39679e94891932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 21 Jan 2025 01:08:55 +0100 Subject: [PATCH 1/4] Change Delete Policy request type from GET to POST --- src/pages/endpoint/MEM/list-policies/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/endpoint/MEM/list-policies/index.js b/src/pages/endpoint/MEM/list-policies/index.js index 299881df53fe..21c2f1962a24 100644 --- a/src/pages/endpoint/MEM/list-policies/index.js +++ b/src/pages/endpoint/MEM/list-policies/index.js @@ -60,7 +60,7 @@ const Page = () => { }, { label: "Delete Policy", - type: "GET", + type: "POST", url: "/api/RemovePolicy", data: { ID: "id", From fe3b29355744e49dd08b669ad35c086d8a49f812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 21 Jan 2025 01:09:07 +0100 Subject: [PATCH 2/4] Add "Scripts" menu item to the endpoint navigation --- src/layouts/config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/layouts/config.js b/src/layouts/config.js index e74843605127..3ba6ec3a98b1 100644 --- a/src/layouts/config.js +++ b/src/layouts/config.js @@ -251,6 +251,7 @@ export const nativeMenuItems = [ { title: "Protection Policies", path: "/endpoint/MEM/list-appprotection-policies" }, { title: "Apply Policy", path: "/endpoint/MEM/add-policy" }, { title: "Policy Templates", path: "/endpoint/MEM/list-templates" }, + { title: "Scripts", path: "/endpoint/MEM/list-scripts" }, ], }, { From 1f3b7558adacf81b570e05a37010d4ddcd9fc1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Tue, 21 Jan 2025 01:21:07 +0100 Subject: [PATCH 3/4] Add Intune scripts page --- src/pages/endpoint/MEM/list-scripts/index.js | 69 ++++++++++++++++++ src/pages/endpoint/MEM/list-scripts/linux.js | 61 ++++++++++++++++ src/pages/endpoint/MEM/list-scripts/macOS.js | 70 +++++++++++++++++++ .../endpoint/MEM/list-scripts/remediation.js | 69 ++++++++++++++++++ .../endpoint/MEM/list-scripts/tabOptions.json | 18 +++++ 5 files changed, 287 insertions(+) create mode 100644 src/pages/endpoint/MEM/list-scripts/index.js create mode 100644 src/pages/endpoint/MEM/list-scripts/linux.js create mode 100644 src/pages/endpoint/MEM/list-scripts/macOS.js create mode 100644 src/pages/endpoint/MEM/list-scripts/remediation.js create mode 100644 src/pages/endpoint/MEM/list-scripts/tabOptions.json diff --git a/src/pages/endpoint/MEM/list-scripts/index.js b/src/pages/endpoint/MEM/list-scripts/index.js new file mode 100644 index 000000000000..6ce9383bb2fd --- /dev/null +++ b/src/pages/endpoint/MEM/list-scripts/index.js @@ -0,0 +1,69 @@ +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { Code, TrashIcon } from "@heroicons/react/24/outline"; +import { TabbedLayout } from "/src/layouts/TabbedLayout"; +import tabOptions from "./tabOptions"; + +const Page = () => { + const pageTitle = "Windows Scripts"; + + const actions = [ + { + label: "Delete Script", + type: "POST", + url: "/api/RemoveIntuneScript", + data: { + ID: "id", + displayName: "displayName", + ScriptType: "!windows", + }, + confirmText: "Are you sure you want to delete this script?", + icon: , + color: "danger", + }, + ]; + + const offCanvas = { + extendedInfoFields: [ + "id", + "fileName", + "displayName", + "description", + "lastModifiedDateTime", + "createdDateTime", + ], + actions: actions, + }; + + const simpleColumns = [ + "displayName", + "description", + "runAsAccount", + "runAs32Bit", + "enforceSignatureCheck", + "lastModifiedDateTime", + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => ( + + {page} + +); +export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/linux.js b/src/pages/endpoint/MEM/list-scripts/linux.js new file mode 100644 index 000000000000..be139e47205f --- /dev/null +++ b/src/pages/endpoint/MEM/list-scripts/linux.js @@ -0,0 +1,61 @@ +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { Code, TrashIcon } from "@heroicons/react/24/outline"; +import { TabbedLayout } from "/src/layouts/TabbedLayout"; +import tabOptions from "./tabOptions"; + +const Page = () => { + const pageTitle = "Linux Scripts"; + + const actions = [ + { + label: "Delete Script", + type: "POST", + url: "/api/RemovePolicy", + data: { + ID: "id", + URLName: "URLName", + }, + confirmText: "Are you sure you want to delete this script?", + icon: , + color: "danger", + }, + ]; + + const offCanvas = { + extendedInfoFields: [ + "id", + "displayName", + "description", + "lastModifiedDateTime", + "createdDateTime", + ], + actions: actions, + }; + + const simpleColumns = [ + "displayName", + "description", + "runAsAccount", + "executionFrequency", + "enforceSignatureCheck", + "lastModifiedDateTime", + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => ( + + {page} + +); +export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/macOS.js b/src/pages/endpoint/MEM/list-scripts/macOS.js new file mode 100644 index 000000000000..5fcf6fca1202 --- /dev/null +++ b/src/pages/endpoint/MEM/list-scripts/macOS.js @@ -0,0 +1,70 @@ +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { Code, TrashIcon } from "@heroicons/react/24/outline"; +import { TabbedLayout } from "/src/layouts/TabbedLayout"; +import tabOptions from "./tabOptions"; + +const Page = () => { + const pageTitle = "MacOS Scripts"; + + const actions = [ + { + label: "Delete Script", + type: "POST", + url: "/api/RemoveIntuneScript", + data: { + ID: "id", + displayName: "displayName", + ScriptType: "!macOS", + }, + confirmText: "Are you sure you want to delete this script?", + icon: , + color: "danger", + }, + ]; + + const offCanvas = { + extendedInfoFields: [ + "id", + "fileName", + "displayName", + "description", + "lastModifiedDateTime", + "createdDateTime", + "retryCount", + ], + actions: actions, + }; + + const simpleColumns = [ + "displayName", + "description", + "runAsAccount", + "executionFrequency", + "enforceSignatureCheck", + "lastModifiedDateTime", + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => ( + + {page} + +); +export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/remediation.js b/src/pages/endpoint/MEM/list-scripts/remediation.js new file mode 100644 index 000000000000..f08106b87099 --- /dev/null +++ b/src/pages/endpoint/MEM/list-scripts/remediation.js @@ -0,0 +1,69 @@ +import { Layout as DashboardLayout } from "/src/layouts/index.js"; +import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; +import { Code, TrashIcon } from "@heroicons/react/24/outline"; +import { TabbedLayout } from "/src/layouts/TabbedLayout"; +import tabOptions from "./tabOptions"; + +const Page = () => { + const pageTitle = "Remediation Scripts"; + + const actions = [ + { + label: "Delete Script", + type: "POST", + url: "/api/RemoveIntuneScript", + data: { + ID: "id", + displayName: "displayName", + ScriptType: "!remediate", + }, + confirmText: "Are you sure you want to delete this script?", + icon: , + color: "danger", + }, + ]; + + const offCanvas = { + extendedInfoFields: [ + "id", + "fileName", + "displayName", + "description", + "lastModifiedDateTime", + "createdDateTime", + ], + actions: actions, + }; + + const simpleColumns = [ + "displayName", + "description", + "runAsAccount", + "runAs32Bit", + "enforceSignatureCheck", + "lastModifiedDateTime", + ]; + + return ( + + ); +}; + +Page.getLayout = (page) => ( + + {page} + +); +export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/tabOptions.json b/src/pages/endpoint/MEM/list-scripts/tabOptions.json new file mode 100644 index 000000000000..0e10ef91f490 --- /dev/null +++ b/src/pages/endpoint/MEM/list-scripts/tabOptions.json @@ -0,0 +1,18 @@ +[ + { + "label": "Windows Scripts", + "path": "/endpoint/MEM/list-scripts" + }, + { + "label": "MacOS Scripts", + "path": "/endpoint/MEM/list-scripts/macOS" + }, + { + "label": "Linux Scripts", + "path": "/endpoint/MEM/list-scripts/linux" + }, + { + "label": "Remediation Scripts", + "path": "/endpoint/MEM/list-scripts/remediation" + } +] From a45dc747ec2415334ce811c0e0f52fd993c56f62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20Kj=C3=A6rg=C3=A5rd?= Date: Thu, 23 Jan 2025 22:55:59 +0100 Subject: [PATCH 4/4] Make into 1 page --- .../email/tools/mailbox-restores/index.js | 6 +- src/pages/endpoint/MEM/list-scripts/index.js | 28 +++----- src/pages/endpoint/MEM/list-scripts/linux.js | 61 ---------------- src/pages/endpoint/MEM/list-scripts/macOS.js | 70 ------------------- .../endpoint/MEM/list-scripts/remediation.js | 69 ------------------ .../endpoint/MEM/list-scripts/tabOptions.json | 18 ----- 6 files changed, 13 insertions(+), 239 deletions(-) delete mode 100644 src/pages/endpoint/MEM/list-scripts/linux.js delete mode 100644 src/pages/endpoint/MEM/list-scripts/macOS.js delete mode 100644 src/pages/endpoint/MEM/list-scripts/remediation.js delete mode 100644 src/pages/endpoint/MEM/list-scripts/tabOptions.json diff --git a/src/pages/email/tools/mailbox-restores/index.js b/src/pages/email/tools/mailbox-restores/index.js index ffa463800bd5..16ffea192996 100644 --- a/src/pages/email/tools/mailbox-restores/index.js +++ b/src/pages/email/tools/mailbox-restores/index.js @@ -15,7 +15,7 @@ const Page = () => { data: { TenantFilter: "Tenant", Identity: "Identity", - Action: "Resume", + Action: "!Resume", }, confirmText: "Are you sure you want to resume this restore request?", color: "info", @@ -27,7 +27,7 @@ const Page = () => { data: { TenantFilter: "Tenant", Identity: "Identity", - Action: "Suspend", + Action: "!Suspend", }, confirmText: "Are you sure you want to suspend this restore request?", color: "warning", @@ -39,7 +39,7 @@ const Page = () => { data: { TenantFilter: "Tenant", Identity: "Identity", - Action: "Remove", + Action: "!Remove", }, confirmText: "Are you sure you want to remove this restore request?", color: "danger", diff --git a/src/pages/endpoint/MEM/list-scripts/index.js b/src/pages/endpoint/MEM/list-scripts/index.js index 6ce9383bb2fd..db6dd7a1d1eb 100644 --- a/src/pages/endpoint/MEM/list-scripts/index.js +++ b/src/pages/endpoint/MEM/list-scripts/index.js @@ -1,11 +1,9 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; import { Code, TrashIcon } from "@heroicons/react/24/outline"; -import { TabbedLayout } from "/src/layouts/TabbedLayout"; -import tabOptions from "./tabOptions"; const Page = () => { - const pageTitle = "Windows Scripts"; + const pageTitle = "Scripts"; const actions = [ { @@ -15,7 +13,7 @@ const Page = () => { data: { ID: "id", displayName: "displayName", - ScriptType: "!windows", + ScriptType: "scriptType", }, confirmText: "Are you sure you want to delete this script?", icon: , @@ -25,35 +23,33 @@ const Page = () => { const offCanvas = { extendedInfoFields: [ + "scriptType", "id", "fileName", "displayName", "description", "lastModifiedDateTime", + "runAsAccount", "createdDateTime", + "runAs32Bit", + "executionFrequency", + "enforceSignatureCheck", ], actions: actions, }; const simpleColumns = [ + "scriptType", "displayName", "description", "runAsAccount", - "runAs32Bit", - "enforceSignatureCheck", "lastModifiedDateTime", ]; return ( { ); }; -Page.getLayout = (page) => ( - - {page} - -); +Page.getLayout = (page) => {page}; export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/linux.js b/src/pages/endpoint/MEM/list-scripts/linux.js deleted file mode 100644 index be139e47205f..000000000000 --- a/src/pages/endpoint/MEM/list-scripts/linux.js +++ /dev/null @@ -1,61 +0,0 @@ -import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import { Code, TrashIcon } from "@heroicons/react/24/outline"; -import { TabbedLayout } from "/src/layouts/TabbedLayout"; -import tabOptions from "./tabOptions"; - -const Page = () => { - const pageTitle = "Linux Scripts"; - - const actions = [ - { - label: "Delete Script", - type: "POST", - url: "/api/RemovePolicy", - data: { - ID: "id", - URLName: "URLName", - }, - confirmText: "Are you sure you want to delete this script?", - icon: , - color: "danger", - }, - ]; - - const offCanvas = { - extendedInfoFields: [ - "id", - "displayName", - "description", - "lastModifiedDateTime", - "createdDateTime", - ], - actions: actions, - }; - - const simpleColumns = [ - "displayName", - "description", - "runAsAccount", - "executionFrequency", - "enforceSignatureCheck", - "lastModifiedDateTime", - ]; - - return ( - - ); -}; - -Page.getLayout = (page) => ( - - {page} - -); -export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/macOS.js b/src/pages/endpoint/MEM/list-scripts/macOS.js deleted file mode 100644 index 5fcf6fca1202..000000000000 --- a/src/pages/endpoint/MEM/list-scripts/macOS.js +++ /dev/null @@ -1,70 +0,0 @@ -import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import { Code, TrashIcon } from "@heroicons/react/24/outline"; -import { TabbedLayout } from "/src/layouts/TabbedLayout"; -import tabOptions from "./tabOptions"; - -const Page = () => { - const pageTitle = "MacOS Scripts"; - - const actions = [ - { - label: "Delete Script", - type: "POST", - url: "/api/RemoveIntuneScript", - data: { - ID: "id", - displayName: "displayName", - ScriptType: "!macOS", - }, - confirmText: "Are you sure you want to delete this script?", - icon: , - color: "danger", - }, - ]; - - const offCanvas = { - extendedInfoFields: [ - "id", - "fileName", - "displayName", - "description", - "lastModifiedDateTime", - "createdDateTime", - "retryCount", - ], - actions: actions, - }; - - const simpleColumns = [ - "displayName", - "description", - "runAsAccount", - "executionFrequency", - "enforceSignatureCheck", - "lastModifiedDateTime", - ]; - - return ( - - ); -}; - -Page.getLayout = (page) => ( - - {page} - -); -export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/remediation.js b/src/pages/endpoint/MEM/list-scripts/remediation.js deleted file mode 100644 index f08106b87099..000000000000 --- a/src/pages/endpoint/MEM/list-scripts/remediation.js +++ /dev/null @@ -1,69 +0,0 @@ -import { Layout as DashboardLayout } from "/src/layouts/index.js"; -import { CippTablePage } from "/src/components/CippComponents/CippTablePage.jsx"; -import { Code, TrashIcon } from "@heroicons/react/24/outline"; -import { TabbedLayout } from "/src/layouts/TabbedLayout"; -import tabOptions from "./tabOptions"; - -const Page = () => { - const pageTitle = "Remediation Scripts"; - - const actions = [ - { - label: "Delete Script", - type: "POST", - url: "/api/RemoveIntuneScript", - data: { - ID: "id", - displayName: "displayName", - ScriptType: "!remediate", - }, - confirmText: "Are you sure you want to delete this script?", - icon: , - color: "danger", - }, - ]; - - const offCanvas = { - extendedInfoFields: [ - "id", - "fileName", - "displayName", - "description", - "lastModifiedDateTime", - "createdDateTime", - ], - actions: actions, - }; - - const simpleColumns = [ - "displayName", - "description", - "runAsAccount", - "runAs32Bit", - "enforceSignatureCheck", - "lastModifiedDateTime", - ]; - - return ( - - ); -}; - -Page.getLayout = (page) => ( - - {page} - -); -export default Page; diff --git a/src/pages/endpoint/MEM/list-scripts/tabOptions.json b/src/pages/endpoint/MEM/list-scripts/tabOptions.json deleted file mode 100644 index 0e10ef91f490..000000000000 --- a/src/pages/endpoint/MEM/list-scripts/tabOptions.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "label": "Windows Scripts", - "path": "/endpoint/MEM/list-scripts" - }, - { - "label": "MacOS Scripts", - "path": "/endpoint/MEM/list-scripts/macOS" - }, - { - "label": "Linux Scripts", - "path": "/endpoint/MEM/list-scripts/linux" - }, - { - "label": "Remediation Scripts", - "path": "/endpoint/MEM/list-scripts/remediation" - } -]