diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml new file mode 100644 index 000000000000..1f5a0ee5feb6 --- /dev/null +++ b/.github/workflows/dev_deploy.yml @@ -0,0 +1,45 @@ +name: CIPP Development Frontend CI/CD + +on: + push: + branches: + - dev + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - dev + +jobs: + build_and_deploy_job: + if: github.event.repository.fork == false && github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # change this to your repository secret name + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: 'upload' + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: '/' # App source code path + api_location: '' # Api source code path - optional + output_location: '' # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event.repository.fork == false && github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} # change this to your repository secret name + action: 'close' diff --git a/.prettierignore b/.prettierignore index 849ddff3b7ec..1611c469b3e9 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,4 @@ dist/ +build/ +importsMap.jsx +Generate-Import-Map.js \ No newline at end of file diff --git a/Generate-Import-Map.js b/Generate-Import-Map.js new file mode 100644 index 000000000000..d8b23547c55b --- /dev/null +++ b/Generate-Import-Map.js @@ -0,0 +1,35 @@ +// Using ES Module syntax compatible with Node.js 18 and ensuring cross-platform compatibility +import fs from 'fs/promises' +import path from 'path' +import { fileURLToPath } from 'url' + +// Convert __dirname equivalent for ES Modules +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) + +// Adjust the relative path as necessary to point to your routes.json location +const routesPath = path.join(__dirname, './src/routes.json') // Example path + +// Load routes.json with an import assertion for JSON +const routes = await import(`file://${routesPath}`, { assert: { type: 'json' } }).then( + (module) => module.default, +) + +let importsMap = "import React from 'react'\n export const importsMap = {\n" + +routes.forEach((route) => { + if (route.component) { + // Adjust the import path to be relative to the importsMap.js file location + const importPath = route.component.replace('views', './views') + // Ensure paths are Unix-like for the dynamic import to work cross-platform + const unixImportPath = importPath.split(path.sep).join('/') + importsMap += ` "${route.path}": React.lazy(() => import('${unixImportPath}')), \n` + } +}) + +importsMap += '}\nexport default importsMap' + +// Specify the output file path for the generated imports map +const outputPath = path.join(__dirname, './src/importsMap.jsx') +await fs.writeFile(outputPath, importsMap) +console.log('Import map generated.') diff --git a/Importmap.ps1 b/Importmap.ps1 new file mode 100644 index 000000000000..357c3af5d1ce --- /dev/null +++ b/Importmap.ps1 @@ -0,0 +1,22 @@ +// generate-imports-map.js +const fs = require('fs') +const path = require('path') +const routes = require('./path/to/routes.json') + +let importsMap = 'export const importsMap = {\n' + +routes.forEach(route => { + if (route.component) { + // Convert the path to a format that's relative to where you'll be importing from + const importPath = route.component.replace('views', './views') + const componentName = path.basename(importPath) + + // Create an import statement for the component + importsMap += "${route.path}": React.lazy(() = > import('${importPath}')), \n`; + } + }) + +importsMap += '};\n' + +fs.writeFileSync(path.resolve(__dirname,'./src/importsMap.js'), importsMap) +console.log('Import map generated.') diff --git a/package-lock.json b/package-lock.json index 2aa77725f1a3..5ed51cbacbdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@rjsf/core": "^5.12.1", "@rjsf/utils": "^5.12.1", "@rjsf/validator-ajv8": "^5.12.1", + "@uiw/react-json-view": "^2.0.0-alpha.23", "axios": "^1.6.2", "buffer": "^6.0.3", "chart.js": "^3.5.1", @@ -1907,6 +1908,19 @@ "resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.3.tgz", "integrity": "sha512-D1XC7WK8K+zZEveUPY+cf4+kgauk8N4eHr/XIHXGlGYkHLud6hK9lYfZk1ry1TNh798cZUCgb6MqGEG8DkJt6Q==" }, + "node_modules/@uiw/react-json-view": { + "version": "2.0.0-alpha.23", + "resolved": "https://registry.npmjs.org/@uiw/react-json-view/-/react-json-view-2.0.0-alpha.23.tgz", + "integrity": "sha512-GT0fy/K7+xSsfhvV4PVx2qPRomr/RjzFnerCjglfTYX0oEjFe9S2UwnhqOBaSHrfaCL6ccALZ2c+qV73eqop9Q==", + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.10.0", + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", diff --git a/package.json b/package.json index 97468afd515b..c1ee11ae71fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cipp", - "version": "5.4.2", + "version": "5.5.0", "description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.", "homepage": "https://cipp.app/", "bugs": { @@ -14,6 +14,7 @@ "license": "AGPL-3.0", "author": "CIPP Contributors", "scripts": { + "prebuild": "node Generate-Import-Map.js", "build": "echo react-scripts build && vite build", "changelog": "auto-changelog --starting-version 3.0.0 --commit-limit false --hide-credit", "lint": "eslint \"src/**/*.js\"", @@ -43,6 +44,7 @@ "@rjsf/core": "^5.12.1", "@rjsf/utils": "^5.12.1", "@rjsf/validator-ajv8": "^5.12.1", + "@uiw/react-json-view": "^2.0.0-alpha.23", "axios": "^1.6.2", "buffer": "^6.0.3", "chart.js": "^3.5.1", diff --git a/public/img/augmentt-dark.png b/public/img/augmentt-dark.png new file mode 100644 index 000000000000..f32dea1cfce9 Binary files /dev/null and b/public/img/augmentt-dark.png differ diff --git a/public/img/augmentt-light.png b/public/img/augmentt-light.png new file mode 100644 index 000000000000..46bead134eb1 Binary files /dev/null and b/public/img/augmentt-light.png differ diff --git a/public/img/netfriends.png b/public/img/netfriends.png deleted file mode 100644 index e53cc963113d..000000000000 Binary files a/public/img/netfriends.png and /dev/null differ diff --git a/public/img/netfriends_dark.png b/public/img/netfriends_dark.png deleted file mode 100644 index 4beefca6aa31..000000000000 Binary files a/public/img/netfriends_dark.png and /dev/null differ diff --git a/public/version_latest.txt b/public/version_latest.txt index 8ae03c11904c..d50359de1859 100644 --- a/public/version_latest.txt +++ b/public/version_latest.txt @@ -1 +1 @@ -5.4.2 +5.5.0 diff --git a/src/App.jsx b/src/App.jsx index db95409b5c98..5e5678b80784 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,22 +2,24 @@ import React, { Suspense } from 'react' import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom' import { PrivateRoute, FullScreenLoading, ErrorBoundary } from 'src/components/utilities' import 'src/scss/style.scss' -import routes from 'src/routes' import { Helmet } from 'react-helmet-async' -import adminRoutes from './adminRoutes' import Skeleton from 'react-loading-skeleton' import TimeAgo from 'javascript-time-ago' import en from 'javascript-time-ago/locale/en.json' TimeAgo.addDefaultLocale(en) import { library } from '@fortawesome/fontawesome-svg-core' import { fas } from '@fortawesome/free-solid-svg-icons' +import routes from 'src/routes' +import { useAuthCheck } from './components/utilities/CippauthCheck' +import importsMap from './importsMap' library.add(fas) -// Containers -const DefaultLayout = React.lazy(() => import('./layout/DefaultLayout')) +const dynamicImport = (path) => { + return importsMap[path] || null +} -// Pages +const DefaultLayout = React.lazy(() => import('./layout/DefaultLayout')) const Page401 = React.lazy(() => import('./views/pages/page401/Page401')) const Page403 = React.lazy(() => import('./views/pages/page403/Page403')) const Page404 = React.lazy(() => import('./views/pages/page404/Page404')) @@ -25,6 +27,7 @@ const Page500 = React.lazy(() => import('./views/pages/page500/Page500')) const PageLogOut = React.lazy(() => import('src/views/pages/LogoutRedirect/PageLogOut')) const Login = React.lazy(() => import('./views/pages/login/Login')) const Logout = React.lazy(() => import('./views/pages/login/Logout')) +//we loop through the routes array, dynamicly create the component by using dynamicImport, add the component to the route array as 'component' key. const App = () => { return ( @@ -50,6 +53,10 @@ const App = () => { } > {routes.map((route, idx) => { + const allowedRoles = route.allowedRoles + const Routecomponent = dynamicImport(route.path) + console.log('route', route) + console.log('Routecomponent', Routecomponent) return ( route.component && ( { exact={route.exact} name={route.name} element={ - }> - - CIPP - {route.name} - - - - - - } - /> - ) - ) - })} - {adminRoutes.map((route, idx) => { - return ( - route.component && ( - + }> CIPP - {route.name} - + diff --git a/src/_nav.jsx b/src/_nav.jsx index f55c93339bd1..fbf1ff50f013 100644 --- a/src/_nav.jsx +++ b/src/_nav.jsx @@ -244,6 +244,11 @@ const _nav = [ name: 'Deploy CA Policies', to: '/tenant/conditional/deploy', }, + { + component: CNavItem, + name: 'CA Policy Tester', + to: '/tenant/conditional/test-policy', + }, { component: CNavItem, name: 'CA Vacation Mode', @@ -254,11 +259,6 @@ const _nav = [ name: 'CA Templates', to: '/tenant/conditional/list-template', }, - { - component: CNavItem, - name: 'Add CA Template', - to: '/tenant/conditional/add-template', - }, { component: CNavItem, name: 'Named Locations', diff --git a/src/adminRoutes.js b/src/adminRoutes.js deleted file mode 100644 index 2f6f666ab905..000000000000 --- a/src/adminRoutes.js +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react' - -const CIPPSettings = React.lazy(() => import('src/views/cipp/app-settings/CIPPSettings')) -const Setup = React.lazy(() => import('src/views/cipp/Setup')) -const ApplyStandard = React.lazy(() => import('src/views/tenant/standards/ListStandards')) -const GDAPStatus = React.lazy(() => import('src/views/tenant/administration/ListGDAPQueue')) -const GDAP = React.lazy(() => import('src/views/tenant/administration/GDAPWizard')) -const GDAPInvite = React.lazy(() => import('src/views/tenant/administration/GDAPInviteWizard')) -const GDAPRoleWizard = React.lazy(() => import('src/views/tenant/administration/GDAPRoleWizard')) -const GDAPRoles = React.lazy(() => import('src/views/tenant/administration/ListGDAPRoles')) -const GDAPRelationships = React.lazy(() => - import('./views/tenant/administration/ListGDAPRelationships'), -) -const appapproval = React.lazy(() => import('src/views/cipp/AppApproval')) -const TenantOffboardingWizard = React.lazy(() => - import('src/views/tenant/administration/TenantOffboardingWizard'), -) -const TenantOnboardingWizard = React.lazy(() => - import('src/views/tenant/administration/TenantOnboardingWizard'), -) - -const adminRoutes = [ - { path: '/cipp', name: 'CIPP' }, - { path: '/cipp/cipp', name: 'CIPP' }, - { path: '/cipp/settings', name: 'Settings', component: CIPPSettings }, - { path: '/cipp/setup', name: 'Setup', component: Setup }, - - { path: '/tenant/administration/gdap', name: 'GDAP Wizard', component: GDAP }, - { - path: '/tenant/administration/gdap-invite', - name: 'GDAP Invite Wizard', - component: GDAPInvite, - }, - { - path: '/tenant/administration/gdap-role-wizard', - name: 'GDAP Role Wizard', - component: GDAPRoleWizard, - }, - { - path: '/tenant/administration/gdap-roles', - name: 'GDAP Roles', - component: GDAPRoles, - }, - { - path: '/tenant/administration/gdap-relationships', - name: 'GDAP Relationships', - component: GDAPRelationships, - }, - { - path: '/tenant/administration/appapproval', - name: 'App Approval', - component: appapproval, - }, - { - path: '/tenant/administration/gdap-status', - name: 'GDAP Status', - component: GDAPStatus, - }, - { - path: '/tenant/standards/list-standards', - name: 'List Standard', - component: ApplyStandard, - }, - { - path: '/tenant/administration/tenant-offboarding-wizard', - name: 'Tenant Offboarding', - component: TenantOffboardingWizard, - }, - { - path: '/tenant/administration/tenant-onboarding-wizard', - name: 'Tenant Onboarding', - component: TenantOnboardingWizard, - }, -] - -export default adminRoutes diff --git a/src/components/buttons/PdfButton.jsx b/src/components/buttons/PdfButton.jsx index 4bfda756a7e4..38c00ce6124f 100644 --- a/src/components/buttons/PdfButton.jsx +++ b/src/components/buttons/PdfButton.jsx @@ -9,7 +9,7 @@ import { useSelector } from 'react-redux' function ExportPDFButton(props) { const base64 = useSelector((state) => state.app.reportImage) - const exportPDF = (pdfData, pdfHeaders, pdfSize = 'A4', reportName = 'report') => { + const exportPDF = (pdfData, pdfHeaders, pdfSize = 'A3', reportName = 'report') => { const unit = 'pt' const size = pdfSize // Use A1, A2, A3 or A4 const orientation = 'landscape' // portrait or landscape diff --git a/src/components/forms/RFFComponents.jsx b/src/components/forms/RFFComponents.jsx index b3d491caa5b7..0d07909c5975 100644 --- a/src/components/forms/RFFComponents.jsx +++ b/src/components/forms/RFFComponents.jsx @@ -102,9 +102,16 @@ export const RFFCFormSwitch = ({ disabled = false, initialValue, onClick, + defaultValue, }) => { return ( - + {({ meta, input }) => ( { const isDark = currentTheme === 'impact' || (currentTheme === 'default' && preferredTheme === 'impact') - const netfriends = isDark ? '/img/netfriends_dark.png' : '/img/netfriends.png' const datto = isDark ? '/img/datto.png' : '/img/datto.png' const huntress = isDark ? '/img/huntress_teal.png' : '/img/huntress_teal.png' const rewst = isDark ? '/img/rewst_dark.png' : '/img/rewst.png' const ninjaone = isDark ? '/img/ninjaone_dark.png' : '/img/ninjaone.png' + const augmentt = isDark ? '/img/augmentt-dark.png' : '/img/augmentt-light.png' return (

This application is sponsored by - + - + - + - - + + - +

