From 2f681351e78436d7c8732ae9e33e6cba4a6326e0 Mon Sep 17 00:00:00 2001 From: Roel van der Wegen Date: Wed, 19 Jul 2023 22:21:28 +0200 Subject: [PATCH 1/8] Create portals.json --- src/data/portals.json | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/data/portals.json diff --git a/src/data/portals.json b/src/data/portals.json new file mode 100644 index 000000000000..264b8a4aaab0 --- /dev/null +++ b/src/data/portals.json @@ -0,0 +1,66 @@ +[ + { + "label" : "M365 Portal", + "name" : "M365_Portal", + "url" : "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=${row.customerId}&CSDEST=o365admincenter", + "variable" : "${row.customerId}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Exchange Portal", + "name" : "Exchange_Portal", + "url" : "https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=${row.defaultDomainName}#", + "variable" : "${row.defaultDomainName}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Entra Portal", + "name" : "Entra_Portal", + "url" : "https://entra.microsoft.com/${row.defaultDomainName}", + "variable" : "${row.defaultDomainName}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Teams Portal", + "name" : "Teams_Portal", + "url" : "https://admin.teams.microsoft.com/?delegatedOrg=${row.defaultDomainName}", + "variable" : "${row.defaultDomainName}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Azure Portal", + "name" : "Azure_Portal", + "url" : "https://portal.azure.com/${row.defaultDomainName}", + "variable" : "${row.defaultDomainName}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Intune Portal", + "name" : "Intune_Portal", + "url" : "https://intune.microsoft.com/${row.defaultDomainName}", + "variable" : "${row.defaultDomainName}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Security Portal", + "name" : "Security_Portal", + "url" : "https://security.microsoft.com/?tid=${row.customerId}", + "variable" : "${row.customerId}", + "target" : "_blank", + "external" : true + }, + { + "label" : "Sharepoint Admin", + "name" : "Sharepoint_Admin", + "url" : "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${row.customerId}&CSDEST=SharePoint", + "variable" : "${row.customerId}", + "target" : "_blank", + "external" : true + } +] From a005d17034f26610ccd6aae15b748d25533669f6 Mon Sep 17 00:00:00 2001 From: Roel van der Wegen Date: Wed, 19 Jul 2023 22:22:18 +0200 Subject: [PATCH 2/8] Update Tenants.js --- src/views/tenant/administration/Tenants.js | 127 ++++++++++++++------- 1 file changed, 88 insertions(+), 39 deletions(-) diff --git a/src/views/tenant/administration/Tenants.js b/src/views/tenant/administration/Tenants.js index f3431c1a8eb7..45f6d7769a5e 100644 --- a/src/views/tenant/administration/Tenants.js +++ b/src/views/tenant/administration/Tenants.js @@ -15,6 +15,7 @@ import { CippActionsOffcanvas } from 'src/components/utilities' import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import Skeleton from 'react-loading-skeleton' import { TitleButton } from 'src/components/buttons' +import Portals from 'src/data/portals' const Offcanvas = (row, rowIndex, formatExtraData) => { const [getTenantDetails, tenantDetails] = useLazyGenericGetRequestQuery() @@ -86,59 +87,83 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { }, { icon: , - label: 'M365 Portal', - link: `https://portal.office.com/Partner/BeginClientSession.aspx?CTID=${row.customerId}&CSDEST=o365admincenter`, + label: Portals.find((obj) => obj.name === 'M365_Portal').label, external: true, color: 'info', + link: Portals.find((obj) => obj.name === 'M365_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Exchange Portal', - color: 'info', + label: Portals.find((obj) => obj.name === 'Exchange_Portal').label, external: true, - link: `https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=${row.defaultDomainName}#`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Exchange_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Entra Portal', - color: 'info', + label: Portals.find((obj) => obj.name === 'Entra_Portal').label, external: true, - link: `https://entra.microsoft.com/${row.defaultDomainName}`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Entra_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Teams Portal', - color: 'info', + label: Portals.find((obj) => obj.name === 'Teams_Portal').label, external: true, - link: `https://admin.teams.microsoft.com/?delegatedOrg=${row.defaultDomainName}`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Teams_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Azure Portal', - color: 'info', + label: Portals.find((obj) => obj.name === 'Azure_Portal').label, external: true, - link: `https://portal.azure.com/${row.defaultDomainName}`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Azure_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'MEM (Intune) Portal', - color: 'info', + label: Portals.find((obj) => obj.name === 'Intune_Portal').label, external: true, - link: `https://intune.microsoft.com/${row.defaultDomainName}`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Intune_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Security Portal (GDAP)', - color: 'info', + label: Portals.find((obj) => obj.name === 'Security_Portal').label, external: true, - link: `https://security.microsoft.com/?tid=${row.customerId}`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Security_Portal').url.replace( + '${row.customerId}', + row.customerId, + ), }, { icon: , - label: 'Sharepoint Admin', - color: 'info', + label: Portals.find((obj) => obj.name === 'Sharepoint_Admin').label, external: true, - link: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${row.customerId}&CSDEST=SharePoint`, + color: 'info', + link: Portals.find((obj) => obj.name === 'Sharepoint_Admin').url.replace( + '${row.customerId}', + row.customerId, + ), }, ]} placement="end" @@ -189,13 +214,16 @@ const TenantsList = () => { minWidth: '200px', }, { - name: 'M365 Portal', + name: Portals.find((obj) => obj.name === 'M365_Portal').label, omit: columnOmits, selector: (row) => row['customerId'], center: true, cell: (row) => ( obj.name === 'M365_Portal').url.replace( + '${row.customerId}', + row.customerId, + )} target="_blank" className="dlink" rel="noreferrer" @@ -205,13 +233,16 @@ const TenantsList = () => { ), }, { - name: 'Exchange Portal', + name: Portals.find((obj) => obj.name === 'Exchange_Portal').label, omit: columnOmits, selector: (row) => row['defaultDomainName'], center: true, cell: (row) => ( obj.name === 'Exchange_Portal').url.replace( + '${row.defaultDomainName}', + row.defaultDomainName, + )} target="_blank" className="dlink" rel="noreferrer" @@ -221,13 +252,16 @@ const TenantsList = () => { ), }, { - name: 'Entra Portal', + name: Portals.find((obj) => obj.name === 'Entra_Portal').label, omit: columnOmits, selector: (row) => row['defaultDomainName'], center: true, cell: (row) => ( obj.name === 'Entra_Portal').url.replace( + '${row.defaultDomainName}', + row.defaultDomainName, + )} target="_blank" className="dlink" rel="noreferrer" @@ -237,13 +271,16 @@ const TenantsList = () => { ), }, { - name: 'Teams Portal', + name: Portals.find((obj) => obj.name === 'Teams_Portal').label, omit: columnOmits, selector: (row) => row['defaultDomainName'], center: true, cell: (row) => ( obj.name === 'Teams_Portal').url.replace( + '${row.defaultDomainName}', + row.defaultDomainName, + )} target="_blank" className="dlink" rel="noreferrer" @@ -253,13 +290,16 @@ const TenantsList = () => { ), }, { - name: 'Azure Portal', + name: Portals.find((obj) => obj.name === 'Azure_Portal').label, omit: columnOmits, selector: (row) => row['defaultDomainName'], center: true, cell: (row) => ( obj.name === 'Azure_Portal').url.replace( + '${row.defaultDomainName}', + row.defaultDomainName, + )} target="_blank" className="dlink" rel="noreferrer" @@ -269,13 +309,16 @@ const TenantsList = () => { ), }, { - name: 'MEM (Intune) Portal', + name: Portals.find((obj) => obj.name === 'Intune_Portal').label, omit: columnOmits, selector: (row) => row['defaultDomainName'], center: true, cell: (row) => ( obj.name === 'Intune_Portal').url.replace( + '${row.defaultDomainName}', + row.defaultDomainName, + )} target="_blank" className="dlink" rel="noreferrer" @@ -285,13 +328,16 @@ const TenantsList = () => { ), }, { - name: 'Security Portal (GDAP)', + name: Portals.find((obj) => obj.name === 'Security_Portal').label, selector: (row) => row['defaultDomainName'], center: true, omit: columnOmits, cell: (row) => ( obj.name === 'Security_Portal').url.replace( + '${row.customerId}', + row.customerId, + )} target="_blank" className="dlink" rel="noreferrer" @@ -301,13 +347,16 @@ const TenantsList = () => { ), }, { - name: 'SharePoint Admin', + name: Portals.find((obj) => obj.name === 'Sharepoint_Admin').label, selector: (row) => row['defaultDomainName'], center: true, omit: columnOmits, cell: (row) => ( obj.name === 'Sharepoint_Admin').url.replace( + '${row.customerId}', + row.customerId, + )} target="_blank" className="dlink" rel="noreferrer" From e77009beea868465e402b2dc3a172474112996bd Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:16:39 +0200 Subject: [PATCH 3/8] updates to new portal logic --- src/data/portals.json | 128 +++++----- src/views/tenant/administration/Tenants.js | 275 ++------------------- 2 files changed, 90 insertions(+), 313 deletions(-) diff --git a/src/data/portals.json b/src/data/portals.json index 264b8a4aaab0..0e49317032f2 100644 --- a/src/data/portals.json +++ b/src/data/portals.json @@ -1,66 +1,66 @@ [ - { - "label" : "M365 Portal", - "name" : "M365_Portal", - "url" : "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=${row.customerId}&CSDEST=o365admincenter", - "variable" : "${row.customerId}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Exchange Portal", - "name" : "Exchange_Portal", - "url" : "https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=${row.defaultDomainName}#", - "variable" : "${row.defaultDomainName}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Entra Portal", - "name" : "Entra_Portal", - "url" : "https://entra.microsoft.com/${row.defaultDomainName}", - "variable" : "${row.defaultDomainName}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Teams Portal", - "name" : "Teams_Portal", - "url" : "https://admin.teams.microsoft.com/?delegatedOrg=${row.defaultDomainName}", - "variable" : "${row.defaultDomainName}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Azure Portal", - "name" : "Azure_Portal", - "url" : "https://portal.azure.com/${row.defaultDomainName}", - "variable" : "${row.defaultDomainName}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Intune Portal", - "name" : "Intune_Portal", - "url" : "https://intune.microsoft.com/${row.defaultDomainName}", - "variable" : "${row.defaultDomainName}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Security Portal", - "name" : "Security_Portal", - "url" : "https://security.microsoft.com/?tid=${row.customerId}", - "variable" : "${row.customerId}", - "target" : "_blank", - "external" : true - }, - { - "label" : "Sharepoint Admin", - "name" : "Sharepoint_Admin", - "url" : "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${row.customerId}&CSDEST=SharePoint", - "variable" : "${row.customerId}", - "target" : "_blank", - "external" : true - } + { + "label": "M365 Portal", + "name": "M365_Portal", + "url": "https://portal.office.com/Partner/BeginClientSession.aspx?CTID=customerId&CSDEST=o365admincenter", + "variable": "customerId", + "target": "_blank", + "external": true + }, + { + "label": "Exchange Portal", + "name": "Exchange_Portal", + "url": "https://admin.exchange.microsoft.com/?landingpage=homepage&form=mac_sidebar&delegatedOrg=defaultDomainName#", + "variable": "defaultDomainName", + "target": "_blank", + "external": true + }, + { + "label": "Entra Portal", + "name": "Entra_Portal", + "url": "https://entra.microsoft.com/defaultDomainName", + "variable": "defaultDomainName", + "target": "_blank", + "external": true + }, + { + "label": "Teams Portal", + "name": "Teams_Portal", + "url": "https://admin.teams.microsoft.com/?delegatedOrg=defaultDomainName", + "variable": "defaultDomainName", + "target": "_blank", + "external": true + }, + { + "label": "Azure Portal", + "name": "Azure_Portal", + "url": "https://portal.azure.com/defaultDomainName", + "variable": "defaultDomainName", + "target": "_blank", + "external": true + }, + { + "label": "Intune Portal", + "name": "Intune_Portal", + "url": "https://intune.microsoft.com/defaultDomainName", + "variable": "defaultDomainName", + "target": "_blank", + "external": true + }, + { + "label": "Security Portal", + "name": "Security_Portal", + "url": "https://security.microsoft.com/?tid=customerId", + "variable": "customerId", + "target": "_blank", + "external": true + }, + { + "label": "Sharepoint Admin", + "name": "Sharepoint_Admin", + "url": "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=customerId&CSDEST=SharePoint", + "variable": "customerId", + "target": "_blank", + "external": true + } ] diff --git a/src/views/tenant/administration/Tenants.js b/src/views/tenant/administration/Tenants.js index 45f6d7769a5e..3347f1f84471 100644 --- a/src/views/tenant/administration/Tenants.js +++ b/src/views/tenant/administration/Tenants.js @@ -36,7 +36,13 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { ) } - + const actions = Portals.map((portal) => ({ + icon: , + label: portal.label, + external: true, + color: 'info', + link: portal.url.replace(portal.variable, row[portal.variable]), + })) return ( <> loadOffCanvasDetails(row.defaultDomainName)}> @@ -85,86 +91,7 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { link: `/tenant/administration/tenants/Edit?tenantFilter=${row.defaultDomainName}&customerId=${row.customerId}`, color: 'warning', }, - { - icon: , - label: Portals.find((obj) => obj.name === 'M365_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'M365_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Exchange_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Exchange_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Entra_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Entra_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Teams_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Teams_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Azure_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Azure_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Intune_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Intune_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Security_Portal').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Security_Portal').url.replace( - '${row.customerId}', - row.customerId, - ), - }, - { - icon: , - label: Portals.find((obj) => obj.name === 'Sharepoint_Admin').label, - external: true, - color: 'info', - link: Portals.find((obj) => obj.name === 'Sharepoint_Admin').url.replace( - '${row.customerId}', - row.customerId, - ), - }, + ...actions, ]} placement="end" visible={ocVisible} @@ -175,27 +102,28 @@ const Offcanvas = (row, rowIndex, formatExtraData) => { ) } -function StatusIcon(graphErrorCount) { - if (graphErrorCount > 0) { - return - } else { - return - } -} - -function StatusText(graphErrorCount, lastGraphError) { - if (graphErrorCount > 0) { - return 'Error Count: ' + graphErrorCount + ' - Last Error: ' + lastGraphError - } else { - return 'No errors detected with this tenant' - } -} - const TenantsList = () => { const TenantListSelector = useSelector((state) => state.app.TenantListSelector) const tenant = useSelector((state) => state.app.currentTenant) const [columnOmits, setOmitVisible] = useState(TenantListSelector) + const generatePortalColumn = (portal) => ({ + name: portal.label, + omit: columnOmits, + selector: (row) => row['defaultDomainName'], + center: true, + cell: (row) => ( + + + + ), + }) + const columns = [ { name: 'Name', @@ -213,158 +141,7 @@ const TenantsList = () => { exportSelector: 'defaultDomainName', minWidth: '200px', }, - { - name: Portals.find((obj) => obj.name === 'M365_Portal').label, - omit: columnOmits, - selector: (row) => row['customerId'], - center: true, - cell: (row) => ( - obj.name === 'M365_Portal').url.replace( - '${row.customerId}', - row.customerId, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Exchange_Portal').label, - omit: columnOmits, - selector: (row) => row['defaultDomainName'], - center: true, - cell: (row) => ( - obj.name === 'Exchange_Portal').url.replace( - '${row.defaultDomainName}', - row.defaultDomainName, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Entra_Portal').label, - omit: columnOmits, - selector: (row) => row['defaultDomainName'], - center: true, - cell: (row) => ( - obj.name === 'Entra_Portal').url.replace( - '${row.defaultDomainName}', - row.defaultDomainName, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Teams_Portal').label, - omit: columnOmits, - selector: (row) => row['defaultDomainName'], - center: true, - cell: (row) => ( - obj.name === 'Teams_Portal').url.replace( - '${row.defaultDomainName}', - row.defaultDomainName, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Azure_Portal').label, - omit: columnOmits, - selector: (row) => row['defaultDomainName'], - center: true, - cell: (row) => ( - obj.name === 'Azure_Portal').url.replace( - '${row.defaultDomainName}', - row.defaultDomainName, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Intune_Portal').label, - omit: columnOmits, - selector: (row) => row['defaultDomainName'], - center: true, - cell: (row) => ( - obj.name === 'Intune_Portal').url.replace( - '${row.defaultDomainName}', - row.defaultDomainName, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Security_Portal').label, - selector: (row) => row['defaultDomainName'], - center: true, - omit: columnOmits, - cell: (row) => ( - obj.name === 'Security_Portal').url.replace( - '${row.customerId}', - row.customerId, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, - { - name: Portals.find((obj) => obj.name === 'Sharepoint_Admin').label, - selector: (row) => row['defaultDomainName'], - center: true, - omit: columnOmits, - cell: (row) => ( - obj.name === 'Sharepoint_Admin').url.replace( - '${row.customerId}', - row.customerId, - )} - target="_blank" - className="dlink" - rel="noreferrer" - > - - - ), - }, + ...Portals.map(generatePortalColumn), { exportSelector: 'customerId', }, From 6101cf3f4e18549199d7c4c7147d01abd52a1892 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 20 Jul 2023 17:10:22 +0200 Subject: [PATCH 4/8] Added API authentication option --- src/data/Extensions.json | 34 +++++++++++++++++++++++++++++++++- src/views/cipp/CIPPSettings.js | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/data/Extensions.json b/src/data/Extensions.json index 2c15dbf56878..84e18fdf6553 100644 --- a/src/data/Extensions.json +++ b/src/data/Extensions.json @@ -1,4 +1,37 @@ [ + { + "name": "CIPP-API Integration", + "type": "CIPP-API", + "cat": "API", + "forceSyncButton": false, + "helpText": "This integration allows you to use to enable API access outside of CIPP usage. Requires Global Administrator permissions inside your tenant for activation of the API. These credentials will only be shown once.", + "SettingOptions": [ + { + "type": "input", + "fieldtype": "input", + "name": "cippapi.ApplicationID", + "label": "Application ID", + "placeholder": "None." + }, + { + "type": "input", + "fieldtype": "input", + "name": "cippapi.ApplicationSecret", + "label": "Application Secret", + "placeholder": "None." + }, + { + "type": "checkbox", + "name": "cippapi.resetcreds", + "label": "Reset Credentials" + }, + { + "type": "checkbox", + "name": "cippapi.Enabled", + "label": "Enable Integration" + } + ] + }, { "name": "Gradient Integration", "type": "Gradient", @@ -32,7 +65,6 @@ } ] }, - { "name": "Halo PSA Ticketing Integration", "type": "HaloPSA", diff --git a/src/views/cipp/CIPPSettings.js b/src/views/cipp/CIPPSettings.js index f4d145b593ca..509f4304a39f 100644 --- a/src/views/cipp/CIPPSettings.js +++ b/src/views/cipp/CIPPSettings.js @@ -1353,7 +1353,7 @@ const ExtensionsTab = () => { {Extensions.map((integration) => ( - + {integration.name} From 900aae154b6040a81494c627d4692e80165ecccc Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 20 Jul 2023 20:41:00 +0200 Subject: [PATCH 5/8] add cipp-api extension --- src/data/Extensions.json | 19 ------------------- src/views/cipp/CIPPSettings.js | 2 +- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/data/Extensions.json b/src/data/Extensions.json index 84e18fdf6553..523d9d249c96 100644 --- a/src/data/Extensions.json +++ b/src/data/Extensions.json @@ -6,25 +6,6 @@ "forceSyncButton": false, "helpText": "This integration allows you to use to enable API access outside of CIPP usage. Requires Global Administrator permissions inside your tenant for activation of the API. These credentials will only be shown once.", "SettingOptions": [ - { - "type": "input", - "fieldtype": "input", - "name": "cippapi.ApplicationID", - "label": "Application ID", - "placeholder": "None." - }, - { - "type": "input", - "fieldtype": "input", - "name": "cippapi.ApplicationSecret", - "label": "Application Secret", - "placeholder": "None." - }, - { - "type": "checkbox", - "name": "cippapi.resetcreds", - "label": "Reset Credentials" - }, { "type": "checkbox", "name": "cippapi.Enabled", diff --git a/src/views/cipp/CIPPSettings.js b/src/views/cipp/CIPPSettings.js index 509f4304a39f..bb428a0fac45 100644 --- a/src/views/cipp/CIPPSettings.js +++ b/src/views/cipp/CIPPSettings.js @@ -1353,7 +1353,7 @@ const ExtensionsTab = () => { {Extensions.map((integration) => ( - + {integration.name} From dcd339a3308314c97a9d0eb05bcd0d7f1c1b3c98 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:48:11 +0200 Subject: [PATCH 6/8] fix version check --- src/components/layout/AppHeader.js | 9 ++------- src/store/api/app.js | 10 ++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/layout/AppHeader.js b/src/components/layout/AppHeader.js index e902401f52a9..bfda84ceee1b 100644 --- a/src/components/layout/AppHeader.js +++ b/src/components/layout/AppHeader.js @@ -21,18 +21,13 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCaretSquareLeft, faCaretSquareRight } from '@fortawesome/free-solid-svg-icons' import { toggleSidebarShow } from 'src/store/features/app' import { useMediaPredicate } from 'react-media-hook' -import { useGenericGetRequestQuery } from 'src/store/api/app' - +import { useLoadAlertsDashQuery } from 'src/store/api/app' const AppHeader = () => { const dispatch = useDispatch() const sidebarShow = useSelector((state) => state.app.sidebarShow) const currentTheme = useSelector((state) => state.app.currentTheme) const preferredTheme = useMediaPredicate('(prefers-color-scheme: dark)') ? 'impact' : 'cyberdrain' - const { - data: dashboard, - isLoading: isLoadingDash, - isSuccess: issuccessDash, - } = useGenericGetRequestQuery({ path: '/api/GetCippAlerts' }) + const { data: dashboard } = useLoadAlertsDashQuery() return ( <> diff --git a/src/store/api/app.js b/src/store/api/app.js index 5f366d65ee93..77cab1b67fc9 100644 --- a/src/store/api/app.js +++ b/src/store/api/app.js @@ -20,6 +20,15 @@ export const appApi = baseApi.injectEndpoints({ params: { localversion: localVersion }, }), }), + loadAlertsDash: builder.query({ + queryFn: (_args, _baseQueryApi, _options, baseQuery) => + baseQuery({ path: '/version_latest.txt' }).then(({ data }) => + baseQuery({ + path: '/api/GetCippAlerts', + params: { localversion: data.replace(/(\r\n|\n|\r)/gm, '') }, + }), + ), + }), loadDash: builder.query({ query: (localVersion) => ({ path: '/api/GetDashboard', @@ -114,6 +123,7 @@ export const { useLoadVersionRemoteQuery, useLoadVersionsQuery, useLoadDashQuery, + useLoadAlertsDashQuery, useExecPermissionsAccessCheckQuery, useLazyExecPermissionsAccessCheckQuery, useExecTenantsAccessCheckQuery, From 9bd050e17f7f024d5bd581d3d40284b0d3e12d46 Mon Sep 17 00:00:00 2001 From: DChorn-ANS <94991453+DChorn-ANS@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:03:58 -0600 Subject: [PATCH 7/8] Connector and Transport Fixes Correcting links renaming constants to template value added titlebuttons --- .../connectors/AddConnectorTemplate.js | 10 +++++----- .../connectors/ConnectorList.js | 2 +- .../connectors/DeployConnector.js | 14 ++++++------- .../connectors/ListConnectorTemplates.js | 6 ++++-- .../transport/DeployTransport.js | 20 +++++++++---------- .../transport/ListTransportTemplates.js | 4 ++-- .../transport/TransportRules.js | 6 ++++++ 7 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/views/email-exchange/connectors/AddConnectorTemplate.js b/src/views/email-exchange/connectors/AddConnectorTemplate.js index 339ff4fd87d7..d2936d2f7352 100644 --- a/src/views/email-exchange/connectors/AddConnectorTemplate.js +++ b/src/views/email-exchange/connectors/AddConnectorTemplate.js @@ -5,17 +5,17 @@ import { CippContentCard, CippPage } from 'src/components/layout' import { RFFCFormTextarea } from 'src/components/forms' import { useLazyGenericPostRequestQuery } from 'src/store/api/app' -const TransportAddTemplate = () => { +const ConnectorAddTemplate = () => { const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const handleSubmit = async (values) => { // alert(JSON.stringify(values, null, 2)) // @todo hook this up - genericPostRequest({ path: '/api/AddTransportTemplate', values }) + genericPostRequest({ path: '/api/AddEXConnectorTemplate', values }) } return ( - + {postResults.isFetching && ( @@ -32,7 +32,7 @@ const TransportAddTemplate = () => { @@ -58,4 +58,4 @@ const TransportAddTemplate = () => { ) } -export default TransportAddTemplate +export default ConnectorAddTemplate diff --git a/src/views/email-exchange/connectors/ConnectorList.js b/src/views/email-exchange/connectors/ConnectorList.js index 488f2a88e24a..2b818a2734d5 100644 --- a/src/views/email-exchange/connectors/ConnectorList.js +++ b/src/views/email-exchange/connectors/ConnectorList.js @@ -143,7 +143,7 @@ const ConnectorList = () => { title="Connector List" titleButton={ <> - + } tenantSelector={true} diff --git a/src/views/email-exchange/connectors/DeployConnector.js b/src/views/email-exchange/connectors/DeployConnector.js index 9b3d03e6c4ad..fee824106b2b 100644 --- a/src/views/email-exchange/connectors/DeployConnector.js +++ b/src/views/email-exchange/connectors/DeployConnector.js @@ -31,7 +31,7 @@ Error.propTypes = { const requiredArray = (value) => (value && value.length !== 0 ? undefined : 'Required') const DeployConnectorTemplate = () => { - const [intuneGetRequest, intuneTemplates] = useLazyGenericGetRequestQuery() + const [EXConnectorGetRequest, EXConnectorTemplates] = useLazyGenericGetRequestQuery() const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const handleSubmit = async (values) => { @@ -51,7 +51,7 @@ const DeployConnectorTemplate = () => { {({ form }) => ( {(value) => { - let template = intuneTemplates.data.filter(function (obj) { + let template = EXConnectorTemplates.data.filter(function (obj) { return obj.GUID === value }) // console.log(template[0][set]) @@ -86,7 +86,7 @@ const DeployConnectorTemplate = () => { {(props) => ( {
- {intuneTemplates.isUninitialized && - intuneGetRequest({ path: 'api/ListExConnectorTemplates' })} - {intuneTemplates.isSuccess && ( + {EXConnectorTemplates.isUninitialized && + EXConnectorGetRequest({ path: 'api/ListExConnectorTemplates' })} + {EXConnectorTemplates.isSuccess && ( ({ + values={EXConnectorTemplates.data?.map((template) => ({ value: template.GUID, label: template.name, }))} diff --git a/src/views/email-exchange/connectors/ListConnectorTemplates.js b/src/views/email-exchange/connectors/ListConnectorTemplates.js index b7c5abaca2cd..beba4bc003ef 100644 --- a/src/views/email-exchange/connectors/ListConnectorTemplates.js +++ b/src/views/email-exchange/connectors/ListConnectorTemplates.js @@ -8,6 +8,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { useLazyGenericGetRequestQuery } from 'src/store/api/app' import { CippPageList } from 'src/components/layout' import { ModalService } from 'src/components/utilities' +import { TitleButton } from 'src/components/buttons' const ConnectorListTemplates = () => { const tenant = useSelector((state) => state.app.currentTenant) @@ -15,7 +16,7 @@ const ConnectorListTemplates = () => { const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() const Offcanvas = (row, rowIndex, formatExtraData) => { const [ocVisible, setOCVisible] = useState(false) - const handleDeleteIntuneTemplate = (apiurl, message) => { + const handleDeleteEXConnectorTemplate = (apiurl, message) => { ModalService.confirm({ title: 'Confirm', body:
{message}
, @@ -34,7 +35,7 @@ const ConnectorListTemplates = () => { variant="ghost" color="danger" onClick={() => - handleDeleteIntuneTemplate( + handleDeleteEXConnectorTemplate( `/api/RemoveExConnectorTemplate?ID=${row.GUID}`, 'Do you want to delete the template?', ) @@ -98,6 +99,7 @@ const ConnectorListTemplates = () => { )} } datatable={{ reportName: `${tenant?.defaultDomainName}-Groups`, path: '/api/ListExconnectorTemplates', diff --git a/src/views/email-exchange/transport/DeployTransport.js b/src/views/email-exchange/transport/DeployTransport.js index e8498ffa0022..e53991072fa2 100644 --- a/src/views/email-exchange/transport/DeployTransport.js +++ b/src/views/email-exchange/transport/DeployTransport.js @@ -31,7 +31,7 @@ Error.propTypes = { const requiredArray = (value) => (value && value.length !== 0 ? undefined : 'Required') const AddPolicy = () => { - const [intuneGetRequest, intuneTemplates] = useLazyGenericGetRequestQuery() + const [TransportGetRequest, TransportTemplates] = useLazyGenericGetRequestQuery() const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const handleSubmit = async (values) => { @@ -41,7 +41,7 @@ const AddPolicy = () => { values.TemplateType = values.Type genericPostRequest({ path: '/api/AddTransportRule', values: values }) } - /* eslint-disable react/prop-types */ + //* eslint-disable react/prop-types */ const WhenFieldChanges = ({ field, set }) => ( {( @@ -52,7 +52,7 @@ const AddPolicy = () => { {({ form }) => ( {(value) => { - let template = intuneTemplates.data.filter(function (obj) { + let template = TransportTemplates.data.filter(function (obj) { return obj.GUID === value }) // console.log(template[0][set]) @@ -73,7 +73,7 @@ const AddPolicy = () => { { {(props) => ( {
- {intuneTemplates.isUninitialized && - intuneGetRequest({ path: 'api/ListTransportRulesTemplates' })} - {intuneTemplates.isSuccess && ( + {TransportTemplates.isUninitialized && + TransportGetRequest({ path: 'api/ListTransportRulesTemplates' })} + {TransportTemplates.isSuccess && ( ({ + values={TransportTemplates.data?.map((template) => ({ value: template.GUID, label: template.name, }))} @@ -160,7 +160,7 @@ const AddPolicy = () => { {!postResults.isSuccess && ( {(props) => { - /* eslint-disable react/prop-types */ + //* eslint-disable react/prop-types */ return ( <> diff --git a/src/views/email-exchange/transport/ListTransportTemplates.js b/src/views/email-exchange/transport/ListTransportTemplates.js index 3be990ce2db7..3a8cf38287bd 100644 --- a/src/views/email-exchange/transport/ListTransportTemplates.js +++ b/src/views/email-exchange/transport/ListTransportTemplates.js @@ -16,7 +16,7 @@ const TransportListTemplates = () => { const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() const Offcanvas = (row, rowIndex, formatExtraData) => { const [ocVisible, setOCVisible] = useState(false) - const handleDeleteIntuneTemplate = (apiurl, message) => { + const handleDeleteTransportTemplate = (apiurl, message) => { ModalService.confirm({ title: 'Confirm', body:
{message}
, @@ -35,7 +35,7 @@ const TransportListTemplates = () => { variant="ghost" color="danger" onClick={() => - handleDeleteIntuneTemplate( + handleDeleteTransportTemplate( `/api/RemoveTransportRuleTemplate?ID=${row.GUID}`, 'Do you want to delete the template?', ) diff --git a/src/views/email-exchange/transport/TransportRules.js b/src/views/email-exchange/transport/TransportRules.js index 9dab60d88d8a..ecb39e6d9af6 100644 --- a/src/views/email-exchange/transport/TransportRules.js +++ b/src/views/email-exchange/transport/TransportRules.js @@ -6,6 +6,7 @@ import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' import { CippActionsOffcanvas } from 'src/components/utilities' import { CellTip } from 'src/components/tables' +import { TitleButton } from 'src/components/buttons' const Offcanvas = (row, rowIndex, formatExtraData) => { const tenant = useSelector((state) => state.app.currentTenant) @@ -119,6 +120,11 @@ const TransportRulesList = () => { + + + } datatable={{ reportName: `${tenant?.defaultDomainName}-transport-rules-list`, path: '/api/ListTransportRules', From f565090bde9d98b0cc42d2c148eab5558e5c7c44 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar <49186168+KelvinTegelaar@users.noreply.github.com> Date: Thu, 20 Jul 2023 23:59:53 +0200 Subject: [PATCH 8/8] updates to ext --- src/data/Extensions.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/data/Extensions.json b/src/data/Extensions.json index 523d9d249c96..194c0c6c153d 100644 --- a/src/data/Extensions.json +++ b/src/data/Extensions.json @@ -6,6 +6,11 @@ "forceSyncButton": false, "helpText": "This integration allows you to use to enable API access outside of CIPP usage. Requires Global Administrator permissions inside your tenant for activation of the API. These credentials will only be shown once.", "SettingOptions": [ + { + "type": "checkbox", + "name": "cippapi.ResetPassword", + "label": "Reset application secret - this will invalidate all existing API tokens" + }, { "type": "checkbox", "name": "cippapi.Enabled",