Skip to content

Commit

Permalink
Merge pull request #770 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Pushing dev to release
  • Loading branch information
KelvinTegelaar authored Feb 18, 2022
2 parents 1901a03 + 4a49a39 commit 0d5cafc
Show file tree
Hide file tree
Showing 32 changed files with 1,034 additions and 500 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This project is **FREE** but we do have a **Sponsorware** component. The sponsor
- The project will be hosted for you.
- The hosted version will always be the latest release and automatically updated.
- You'll also receive a staging environment with the latest (nightly/beta) build, to see new features before anyone else.
- You will receive priority on support issues reported on Github.
- You will receive priority on support issues reported on GitHub.
- You will be able to make 1 priortized feature request per month.

Sponsorship allows me to sink some more time into this project and keep it free, so please consider it. :)
Expand Down
392 changes: 147 additions & 245 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.2
2.2.0
17 changes: 16 additions & 1 deletion src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ const _nav = [
name: 'Basic Auth Report',
to: '/identity/reports/basic-auth-report',
},
{
component: CNavItem,
name: 'AAD Connect Report',
to: '/identity/reports/azure-ad-connect-report',
},
],
},
{
Expand All @@ -95,9 +100,14 @@ const _nav = [
items: [
{
component: CNavItem,
name: 'Tenants',
name: 'List Tenants',
to: '/tenant/administration/tenants',
},
{
component: CNavItem,
name: 'List Licences',
to: '/tenant/administration/list-licenses',
},
{
component: CNavItem,
name: 'Conditional Access Policies',
Expand Down Expand Up @@ -167,6 +177,11 @@ const _nav = [
name: 'List Alerts',
to: '/security/reports/list-alerts',
},
{
component: CNavItem,
name: 'Device Compliance',
to: '/security/reports/list-device-compliance',
},
],
},
{
Expand Down
51 changes: 51 additions & 0 deletions src/components/utilities/CippListOffcanvas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React from 'react'
import PropTypes from 'prop-types'
import { CListGroup, CListGroupItem } from '@coreui/react'
import { CippOffcanvas } from '.'

export default function CippListOffcanvas(props) {
return (
<CippOffcanvas
placement={props.placement}
title={props.title}
visible={props.visible}
id={props.id}
hideFunction={props.hideFunction}
>
{props.groups.map((group, key) => (
<OffcanvasListSection title={group.title} items={group.items} key={key} />
))}
</CippOffcanvas>
)
}

CippListOffcanvas.propTypes = {
groups: PropTypes.array,
placement: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
visible: PropTypes.bool,
id: PropTypes.string.isRequired,
hideFunction: PropTypes.func.isRequired,
}

export function OffcanvasListSection({ title, items }) {
return (
<>
<h4 className="mt-4">{title}</h4>
{items.length > 0 && (
<CListGroup className="my-3">
{items.map((item, key) => (
<CListGroupItem className="d-flex justify-content-between align-items-center" key={key}>
{item.heading && <h6 className="w-50 mb-0">{item.heading}</h6>}
{item.content}
</CListGroupItem>
))}
</CListGroup>
)}
</>
)
}
OffcanvasListSection.propTypes = {
title: PropTypes.string,
items: PropTypes.array,
}
32 changes: 20 additions & 12 deletions src/components/utilities/TenantSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useDispatch, useSelector } from 'react-redux'
import PropTypes from 'prop-types'
import { useListTenantsQuery } from 'src/store/api/tenants'
import { setCurrentTenant } from 'src/store/features/app'
import { CippContentCard } from 'src/components/layout'
import { faCity, faBuilding } from '@fortawesome/free-solid-svg-icons'

const TenantSelector = ({ action, showAllTenantSelector = false }) => {
const dispatch = useDispatch()
Expand All @@ -29,18 +31,24 @@ const TenantSelector = ({ action, showAllTenantSelector = false }) => {
}

return (
<SelectSearch
search
onChange={activated}
filterOptions={fuzzySearch}
placeholder={placeholder}
disabled={isLoading}
value={currentTenant && currentTenant.customerId}
options={tenants.map(({ customerId, displayName, defaultDomainName }) => ({
value: customerId,
name: [displayName] + [` (${defaultDomainName})`],
}))}
/>
<CippContentCard
title={showAllTenantSelector ? 'Select a Tenant or All Tenants' : 'Select a Tenant'}
icon={showAllTenantSelector ? faCity : faBuilding}
className="tenant-selector"
>
<SelectSearch
search
onChange={activated}
filterOptions={fuzzySearch}
placeholder={placeholder}
disabled={isLoading}
value={currentTenant && currentTenant.customerId}
options={tenants.map(({ customerId, displayName, defaultDomainName }) => ({
value: customerId,
name: [displayName] + [` (${defaultDomainName})`],
}))}
/>
</CippContentCard>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/utilities/Toasts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Toast = ({ message, title, onClose, error }) => {
<CToastBody>
<div className="d-flex justify-content-between align-items-center text-danger">
<strong>{message}</strong>
<CButton size="sm" variant="outline" color="light" onClick={() => setVisible(!visible)}>
<CButton size="sm" variant="outline" color="primary" onClick={() => setVisible(!visible)}>
Details
<FontAwesomeIcon
className="ms-1"
Expand Down
24 changes: 22 additions & 2 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ const EditTenant = React.lazy(() => import('src/views/tenant/administration/Edit
const ConditionalAccess = React.lazy(() =>
import('src/views/tenant/administration/ConditionalAccess'),
)
const ListLicences = React.lazy(() => import('src/views/tenant/administration/ListLicences'))

const BasicAuthReport = React.lazy(() => import('src/views/identity/reports/BasicAuthReport'))
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'),
)
Expand All @@ -39,7 +46,6 @@ const ListAppliedStandards = React.lazy(() =>
import('src/views/tenant/standards/ListAppliedStandards'),
)
const IndividualDomain = React.lazy(() => import('src/views/tenant/standards/IndividualDomain'))
const ApplyStandard = React.lazy(() => import('src/views/tenant/standards/ApplyStandard'))
const ListAlerts = React.lazy(() => import('src/views/security/reports/ListAlerts'))
const ApplicationsList = React.lazy(() =>
import('src/views/endpoint/applications/ApplicationsList'),
Expand Down Expand Up @@ -148,6 +154,11 @@ const routes = [
name: 'Basic Auth Report',
component: BasicAuthReport,
},
{
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 },
Expand All @@ -161,13 +172,17 @@ const routes = [
name: 'Conditional Access',
component: ConditionalAccess,
},
{
path: '/tenant/administration/list-licenses',
name: 'List Licenses',
component: ListLicences,
},
{ path: '/tenant/standards', name: 'Standards' },
{
path: '/tenant/standards/list-applied-standards',
name: 'List Applied Standards',
component: ListAppliedStandards,
},
{ path: '/tenant/standards/apply-standard', name: 'Apply Standard', component: ApplyStandard },
{
path: '/tenant/standards/bpa-report',
name: 'Best Practice Report',
Expand Down Expand Up @@ -302,6 +317,11 @@ const routes = [
path: '/security/reports/list-alerts',
component: SecurityComplianceAlerts,
},
{
name: 'List Device Compliance Report',
path: '/security/reports/list-device-compliance',
component: DeviceComplianceReport,
},
{
name: 'License',
path: '/license',
Expand Down
33 changes: 33 additions & 0 deletions src/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

.btn {
border-radius: var(--cipp-border-radius);
white-space: nowrap;
}

.card {
Expand Down Expand Up @@ -344,6 +345,30 @@
}
}

.rdt_TableRow.mbusage-warning {
background-color: color.adjust($cyberdrain-warning, $alpha: -0.5) !important;

.text-success {
color: var(--cui-body-color) !important;
}

.text-danger {
color: var(--cui-body-color) !important;
}
}

.rdt_TableRow.mbusage-danger {
background-color: color.adjust($cyberdrain-danger, $alpha: -0.5) !important;

.text-success {
color: var(--cui-body-color) !important;
}

.text-danger {
color: var(--cui-body-color) !important;
}
}

/* Footer */
.footer {
p {
Expand All @@ -354,3 +379,11 @@
max-height: 2rem;
}
}

/* Toasts */

.toast-body {
.btn {
margin-left: 1rem;
}
}
20 changes: 20 additions & 0 deletions src/store/api/adconnect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { baseApi } from 'src/store/api/baseApi'

export const adconnectApi = baseApi.injectEndpoints({
endpoints: (builder) => ({
listAdConnectSettings: builder.query({
query: ({ tenantDomain }) => ({
path: '/api/ListAzureADConnectStatus',
params: { TenantFilter: tenantDomain, DataToReturn: 'AzureADConnectSettings' },
}),
transformResponse: (response) => {
if (!response) {
return []
}
return response
},
}),
}),
})

export const { useListAdConnectSettingsQuery } = adconnectApi
5 changes: 4 additions & 1 deletion src/store/api/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export const securityApi = baseApi.injectEndpoints({
endpoints: (builder) => ({
execAlertsList: builder.query({
queryFn: async (_args, _baseQueryApi, _options, baseQuery) => {
const startRequest = await baseQuery({ path: '/api/ExecAlertsList' })
const startRequest = await baseQuery({
path: '/api/ExecAlertsList',
params: { tenantFilter: _args.tenantFilter },
})
if (startRequest.error) {
return { error: startRequest.error }
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/middleware/errorMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const errorMiddleware =
(action) => {
if (isRejectedWithValue(action) && !action.error?.hideToastError) {
console.error(action)
const message = action.payload?.message || 'A generic error has occurred.'
const message = action.payload?.data || 'A generic error has occurred.'

const toastError = action.payload

Expand Down
14 changes: 14 additions & 0 deletions src/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@ export const validJson = (value) => {
return 'Invalid JSON'
}
}

export const password = (value) => {
let strongPassword = new RegExp('(?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9])(?=.{8,})')

try {
if (strongPassword.test(value)) {
return undefined
} else {
throw new Error()
}
} catch (e) {
return 'Invalid password. Must be a minimum of 8 characters and contain special characters'
}
}
14 changes: 14 additions & 0 deletions src/views/email-exchange/reports/MailboxStatisticsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ import { useSelector } from 'react-redux'
import { cellBooleanFormatter } from 'src/components/tables'
import { CippPageList } from 'src/components/layout'

const conditionalRowStyles = [
{
when: (row) => (row.UsedGB / row.QuotaGB) * 100 > 80 && (row.UsedGB / row.QuotaGB) * 100 < 90,
classNames: ['mbusage-warning'],
},
{
when: (row) => (row.UsedGB / row.QuotaGB) * 100 > 90 && (row.UsedGB / row.QuotaGB) * 100 < 100,
classNames: ['mbusage-danger'],
},
]

const columns = [
{
selector: (row) => row['UPN'],
Expand Down Expand Up @@ -61,6 +72,9 @@ const MailboxStatsList = () => {
path: '/api/ListMailboxStatistics',
columns,
params: { TenantFilter: tenant?.defaultDomainName },
tableProps: {
conditionalRowStyles: conditionalRowStyles,
},
}}
/>
)
Expand Down
Loading

0 comments on commit 0d5cafc

Please sign in to comment.