diff --git a/src/components/layout/AppSidebar.jsx b/src/components/layout/AppSidebar.jsx index f680f42116d1..8a0b0c8a2432 100644 --- a/src/components/layout/AppSidebar.jsx +++ b/src/components/layout/AppSidebar.jsx @@ -12,6 +12,10 @@ import { AppSidebarNav } from 'src/components/layout' import SimpleBar from 'simplebar-react' import 'simplebar/dist/simplebar.min.css' import navigation from 'src/_nav' +import { useAuthCheck } from '../utilities/CippauthCheck' +import routes from 'src/routes' +import { useRouteNavCompare } from 'src/hooks/useRouteNavCompare' +import { useNavFavouriteCheck } from 'src/hooks/useNavFavouriteCheck' const AppSidebar = () => { const i = @@ -22,6 +26,8 @@ const AppSidebar = () => { if (!i.includes('JGySCBt1QXmNc')) { throw '' } + const newNav = useRouteNavCompare(navigation) + const navwithFavourites = useNavFavouriteCheck(newNav) return ( { @@ -41,7 +47,7 @@ const AppSidebar = () => { /> - + diff --git a/src/components/tables/CellTable.jsx b/src/components/tables/CellTable.jsx index 549e4805dfa0..8c259bc06200 100644 --- a/src/components/tables/CellTable.jsx +++ b/src/components/tables/CellTable.jsx @@ -23,17 +23,18 @@ export default function cellTable( if (!Array.isArray(columnProp) && typeof columnProp === 'object') { columnProp = Object.keys(columnProp).map((key) => { return { - [key]: columnProp[key], - } - }) - } - - if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') { - columnProp = columnProp.map((row) => { - return { - Value: row, + Key: key, + Value: columnProp[key], } }) + } else { + if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') { + columnProp = columnProp.map((row) => { + return { + Value: row, + } + }) + } } const handleTable = ({ columnProp }) => { diff --git a/src/components/tables/CippTable.jsx b/src/components/tables/CippTable.jsx index 3c246cbecb40..510aaa3ec9f0 100644 --- a/src/components/tables/CippTable.jsx +++ b/src/components/tables/CippTable.jsx @@ -739,8 +739,8 @@ export default function CippTable({ diff --git a/src/components/utilities/CippActionsOffcanvas.jsx b/src/components/utilities/CippActionsOffcanvas.jsx index 6bc9d896d71c..c2cab6d24539 100644 --- a/src/components/utilities/CippActionsOffcanvas.jsx +++ b/src/components/utilities/CippActionsOffcanvas.jsx @@ -40,7 +40,7 @@ export default function CippActionsOffcanvas(props) { (modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput, modalDropdown) => { const handlePostConfirm = () => { const selectedValue = inputRef.current.value - console.log(inputRef) + //console.log(inputRef) let additionalFields = {} if (inputRef.current.nodeName === 'SELECT') { diff --git a/src/components/utilities/CippJsonView.jsx b/src/components/utilities/CippJsonView.jsx new file mode 100644 index 000000000000..4a738c33a600 --- /dev/null +++ b/src/components/utilities/CippJsonView.jsx @@ -0,0 +1,260 @@ +import React, { useEffect, useState } from 'react' +import JsonView from '@uiw/react-json-view' +import { useSelector } from 'react-redux' +import { useMediaPredicate } from 'react-media-hook' +import translator from 'src/data/translator.json' +import { + CAccordion, + CAccordionBody, + CAccordionHeader, + CAccordionItem, + CButton, + CCard, + CCardBody, + CCardHeader, + CCardTitle, + CCol, + CFormSwitch, + CListGroup, + CListGroupItem, + CNav, + CNavItem, + CNavLink, + CRow, +} from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' + +const githubLightTheme = { + '--w-rjv-font-family': 'monospace', + '--w-rjv-color': '#6f42c1', + '--w-rjv-key-string': '#6f42c1', + '--w-rjv-background-color': '#ffffff', + '--w-rjv-line-color': '#ddd', + '--w-rjv-arrow-color': '#6e7781', + '--w-rjv-edit-color': 'var(--w-rjv-color)', + '--w-rjv-info-color': '#0000004d', + '--w-rjv-update-color': '#ebcb8b', + '--w-rjv-copied-color': '#002b36', + '--w-rjv-copied-success-color': '#28a745', + + '--w-rjv-curlybraces-color': '#6a737d', + '--w-rjv-colon-color': '#24292e', + '--w-rjv-brackets-color': '#6a737d', + '--w-rjv-quotes-color': 'var(--w-rjv-key-string)', + '--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)', + + '--w-rjv-type-string-color': '#032f62', + '--w-rjv-type-int-color': '#005cc5', + '--w-rjv-type-float-color': '#005cc5', + '--w-rjv-type-bigint-color': '#005cc5', + '--w-rjv-type-boolean-color': '#d73a49', + '--w-rjv-type-date-color': '#005cc5', + '--w-rjv-type-url-color': '#0969da', + '--w-rjv-type-null-color': '#d73a49', + '--w-rjv-type-nan-color': '#859900', + '--w-rjv-type-undefined-color': '#005cc5', +} + +export const githubDarkTheme = { + '--w-rjv-font-family': 'monospace', + '--w-rjv-color': '#79c0ff', + '--w-rjv-key-string': '#79c0ff', + '--w-rjv-background-color': '#0d1117', + '--w-rjv-line-color': '#94949480', + '--w-rjv-arrow-color': '#ccc', + '--w-rjv-edit-color': 'var(--w-rjv-color)', + '--w-rjv-info-color': '#7b7b7b', + '--w-rjv-update-color': '#ebcb8b', + '--w-rjv-copied-color': '#79c0ff', + '--w-rjv-copied-success-color': '#28a745', + + '--w-rjv-curlybraces-color': '#8b949e', + '--w-rjv-colon-color': '#c9d1d9', + '--w-rjv-brackets-color': '#8b949e', + '--w-rjv-quotes-color': 'var(--w-rjv-key-string)', + '--w-rjv-quotes-string-color': 'var(--w-rjv-type-string-color)', + + '--w-rjv-type-string-color': '#a5d6ff', + '--w-rjv-type-int-color': '#79c0ff', + '--w-rjv-type-float-color': '#79c0ff', + '--w-rjv-type-bigint-color': '#79c0ff', + '--w-rjv-type-boolean-color': '#ffab70', + '--w-rjv-type-date-color': '#79c0ff', + '--w-rjv-type-url-color': '#4facff', + '--w-rjv-type-null-color': '#ff7b72', + '--w-rjv-type-nan-color': '#859900', + '--w-rjv-type-undefined-color': '#79c0ff', +} +const matchPattern = (key, patterns) => { + return patterns.some((pattern) => { + if (pattern.includes('*')) { + // Replace * with regex that matches any character sequence and create a RegExp object + const regex = new RegExp(`^${pattern.replace(/\*/g, '.*')}$`, 'i') + return regex.test(key) + } + return pattern.toLowerCase() === key.toLowerCase() + }) +} + +const removeNullOrEmpty = (obj) => { + if (Array.isArray(obj)) { + // Filter out null or undefined items and apply recursively + const filteredArray = obj.filter((item) => item != null).map(removeNullOrEmpty) + // Additionally, remove empty arrays + return filteredArray.length > 0 ? filteredArray : null + } else if (typeof obj === 'object' && obj !== null) { + const result = Object.entries(obj).reduce((acc, [key, value]) => { + const processedValue = removeNullOrEmpty(value) + if (processedValue != null) { + // Checks for both null and undefined + acc[key] = processedValue + } + return acc + }, {}) + // Additionally, remove empty objects + return Object.keys(result).length > 0 ? result : null + } + return obj +} + +const translateAndRemoveKeys = (obj, removePatterns = []) => { + obj = removeNullOrEmpty(obj) // Clean the object first + if (Array.isArray(obj)) { + return obj.map((item) => translateAndRemoveKeys(item, removePatterns)) + } else if (typeof obj === 'object' && obj !== null) { + return Object.entries(obj).reduce((acc, [key, value]) => { + // Check if the key matches any removal pattern + if (!matchPattern(key, removePatterns)) { + const translatedKey = + translator[key.toLowerCase()] || + key.replace(/([A-Z])/g, ' $1').replace(/^./, (str) => str.toUpperCase()) + acc[translatedKey] = translateAndRemoveKeys(value, removePatterns) // Recursively process + } + return acc + }, {}) + } + return obj +} +function CippJsonView({ + object = { 'No Data Selected': 'No Data Selected' }, + removeKeys = ['*@odata*', 'created*', '*modified*', 'id', 'guid'], +}) { + const currentTheme = useSelector((state) => state.app.currentTheme) + const preferredTheme = useMediaPredicate('(prefers-color-scheme: dark)') ? 'impact' : 'cyberdrain' + const theme = + currentTheme === 'impact' || (currentTheme === preferredTheme) === 'impact' + ? githubDarkTheme + : githubLightTheme + const [translatedObject, setTranslatedObject] = useState(() => + translateAndRemoveKeys(object, removeKeys), + ) + const [switchRef, setSwitchRef] = useState(false) + // Adjusting the expanded state to track selections for up to 4 levels + const [expansionPath, setExpansionPath] = useState([{ object: translatedObject }]) + + useEffect(() => { + const sortObject = (obj) => { + const order = ['displayName', 'name', 'state'] // Define the desired order + const sortedKeys = Object.keys(obj).sort((a, b) => { + const indexA = order.indexOf(a) + const indexB = order.indexOf(b) + if (indexA === -1 && indexB === -1) { + return 0 // If both keys are not in the order array, maintain the original order + } else if (indexA === -1) { + return 1 // If only key A is not in the order array, move key B to a higher position + } else if (indexB === -1) { + return -1 // If only key B is not in the order array, move key A to a higher position + } else { + return indexA - indexB // Sort based on the index in the order array + } + }) + const sortedObject = {} + sortedKeys.forEach((key) => { + sortedObject[key] = obj[key] + }) + return sortedObject + } + + const newTranslatedObject = sortObject(translateAndRemoveKeys(sortObject(object), removeKeys)) + setTranslatedObject(newTranslatedObject) + setExpansionPath([{ object: newTranslatedObject }]) // Reset the expansion path with the new object + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [JSON.stringify(object), JSON.stringify(removeKeys)]) + + // Updated to handle deeper level expansions + const handleExpand = (level, content) => { + const newPath = expansionPath.slice(0, level) + newPath.push({ object: content }) + setExpansionPath(newPath) + } + const renderContent = (content, level = 0) => { + if (Array.isArray(content)) { + return ( +
    + {content.map((item, index) => ( +
  • {JSON.stringify(item, null, 2)}
  • + ))} +
+ ) + } else if (typeof content === 'object') { + return Object.entries(content).map(([key, value]) => ( +
+ {key}: + {typeof value === 'object' ? ( + handleExpand(level + 1, value)} variant="ghost"> + + Show More + + ) : ( + ` ${value}` + )} +
+ )) + } else if (typeof content === 'string') { + return content.replace(/(^"|"$)/g, '') // Remove quotes + } + return String(content) + } + + return ( +
+ + + + {object.displayName ? `${object.displayName} Settings` : 'Settings'} + + + setSwitchRef(!switchRef)} /> + {switchRef ? ( + + ) : ( + + {expansionPath.map((expansion, index) => ( + + {Object.entries(expansion.object).map(([key, value]) => ( + + + {key} + + + {renderContent(value, index)} + + ))} + + ))} + + )} + + + +
+ ) +} + +export default CippJsonView diff --git a/src/components/utilities/CippListOffcanvas.jsx b/src/components/utilities/CippListOffcanvas.jsx index b27c1ed3dbd4..4fbde6931ce3 100644 --- a/src/components/utilities/CippListOffcanvas.jsx +++ b/src/components/utilities/CippListOffcanvas.jsx @@ -39,7 +39,7 @@ CippListOffcanvas.propTypes = { } export function OffcanvasListSection({ title, items }) { - console.log(items) + //console.log(items) const mappedItems = items.map((item, key) => ({ value: item.content, label: item.heading })) return ( <> diff --git a/src/components/utilities/CippOffcanvas.jsx b/src/components/utilities/CippOffcanvas.jsx index d3eaece82e94..eb20726fbfbe 100644 --- a/src/components/utilities/CippOffcanvas.jsx +++ b/src/components/utilities/CippOffcanvas.jsx @@ -23,7 +23,7 @@ export default function CippOffcanvas(props) { color="link" size="lg" onClick={() => { - console.log('refresh') + //console.log('refresh') props.refreshFunction() }} > diff --git a/src/components/utilities/CippauthCheck.jsx b/src/components/utilities/CippauthCheck.jsx new file mode 100644 index 000000000000..338c22233bf7 --- /dev/null +++ b/src/components/utilities/CippauthCheck.jsx @@ -0,0 +1,27 @@ +import { useLoadClientPrincipalQuery } from 'src/store/api/auth' +import { useDispatch } from 'react-redux' +import { updateAccessToken } from 'src/store/features/auth' +import { Navigate } from 'react-router-dom' + +export const useAuthCheck = (allowedRoles) => { + const dispatch = useDispatch() + const { data: profile, isFetching } = useLoadClientPrincipalQuery() + if (isFetching) { + return { isLoading: true, component: null } + } + dispatch(updateAccessToken(profile)) + let roles = profile?.clientPrincipal?.userRoles || [] + + if (!profile?.clientPrincipal) { + return { + component: ( + + ), + result: false, + } + } + if (allowedRoles && !allowedRoles.some((role) => roles.includes(role))) { + return { component: , result: true } + } + return { component: null, result: false } +} diff --git a/src/components/utilities/TenantSelector.jsx b/src/components/utilities/TenantSelector.jsx index 3abcc5b9c46f..a7c059c39d4f 100644 --- a/src/components/utilities/TenantSelector.jsx +++ b/src/components/utilities/TenantSelector.jsx @@ -42,6 +42,11 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa const Paramcount = Array.from(searchParams).length if (Paramcount <= 1) { const customerId = searchParams.get('customerId') + const tableFilter = searchParams.get('tableFilter') + var newSearchParams = {} + if (tableFilter) { + newSearchParams.tableFilter = tableFilter + } if (customerId && isSuccess) { const currentTenant = tenants.filter((tenant) => tenant.customerId === customerId) if (currentTenant.length > 0) { @@ -49,7 +54,8 @@ const TenantSelector = ({ action, showAllTenantSelector = true, NavSelector = fa } } if (!customerId && Object.keys(currentTenant).length > 0) { - updateSearchParams({ customerId: currentTenant?.customerId }) + newSearchParams.customerId = currentTenant?.customerId + updateSearchParams(newSearchParams) } } }, [dispatch, isSuccess, searchParams, currentTenant, tenants, updateSearchParams]) diff --git a/src/data/translator.json b/src/data/translator.json new file mode 100644 index 000000000000..6144de6d1a7d --- /dev/null +++ b/src/data/translator.json @@ -0,0 +1,152 @@ +{ + "accessrights": "AccessRights", + "accountenabled": "Enabled", + "acquisitiondate": "Purchased on", + "actions": "Actions", + "activateddatetime": "Activated", + "activationstate": "Activation State", + "activesyncenabled": "ActiveSync Enabled", + "additionalemailaddresses": "Additional Email Addresses", + "affecteddevices": "Affected Devices Names", + "affecteddevicescount": "# Affected Devices", + "allocated": "Allocated (GB)", + "applicationid": "Application ID", + "assignedlicenses": "Licenses", + "assignedto": "Assigned to User", + "autoextendduration": "Auto Extend", + "avgseconds": "Avg (seconds)", + "builtincontrols": "Built-in Controls", + "callcount": "Call Count", + "cippconnectortype": "Type", + "clientapptypes": "Client App Types", + "clienttype": "Client Type", + "clientversion": "Client Version", + "command": "Command", + "comment": "Comment", + "companyname": "Company", + "created": " Created Date (Local)", + "createddatetime": "Created", + "customer/displayname": "Tenant", + "cveid": "CVE ID", + "date": "Date", + "defaultdomainname": "Default Domain", + "desc": "Description", + "deviceaccessstate": "Access State", + "devicefriendlyname": "Friendly Name", + "devicemodel": "Model", + "deviceos": "OS", + "devicetype": "Device Type", + "dkimenabled": "DKIM Enabled", + "dmarcactionpolicy": "DMARC Action Policy", + "dmarcpercentagepass": "DMARC % Pass", + "dmarcpresent": "DMARC Present", + "dnssecpresent": "DNSSec Enabled", + "domain": "Domain", + "ecpenabled": "ECP Enabled", + "enddatetime": "End", + "ewsenabled": "EWS Enabled", + "excludeapplications": "Exclude Applications", + "excluded": "Excluded", + "excludedate": "Exclude Date", + "excludegroups": "Exclude Groups", + "excludelocations": "Exclude Locations", + "excludeplatforms": "Platform Exc", + "excludeuser": "Exclude User", + "excludeusers": "Exclude Users", + "executedtime": "Last executed time", + "execution": "Execute", + "executioncount": "Executions", + "exploitabilitylevel": "Exploit Publicly Available", + "filecount": "File Count (Total)", + "firstsync": "First Sync", + "forwardto": "Forwards To", + "grantcontrolsoperator": "Control Operator", + "guid": "GUID", + "hasarchive": "Archiving Enabled", + "identity": "Identity", + "if": "If", + "imapenabled": "IMAP Enabled", + "includeapplications": "Include Applications", + "includegroups": "Include Groups", + "includelocations": "Include Locations", + "includeplatforms": "Platform Inc", + "includeunknowncountriesandregions": "Include Unknown Countries", + "includeusers": "Include Users", + "isocountrycode": "Country", + "isoperatorconnect": "Operator Connect", + "istransportrulescoped": "Only apply via transport rules", + "itemcount": "Item Count (Total)", + "lastactive": "Last Active", + "lastsuccesssync": "Last Succesfull Sync", + "lastsyncattempt": "Last Sync Attempt", + "mail": "Email", + "mailboxownerid": "Mailbox", + "mailnickname": "Mail nickname", + "mailprovider": "Mail Provider", + "mapienabled": "MAPI Enabled", + "maxseconds": "Max (seconds)", + "meetingcount": "Meeting Count", + "modifieddatetime": "Last Modified", + "mxpasstest": "MX Pass Test", + "numbertype": "Number Type", + "objectid": "Object ID", + "onpremisessyncenabled": "AD Synced", + "osplatform": "Platform", + "owaenabled": "OWA Enabled", + "parameters": "Parameters", + "placename": "Location", + "policyname": "Blocked by Policy", + "popenabled": "POP Enabled", + "postexecution": "Sending to", + "primarysmtpaddress": "Primary E-mail", + "product_display_name": "Display Name", + "quickscanoverdue": "CVSS Score", + "quotagb": "Quota (GB)", + "quotaused": "Quota Used(%)", + "rangeorlocation": "Locations or IPs", + "receivedtime": "Received on", + "recipientaddress": "Recipient", + "recipienttype": "Mailbox Type", + "recipienttypedetails": "Recipient Type Details", + "recurrence": "Recurrence", + "requestdate": "Request Date", + "requestreason": "Reason", + "requeststatus": "Status", + "requestuser": "Requester", + "scheduledtime": "Scheduled Time", + "scope": "Scope (Permissions)", + "scorepercentage": "Security Score", + "securityupdateavailable": "Update Available", + "senderaddress": "Sender", + "senderipaddresses": "Sender IP Addresses", + "service": "Service", + "smarthost": "Smarthost", + "softwarename": "Application Name", + "softwarevendor": "Vendor", + "spfpassall": "SPF Pass Test", + "startat": "Migration Started at", + "starttime": "Permissions Granted (Local)", + "state": "State", + "storageusedinbytes": "Used Space (GB)", + "subject": "Subject", + "tags": "Tags", + "taskstate": "Task State", + "teamschat": "Chat Count", + "telephonenumber": "Phone Number", + "template": "Root Template", + "tenantid": "Tenant ID", + "tenantname": "Tenant Name", + "tlsdomain": "TLS Domain", + "tlssendercertificatename": "Inbound Connector Hostname", + "tlssettings": "TLS Settings", + "totalseconds": "Total (seconds)", + "upn": "UPN", + "url": "URL", + "usedgb": "Used (GB)", + "user": "User", + "userprincipalname": "User Prinicipal Name", + "usertype": "User Type", + "visibility": "Visibility", + "vulnerabilityseveritylevel": "Severity", + "locationinfo": "Location Info" +} diff --git a/src/hooks/useNavFavouriteCheck.jsx b/src/hooks/useNavFavouriteCheck.jsx new file mode 100644 index 000000000000..2045b101ea25 --- /dev/null +++ b/src/hooks/useNavFavouriteCheck.jsx @@ -0,0 +1,32 @@ +import { CNavGroup, CNavItem, CNavTitle } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { useSelector } from 'react-redux' + +export const useNavFavouriteCheck = (navigation) => { + const favourites = useSelector((state) => state.app.userSettingsDefaults?.favourites) + + if (Array.isArray(favourites)) { + const newNavigation = [ + { component: CNavTitle, name: 'Favourites' }, + { + component: CNavGroup, + section: 'favourites', + name: 'Favourites', + to: '/favorites', + icon: , + items: favourites.map((item) => { + //console.log(item) + return { + name: item.value.name, + to: item.value.to, + component: CNavItem, + } + }), + }, + { component: CNavTitle, name: 'Dashboard' }, + ...navigation, + ] + return newNavigation + } + return navigation +} diff --git a/src/hooks/useRouteNavCompare.jsx b/src/hooks/useRouteNavCompare.jsx new file mode 100644 index 000000000000..27fc1f9a3a14 --- /dev/null +++ b/src/hooks/useRouteNavCompare.jsx @@ -0,0 +1,33 @@ +import { useLoadClientPrincipalQuery } from 'src/store/api/auth' +import { useDispatch } from 'react-redux' +import { updateAccessToken } from 'src/store/features/auth' +import routes from 'src/routes' + +export const useRouteNavCompare = (navigation) => { + const dispatch = useDispatch() + const { data: profile, isFetching } = useLoadClientPrincipalQuery() + if (isFetching) { + return { isLoading: true, component: null } + } + dispatch(updateAccessToken(profile)) + let roles = profile?.clientPrincipal?.userRoles || [] + let newNavigation = navigation.map((nav) => { + if (nav.items) { + nav.items = nav.items.filter((item) => { + const route = routes.find((r) => r.path === item.to) + if ( + !route || + (route.allowedRoles && route.allowedRoles.some((role) => roles.includes(role))) + ) { + return true + } else { + //console.log('Removing route', item) + return false + } + }) + } + return nav + }) + + return newNavigation +} diff --git a/src/importsMap.jsx b/src/importsMap.jsx new file mode 100644 index 000000000000..ab783b321471 --- /dev/null +++ b/src/importsMap.jsx @@ -0,0 +1,139 @@ +import React from 'react' + export const importsMap = { + "/home": React.lazy(() => import('./views/home/Home')), + "/cipp/logs": React.lazy(() => import('./views/cipp/Logs')), + "/cipp/scheduler": React.lazy(() => import('./views/cipp/Scheduler')), + "/cipp/statistics": React.lazy(() => import('./views/cipp/Statistics')), + "/cipp/404": React.lazy(() => import('./views/pages/page404/Page404')), + "/cipp/403": React.lazy(() => import('./views/pages/page403/Page403')), + "/cipp/500": React.lazy(() => import('./views/pages/page500/Page500')), + "/identity/administration/users/add": React.lazy(() => import('./views/identity/administration/AddUser')), + "/identity/administration/users/addbulk": React.lazy(() => import('./views/identity/administration/AddUserBulk')), + "/identity/administration/users/edit": React.lazy(() => import('./views/identity/administration/EditUser')), + "/identity/administration/users/view": React.lazy(() => import('./views/identity/administration/ViewUser')), + "/identity/administration/users/InviteGuest": React.lazy(() => import('./views/identity/administration/InviteGuest')), + "/identity/administration/ViewBec": React.lazy(() => import('./views/identity/administration/ViewBEC')), + "/identity/administration/users": React.lazy(() => import('./views/identity/administration/Users')), + "/identity/administration/devices": React.lazy(() => import('./views/identity/administration/Devices')), + "/identity/administration/groups/add": React.lazy(() => import('./views/identity/administration/AddGroup')), + "/identity/administration/group-templates": React.lazy(() => import('./views/identity/administration/GroupTemplates')), + "/identity/administration/group-add-template": React.lazy(() => import('./views/identity/administration/AddGroupTemplate')), + "/identity/administration/deploy-group-template": React.lazy(() => import('./views/identity/administration/DeployGroupTemplate')), + "/identity/administration/groups/edit": React.lazy(() => import('./views/identity/administration/EditGroup')), + "/identity/administration/groups/view": React.lazy(() => import('./views/identity/administration/ViewGroup')), + "/identity/administration/groups": React.lazy(() => import('./views/identity/administration/Groups')), + "/identity/administration/roles": React.lazy(() => import('./views/identity/administration/Roles')), + "/identity/administration/deleted-items": React.lazy(() => import('./views/identity/administration/Deleted')), + "/teams-share/teams/business-voice": React.lazy(() => import('./views/teams-share/teams/BusinessVoice')), + "/identity/administration/offboarding-wizard": React.lazy(() => import('./views/identity/administration/OffboardingWizard')), + "/endpoint/reports/devices": React.lazy(() => import('./views/endpoint/intune/Devices')), + "/identity/reports/mfa-report": React.lazy(() => import('./views/identity/reports/MFAReport')), + "/identity/reports/inactive-users-report": React.lazy(() => import('./views/identity/reports/InactiveUsers')), + "/identity/reports/Signin-report": React.lazy(() => import('./views/identity/reports/SignIns')), + "/identity/reports/azure-ad-connect-report": React.lazy(() => import('./views/identity/reports/AzureADConnectReport')), + "/tenant/administration/tenants": React.lazy(() => import('./views/tenant/administration/Tenants')), + "/tenant/administration/tenants/edit": React.lazy(() => import('./views/tenant/administration/EditTenant')), + "/tenant/administration/domains": React.lazy(() => import('./views/tenant/administration/Domains')), + "/tenant/administration/alertswizard": React.lazy(() => import('./views/tenant/administration/AlertWizard')), + "/tenant/administration/alertrules": React.lazy(() => import('./views/tenant/administration/AlertRules')), + "/tenant/administration/alertsqueue": React.lazy(() => import('./views/tenant/administration/ListAlertsQueue')), + "/tenant/administration/graph-explorer": React.lazy(() => import('./views/tenant/administration/GraphExplorer')), + "/tenant/administration/service-health": React.lazy(() => import('./views/tenant/administration/ServiceHealth')), + "/tenant/administration/enterprise-apps": React.lazy(() => import('./views/tenant/administration/ListEnterpriseApps')), + "/tenant/administration/app-consent-requests": React.lazy(() => import('./views/tenant/administration/ListAppConsentRequests')), + "/tenant/conditional/list-policies": React.lazy(() => import('./views/tenant/conditional/ConditionalAccess')), + "/tenant/conditional/deploy-vacation": React.lazy(() => import('./views/tenant/conditional/DeployVacation')), + "/tenant/conditional/test-policy": React.lazy(() => import('./views/tenant/conditional/TestCAPolicy')), + "/tenant/conditional/list-named-locations": React.lazy(() => import('./views/tenant/conditional/NamedLocations')), + "/tenant/conditional/deploy": React.lazy(() => import('./views/tenant/conditional/DeployCA')), + "/tenant/conditional/deploy-named-location": React.lazy(() => import('./views/tenant/conditional/DeployNamedLocation')), + "/tenant/conditional/list-template": React.lazy(() => import('./views/tenant/conditional/ListCATemplates')), + "/tenant/conditional/add-template": React.lazy(() => import('./views/tenant/conditional/AddCATemplate')), + "/tenant/administration/list-licenses": React.lazy(() => import('./views/tenant/administration/ListLicences')), + "/tenant/administration/application-consent": React.lazy(() => import('./views/tenant/administration/ListOauthApps')), + "/tenant/standards/list-applied-standards": React.lazy(() => import('./views/tenant/standards/ListAppliedStandards')), + "/tenant/standards/bpa-report": React.lazy(() => import('./views/tenant/standards/BestPracticeAnalyser')), + "/tenant/standards/domains-analyser": React.lazy(() => import('./views/tenant/standards/DomainsAnalyser')), + "/tenant/standards/individual-domains": React.lazy(() => import('./views/tenant/standards/IndividualDomain')), + "/tenant/administration/tenantlookup": React.lazy(() => import('./views/tenant/administration/TenantLookup')), + "/tenant/tools/geoiplookup": React.lazy(() => import('./views/tenant/administration/GeoIPLookup')), + "/tenant/tools/bpa-report-builder": React.lazy(() => import('./views/tenant/standards/BPAReportBuilder')), + "/tenant/standards/alert-list": React.lazy(() => import('./views/security/incidents/ListAlerts')), + "/endpoint/applications/list": React.lazy(() => import('./views/endpoint/applications/ApplicationsList')), + "/endpoint/applications/queue": React.lazy(() => import('./views/endpoint/applications/ListApplicationQueue')), + "/endpoint/applications/add-choco-app": React.lazy(() => import('./views/endpoint/applications/ApplicationsAddChocoApp')), + "/endpoint/applications/add-winget-app": React.lazy(() => import('./views/endpoint/applications/ApplicationsAddWinGet')), + "/endpoint/applications/add-office-app": React.lazy(() => import('./views/endpoint/applications/ApplicationsAddOffice')), + "/endpoint/applications/add-rmm-app": React.lazy(() => import('./views/endpoint/applications/ApplicationsAddRMM')), + "/endpoint/autopilot/add-device": React.lazy(() => import('./views/endpoint/autopilot/AutopilotAddDevice')), + "/endpoint/autopilot/add-profile": React.lazy(() => import('./views/endpoint/autopilot/AutopilotAddProfile')), + "/endpoint/autopilot/add-status-page": React.lazy(() => import('./views/endpoint/autopilot/AutopilotAddStatusPage')), + "/endpoint/autopilot/list-devices": React.lazy(() => import('./views/endpoint/autopilot/AutopilotListDevices')), + "/endpoint/autopilot/list-profiles": React.lazy(() => import('./views/endpoint/autopilot/AutopilotListProfiles')), + "/endpoint/autopilot/list-status-pages": React.lazy(() => import('./views/endpoint/autopilot/AutopilotListStatusPages')), + "/endpoint/MEM/list-policies": React.lazy(() => import('./views/endpoint/intune/MEMListPolicies')), + "/endpoint/MEM/list-compliance-policies": React.lazy(() => import('./views/endpoint/intune/MEMListCompliance')), + "/endpoint/MEM/list-appprotection-policies": React.lazy(() => import('./views/endpoint/intune/MEMListAppProtection')), + "/endpoint/MEM/edit-policy": React.lazy(() => import('./views/endpoint/intune/MEMEditPolicy')), + "/endpoint/MEM/ca-policies": React.lazy(() => import('./views/endpoint/intune/MEMCAPolicies')), + "/endpoint/MEM/add-policy": React.lazy(() => import('./views/endpoint/intune/MEMAddPolicy')), + "/endpoint/MEM/add-policy-template": React.lazy(() => import('./views/endpoint/intune/MEMAddPolicyTemplate')), + "/endpoint/MEM/list-templates": React.lazy(() => import('./views/endpoint/intune/MEMListPolicyTemplates')), + "/security/defender/deployment": React.lazy(() => import('./views/security/defender/DeployDefender')), + "/security/defender/list-defender": React.lazy(() => import('./views/security/defender/ListDefender')), + "/security/defender/list-defender-tvm": React.lazy(() => import('./views/security/defender/ListVuln')), + "/teams-share/onedrive/list": React.lazy(() => import('./views/teams-share/onedrive/OneDriveList')), + "/teams-share/sharepoint/list-sharepoint": React.lazy(() => import('./views/teams-share/sharepoint/SharepointList')), + "/teams-share/teams/list-team": React.lazy(() => import('./views/teams-share/teams/TeamsListTeam')), + "/teams-share/teams/view-team-settings": React.lazy(() => import('./views/teams-share/teams/ViewTeamSettings')), + "/teams-share/teams/add-team": React.lazy(() => import('./views/teams-share/teams/TeamsAddTeam')), + "/teams-share/teams/teams-activity": React.lazy(() => import('./views/teams-share/teams/TeamsActivity')), + "/email/administration/contacts": React.lazy(() => import('./views/email-exchange/administration/ContactsList')), + "/email/connectors/list-connectors": React.lazy(() => import('./views/email-exchange/connectors/ConnectorList')), + "/email/connectors/deploy-connector": React.lazy(() => import('./views/email-exchange/connectors/DeployConnector')), + "/email/connectors/add-connector-templates": React.lazy(() => import('./views/email-exchange/connectors/AddConnectorTemplate')), + "/email/connectors/list-connector-templates": React.lazy(() => import('./views/email-exchange/connectors/ListConnectorTemplates')), + "/email/transport/list-rules": React.lazy(() => import('./views/email-exchange/transport/TransportRules')), + "/email/transport/deploy-rules": React.lazy(() => import('./views/email-exchange/transport/DeployTransport')), + "/email/transport/list-templates": React.lazy(() => import('./views/email-exchange/transport/ListTransportTemplates')), + "/email/transport/add-template": React.lazy(() => import('./views/email-exchange/transport/AddTransportTemplate')), + "/email/spamfilter/list-spamfilter": React.lazy(() => import('./views/email-exchange/spamfilter/Spamfilter')), + "/email/spamfilter/deploy": React.lazy(() => import('./views/email-exchange/spamfilter/DeploySpamfilter')), + "/email/spamfilter/list-templates": React.lazy(() => import('./views/email-exchange/spamfilter/ListSpamfilterTemplates')), + "/email/tools/mailbox-restore-wizard": React.lazy(() => import('./views/email-exchange/tools/MailboxRestoreWizard')), + "/email/tools/mailbox-restores": React.lazy(() => import('./views/email-exchange/tools/MailboxRestores')), + "/email/tools/mail-test": React.lazy(() => import('./views/email-exchange/tools/MailTest')), + "/email/spamfilter/add-template": React.lazy(() => import('./views/email-exchange/spamfilter/AddSpamfilterTemplate')), + "/email/administration/edit-mailbox-permissions": React.lazy(() => import('./views/email-exchange/administration/EditMailboxPermissions')), + "/email/administration/add-shared-mailbox": React.lazy(() => import('./views/email-exchange/administration/AddSharedMailbox')), + "/email/administration/add-contact": React.lazy(() => import('./views/email-exchange/administration/AddContact')), + "/email/administration/edit-calendar-permissions": React.lazy(() => import('./views/email-exchange/administration/EditCalendarPermissions')), + "/email/administration/view-mobile-devices": React.lazy(() => import('./views/email-exchange/administration/ViewMobileDevices')), + "/email/administration/edit-contact": React.lazy(() => import('./views/email-exchange/administration/EditContact')), + "/email/administration/mailboxes": React.lazy(() => import('./views/email-exchange/administration/MailboxesList')), + "/email/administration/mailbox-rules": React.lazy(() => import('./views/email-exchange/administration/MailboxRuleList')), + "/email/administration/Quarantine": React.lazy(() => import('./views/email-exchange/administration/QuarantineList')), + "/email/reports/mailbox-statistics": React.lazy(() => import('./views/email-exchange/reports/MailboxStatisticsList')), + "/email/reports/SharedMailboxEnabledAccount": React.lazy(() => import('./views/email-exchange/reports/SharedMailboxEnabledAccount')), + "/email/reports/mailbox-cas-settings": React.lazy(() => import('./views/email-exchange/reports/MailboxClientAccessSettingsList')), + "/email/reports/message-trace": React.lazy(() => import('./views/email-exchange/reports/MessageTrace')), + "/cipp/user-settings": React.lazy(() => import('./views/cipp/UserSettings')), + "/email/reports/phishing-policies": React.lazy(() => import('./views/email-exchange/reports/PhishingPoliciesList')), + "/security/incidents/list-alerts": React.lazy(() => import('./views/security/incidents/ListAlerts')), + "/security/incidents/list-incidents": React.lazy(() => import('./views/security/incidents/ListIncidents')), + "/security/reports/list-device-compliance": React.lazy(() => import('./views/security/reports/ListDeviceComplianceReport')), + "/license": React.lazy(() => import('./views/pages/license/License')), + "/cipp/settings": React.lazy(() => import('./views/cipp/app-settings/CIPPSettings')), + "/cipp/setup": React.lazy(() => import('./views/cipp/Setup')), + "/tenant/administration/gdap": React.lazy(() => import('./views/tenant/administration/GDAPWizard')), + "/tenant/administration/gdap-invite": React.lazy(() => import('./views/tenant/administration/GDAPInviteWizard')), + "/tenant/administration/gdap-role-wizard": React.lazy(() => import('./views/tenant/administration/GDAPRoleWizard')), + "/tenant/administration/gdap-roles": React.lazy(() => import('./views/tenant/administration/ListGDAPRoles')), + "/tenant/administration/gdap-relationships": React.lazy(() => import('././views/tenant/administration/ListGDAPRelationships')), + "/tenant/administration/appapproval": React.lazy(() => import('./views/cipp/AppApproval')), + "/tenant/administration/gdap-status": React.lazy(() => import('./views/tenant/administration/ListGDAPQueue')), + "/tenant/standards/list-standards": React.lazy(() => import('./views/tenant/standards/ListStandards')), + "/tenant/administration/tenant-offboarding-wizard": React.lazy(() => import('./views/tenant/administration/TenantOffboardingWizard')), + "/tenant/administration/tenant-onboarding-wizard": React.lazy(() => import('./views/tenant/administration/TenantOnboardingWizard')), +} +export default importsMap \ No newline at end of file diff --git a/src/routes.js b/src/routes.js deleted file mode 100644 index 794ebb4b4c4d..000000000000 --- a/src/routes.js +++ /dev/null @@ -1,714 +0,0 @@ -import React from 'react' -import MailTest from 'src/views/email-exchange/tools/MailTest' - -const Home = React.lazy(() => import('src/views/home/Home')) -const Logs = React.lazy(() => import('src/views/cipp/Logs')) -const Scheduler = React.lazy(() => import('src/views/cipp/Scheduler')) -const Statistics = React.lazy(() => import('src/views/cipp/Statistics')) -const Users = React.lazy(() => import('src/views/identity/administration/Users')) -const DeletedItems = React.lazy(() => import('src/views/identity/administration/Deleted')) -const ViewBEC = React.lazy(() => import('src/views/identity/administration/ViewBEC')) -const AddUser = React.lazy(() => import('src/views/identity/administration/AddUser')) -const AddUserBulk = React.lazy(() => import('src/views/identity/administration/AddUserBulk')) - -const InviteGuest = React.lazy(() => import('src/views/identity/administration/InviteGuest')) -const EditUser = React.lazy(() => import('src/views/identity/administration/EditUser')) -const ViewUser = React.lazy(() => import('src/views/identity/administration/ViewUser')) -const Groups = React.lazy(() => import('src/views/identity/administration/Groups')) -const AddGroup = React.lazy(() => import('src/views/identity/administration/AddGroup')) -const UserSettings = React.lazy(() => import('src/views/cipp/UserSettings')) - -const AddGroupTemplates = React.lazy(() => - import('src/views/identity/administration/AddGroupTemplate'), -) -const DeployGroupTemplates = React.lazy(() => - import('src/views/identity/administration/DeployGroupTemplate'), -) -const GeoIPLookup = React.lazy(() => import('src/views/tenant/administration/GeoIPLookup')) - -const TenantLookup = React.lazy(() => import('src/views/tenant/administration/TenantLookup')) - -const GroupTemplates = React.lazy(() => import('src/views/identity/administration/GroupTemplates')) - -const EditGroup = React.lazy(() => import('src/views/identity/administration/EditGroup')) -const ViewGroup = React.lazy(() => import('src/views/identity/administration/ViewGroup')) -const Roles = React.lazy(() => import('src/views/identity/administration/Roles')) -const Devices = React.lazy(() => import('src/views/endpoint/intune/Devices')) -const allDevices = React.lazy(() => import('src/views/identity/administration/Devices')) - -const PageLogOut = React.lazy(() => import('src/views/pages/LogoutRedirect/PageLogOut')) - -const Page404 = React.lazy(() => import('src/views/pages/page404/Page404')) -const Page403 = React.lazy(() => import('src/views/pages/page403/Page403')) -const Page500 = React.lazy(() => import('src/views/pages/page500/Page500')) - -const MFAReport = React.lazy(() => import('src/views/identity/reports/MFAReport')) -const Tenants = React.lazy(() => import('src/views/tenant/administration/Tenants')) -const AlertWizard = React.lazy(() => import('src/views/tenant/administration/AlertWizard')) -const AlertRules = React.lazy(() => import('src/views/tenant/administration/AlertRules')) - -const AlertsQueue = React.lazy(() => import('src/views/tenant/administration/ListAlertsQueue')) -const GraphExplorer = React.lazy(() => import('src/views/tenant/administration/GraphExplorer')) - -const Domains = React.lazy(() => import('src/views/tenant/administration/Domains')) -const EditTenant = React.lazy(() => import('src/views/tenant/administration/EditTenant')) -const ConditionalAccess = React.lazy(() => import('src/views/tenant/conditional/ConditionalAccess')) -const DeployVacationCA = React.lazy(() => import('src/views/tenant/conditional/DeployVacation')) -const NamedLocations = React.lazy(() => import('src/views/tenant/conditional/NamedLocations')) - -const ListConditionalTemplates = React.lazy(() => - import('src/views/tenant/conditional/ListCATemplates'), -) - -const DeployNamedLocation = React.lazy(() => - import('src/views/tenant/conditional/DeployNamedLocation'), -) -const AddConditionalTemplate = React.lazy(() => - import('src/views/tenant/conditional/AddCATemplate'), -) - -const DeployConditional = React.lazy(() => import('src/views/tenant/conditional/DeployCA')) - -const ListLicences = React.lazy(() => import('src/views/tenant/administration/ListLicences')) -const ListAppConsent = React.lazy(() => import('src/views/tenant/administration/ListOauthApps')) - -const InActiveUserReport = React.lazy(() => import('src/views/identity/reports/InactiveUsers')) -const SignInReport = React.lazy(() => import('src/views/identity/reports/SignIns')) - -const AzureADConnectReport = React.lazy(() => - import('src/views/identity/reports/AzureADConnectReport'), -) -const DeviceComplianceReport = React.lazy(() => - import('src/views/security/reports/ListDeviceComplianceReport'), -) -const BestPracticeAnalyzer = React.lazy(() => - import('src/views/tenant/standards/BestPracticeAnalyser'), -) -const BPAReportBuilder = React.lazy(() => import('src/views/tenant/standards/BPAReportBuilder')) -const DomainsAnalyser = React.lazy(() => import('src/views/tenant/standards/DomainsAnalyser')) -const OffboardingWizard = React.lazy(() => - import('src/views/identity/administration/OffboardingWizard'), -) -const ListAppliedStandards = React.lazy(() => - import('src/views/tenant/standards/ListAppliedStandards'), -) -const IndividualDomain = React.lazy(() => import('src/views/tenant/standards/IndividualDomain')) -const ListAlerts = React.lazy(() => import('src/views/security/incidents/ListAlerts')) -const ApplicationsList = React.lazy(() => - import('src/views/endpoint/applications/ApplicationsList'), -) -const ApplicationsQueue = React.lazy(() => - import('src/views/endpoint/applications/ListApplicationQueue'), -) -const ApplicationsAddChocoApp = React.lazy(() => - import('src/views/endpoint/applications/ApplicationsAddChocoApp'), -) -const ApplicationsAddWingetApp = React.lazy(() => - import('src/views/endpoint/applications/ApplicationsAddWinGet'), -) -const ApplicationsAddOfficeApp = React.lazy(() => - import('src/views/endpoint/applications/ApplicationsAddOffice'), -) -const ApplicationsAddRMMApp = React.lazy(() => - import('src/views/endpoint/applications/ApplicationsAddRMM'), -) -const AutopilotAddDevice = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotAddDevice'), -) -const AutopilotAddProfile = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotAddProfile'), -) -const AutopilotAddStatusPage = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotAddStatusPage'), -) -const AutopilotListDevices = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotListDevices'), -) -const AutopilotListProfiles = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotListProfiles'), -) -const AutopilotListStatusPages = React.lazy(() => - import('src/views/endpoint/autopilot/AutopilotListStatusPages'), -) -const IntuneListPolicies = React.lazy(() => import('src/views/endpoint/intune/MEMListPolicies')) -const IntuneListCompliance = React.lazy(() => import('src/views/endpoint/intune/MEMListCompliance')) - -const IntuneListAppProtection = React.lazy(() => - import('src/views/endpoint/intune/MEMListAppProtection'), -) - -const MEMEditPolicy = React.lazy(() => import('src/views/endpoint/intune/MEMEditPolicy')) - -const IntuneCAPolicies = React.lazy(() => import('src/views/endpoint/intune/MEMCAPolicies')) -const IntuneAddPolicy = React.lazy(() => import('src/views/endpoint/intune/MEMAddPolicy')) -const MEMAddPolicyTemplate = React.lazy(() => - import('src/views/endpoint/intune/MEMAddPolicyTemplate'), -) -const IntuneListPolicyTemplate = React.lazy(() => - import('src/views/endpoint/intune/MEMListPolicyTemplates'), -) -const ListDefender = React.lazy(() => import('src/views/security/defender/ListDefender')) -const ListVulnerabilities = React.lazy(() => import('src/views/security/defender/ListVuln')) - -const DeployDefender = React.lazy(() => import('src/views/security/defender/DeployDefender')) - -const OneDriveList = React.lazy(() => import('src/views/teams-share/onedrive/OneDriveList')) -const SharepointList = React.lazy(() => import('src/views/teams-share/sharepoint/SharepointList')) -const BusinessVoice = React.lazy(() => import('src/views/teams-share/teams/BusinessVoice')) -const TeamsListTeam = React.lazy(() => import('src/views/teams-share/teams/TeamsListTeam')) -const TeamsAddTeam = React.lazy(() => import('src/views/teams-share/teams/TeamsAddTeam')) -const ViewTeamsSettings = React.lazy(() => import('src/views/teams-share/teams/ViewTeamSettings')) -const TeamsActivity = React.lazy(() => import('src/views/teams-share/teams/TeamsActivity')) -const ContactsList = React.lazy(() => - import('src/views/email-exchange/administration/ContactsList'), -) -const EditContact = React.lazy(() => import('src/views/email-exchange/administration/EditContact')) -const EditMailboxPermissions = React.lazy(() => - import('src/views/email-exchange/administration/EditMailboxPermissions'), -) -const AddSharedMailbox = React.lazy(() => - import('src/views/email-exchange/administration/AddSharedMailbox'), -) -const AddContact = React.lazy(() => import('src/views/email-exchange/administration/AddContact')) -const EditCalendarPermissions = React.lazy(() => - import('src/views/email-exchange/administration/EditCalendarPermissions'), -) -const ViewMobileDevices = React.lazy(() => - import('src/views/email-exchange/administration/ViewMobileDevices'), -) -const MailboxesList = React.lazy(() => - import('src/views/email-exchange/administration/MailboxesList'), -) -const MailboxRulesList = React.lazy(() => - import('src/views/email-exchange/administration/MailboxRuleList'), -) -const QuarantineList = React.lazy(() => - import('src/views/email-exchange/administration/QuarantineList'), -) -const MailboxClientAccessSettingsList = React.lazy(() => - import('src/views/email-exchange/reports/MailboxClientAccessSettingsList'), -) -const MailboxStatisticsList = React.lazy(() => - import('src/views/email-exchange/reports/MailboxStatisticsList'), -) -const SharedMailboxEnabledAccount = React.lazy(() => - import('src/views/email-exchange/reports/SharedMailboxEnabledAccount'), -) -const MessageTrace = React.lazy(() => import('src/views/email-exchange/reports/MessageTrace')) -const PhishingPoliciesList = React.lazy(() => - import('src/views/email-exchange/reports/PhishingPoliciesList'), -) -const TransportRulesList = React.lazy(() => - import('src/views/email-exchange/transport/TransportRules'), -) -const TransportTemplate = React.lazy(() => - import('src/views/email-exchange/transport/ListTransportTemplates'), -) -const AddTransportTemplate = React.lazy(() => - import('src/views/email-exchange/transport/AddTransportTemplate'), -) -const TransportDeploy = React.lazy(() => - import('src/views/email-exchange/transport/DeployTransport'), -) -const SpamfilterList = React.lazy(() => import('src/views/email-exchange/spamfilter/Spamfilter')) -const SpamFilterTemplate = React.lazy(() => - import('src/views/email-exchange/spamfilter/ListSpamfilterTemplates'), -) -const AddSpamFilterTemplate = React.lazy(() => - import('src/views/email-exchange/spamfilter/AddSpamfilterTemplate'), -) -const SpamFilterDeploy = React.lazy(() => - import('src/views/email-exchange/spamfilter/DeploySpamfilter'), -) -const ConnectorList = React.lazy(() => import('src/views/email-exchange/connectors/ConnectorList')) -const ConnectorListTemplates = React.lazy(() => - import('src/views/email-exchange/connectors/ListConnectorTemplates'), -) -const DeployConnector = React.lazy(() => - import('src/views/email-exchange/connectors/DeployConnector'), -) -const AddConnectorTemplate = React.lazy(() => - import('src/views/email-exchange/connectors/AddConnectorTemplate'), -) - -const SecurityComplianceAlerts = React.lazy(() => import('src/views/security/incidents/ListAlerts')) -const SecurityComplianceIncidents = React.lazy(() => - import('src/views/security/incidents/ListIncidents'), -) -const License = React.lazy(() => import('src/views/pages/license/License')) -const ServiceHealth = React.lazy(() => import('src/views/tenant/administration/ServiceHealth')) - -const EnterpriseApplications = React.lazy(() => - import('src/views/tenant/administration/ListEnterpriseApps'), -) -const AppConsentRequests = React.lazy(() => - import('src/views/tenant/administration/ListAppConsentRequests'), -) -const MailboxRestoreWizard = React.lazy(() => - import('src/views/email-exchange/tools/MailboxRestoreWizard'), -) -const MailboxRestores = React.lazy(() => import('src/views/email-exchange/tools/MailboxRestores')) -const Mailtest = React.lazy(() => import('src/views/email-exchange/tools/MailTest')) - -const routes = [ - // { path: '/', exact: true, name: 'Home' }, - { path: '/home', name: 'Home', component: Home }, - { path: '/cipp/logs', name: 'Logs', component: Logs }, - { path: '/cipp/scheduler', name: 'Scheduler', component: Scheduler }, - { path: '/cipp/statistics', name: 'Statistics', component: Statistics }, - { path: '/cipp/404', name: 'Error', component: Page404 }, - { path: '/cipp/403', name: 'Error', component: Page403 }, - { path: '/cipp/500', name: 'Error', component: Page500 }, - { path: '/identity', name: 'Identity' }, - { path: '/identity/administration/users/add', name: 'Add User', component: AddUser }, - { - path: '/identity/administration/users/addbulk', - name: 'Add User Bulk', - component: AddUserBulk, - }, - - { path: '/identity/administration/users/edit', name: 'Edit User', component: EditUser }, - { path: '/identity/administration/users/view', name: 'View User', component: ViewUser }, - { - path: '/identity/administration/users/InviteGuest', - name: 'Invite Guest', - component: InviteGuest, - }, - { path: '/identity/administration/ViewBec', name: 'View BEC', component: ViewBEC }, - { path: '/identity/administration', name: 'Administration' }, - { path: '/identity/administration/users', name: 'Users', component: Users }, - { path: '/identity/administration/devices', name: 'Devices', component: allDevices }, - - { path: '/identity/administration/groups/add', name: 'Add Group', component: AddGroup }, - { - path: '/identity/administration/group-templates', - name: 'Group Templates', - component: GroupTemplates, - }, - { - path: '/identity/administration/group-add-template', - name: 'Add Group Template', - component: AddGroupTemplates, - }, - { - path: '/identity/administration/deploy-group-template', - name: 'Deploy Group Template', - component: DeployGroupTemplates, - }, - { path: '/identity/administration/groups/edit', name: 'Edit Group', component: EditGroup }, - { path: '/identity/administration/groups/view', name: 'View Group', component: ViewGroup }, - { path: '/identity/administration/groups', name: 'Groups', component: Groups }, - { path: '/identity/administration/roles', name: 'Roles', component: Roles }, - { - path: '/identity/administration/deleted-items', - name: 'Deleted Items', - component: DeletedItems, - }, - - { path: '/teams-share/teams/business-voice', name: 'BusinessVoice', component: BusinessVoice }, - { - path: '/identity/administration/offboarding-wizard', - name: 'Offboarding Wizard', - component: OffboardingWizard, - }, - { path: '/identity/reports', name: 'Reports' }, - { path: '/endpoint/reports/devices', name: 'Devices', component: Devices }, - { path: '/identity/reports/mfa-report', name: 'MFA Report', component: MFAReport }, - { - path: '/identity/reports/inactive-users-report', - name: 'Inactive Users Report', - component: InActiveUserReport, - }, - { - path: '/identity/reports/Signin-report', - name: 'Sign-In Report', - component: SignInReport, - }, - { - path: '/identity/reports/azure-ad-connect-report', - name: 'AAD Connect Report', - component: AzureADConnectReport, - }, - { path: '/tenant', name: 'Tenant' }, - { path: '/tenant/administration', name: 'Administration' }, - { path: '/tenant/administration/tenants', name: 'Tenants', component: Tenants }, - { path: '/tenant/administration/tenants/edit', name: 'Edit Tenant', component: EditTenant }, - { path: '/tenant/administration/domains', name: 'Domains', component: Domains }, - { path: '/tenant/administration/alertswizard', name: 'Alerts Wizard', component: AlertWizard }, - { path: '/tenant/administration/alertrules', name: 'Alerts Wizard', component: AlertRules }, - - { path: '/tenant/administration/alertsqueue', name: 'Alerts Queue', component: AlertsQueue }, - { - path: '/tenant/administration/graph-explorer', - name: 'Graph Explorer', - component: GraphExplorer, - }, - { - path: '/tenant/administration/service-health', - name: 'Service Health', - component: ServiceHealth, - }, - { - path: '/tenant/administration/enterprise-apps', - name: 'Enterprise Applications', - component: EnterpriseApplications, - }, - { - path: '/tenant/administration/app-consent-requests', - name: 'App Consent Requests', - component: AppConsentRequests, - }, - { - path: '/tenant/conditional/list-policies', - name: 'Conditional Access', - component: ConditionalAccess, - }, - { - path: '/tenant/conditional/deploy-vacation', - name: 'Deploy Vacation Mode', - component: DeployVacationCA, - }, - { - path: '/tenant/conditional/list-named-locations', - name: 'Named Locations', - component: NamedLocations, - }, - { - path: '/tenant/conditional/deploy', - name: 'Deploy Conditional Access', - component: DeployConditional, - }, - { - path: '/tenant/conditional/deploy-named-location', - name: 'Deploy Named Locations', - component: DeployNamedLocation, - }, - { - path: '/tenant/conditional/list-template', - name: 'Conditional Access Templates', - component: ListConditionalTemplates, - }, - { - path: '/tenant/conditional/add-template', - name: 'Conditional Access Add Template', - component: AddConditionalTemplate, - }, - { - path: '/tenant/administration/list-licenses', - name: 'List Licenses', - component: ListLicences, - }, - { - path: '/tenant/administration/application-consent', - name: 'Consented Applications', - component: ListAppConsent, - }, - { path: '/tenant/standards', name: 'Standards' }, - { - path: '/tenant/standards/list-applied-standards', - name: 'List Applied Standards', - component: ListAppliedStandards, - }, - { - path: '/tenant/standards/bpa-report', - name: 'Best Practice Report', - component: BestPracticeAnalyzer, - }, - { - path: '/tenant/standards/domains-analyser', - name: 'Domains Analyser', - component: DomainsAnalyser, - }, - { - path: '/tenant/standards/individual-domains', - name: 'Individual Domain Check', - component: IndividualDomain, - }, - { - path: '/tenant/administration/tenantlookup', - name: 'Tenant Lookup', - component: TenantLookup, - }, - { - path: '/tenant/tools/geoiplookup', - name: 'Geo IP Lookup', - component: GeoIPLookup, - }, - { - path: '/tenant/tools/bpa-report-builder', - name: 'BPA Report Builder', - component: BPAReportBuilder, - }, - { path: '/tenant/standards/alert-list', name: 'Alert List (Alpha)', component: ListAlerts }, - { path: '/endpoint', name: 'Endpoint' }, - { path: '/endpoint/applications', name: 'Applications' }, - { path: '/endpoint/applications/list', name: 'List Applications', component: ApplicationsList }, - { path: '/endpoint/applications/queue', name: 'Application Queue', component: ApplicationsQueue }, - - { - path: '/endpoint/applications/add-choco-app', - name: 'Add Choco App', - component: ApplicationsAddChocoApp, - }, - { - path: '/endpoint/applications/add-winget-app', - name: 'Add Store App', - component: ApplicationsAddWingetApp, - }, - { - path: '/endpoint/applications/add-office-app', - name: 'Add Office App', - component: ApplicationsAddOfficeApp, - }, - { - path: '/endpoint/applications/add-rmm-app', - name: 'Add RMM App', - component: ApplicationsAddRMMApp, - }, - { path: '/endpoint/autopilot', name: 'Autopilot' }, - { path: '/endpoint/autopilot/add-device', name: 'Add Device', component: AutopilotAddDevice }, - { path: '/endpoint/autopilot/add-profile', name: 'Add Profile', component: AutopilotAddProfile }, - { - path: '/endpoint/autopilot/add-status-page', - name: 'Add Status Page', - component: AutopilotAddStatusPage, - }, - { - path: '/endpoint/autopilot/list-devices', - name: 'List Devices', - component: AutopilotListDevices, - }, - { - path: '/endpoint/autopilot/list-profiles', - name: 'List Profiles', - component: AutopilotListProfiles, - }, - { - path: '/endpoint/autopilot/list-status-pages', - name: 'List Status Pages', - component: AutopilotListStatusPages, - }, - { path: '/endpoint/MEM', name: 'MEM' }, - { - path: '/endpoint/MEM/list-policies', - name: 'List Intune Policies', - component: IntuneListPolicies, - }, - { - path: '/endpoint/MEM/list-compliance-policies', - name: 'List Intune Compliance Policies', - component: IntuneListCompliance, - }, - { - path: '/endpoint/MEM/list-appprotection-policies', - name: 'List App Protection Policies', - component: IntuneListAppProtection, - }, - - { path: '/endpoint/MEM/edit-policy', name: 'Edit MEM Policy', component: MEMEditPolicy }, - { path: '/endpoint/MEM/ca-policies', name: 'List Status Pages', component: IntuneCAPolicies }, - { path: '/endpoint/MEM/add-policy', name: 'Add Intune Policy', component: IntuneAddPolicy }, - { - path: '/endpoint/MEM/add-policy-template', - name: 'Add Endpoint Manager Policy Template', - component: MEMAddPolicyTemplate, - }, - { - path: '/endpoint/MEM/list-templates', - name: 'List Intune Policy Template', - component: IntuneListPolicyTemplate, - }, - { path: '/security/defender', name: 'Defender' }, - { path: '/security/defender/deployment', name: 'Deploy Defender', component: DeployDefender }, - { path: '/security/defender/list-defender', name: 'List Defender', component: ListDefender }, - { - path: '/security/defender/list-defender-tvm', - name: 'List Vulnerabilities', - component: ListVulnerabilities, - }, - - { path: '/teams-share', name: 'Teams & SharePoint' }, - { path: '/teams-share/onedrive', name: 'OneDrive' }, - { path: '/teams-share/onedrive/list', name: 'List OneDrive', component: OneDriveList }, - { path: '/teams-share/sharepoint', name: 'SharePoint' }, - { - path: '/teams-share/sharepoint/list-sharepoint', - name: 'List SharePoint', - component: SharepointList, - }, - { path: '/teams-share/teams', name: 'Teams' }, - { path: '/teams-share/teams/list-team', name: 'List Teams', component: TeamsListTeam }, - { - path: '/teams-share/teams/view-team-settings', - name: 'View Team Settings', - component: ViewTeamsSettings, - }, - { path: '/teams-share/teams/add-team', name: 'Add Team', component: TeamsAddTeam }, - { path: '/teams-share/teams/teams-activity', name: 'Teams Activity', component: TeamsActivity }, - { name: 'Email & Exchange', path: '/email' }, - { name: 'Email Administration', path: '/email/administration' }, - { name: 'List Contacts', path: '/email/administration/contacts', component: ContactsList }, - { - path: '/email/connectors/list-connectors', - name: 'List Connectors', - component: ConnectorList, - }, - { - path: '/email/connectors/deploy-connector', - name: 'Deploy Connectors', - component: DeployConnector, - }, - { - path: '/email/connectors/add-connector-templates', - name: 'Add Connectors Templates', - component: AddConnectorTemplate, - }, - { - path: '/email/connectors/list-connector-templates', - name: 'List Connectors Templates', - component: ConnectorListTemplates, - }, - { - path: '/email/transport/list-rules', - name: 'List Transport Rules', - component: TransportRulesList, - }, - { - path: '/email/transport/deploy-rules', - name: 'Deploy Transport Rule', - component: TransportDeploy, - }, - { - path: '/email/transport/list-templates', - name: 'Transport Rule Templates', - component: TransportTemplate, - }, - { - path: '/email/transport/add-template', - name: 'Transport Rule Add Temmplate', - component: AddTransportTemplate, - }, - { - path: '/email/spamfilter/list-spamfilter', - name: 'List Spamfilter', - component: SpamfilterList, - }, - { - path: '/email/spamfilter/deploy', - name: 'Deploy Spamfilter', - component: SpamFilterDeploy, - }, - { - path: '/email/spamfilter/list-templates', - name: 'List Spamfilter Templates', - component: SpamFilterTemplate, - }, - { - path: '/email/tools/mailbox-restore-wizard', - name: 'Mailbox Restore Wizard', - component: MailboxRestoreWizard, - }, - { - path: '/email/tools/mailbox-restores', - name: 'Mailbox Restores', - component: MailboxRestores, - }, - { - path: '/email/tools/mail-test', - name: 'Mail Test', - component: MailTest, - }, - { - path: '/email/spamfilter/add-template', - name: 'Add Spamfilter Template', - component: AddSpamFilterTemplate, - }, - { - name: 'Edit Mailbox Permissions', - path: '/email/administration/edit-mailbox-permissions', - component: EditMailboxPermissions, - }, - { - name: 'Add Shared Mailbox', - path: '/email/administration/add-shared-mailbox', - component: AddSharedMailbox, - }, - { - name: 'Edit Contact', - path: '/email/administration/add-contact', - component: AddContact, - }, - { - name: 'Edit Calendar Permissions', - path: '/email/administration/edit-calendar-permissions', - component: EditCalendarPermissions, - }, - { - name: 'View Mobile Devices', - path: '/email/administration/view-mobile-devices', - component: ViewMobileDevices, - }, - { name: 'Edit Contact', path: '/email/administration/edit-contact', component: EditContact }, - { name: 'List Mailboxes', path: '/email/administration/mailboxes', component: MailboxesList }, - { - name: 'List Mailbox Rules', - path: '/email/administration/mailbox-rules', - component: MailboxRulesList, - }, - - { - name: 'List Quarantine', - path: '/email/administration/Quarantine', - component: QuarantineList, - }, - - { name: 'Email Reports', path: '/email/reports' }, - { - name: 'Mailbox Statistics', - path: '/email/reports/mailbox-statistics', - component: MailboxStatisticsList, - }, - { - name: 'Shared Mailbox Enabled Account', - path: '/email/reports/SharedMailboxEnabledAccount', - component: SharedMailboxEnabledAccount, - }, - { - name: 'Mailbox Client Access Settings', - path: '/email/reports/mailbox-cas-settings', - component: MailboxClientAccessSettingsList, - }, - { name: 'Message Trace', path: '/email/reports/message-trace', component: MessageTrace }, - { path: '/cipp/user-settings', name: 'User Settings', component: UserSettings }, - - { - name: 'Phishing Policies', - path: '/email/reports/phishing-policies', - component: PhishingPoliciesList, - }, - { name: 'Security & Compliance', path: '/security' }, - { name: 'Security Administration', path: '/security/administration' }, - { name: 'Security Reports', path: '/security/reports' }, - { - name: 'List Alerts', - path: '/security/incidents/list-alerts', - component: SecurityComplianceAlerts, - }, - { - name: 'List Incidents', - path: '/security/incidents/list-incidents', - component: SecurityComplianceIncidents, - }, - { - name: 'List Device Compliance Report', - path: '/security/reports/list-device-compliance', - component: DeviceComplianceReport, - }, - { - name: 'License', - path: '/license', - component: License, - }, -] - -export default routes diff --git a/src/routes.json b/src/routes.json new file mode 100644 index 000000000000..db9ee316185f --- /dev/null +++ b/src/routes.json @@ -0,0 +1,927 @@ +[ + { + "path": "/home", + "name": "Home", + "component": "views/home/Home", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/logs", + "name": "Logs", + "component": "views/cipp/Logs", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/scheduler", + "name": "Scheduler", + "component": "views/cipp/Scheduler", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/statistics", + "name": "Statistics", + "component": "views/cipp/Statistics", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/404", + "name": "Error", + "component": "views/pages/page404/Page404", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/403", + "name": "Error", + "component": "views/pages/page403/Page403", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/500", + "name": "Error", + "component": "views/pages/page500/Page500", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity", + "name": "Identity", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users/add", + "name": "Add User", + "component": "views/identity/administration/AddUser", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users/addbulk", + "name": "Add User Bulk", + "component": "views/identity/administration/AddUserBulk", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users/edit", + "name": "Edit User", + "component": "views/identity/administration/EditUser", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users/view", + "name": "View User", + "component": "views/identity/administration/ViewUser", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users/InviteGuest", + "name": "Invite Guest", + "component": "views/identity/administration/InviteGuest", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/ViewBec", + "name": "View BEC", + "component": "views/identity/administration/ViewBEC", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration", + "name": "Administration", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/users", + "name": "Users", + "component": "views/identity/administration/Users", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/devices", + "name": "Devices", + "component": "views/identity/administration/Devices", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/groups/add", + "name": "Add Group", + "component": "views/identity/administration/AddGroup", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/group-templates", + "name": "Group Templates", + "component": "views/identity/administration/GroupTemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/group-add-template", + "name": "Add Group Template", + "component": "views/identity/administration/AddGroupTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/deploy-group-template", + "name": "Deploy Group Template", + "component": "views/identity/administration/DeployGroupTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/groups/edit", + "name": "Edit Group", + "component": "views/identity/administration/EditGroup", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/groups/view", + "name": "View Group", + "component": "views/identity/administration/ViewGroup", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/groups", + "name": "Groups", + "component": "views/identity/administration/Groups", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/roles", + "name": "Roles", + "component": "views/identity/administration/Roles", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/deleted-items", + "name": "Deleted Items", + "component": "views/identity/administration/Deleted", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams/business-voice", + "name": "BusinessVoice", + "component": "views/teams-share/teams/BusinessVoice", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/administration/offboarding-wizard", + "name": "Offboarding Wizard", + "component": "views/identity/administration/OffboardingWizard", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/reports", + "name": "Reports", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/reports/devices", + "name": "Devices", + "component": "views/endpoint/intune/Devices", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/reports/mfa-report", + "name": "MFA Report", + "component": "views/identity/reports/MFAReport", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/reports/inactive-users-report", + "name": "Inactive Users Report", + "component": "views/identity/reports/InactiveUsers", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/reports/Signin-report", + "name": "Sign-In Report", + "component": "views/identity/reports/SignIns", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/identity/reports/azure-ad-connect-report", + "name": "AAD Connect Report", + "component": "views/identity/reports/AzureADConnectReport", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant", + "name": "Tenant", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration", + "name": "Administration", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/tenants", + "name": "Tenants", + "component": "views/tenant/administration/Tenants", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/tenants/edit", + "name": "Edit Tenant", + "component": "views/tenant/administration/EditTenant", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/domains", + "name": "Domains", + "component": "views/tenant/administration/Domains", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/alertswizard", + "name": "Alerts Wizard", + "component": "views/tenant/administration/AlertWizard", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/alertrules", + "name": "Alerts Wizard", + "component": "views/tenant/administration/AlertRules", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/alertsqueue", + "name": "Alerts Queue", + "component": "views/tenant/administration/ListAlertsQueue", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/graph-explorer", + "name": "Graph Explorer", + "component": "views/tenant/administration/GraphExplorer", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/service-health", + "name": "Service Health", + "component": "views/tenant/administration/ServiceHealth", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/enterprise-apps", + "name": "Enterprise Applications", + "component": "views/tenant/administration/ListEnterpriseApps", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/app-consent-requests", + "name": "App Consent Requests", + "component": "views/tenant/administration/ListAppConsentRequests", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/list-policies", + "name": "Conditional Access", + "component": "views/tenant/conditional/ConditionalAccess", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/deploy-vacation", + "name": "Deploy Vacation Mode", + "component": "views/tenant/conditional/DeployVacation", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/test-policy", + "name": "Test Conditional Access Policy", + "component": "views/tenant/conditional/TestCAPolicy", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/list-named-locations", + "name": "Named Locations", + "component": "views/tenant/conditional/NamedLocations", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/deploy", + "name": "Deploy Conditional Access", + "component": "views/tenant/conditional/DeployCA", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/deploy-named-location", + "name": "Deploy Named Locations", + "component": "views/tenant/conditional/DeployNamedLocation", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/list-template", + "name": "Conditional Access Templates", + "component": "views/tenant/conditional/ListCATemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/conditional/add-template", + "name": "Conditional Access Add Template", + "component": "views/tenant/conditional/AddCATemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/list-licenses", + "name": "List Licenses", + "component": "views/tenant/administration/ListLicences", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/application-consent", + "name": "Consented Applications", + "component": "views/tenant/administration/ListOauthApps", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards", + "name": "Standards", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards/list-applied-standards", + "name": "List Applied Standards", + "component": "views/tenant/standards/ListAppliedStandards", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards/bpa-report", + "name": "Best Practice Report", + "component": "views/tenant/standards/BestPracticeAnalyser", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards/domains-analyser", + "name": "Domains Analyser", + "component": "views/tenant/standards/DomainsAnalyser", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards/individual-domains", + "name": "Individual Domain Check", + "component": "views/tenant/standards/IndividualDomain", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/administration/tenantlookup", + "name": "Tenant Lookup", + "component": "views/tenant/administration/TenantLookup", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/tools/geoiplookup", + "name": "Geo IP Lookup", + "component": "views/tenant/administration/GeoIPLookup", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/tools/bpa-report-builder", + "name": "BPA Report Builder", + "component": "views/tenant/standards/BPAReportBuilder", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/tenant/standards/alert-list", + "name": "Alert List (Alpha)", + "component": "views/security/incidents/ListAlerts", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint", + "name": "Endpoint", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications", + "name": "Applications", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/list", + "name": "List Applications", + "component": "views/endpoint/applications/ApplicationsList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/queue", + "name": "Application Queue", + "component": "views/endpoint/applications/ListApplicationQueue", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/add-choco-app", + "name": "Add Choco App", + "component": "views/endpoint/applications/ApplicationsAddChocoApp", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/add-winget-app", + "name": "Add Store App", + "component": "views/endpoint/applications/ApplicationsAddWinGet", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/add-office-app", + "name": "Add Office App", + "component": "views/endpoint/applications/ApplicationsAddOffice", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/applications/add-rmm-app", + "name": "Add RMM App", + "component": "views/endpoint/applications/ApplicationsAddRMM", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot", + "name": "Autopilot", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/add-device", + "name": "Add Device", + "component": "views/endpoint/autopilot/AutopilotAddDevice", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/add-profile", + "name": "Add Profile", + "component": "views/endpoint/autopilot/AutopilotAddProfile", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/add-status-page", + "name": "Add Status Page", + "component": "views/endpoint/autopilot/AutopilotAddStatusPage", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/list-devices", + "name": "List Devices", + "component": "views/endpoint/autopilot/AutopilotListDevices", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/list-profiles", + "name": "List Profiles", + "component": "views/endpoint/autopilot/AutopilotListProfiles", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/autopilot/list-status-pages", + "name": "List Status Pages", + "component": "views/endpoint/autopilot/AutopilotListStatusPages", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM", + "name": "MEM", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/list-policies", + "name": "List Intune Policies", + "component": "views/endpoint/intune/MEMListPolicies", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/list-compliance-policies", + "name": "List Intune Compliance Policies", + "component": "views/endpoint/intune/MEMListCompliance", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/list-appprotection-policies", + "name": "List App Protection Policies", + "component": "views/endpoint/intune/MEMListAppProtection", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/edit-policy", + "name": "Edit MEM Policy", + "component": "views/endpoint/intune/MEMEditPolicy", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/ca-policies", + "name": "List Status Pages", + "component": "views/endpoint/intune/MEMCAPolicies", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/add-policy", + "name": "Add Intune Policy", + "component": "views/endpoint/intune/MEMAddPolicy", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/add-policy-template", + "name": "Add Endpoint Manager Policy Template", + "component": "views/endpoint/intune/MEMAddPolicyTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/endpoint/MEM/list-templates", + "name": "List Intune Policy Template", + "component": "views/endpoint/intune/MEMListPolicyTemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/security/defender", + "name": "Defender", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/security/defender/deployment", + "name": "Deploy Defender", + "component": "views/security/defender/DeployDefender", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/security/defender/list-defender", + "name": "List Defender", + "component": "views/security/defender/ListDefender", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/security/defender/list-defender-tvm", + "name": "List Vulnerabilities", + "component": "views/security/defender/ListVuln", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share", + "name": "Teams & SharePoint", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/onedrive", + "name": "OneDrive", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/onedrive/list", + "name": "List OneDrive", + "component": "views/teams-share/onedrive/OneDriveList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/sharepoint", + "name": "SharePoint", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/sharepoint/list-sharepoint", + "name": "List SharePoint", + "component": "views/teams-share/sharepoint/SharepointList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams", + "name": "Teams", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams/list-team", + "name": "List Teams", + "component": "views/teams-share/teams/TeamsListTeam", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams/view-team-settings", + "name": "View Team Settings", + "component": "views/teams-share/teams/ViewTeamSettings", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams/add-team", + "name": "Add Team", + "component": "views/teams-share/teams/TeamsAddTeam", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/teams-share/teams/teams-activity", + "name": "Teams Activity", + "component": "views/teams-share/teams/TeamsActivity", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Email & Exchange", + "path": "/email", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Email Administration", + "path": "/email/administration", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Contacts", + "path": "/email/administration/contacts", + "component": "views/email-exchange/administration/ContactsList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/connectors/list-connectors", + "name": "List Connectors", + "component": "views/email-exchange/connectors/ConnectorList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/connectors/deploy-connector", + "name": "Deploy Connectors", + "component": "views/email-exchange/connectors/DeployConnector", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/connectors/add-connector-templates", + "name": "Add Connectors Templates", + "component": "views/email-exchange/connectors/AddConnectorTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/connectors/list-connector-templates", + "name": "List Connectors Templates", + "component": "views/email-exchange/connectors/ListConnectorTemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/transport/list-rules", + "name": "List Transport Rules", + "component": "views/email-exchange/transport/TransportRules", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/transport/deploy-rules", + "name": "Deploy Transport Rule", + "component": "views/email-exchange/transport/DeployTransport", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/transport/list-templates", + "name": "Transport Rule Templates", + "component": "views/email-exchange/transport/ListTransportTemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/transport/add-template", + "name": "Transport Rule Add Temmplate", + "component": "views/email-exchange/transport/AddTransportTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/spamfilter/list-spamfilter", + "name": "List Spamfilter", + "component": "views/email-exchange/spamfilter/Spamfilter", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/spamfilter/deploy", + "name": "Deploy Spamfilter", + "component": "views/email-exchange/spamfilter/DeploySpamfilter", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/spamfilter/list-templates", + "name": "List Spamfilter Templates", + "component": "views/email-exchange/spamfilter/ListSpamfilterTemplates", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/tools/mailbox-restore-wizard", + "name": "Mailbox Restore Wizard", + "component": "views/email-exchange/tools/MailboxRestoreWizard", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/tools/mailbox-restores", + "name": "Mailbox Restores", + "component": "views/email-exchange/tools/MailboxRestores", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/tools/mail-test", + "name": "Mail Test", + "component": "views/email-exchange/tools/MailTest", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/email/spamfilter/add-template", + "name": "Add Spamfilter Template", + "component": "views/email-exchange/spamfilter/AddSpamfilterTemplate", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Edit Mailbox Permissions", + "path": "/email/administration/edit-mailbox-permissions", + "component": "views/email-exchange/administration/EditMailboxPermissions", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Add Shared Mailbox", + "path": "/email/administration/add-shared-mailbox", + "component": "views/email-exchange/administration/AddSharedMailbox", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Edit Contact", + "path": "/email/administration/add-contact", + "component": "views/email-exchange/administration/AddContact", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Edit Calendar Permissions", + "path": "/email/administration/edit-calendar-permissions", + "component": "views/email-exchange/administration/EditCalendarPermissions", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "View Mobile Devices", + "path": "/email/administration/view-mobile-devices", + "component": "views/email-exchange/administration/ViewMobileDevices", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Edit Contact", + "path": "/email/administration/edit-contact", + "component": "views/email-exchange/administration/EditContact", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Mailboxes", + "path": "/email/administration/mailboxes", + "component": "views/email-exchange/administration/MailboxesList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Mailbox Rules", + "path": "/email/administration/mailbox-rules", + "component": "views/email-exchange/administration/MailboxRuleList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Quarantine", + "path": "/email/administration/Quarantine", + "component": "views/email-exchange/administration/QuarantineList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Email Reports", + "path": "/email/reports", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Mailbox Statistics", + "path": "/email/reports/mailbox-statistics", + "component": "views/email-exchange/reports/MailboxStatisticsList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Shared Mailbox Enabled Account", + "path": "/email/reports/SharedMailboxEnabledAccount", + "component": "views/email-exchange/reports/SharedMailboxEnabledAccount", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Mailbox Client Access Settings", + "path": "/email/reports/mailbox-cas-settings", + "component": "views/email-exchange/reports/MailboxClientAccessSettingsList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Message Trace", + "path": "/email/reports/message-trace", + "component": "views/email-exchange/reports/MessageTrace", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp/user-settings", + "name": "User Settings", + "component": "views/cipp/UserSettings", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Phishing Policies", + "path": "/email/reports/phishing-policies", + "component": "views/email-exchange/reports/PhishingPoliciesList", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Security & Compliance", + "path": "/security", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Security Administration", + "path": "/security/administration", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "Security Reports", + "path": "/security/reports", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Alerts", + "path": "/security/incidents/list-alerts", + "component": "views/security/incidents/ListAlerts", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Incidents", + "path": "/security/incidents/list-incidents", + "component": "views/security/incidents/ListIncidents", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "List Device Compliance Report", + "path": "/security/reports/list-device-compliance", + "component": "views/security/reports/ListDeviceComplianceReport", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "name": "License", + "path": "/license", + "component": "views/pages/license/License", + "allowedRoles": ["admin", "editor", "readonly"] + }, + { + "path": "/cipp", + "name": "CIPP", + "allowedRoles": ["admin"] + }, + { + "path": "/cipp/cipp", + "name": "CIPP", + "allowedRoles": ["admin"] + }, + { + "path": "/cipp/settings", + "name": "Settings", + "component": "views/cipp/app-settings/CIPPSettings", + "allowedRoles": ["admin"] + }, + { + "path": "/cipp/setup", + "name": "Setup", + "component": "views/cipp/Setup", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap", + "name": "GDAP Wizard", + "component": "views/tenant/administration/GDAPWizard", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap-invite", + "name": "GDAP Invite Wizard", + "component": "views/tenant/administration/GDAPInviteWizard", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap-role-wizard", + "name": "GDAP Role Wizard", + "component": "views/tenant/administration/GDAPRoleWizard", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap-roles", + "name": "GDAP Roles", + "component": "views/tenant/administration/ListGDAPRoles", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap-relationships", + "name": "GDAP Relationships", + "component": "./views/tenant/administration/ListGDAPRelationships", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/appapproval", + "name": "App Approval", + "component": "views/cipp/AppApproval", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/gdap-status", + "name": "GDAP Status", + "component": "views/tenant/administration/ListGDAPQueue", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/standards/list-standards", + "name": "List Standard", + "component": "views/tenant/standards/ListStandards", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/tenant-offboarding-wizard", + "name": "Tenant Offboarding", + "component": "views/tenant/administration/TenantOffboardingWizard", + "allowedRoles": ["admin"] + }, + { + "path": "/tenant/administration/tenant-onboarding-wizard", + "name": "Tenant Onboarding", + "component": "views/tenant/administration/TenantOnboardingWizard", + "allowedRoles": ["admin"] + } +] diff --git a/src/views/cipp/Logs.jsx b/src/views/cipp/Logs.jsx index 0d339880d1ff..9e41020ced16 100644 --- a/src/views/cipp/Logs.jsx +++ b/src/views/cipp/Logs.jsx @@ -20,6 +20,7 @@ import { CippDatatable, cellDateFormatter, CellTip } from 'src/components/tables import { useNavigate } from 'react-router-dom' import DatePicker from 'react-datepicker' import 'react-datepicker/dist/react-datepicker.css' +import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat' const reverseSort = (rowA, rowB) => { const a = rowA.DateTime.toLowerCase() const b = rowB.DateTime.toLowerCase() @@ -97,6 +98,11 @@ const columns = [ minWidth: '145px', maxWidth: '145px', }, + { + name: 'Data', + selector: (row) => row?.LogData, + cell: cellGenericFormatter(), + }, ] const Logs = () => { diff --git a/src/views/cipp/UserSettings.jsx b/src/views/cipp/UserSettings.jsx index 953d94df0d7c..955101c02921 100644 --- a/src/views/cipp/UserSettings.jsx +++ b/src/views/cipp/UserSettings.jsx @@ -14,9 +14,9 @@ import { import { useDispatch, useSelector } from 'react-redux' import { Form } from 'react-final-form' import { RFFCFormSwitch, RFFSelectSearch } from 'src/components/forms' +import _nav from 'src/_nav' import { useGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import 'react-datepicker/dist/react-datepicker.css' import TenantListSelector from 'src/components/utilities/TenantListSelector' @@ -204,26 +204,32 @@ const UserSettings = () => { isLoading={availableProperties.isFetching} />
- - - {addedAttributes > 0 && ( - setAddedAttribute(addedAttributes - 1)} - className={`circular-button`} - title={'-'} - > - - - )} - setAddedAttribute(addedAttributes + 1)} - className={`circular-button`} - title={'+'} - > - - - - + + +

Favourite Menu Items

+
+ acc.concat(val.items), []) + .map((item) => + // console.log(item), + ({ + name: item?.name, + value: { to: item?.to, name: item?.name }, + }), + )} + allowCreate={false} + refreshFunction={() => + setRandom3((Math.random() + 1).toString(36).substring(7)) + } + isLoading={availableProperties.isFetching} + /> +
diff --git a/src/views/cipp/app-settings/CIPPSettings.jsx b/src/views/cipp/app-settings/CIPPSettings.jsx index ff43ad2a5a94..c1e6b9463fd7 100644 --- a/src/views/cipp/app-settings/CIPPSettings.jsx +++ b/src/views/cipp/app-settings/CIPPSettings.jsx @@ -11,6 +11,7 @@ import { SettingsLicenses } from 'src/views/cipp/app-settings/SettingsLicenses.j import { SettingsExtensions } from 'src/views/cipp/app-settings/SettingsExtensions.jsx' import { SettingsMaintenance } from 'src/views/cipp/app-settings/SettingsMaintenance.jsx' import { SettingsExtensionMappings } from 'src/views/cipp/app-settings/SettingsExtensionMappings.jsx' +import { SettingsPartner } from 'src/views/cipp/app-settings/SettingsPartner.jsx' /** * This function returns the settings page content for CIPP. @@ -35,15 +36,18 @@ export default function CIPPSettings() { Notifications setActive(5)} href="#"> - Licenses + Partner Webhooks setActive(6)} href="#"> - Maintenance + Licenses setActive(7)} href="#"> - Extensions + Maintenance setActive(8)} href="#"> + Extensions + + setActive(9)} href="#"> Extension Mappings @@ -68,22 +72,26 @@ export default function CIPPSettings() { - - - + + - + - + + + + + + diff --git a/src/views/cipp/app-settings/SettingsPartner.jsx b/src/views/cipp/app-settings/SettingsPartner.jsx new file mode 100644 index 000000000000..91f45d98c11e --- /dev/null +++ b/src/views/cipp/app-settings/SettingsPartner.jsx @@ -0,0 +1,267 @@ +import { + useGenericGetRequestQuery, + useLazyGenericGetRequestQuery, + useLazyGenericPostRequestQuery, +} from 'src/store/api/app.js' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { + CBadge, + CButton, + CCallout, + CCard, + CCardBody, + CCardHeader, + CCardTitle, + CCol, + CForm, + CLink, + CRow, + CSpinner, +} from '@coreui/react' +import { Form } from 'react-final-form' +import { RFFSelectSearch } from 'src/components/forms/index.js' +import React, { useEffect } from 'react' +import { CippCallout } from 'src/components/layout/index.js' +import { CippCodeBlock } from 'src/components/utilities' +import { CellDate } from 'src/components/tables' + +/** + * Sets the notification settings. + * @returns {JSX.Element} The notification settings component. + */ +export function SettingsPartner() { + const webhookConfig = useGenericGetRequestQuery({ + path: '/api/ExecPartnerWebhook', + params: { Action: 'ListSubscription' }, + }) + const webhookEvents = useGenericGetRequestQuery({ + path: '/api/ExecPartnerWebhook', + params: { Action: 'ListEventTypes' }, + }) + const [submitWebhook, webhookCreateResult] = useLazyGenericPostRequestQuery() + const [sendTest, sendTestResult] = useLazyGenericGetRequestQuery() + const [checkTest, checkTestResult] = useLazyGenericGetRequestQuery() + + const onSubmit = (values) => { + const shippedValues = { + EventType: values?.EventType?.map((event) => event.value), + } + submitWebhook({ + path: '/api/ExecPartnerWebhook?Action=CreateSubscription', + values: shippedValues, + }).then((res) => { + webhookConfig.refetch() + }) + } + + useEffect(() => { + if ( + sendTestResult.isSuccess && + sendTestResult?.data?.Results?.correlationId && + !checkTestResult?.data?.Results?.results + ) { + setTimeout( + checkTest({ + path: '/api/ExecPartnerWebhook', + params: { + Action: 'ValidateTest', + CorrelationId: sendTestResult?.data?.Results?.correlationId, + }, + }), + 1000, + ) + } + }, [sendTestResult, checkTest, checkTestResult]) + + return ( + + + + <> + webhookConfig.refetch()} + className="mb-2" + disabled={webhookConfig.isFetching} + > + {webhookConfig.isFetching ? ( + <> + Loading... + + ) : ( + <> + + Refresh + + )} + + + {!webhookConfig.isFetching && webhookConfig.error && ( + Error loading data + )} + {webhookConfig.isSuccess && ( + <> +

Webhook Configuration

+ + + Subscribe to Microsoft Partner center webhooks to enable automatic tenant + onboarding and alerting. Updating the settings will replace any existing webhook + subscription with one pointing to CIPP. Refer to the{' '} + + Microsoft Partner Center documentation + {' '} + for more information on the webhook types. + + + + +

Webhook URL

+ +
+ +

Last Updated

+ +
+ +

Subscribed Events

+
({ + label: event, + value: event, + })), + }} + render={({ handleSubmit }) => ( + <> + + ({ + name: event, + value: event, + }))} + multi={true} + refreshFunction={() => webhookEvents.refetch()} + helpText="Select the events you want to receive notifications for." + /> + + {webhookCreateResult.isFetching ? ( + <> + + Saving... + + ) : ( + 'Save' + )} + + + + )} + /> + {webhookCreateResult.isSuccess && ( + + {webhookCreateResult?.data?.Results} + + )} + + +

