Skip to content

Commit

Permalink
Merge pull request #38 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
kris6673 authored May 17, 2024
2 parents f0e0bfe + 1fa566f commit 0c371e4
Show file tree
Hide file tree
Showing 18 changed files with 592 additions and 197 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cipp",
"version": "5.6.2",
"version": "5.7.0",
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
"homepage": "https://cipp.app/",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.2
5.7.0
2 changes: 1 addition & 1 deletion src/_nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const _nav = [
{
component: CNavItem,
name: 'Tenant Onboarding',
to: '/tenant/administration/tenant-onboarding-wizard',
to: '/tenant/administration/tenant-onboarding',
},
{
component: CNavItem,
Expand Down
4 changes: 3 additions & 1 deletion src/components/tables/CippTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export default function CippTable({
filterlist,
showFilter = true,
endpointName,
defaultSortAsc = true,
tableProps: {
keyField = 'id',
theme = 'cyberdrain',
Expand Down Expand Up @@ -989,7 +990,7 @@ export default function CippTable({
expandableRowsComponent={expandableRowsComponent}
highlightOnHover={highlightOnHover}
expandOnRowClicked={expandOnRowClicked}
defaultSortAsc
defaultSortAsc={defaultSortAsc}
defaultSortFieldId={1}
sortFunction={customSort}
paginationPerPage={tablePageSize}
Expand Down Expand Up @@ -1050,6 +1051,7 @@ export const CippTablePropTypes = {
disableCSVExport: PropTypes.bool,
error: PropTypes.object,
filterlist: PropTypes.arrayOf(PropTypes.object),
defaultSortAsc: PropTypes.bool,
}

CippTable.propTypes = CippTablePropTypes
2 changes: 1 addition & 1 deletion src/components/utilities/CippTableOffcanvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function CippTableOffcanvas({
tableProps,
data = null,
}) {
if (Array.isArray(data) && data !== null && data !== undefined) {
if (Array.isArray(data) && data !== null && data !== undefined && data?.length > 0) {
if (!Array.isArray(data) && typeof data === 'object') {
data = Object.keys(data).map((key) => {
return {
Expand Down
3 changes: 3 additions & 0 deletions src/data/AuditLogSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
{ "value": "remove delegation entry.", "name": "removed delegation entry" },
{ "value": "remove domain from company.", "name": "removed domain from company" },
{ "value": "remove member from group.", "name": "removed member from group" },
{ "value": "remove member from a role.", "name": "remove member from a role" },
{ "value": "Disable Strong Authentication.", "name": "Disable Strong Authentication." },

{
"value": "remove service principal.",
"name": "removed a service principal from the directory"
Expand Down
90 changes: 85 additions & 5 deletions src/data/AuditLogTemplates.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@
{
"value": "Add member to role.",
"name": "A user has been added to an admin role",
"template": []
"template": {
"preset": {
"value": "Add member to role.",
"label": "A user has been added to an admin role"
},
"logbook": { "value": "Audit.AzureActiveDirectory", "label": "Azure AD" },
"conditions": [
{
"Property": { "value": "List:Operation", "label": "Operation" },
"Operator": { "value": "EQ", "label": "Equals to" },
"Input": {
"value": "Add member to role.",
"label": "Add member to role."
}
}
]
}
},
{
"value": "Update StsRefreshTokenValidFrom Timestamp.",
Expand All @@ -113,12 +129,44 @@
{
"value": "Disable Strong Authentication.",
"name": "A users MFA has been disabled",
"template": []
"template": {
"preset": {
"value": "Disable Strong Authentication.",
"label": "A users MFA has been disabled"
},
"logbook": { "value": "Audit.AzureActiveDirectory", "label": "Azure AD" },
"conditions": [
{
"Property": { "value": "List:Operation", "label": "Operation" },
"Operator": { "value": "EQ", "label": "Equals to" },
"Input": {
"value": "Disable Strong Authentication.",
"label": "Disable Strong Authentication."
}
}
]
}
},
{
"value": "Remove Member from a role.",
"name": "A user has been removed from a role",
"template": []
"template": {
"preset": {
"value": "Remove Member from a role.",
"label": "A user has been removed from a role"
},
"logbook": { "value": "Audit.AzureActiveDirectory", "label": "Azure AD" },
"conditions": [
{
"Property": { "value": "List:Operation", "label": "Operation" },
"Operator": { "value": "EQ", "label": "Equals to" },
"Input": {
"value": "Remove Member from a role.",
"label": "Remove Member from a role."
}
}
]
}
},
{
"value": "Reset user password.",
Expand Down Expand Up @@ -169,12 +217,44 @@
{
"value": "Add service principal.",
"name": "A service principal has been created",
"template": []
"template": {
"preset": {
"value": "Add service principal.",
"label": "A service principal has been created"
},
"logbook": { "value": "Audit.AzureActiveDirectory", "label": "Azure AD" },
"conditions": [
{
"Property": { "value": "List:Operation", "label": "Operation" },
"Operator": { "value": "EQ", "label": "Equals to" },
"Input": {
"value": "Add service principal.",
"label": "Add service principal."
}
}
]
}
},
{
"value": "Remove service principal.",
"name": "A service principal has been removed",
"template": []
"template": {
"preset": {
"value": "Remove service principal.",
"label": "A service principal has been removed"
},
"logbook": { "value": "Audit.AzureActiveDirectory", "label": "Azure AD" },
"conditions": [
{
"Property": { "value": "List:Operation", "label": "Operation" },
"Operator": { "value": "EQ", "label": "Equals to" },
"Input": {
"value": "Remove service principal.",
"label": "Remove service principal."
}
}
]
}
},
{
"value": "badRepIP",
Expand Down
1 change: 1 addition & 0 deletions src/importsMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ import React from 'react'
"/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": React.lazy(() => import('./views/tenant/administration/TenantOnboarding')),
"/tenant/administration/tenant-onboarding-wizard": React.lazy(() => import('./views/tenant/administration/TenantOnboardingWizard')),
}
export default importsMap
6 changes: 6 additions & 0 deletions src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,12 @@
"component": "views/tenant/administration/TenantOffboardingWizard",
"allowedRoles": ["admin"]
},
{
"path": "/tenant/administration/tenant-onboarding",
"name": "Tenant Onboarding",
"component": "views/tenant/administration/TenantOnboarding",
"allowedRoles": ["admin"]
},
{
"path": "/tenant/administration/tenant-onboarding-wizard",
"name": "Tenant Onboarding",
Expand Down
13 changes: 12 additions & 1 deletion src/views/cipp/app-settings/SettingsPartner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CSpinner,
} from '@coreui/react'
import { Form } from 'react-final-form'
import { RFFSelectSearch } from 'src/components/forms/index.js'
import { RFFCFormSwitch, 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'
Expand All @@ -45,6 +45,7 @@ export function SettingsPartner() {
const onSubmit = (values) => {
const shippedValues = {
EventType: values?.EventType?.map((event) => event.value),
standardsExcludeAllTenants: values?.standardsExcludeAllTenants,
}
submitWebhook({
path: '/api/ExecPartnerWebhook?Action=CreateSubscription',
Expand Down Expand Up @@ -141,6 +142,8 @@ export function SettingsPartner() {
label: event,
value: event,
})),
standardsExcludeAllTenants:
webhookConfig?.data?.Results?.standardsExcludeAllTenants,
}}
render={({ handleSubmit }) => (
<>
Expand All @@ -156,6 +159,14 @@ export function SettingsPartner() {
refreshFunction={() => webhookEvents.refetch()}
helpText="Select the events you want to receive notifications for."
/>
<RFFCFormSwitch
name="standardsExcludeAllTenants"
helpText='Enabling this feature excludes tenants from any top-level
"All Tenants" standard. This means that only the standards you
explicitly set for this tenant will be applied.'
label="Exclude onboarded tenants from top-level standards"
className="mt-3"
/>
<CButton
type="submit"
color="primary"
Expand Down
10 changes: 8 additions & 2 deletions src/views/email-exchange/connectors/ConnectorList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ const ConnectorList = () => {
{ filterName: 'Disabled connectors', filter: 'Complex: Enabled eq false' },
{ filterName: 'Inbound connectors', filter: 'Complex: cippconnectortype eq inbound' },
{ filterName: 'Outbound connectors', filter: 'Complex: cippconnectortype eq outbound' },
{ filterName: 'Transport rule connectors', filter: 'Complex: IsTransportRuleScoped eq true' },
{ filterName: 'Non-transport rule connectors', filter: 'Complex: IsTransportRuleScoped eq false' },
{
filterName: 'Transport rule connectors',
filter: 'Complex: IsTransportRuleScoped eq true',
},
{
filterName: 'Non-transport rule connectors',
filter: 'Complex: IsTransportRuleScoped eq false',
},
],
reportName: `${tenant?.defaultDomainName}-connectors-list`,
path: '/api/ListExchangeConnectors',
Expand Down
67 changes: 60 additions & 7 deletions src/views/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import React, { useState } from 'react'
import {
faBook,
faCog,
faEllipsisH,
faLaptopCode,
faMailBulk,
faSearch,
faUser,
faUserFriends,
faUserPlus,
Expand All @@ -16,19 +14,15 @@ import {
CCol,
CCollapse,
CDropdown,
CDropdownHeader,
CDropdownItem,
CDropdownMenu,
CDropdownToggle,
CLink,
CNav,
CRow,
} from '@coreui/react'
import { useGenericGetRequestQuery } from 'src/store/api/app'
import { CippContentCard } from 'src/components/layout'
import Skeleton from 'react-loading-skeleton'
import { UniversalSearch } from 'src/components/utilities/UniversalSearch'
import { ActionContentCard } from 'src/components/contentcards'
import { useSelector } from 'react-redux'
import allStandardsList from 'src/data/standards'
import Portals from 'src/data/portals'
Expand All @@ -37,11 +31,14 @@ import { CChart } from '@coreui/react-chartjs'
import { getStyle } from '@coreui/utils'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Link } from 'react-router-dom'
import CippPrettyCard from 'src/components/contentcards/CippPrettyCard'
import { useNavigate } from 'react-router-dom'
import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat'
import { ModalService } from 'src/components/utilities'

const TenantDashboard = () => {
const [visible, setVisible] = useState(false)
const [domainVisible, setDomainVisible] = useState(false)
const navigate = useNavigate()

const currentTenant = useSelector((state) => state.app.currentTenant)
const theme = useSelector((state) => state.app.currentTheme)
Expand Down Expand Up @@ -174,6 +171,55 @@ const TenantDashboard = () => {
)
})
}

const handleTable = (data, title) => {
const QueryColumns = []
const columns = Object.keys(data[0]).map((key) => {
QueryColumns.push({
name: key,
selector: (row) => row[key], // Accessing the property using the key
sortable: true,
exportSelector: key,
cell: cellGenericFormatter(),
})
})
ModalService.open({
data: data,
componentType: 'table',
componentProps: {
columns: QueryColumns,
keyField: 'id',
},
title: title,
size: 'lg',
})
}

const userChartLegendClickHandler = function (e, legendItem, legend) {
switch (legendItem.text) {
case 'Total Users':
navigate('/identity/administration/users?customerId=' + currentTenant.customerId)
break
case 'Licensed Users':
navigate(
'/identity/administration/users?customerId=' +
currentTenant.customerId +
'&tableFilter=Graph%3A+assignedLicenses%2F%24count+ne+0',
)
break
case 'Guests':
navigate(
'/identity/administration/users?customerId=' +
currentTenant.customerId +
'&tableFilter=Graph%3A+usertype+eq+%27guest%27',
)
break
case 'Global Admins':
handleTable(GlobalAdminList.data?.Results, 'Global Admins')
break
}
}

return (
<>
<CRow className="mb-3">
Expand Down Expand Up @@ -337,6 +383,13 @@ const TenantDashboard = () => {
labels: {
color: getStyle('--cui-body-color'),
},
onClick: userChartLegendClickHandler,
onHover: (event) => {
event.native.target.style.cursor = 'pointer'
},
onLeave: (event) => {
event.native.target.style.cursor = 'default'
},
},
},
}}
Expand Down
Loading

0 comments on commit 0c371e4

Please sign in to comment.