From d7bbc2669b5f2e9ada091794bdd38db304ddaecb Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 10 Jul 2024 10:17:26 -0400 Subject: [PATCH 1/4] Allow multiple tenant to company map --- src/views/cipp/ExtensionMappings.jsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/views/cipp/ExtensionMappings.jsx b/src/views/cipp/ExtensionMappings.jsx index b0d25677ef2e..4de976555ccc 100644 --- a/src/views/cipp/ExtensionMappings.jsx +++ b/src/views/cipp/ExtensionMappings.jsx @@ -236,16 +236,10 @@ export default function ExtensionMappings({ type, fieldMappings = false, autoMap { - return !Object.values(listMappingBackendResult.data?.Mappings) - .map((value) => { - return value.value - }) - .includes(client.value.toString()) - }).map((client) => ({ + values={listMappingBackendResult.data?.Companies.map((client) => ({ name: client.name, value: client.value, - }))} + })).sort((a, b) => a.name.localeCompare(b.name))} onChange={(e) => setMappingValue(e)} placeholder={`Select a ${type} Organization`} isLoading={listMappingBackendResult.isFetching} From eff03f18bd46bf26bb3f3f1681d47468fed814a5 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 10 Jul 2024 17:09:15 -0400 Subject: [PATCH 2/4] Add Extension Sync Status page --- src/_nav.jsx | 5 ++ src/importsMap.jsx | 1 + src/routes.json | 6 ++ src/views/cipp/ExtensionSync.jsx | 97 ++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 src/views/cipp/ExtensionSync.jsx diff --git a/src/_nav.jsx b/src/_nav.jsx index 631d6eaf1169..0ab9f9db7c5b 100644 --- a/src/_nav.jsx +++ b/src/_nav.jsx @@ -821,6 +821,11 @@ const _nav = [ name: 'Extensions Settings', to: '/cipp/extensions', }, + { + component: CNavItem, + name: 'Extension Sync', + to: '/cipp/extension-sync', + }, { component: CNavItem, name: 'User Settings', diff --git a/src/importsMap.jsx b/src/importsMap.jsx index 9666488abfc9..e6a8a422c777 100644 --- a/src/importsMap.jsx +++ b/src/importsMap.jsx @@ -137,6 +137,7 @@ import React from 'react' "/license": React.lazy(() => import('./views/pages/license/License')), "/cipp/settings": React.lazy(() => import('./views/cipp/app-settings/CIPPSettings')), "/cipp/extensions": React.lazy(() => import('./views/cipp/Extensions')), + "/cipp/extension-sync": React.lazy(() => import('./views/cipp/ExtensionSync')), "/cipp/setup": React.lazy(() => import('./views/cipp/Setup')), "/tenant/administration/securescore": React.lazy(() => import('./views/tenant/administration/SecureScore')), "/tenant/administration/gdap": React.lazy(() => import('./views/tenant/administration/GDAPWizard')), diff --git a/src/routes.json b/src/routes.json index 96584165d77c..b6a54db32b03 100644 --- a/src/routes.json +++ b/src/routes.json @@ -938,6 +938,12 @@ "component": "views/cipp/Extensions", "allowedRoles": ["admin"] }, + { + "path": "/cipp/extension-sync", + "name": "Extension Sync", + "component": "views/cipp/ExtensionSync", + "allowedRoles": ["admin"] + }, { "path": "/cipp/setup", "name": "Setup", diff --git a/src/views/cipp/ExtensionSync.jsx b/src/views/cipp/ExtensionSync.jsx new file mode 100644 index 000000000000..c9937921aa86 --- /dev/null +++ b/src/views/cipp/ExtensionSync.jsx @@ -0,0 +1,97 @@ +import React, { useState } from 'react' +import { CCol, CRow } from '@coreui/react' +import { useSelector } from 'react-redux' + +import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' + +import { CippPage, CippPageList } from 'src/components/layout' +import { CellTip, cellGenericFormatter } from 'src/components/tables/CellGenericFormat' +import 'react-datepicker/dist/react-datepicker.css' +import { CellBadge, cellBadgeFormatter, cellDateFormatter } from 'src/components/tables' +import { TitleButton } from 'src/components/buttons' + +const ExtensionSync = () => { + const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() + const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) + const [refreshState, setRefreshState] = useState(false) + const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() + + const columns = [ + { + name: 'Tenant', + selector: (row) => row['Tenant'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'Tenants', + }, + { + name: 'Sync Type', + selector: (row) => row['SyncType'], + sortable: true, + cell: cellBadgeFormatter({ color: 'info' }), + exportSelector: 'SyncType', + }, + { + name: 'Task', + selector: (row) => row['Name'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'Name', + }, + { + name: 'Scheduled Time', + selector: (row) => row['ScheduledTime'], + sortable: true, + cell: cellDateFormatter({ format: 'short' }), + exportSelector: 'ScheduledTime', + }, + { + name: 'Last Run', + selector: (row) => row['ExecutedTime'], + sortable: true, + cell: cellDateFormatter({ format: 'short' }), + exportSelector: 'ExecutedTime', + }, + { + name: 'Repeats every', + selector: (row) => row['RepeatsEvery'], + sortable: true, + cell: (row) => CellTip(row['RepeatsEvery']), + exportSelector: 'RepeatsEvery', + }, + { + name: 'Results', + selector: (row) => row['Results'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'Results', + }, + ] + + return ( + + <> + + + + + + + + ) +} + +export default ExtensionSync From 7bafde8d27fcffe4abfabe16fa4145ef3d8ab775 Mon Sep 17 00:00:00 2001 From: STG-Tanner <102822322+STG-Tanner@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:50:50 -0500 Subject: [PATCH 3/4] Fix Dashboard domain names list length Domains 4 and 5 would be hidden unless more than 5 were returned --- src/views/home/Home.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/home/Home.jsx b/src/views/home/Home.jsx index 7111f9e41bb2..c3dc3de2afa6 100644 --- a/src/views/home/Home.jsx +++ b/src/views/home/Home.jsx @@ -289,7 +289,7 @@ const TenantDashboard = () => { {organization.verifiedDomains?.slice(0, 3).map((item, idx) => (
  • {item.name}
  • ))} - {organization.verifiedDomains?.length > 5 && ( + {organization.verifiedDomains?.length > 3 && ( <> {organization.verifiedDomains?.slice(3).map((item, idx) => ( From e5f177271d1046321c780cdb1aba9a40879102aa Mon Sep 17 00:00:00 2001 From: John Duprey Date: Wed, 10 Jul 2024 20:28:54 -0400 Subject: [PATCH 4/4] up version --- package.json | 2 +- public/version_latest.txt | 2 +- version_latest.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4e17521cd42b..bdf502e059b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cipp", - "version": "6.0.1", + "version": "6.0.2", "description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.", "homepage": "https://cipp.app/", "bugs": { diff --git a/public/version_latest.txt b/public/version_latest.txt index 5fe60723048a..9b9a244206f6 100644 --- a/public/version_latest.txt +++ b/public/version_latest.txt @@ -1 +1 @@ -6.0.1 +6.0.2 diff --git a/version_latest.txt b/version_latest.txt index 5fe60723048a..9b9a244206f6 100644 --- a/version_latest.txt +++ b/version_latest.txt @@ -1 +1 @@ -6.0.1 +6.0.2