Webhook Test

+ + + + sendTest({ + path: '/api/ExecPartnerWebhook', + params: { Action: 'SendTest' }, + }) + } + > + {sendTestResult.isFetching ? ( + <> + + Running Test... + + ) : ( + 'Start Test' + )} + + {checkTestResult.isFetching && !checkTestResult?.data?.Results?.result && ( + <> + Waiting for results + + )} + + + + {checkTestResult.isSuccess && ( + <> + +

Status

+ {checkTestResult?.data?.Results.status} +
+ {Array.isArray(checkTestResult?.data?.Results?.results) && ( + <> + +

Status Code

+ + {checkTestResult?.data?.Results?.results[0].responseCode} +
+ {checkTestResult?.data?.Results?.results[0].responseMessage !== '' && ( + +

Response Message

+ {checkTestResult.data.Results.results[0].responseMessage} +
+ )} + +

Date/Time

+ +
+ + )} + + )} +
+ + )} + + + + ) +} diff --git a/src/views/email-exchange/administration/ViewMobileDevices.jsx b/src/views/email-exchange/administration/ViewMobileDevices.jsx index 78c835647e61..19a58344894a 100644 --- a/src/views/email-exchange/administration/ViewMobileDevices.jsx +++ b/src/views/email-exchange/administration/ViewMobileDevices.jsx @@ -4,9 +4,8 @@ import { CippPageList } from 'src/components/layout' import useQuery from 'src/hooks/useQuery' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { CellTip, cellDateFormatter } from 'src/components/tables' -import { faEye, faEdit, faEllipsisV, faMobileAlt } from '@fortawesome/free-solid-svg-icons' +import { faEllipsisV } from '@fortawesome/free-solid-svg-icons' import { CippActionsOffcanvas } from 'src/components/utilities' -import { Link } from 'react-router-dom' import { CButton } from '@coreui/react' //TODO: Add CellBoolean diff --git a/src/views/endpoint/applications/ApplicationsAddChocoApp.jsx b/src/views/endpoint/applications/ApplicationsAddChocoApp.jsx index 7d4ef791b391..2995fd32bb16 100644 --- a/src/views/endpoint/applications/ApplicationsAddChocoApp.jsx +++ b/src/views/endpoint/applications/ApplicationsAddChocoApp.jsx @@ -87,7 +87,7 @@ const ApplyStandard = () => { {(value) => { let template = foundPackages.data.Results.filter(function (obj) { - console.log(value) + //console.log(value) return obj.packagename === value }) onChange(template[0][set]) diff --git a/src/views/endpoint/applications/ApplicationsAddWinGet.jsx b/src/views/endpoint/applications/ApplicationsAddWinGet.jsx index dda13eecf7c6..525c39d93799 100644 --- a/src/views/endpoint/applications/ApplicationsAddWinGet.jsx +++ b/src/views/endpoint/applications/ApplicationsAddWinGet.jsx @@ -88,10 +88,10 @@ const AddWinGet = () => { {(value) => { let template = foundPackages.data.filter(function (obj) { - console.log(value) + // console.log(value) return obj.packagename === value }) - console.log(template[0]) + //console.log(template[0]) onChange(template[0][set]) }} diff --git a/src/views/endpoint/intune/MEMAddPolicy.jsx b/src/views/endpoint/intune/MEMAddPolicy.jsx index 9ab14f4840ca..161b0134665f 100644 --- a/src/views/endpoint/intune/MEMAddPolicy.jsx +++ b/src/views/endpoint/intune/MEMAddPolicy.jsx @@ -15,6 +15,7 @@ import { } from 'src/components/forms' import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' import { OnChange } from 'react-final-form-listeners' +import CippJsonView from 'src/components/utilities/CippJsonView' const Error = ({ name }) => ( {

