Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ictsinfx authored Apr 29, 2024
2 parents 3f39a86 + c5ac068 commit df7471b
Show file tree
Hide file tree
Showing 16 changed files with 351 additions and 223 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.0",
"version": "5.6.1",
"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.0
5.6.1
108 changes: 53 additions & 55 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React, { Suspense } from 'react'
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom'
import { BrowserRouter, Route, Routes, Navigate, useLocation } from 'react-router-dom'
import { PrivateRoute, FullScreenLoading, ErrorBoundary } from 'src/components/utilities'
import 'src/scss/style.scss'
import { Helmet } from 'react-helmet-async'
import { Helmet, HelmetProvider } from 'react-helmet-async'
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)
Expand All @@ -32,59 +31,58 @@ const Logout = React.lazy(() => import('./views/pages/login/Logout'))
const App = () => {
return (
<BrowserRouter>
<Suspense fallback={<FullScreenLoading />}>
<Helmet>
<title>CIPP</title>
</Helmet>
<Routes>
<Route exact path="/LogoutRedirect" name="LogoutRedirect" element={<PageLogOut />} />
<Route exact path="/401" name="Page 401" element={<Page401 />} />
<Route exact path="/403" name="Page 403" element={<Page403 />} />
<Route exact path="/404" name="Page 404" element={<Page404 />} />
<Route exact path="/500" name="Page 500" element={<Page500 />} />
<Route exact path="/login" name="Login" element={<Login />} />
<Route exact path="/logout" name="Logout" element={<Logout />} />
<Route
path="/"
element={
<PrivateRoute>
<DefaultLayout />
</PrivateRoute>
}
>
{routes.map((route, idx) => {
const allowedRoles = route.allowedRoles
const Routecomponent = dynamicImport(route.path)
//console.log('route', route)
//console.log('Routecomponent', Routecomponent)
return (
route.component && (
<Route
key={`route-${idx}`}
path={route.path}
exact={route.exact}
name={route.name}
element={
<PrivateRoute allowedRoles={allowedRoles}>
<Suspense fallback={<Skeleton />}>
<Helmet>
<title>CIPP - {route.name}</title>
</Helmet>
<ErrorBoundary key={route.name}>
<Routecomponent />
</ErrorBoundary>
</Suspense>
</PrivateRoute>
}
/>
<HelmetProvider>
<Suspense fallback={<FullScreenLoading />}>
<Helmet>
<title>CIPP</title>
</Helmet>
<Routes>
<Route exact path="/LogoutRedirect" name="LogoutRedirect" element={<PageLogOut />} />
<Route exact path="/401" name="Page 401" element={<Page401 />} />
<Route exact path="/403" name="Page 403" element={<Page403 />} />
<Route exact path="/404" name="Page 404" element={<Page404 />} />
<Route exact path="/500" name="Page 500" element={<Page500 />} />
<Route exact path="/login" name="Login" element={<Login />} />
<Route exact path="/logout" name="Logout" element={<Logout />} />
<Route
path="/"
element={
<PrivateRoute>
<DefaultLayout />
</PrivateRoute>
}
>
{routes.map((route, idx) => {
const allowedRoles = route.allowedRoles
const Routecomponent = dynamicImport(route.path)
//console.log('route', route)
//console.log('Routecomponent', Routecomponent)
return (
route.component && (
<Route
key={`route-${idx}`}
path={route.path}
exact={route.exact}
name={route.name}
element={
<PrivateRoute allowedRoles={allowedRoles}>
<Suspense fallback={<Skeleton />}>
<ErrorBoundary key={route.name}>
<Routecomponent />
</ErrorBoundary>
</Suspense>
</PrivateRoute>
}
/>
)
)
)
})}
<Route path="/" element={<Navigate to="/home" replace={true} />} />
</Route>
<Route path="*" name="Page 404" element={<Page404 />} />
</Routes>
</Suspense>
})}
<Route path="/" element={<Navigate to="/home" replace={true} />} />
</Route>
<Route path="*" name="Page 404" element={<Page404 />} />
</Routes>
</Suspense>
</HelmetProvider>
</BrowserRouter>
)
}
Expand Down
5 changes: 5 additions & 0 deletions src/_nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,11 @@ const _nav = [
name: 'Quarantine',
to: '/email/administration/quarantine',
},
{
component: CNavItem,
name: 'Tenant Allow/Block Lists',
to: '/email/administration/tenant-allow-block-lists',
},
],
},
{
Expand Down
3 changes: 2 additions & 1 deletion src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ export const RFFCFormInput = ({
spellCheck = true,
autoFocus = false,
hiddenValue,
defaultValue,
onChange,
}) => {
return (
<Field initialValue={hiddenValue} name={name} validate={validate}>
<Field defaultValue={defaultValue} initialValue={hiddenValue} name={name} validate={validate}>
{({ input, meta }) => {
const handleChange = onChange
? (e) => {
Expand Down
12 changes: 8 additions & 4 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@
{
"type": "number",
"name": "standards.NudgeMFA.snoozeDurationInDays",
"label": "Number of days to allow users to skip registering Authenticator (0-14, default is 1)"
"label": "Number of days to allow users to skip registering Authenticator (0-14, default is 1)",
"default": 1
}
],
"label": "Sets the state for the request to setup Authenticator",
Expand Down Expand Up @@ -578,7 +579,8 @@
"type": "number",
"name": "standards.EnableMailTips.MailTipsLargeAudienceThreshold",
"label": "Number of recipients to trigger the large audience MailTip (Default is 25)",
"placeholder": "Enter a profile name"
"placeholder": "Enter a profile name",
"default": 25
}
],
"label": "Enable all MailTips",
Expand Down Expand Up @@ -634,12 +636,14 @@
{
"type": "number",
"name": "standards.SendReceiveLimitTenant.SendLimit",
"label": "Send limit in MB (Default is 35)"
"label": "Send limit in MB (Default is 35)",
"default": 35
},
{
"type": "number",
"name": "standards.SendReceiveLimitTenant.ReceiveLimit",
"label": "Receive Limit in MB (Default is 36)"
"label": "Receive Limit in MB (Default is 36)",
"default": 36
}
],
"label": "Set send/receive size limits",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useNavFavouriteCheck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const useNavFavouriteCheck = (navigation) => {
var items = []

recentPages.map((path) => {
const item = routes.find((route) => route.path === path)
const item = routes.find((route) => route.path.toLowerCase() === path.toLowerCase())
if (item?.path) {
items.push({
name: item.name,
Expand Down
Loading

0 comments on commit df7471b

Please sign in to comment.