Step 2

-
- Enter the raw JSON for this policy. See{' '} - - this - {' '} - information. -
+
Enter the information for this policy

@@ -155,25 +150,27 @@ const AddPolicy = () => { label: template.Displayname, }))} placeholder="Select a template" - label="Please choose a template to apply, or enter the information manually." + label="Please choose a template to apply." /> )} - + + + @@ -198,18 +195,23 @@ const AddPolicy = () => { - + + + {(props) => { + console.log(props.values.RAWJson) + const json = props.values?.RAWJson ? JSON.parse(props.values.RAWJson) : undefined return ( <> + {props.values.RAWJson?.match('%.*%') && diff --git a/src/views/endpoint/intune/MEMListAppProtection.jsx b/src/views/endpoint/intune/MEMListAppProtection.jsx index 9f63b4820fde..569608ec916c 100644 --- a/src/views/endpoint/intune/MEMListAppProtection.jsx +++ b/src/views/endpoint/intune/MEMListAppProtection.jsx @@ -19,7 +19,7 @@ import { cellBooleanFormatter, cellDateFormatter } from 'src/components/tables' const Actions = (row, rowIndex, formatExtraData) => { const [ocVisible, setOCVisible] = useState(false) - console.log(row) + //console.log(row) const tenant = useSelector((state) => state.app.currentTenant) return ( <> @@ -36,7 +36,7 @@ const Actions = (row, rowIndex, formatExtraData) => { ]} actions={[ { - label: 'Create template based on policy (beta)', + label: 'Create template based on policy', color: 'info', modal: true, icon: , diff --git a/src/views/endpoint/intune/MEMListCompliance.jsx b/src/views/endpoint/intune/MEMListCompliance.jsx index fed996b957b3..c65a395997fd 100644 --- a/src/views/endpoint/intune/MEMListCompliance.jsx +++ b/src/views/endpoint/intune/MEMListCompliance.jsx @@ -36,7 +36,7 @@ const Actions = (row, rowIndex, formatExtraData) => { ]} actions={[ { - label: 'Create template based on policy (beta)', + label: 'Create template based on policy ', color: 'info', modal: true, icon: , diff --git a/src/views/endpoint/intune/MEMListPolicies.jsx b/src/views/endpoint/intune/MEMListPolicies.jsx index cd54f68eb9f6..0ea3ed1a26f4 100644 --- a/src/views/endpoint/intune/MEMListPolicies.jsx +++ b/src/views/endpoint/intune/MEMListPolicies.jsx @@ -35,7 +35,7 @@ const Actions = (row, rowIndex, formatExtraData) => { ]} actions={[ { - label: 'Create template based on policy (beta)', + label: 'Create template based on policy ', color: 'info', modal: true, icon: , diff --git a/src/views/identity/administration/AddGroup.jsx b/src/views/identity/administration/AddGroup.jsx index 3c2c308d1cef..cf02d42fbfa8 100644 --- a/src/views/identity/administration/AddGroup.jsx +++ b/src/views/identity/administration/AddGroup.jsx @@ -141,7 +141,7 @@ const AddGroup = () => { diff --git a/src/views/identity/administration/AddUser.jsx b/src/views/identity/administration/AddUser.jsx index f35d42385b9d..96186c358ed9 100644 --- a/src/views/identity/administration/AddUser.jsx +++ b/src/views/identity/administration/AddUser.jsx @@ -330,7 +330,7 @@ const AddUser = () => { <> - {currentSettings?.userSettingsDefaults?.defaultAttributes.map( + {currentSettings?.userSettingsDefaults?.defaultAttributes?.map( (attribute, idx) => ( diff --git a/src/views/identity/administration/DeployGroupTemplate.jsx b/src/views/identity/administration/DeployGroupTemplate.jsx index e0524fa0d970..f9bb9edfdb86 100644 --- a/src/views/identity/administration/DeployGroupTemplate.jsx +++ b/src/views/identity/administration/DeployGroupTemplate.jsx @@ -153,7 +153,7 @@ const ApplyGroupTemplate = () => { placeholder="Select a group type" values={[ { label: 'Dynamic Group', value: 'dynamic' }, - { label: 'Dynamic Distribution Group (Beta)', value: 'dynamicdistribution' }, + { label: 'Dynamic Distribution Group ', value: 'dynamicdistribution' }, { label: 'Security Group', value: 'generic' }, { label: 'Distribution group', value: 'distribution' }, diff --git a/src/views/identity/administration/Devices.jsx b/src/views/identity/administration/Devices.jsx index b67740e3136d..664f7552757c 100644 --- a/src/views/identity/administration/Devices.jsx +++ b/src/views/identity/administration/Devices.jsx @@ -159,6 +159,8 @@ const DevicesList = () => { TenantFilter: tenant?.defaultDomainName, Endpoint: 'devices', $format: 'application/json', + $orderby: 'displayName', + $count: true, }, columns, tableProps: { diff --git a/src/views/identity/administration/EditUser.jsx b/src/views/identity/administration/EditUser.jsx index 4f2aef34773e..3cfc21641997 100644 --- a/src/views/identity/administration/EditUser.jsx +++ b/src/views/identity/administration/EditUser.jsx @@ -137,10 +137,12 @@ const EditUser = () => { }, license: precheckedLicenses, //if currentSettings.defaultAttributes exists. Set each of the keys inside of currentSettings.defaultAttributes.label to the value of the user attribute found in the user object. - defaultAttributes: currentSettings?.userSettingsDefaults?.defaultAttributes.reduce( - (o, key) => Object.assign(o, { [key.label]: { Value: user[key.label] } }), - {}, - ), + defaultAttributes: currentSettings?.userSettingsDefaults?.defaultAttributes + ? currentSettings?.userSettingsDefaults?.defaultAttributes.reduce( + (o, key) => Object.assign(o, { [key.label]: { Value: user[key.label] } }), + {}, + ) + : [], } const formDisabled = queryError === true || !!userError || !user || Object.keys(user).length === 0 @@ -410,7 +412,7 @@ const EditUser = () => { <> - {currentSettings?.userSettingsDefaults?.defaultAttributes.map( + {currentSettings?.userSettingsDefaults?.defaultAttributes?.map( (attribute, idx) => ( diff --git a/src/views/tenant/administration/ListGDAPRelationships.jsx b/src/views/tenant/administration/ListGDAPRelationships.jsx index e55def41f1ce..c463797c16c9 100644 --- a/src/views/tenant/administration/ListGDAPRelationships.jsx +++ b/src/views/tenant/administration/ListGDAPRelationships.jsx @@ -128,7 +128,6 @@ const Actions = (row, rowIndex, formatExtraData) => { ) } - const GDAPRelationships = () => { const columns = [ { diff --git a/src/views/tenant/administration/TenantOnboardingWizard.jsx b/src/views/tenant/administration/TenantOnboardingWizard.jsx index bdd301663507..a6eb19460e55 100644 --- a/src/views/tenant/administration/TenantOnboardingWizard.jsx +++ b/src/views/tenant/administration/TenantOnboardingWizard.jsx @@ -157,20 +157,19 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss })} {onboardingStatus.isSuccess && ( <> - {onboardingStatus.data?.Status != 'running' && - onboardingStatus.data?.Status != 'queued' && ( - - getOnboardingStatus({ - path: '/api/ExecOnboardTenant?Retry=True', - values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups }, - }) - } - className="mb-3 me-2" - > - Retry - - )} + {onboardingStatus.data?.Status != 'queued' && ( + + getOnboardingStatus({ + path: '/api/ExecOnboardTenant?Retry=True', + values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups }, + }) + } + className="mb-3 me-2" + > + Retry + + )} {onboardingStatus.data?.Logs && ( ) } +RelationshipOnboarding.propTypes = { + relationship: PropTypes.object.isRequired, + gdapRoles: PropTypes.array, + autoMapRoles: PropTypes.bool, + addMissingGroups: PropTypes.bool, +} const TenantOnboardingWizard = () => { const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) diff --git a/src/views/tenant/administration/Tenants.jsx b/src/views/tenant/administration/Tenants.jsx index 87ab0a9d12da..f4d14335e6cc 100644 --- a/src/views/tenant/administration/Tenants.jsx +++ b/src/views/tenant/administration/Tenants.jsx @@ -11,9 +11,9 @@ import { CippTenantOffcanvasRow } from 'src/components/utilities/CippTenantOffca const TenantsList = () => { const TenantListSelector = useSelector((state) => state.app.TenantListSelector) const tenant = useSelector((state) => state.app.currentTenant) - console.log('TenantListSelector', TenantListSelector) + //console.log('TenantListSelector', TenantListSelector) const [columnOmits, setOmitVisible] = useState(TenantListSelector) - console.log('columnOmits', columnOmits) + //console.log('columnOmits', columnOmits) const generatePortalColumn = (portal) => ({ name: portal.label, omit: columnOmits, diff --git a/src/views/tenant/conditional/DeployCA.jsx b/src/views/tenant/conditional/DeployCA.jsx index f03618ba0bce..46de880a02da 100644 --- a/src/views/tenant/conditional/DeployCA.jsx +++ b/src/views/tenant/conditional/DeployCA.jsx @@ -6,9 +6,16 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons' import { CippWizard } from 'src/components/layout' import { WizardTableField } from 'src/components/tables' import PropTypes from 'prop-types' -import { RFFCFormRadio, RFFCFormSelect, RFFCFormTextarea } from 'src/components/forms' +import { + Condition, + RFFCFormRadio, + RFFCFormSelect, + RFFCFormSwitch, + RFFCFormTextarea, +} from 'src/components/forms' import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' import { OnChange } from 'react-final-form-listeners' +import CippJsonView from 'src/components/utilities/CippJsonView' const Error = ({ name }) => ( { label: template.displayName, }))} placeholder="Select a template" - label="Please choose a template to apply, or enter the information manually." + label="Please choose a template to apply." /> )} + + {/* always hide the textarea */} + + + + + + - + + + {/* eslint-disable react/prop-types */} + {(props) => { + const json = props.values?.rawjson ? JSON.parse(props.values.rawjson) : undefined + return ( + <> + + + ) + }} + + + + + + + + + + + + + + Warning: This will remove all exclusions and apply to all users. You might be + locked out of your tenant if you have not not excluded any roles. Please make sure + this is the action you want to perform. + + + + + + + + + + + + + + + + + - - - -
@@ -187,6 +259,8 @@ const AddPolicy = () => { {/* eslint-disable react/prop-types */} {(props) => { + const json = props.values?.rawjson ? JSON.parse(props.values.rawjson) : undefined + return ( <> @@ -200,8 +274,8 @@ const AddPolicy = () => { ))} -
Rule Settings
- {props.values.rawjson} +
Rule Settings
+
diff --git a/src/views/tenant/conditional/TestCAPolicy.jsx b/src/views/tenant/conditional/TestCAPolicy.jsx new file mode 100644 index 000000000000..098ec1b1e796 --- /dev/null +++ b/src/views/tenant/conditional/TestCAPolicy.jsx @@ -0,0 +1,288 @@ +import React, { useState } from 'react' +import { CButton, CCallout, CCol, CForm, CRow, CSpinner, CTooltip } from '@coreui/react' +import { useSelector } from 'react-redux' +import { Field, Form } from 'react-final-form' +import { RFFCFormInput, RFFSelectSearch } from 'src/components/forms' +import { + useGenericGetRequestQuery, + useLazyGenericGetRequestQuery, + useLazyGenericPostRequestQuery, +} from 'src/store/api/app' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faCircleNotch, faEdit, faEye } from '@fortawesome/free-solid-svg-icons' +import { CippContentCard, CippPage, CippPageList } from 'src/components/layout' +import 'react-datepicker/dist/react-datepicker.css' +import { TenantSelector } from 'src/components/utilities' +import arrayMutators from 'final-form-arrays' +import 'react-datepicker/dist/react-datepicker.css' +import { useListUsersQuery } from 'src/store/api/users' +import { useListConditionalAccessPoliciesQuery } from 'src/store/api/tenants' +import { TableContentCard } from 'src/components/contentcards' +import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat' +import countryList from 'src/data/countryList' + +const TestCAPolicy = () => { + const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() + const currentDate = new Date() + const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) + const [refreshState, setRefreshState] = useState(false) + const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() + + const onSubmit = (values) => { + genericPostRequest({ + path: '/api/ExecCACheck', + values: { tenantFilter: tenantDomain, ...values }, + }).then((res) => { + setRefreshState(res.requestId) + }) + } + + const { + data: users = [], + isFetching: usersIsFetching, + error: usersError, + } = useListUsersQuery({ tenantDomain }) + + const applications = useGenericGetRequestQuery({ + path: '/api/ListGraphRequest', + params: { + Endpoint: 'servicePrincipals', + TenantFilter: tenantDomain, + IgnoreErrors: true, + $top: 999, + }, + }) + const columns = [ + { + name: 'Display Name', + selector: (row) => row['displayName'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'displayName', + }, + { + name: 'State', + selector: (row) => row['state'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'state', + }, + { + name: 'Policy Applied', + selector: (row) => row['policyApplies'], + sortable: true, + cell: cellGenericFormatter(), + exportSelector: 'policyApplies', + }, + { + name: 'Reasons for not applying', + selector: (row) => row['reasons'], + sortable: true, + exportSelector: 'reasons', + }, + ] + return ( + + <> + + + + { + return ( + +

+ Test your conditional access policies before putting them in production. The + returned results will show you if the user is allowed or denied access based + on the policy. +

+ + + + {(props) => } + + + +
+ Mandatory Parameters: +
+ + + ({ + value: user.id, + name: `${user.displayName} <${user.userPrincipalName}>`, + }))} + placeholder={!usersIsFetching ? 'Select user' : 'Loading...'} + name="UserId" + /> + + + + + ({ + value: ca.appId, + name: `${ca.displayName}`, + }))} + placeholder={ + !applications.isFetching ? 'Select Application' : 'Loading...' + } + name="includeApplications" + /> + + + +
+ Optional Parameters: +
+ + + ({ + value: Code, + name: Name, + }))} + name="country" + placeholder="Type to search..." + label="Test from this country" + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Test policies + {postResults.isFetching && ( + + )} + + + + {postResults.isSuccess && ( + +
  • + {postResults.data?.Results?.value + ? 'Test succesful. See the table for the results.' + : postResults.data.Results} +
  • +
    + )} + {getResults.isFetching && ( + + Loading + + )} + {getResults.isSuccess && ( + {getResults.data?.Results} + )} + {getResults.isError && ( + + Could not connect to API: {getResults.error.message} + + )} +
    + ) + }} + /> +
    +
    + + + +
    + +
    + ) +} + +export default TestCAPolicy diff --git a/src/views/tenant/standards/DomainsAnalyser.jsx b/src/views/tenant/standards/DomainsAnalyser.jsx index 30d830a0ad09..528ba47c4a58 100644 --- a/src/views/tenant/standards/DomainsAnalyser.jsx +++ b/src/views/tenant/standards/DomainsAnalyser.jsx @@ -295,7 +295,7 @@ const DomainsAnalyser = () => { }, ], path: `/api/ListDomainAnalyser`, - params: { tenantFilter: currentTenant.defaultDomainName }, + params: { tenantFilter: currentTenant.customerId }, columns, reportName: 'Domains-Analyzer', tableProps: { diff --git a/src/views/tenant/standards/ListAppliedStandards.jsx b/src/views/tenant/standards/ListAppliedStandards.jsx index ba5c10a14601..62a679ff1d9a 100644 --- a/src/views/tenant/standards/ListAppliedStandards.jsx +++ b/src/views/tenant/standards/ListAppliedStandards.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react' +import React, { useRef, useState } from 'react' import { CButton, CCallout, @@ -12,8 +12,9 @@ import { CAccordionItem, CWidgetStatsB, CBadge, + CFormInput, } from '@coreui/react' -import { Form } from 'react-final-form' +import { Form, FormSpy } from 'react-final-form' import { Condition, RFFCFormInput, @@ -37,54 +38,12 @@ import { CippTable, cellBooleanFormatter } from 'src/components/tables' import allStandardsList from 'src/data/standards' import CippCodeOffCanvas from 'src/components/utilities/CippCodeOffcanvas' import GDAPRoles from 'src/data/GDAPRoles' +import Select from 'react-select' -const RefreshAction = () => { - const [execStandards, execStandardsResults] = useLazyGenericGetRequestQuery() - const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) - const showModal = (selectedTenant) => - ModalService.confirm({ - body: ( -
    - Are you sure you want to run the standards now?
    - Please note: this runs every three hours automatically. -
    - ), - onConfirm: () => - execStandards({ path: `api/ExecStandardsRun?Tenantfilter=${selectedTenant}` }), - }) - - return ( - <> - {execStandardsResults.data?.Results === - 'Already running. Please wait for the current instance to finish' && ( -
    {execStandardsResults.data?.Results}
    - )} -

    - showModal('AllTenants')} size="sm" className="m-1"> - {execStandardsResults.isLoading && } - {execStandardsResults.error && ( - - )} - {execStandardsResults.isSuccess && } - Run Standards Now (All Tenants) - - showModal(tenantDomain)} size="sm" className="m-1"> - {execStandardsResults.isLoading && } - {execStandardsResults.error && ( - - )} - {execStandardsResults.isSuccess && } - Run Standards Now (Selected Tenant) - -

    - - ) -} const DeleteAction = () => { const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) const [execStandards, execStandardsResults] = useLazyGenericGetRequestQuery() - const showModal = () => ModalService.confirm({ body:
    Are you sure you want to delete this standard?
    , @@ -109,8 +68,107 @@ const DeleteAction = () => { ) } const ApplyNewStandard = () => { + const [templateStandard, setTemplateStandard] = useState() + console.log(templateStandard) + const RefreshAction = () => { + const [execStandards, execStandardsResults] = useLazyGenericGetRequestQuery() + const { + data: listStandardTemplates = [], + isFetching, + isSuccess, + isError, + } = useGenericGetRequestQuery({ + path: 'api/listStandardTemplates', + }) + const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) + const showModal = (selectedTenant) => + ModalService.confirm({ + body: ( +
    + Are you sure you want to run the standards now?
    + Please note: this runs every three hours automatically. +
    + ), + onConfirm: () => + execStandards({ path: `api/ExecStandardsRun?Tenantfilter=${selectedTenant}` }), + }) + const ourRef = useRef() + const TemplateModal = () => + ModalService.open({ + body: ( +
    + {isFetching && } + {isError && 'Something went wrong loading your templates'} + {isSuccess && ( +