Skip to content

Commit

Permalink
Merge branch 'test' into acc
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefwint committed Jun 27, 2024
2 parents c16d5bf + d1ea964 commit dfaf793
Show file tree
Hide file tree
Showing 209 changed files with 20,165 additions and 6,332 deletions.
54 changes: 24 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,36 @@
"type": "module",
"dependencies": {
"@headlessui/react": "^1.7.17",
"@pzh-ui/components": "^0.0.452",
"@pzh-ui/config": "^0.0.56",
"@pzh-ui/css": "^0.0.75",
"@pzh-ui/icons": "^0.0.47",
"@react-hookz/web": "^24.0.2",
"@tanstack/react-query": "^5.14.2",
"axios": "^1.6.2",
"classnames": "^2.3.2",
"@pzh-ui/components": "^0.0.541",
"@pzh-ui/config": "^0.0.69",
"@pzh-ui/css": "^0.0.96",
"@pzh-ui/icons": "^0.0.60",
"@react-hookz/web": "^24.0.4",
"@tanstack/react-query": "^5.24.7",
"axios": "^1.6.7",
"clsx": "^2.1.0",
"d3": "^7.8.5",
"date-fns": "^2.23.0",
"dompurify": "^3.0.5",
"formik": "^2.4.2",
"dompurify": "^3.0.9",
"formik": "^2.4.6",
"jwt-decode": "^4.0.0",
"leaflet": "^1.9.4",
"leaflet-draw": "^1.0.4",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.groupby": "^4.6.0",
"node-htmldiff": "^0.9.4",
"node-sass": "9.0.0",
"proj4leaflet": "^1.0.2",
"react": "^18.2.0",
"react": "^18.3.1",
"react-content-loader": "^6.2.1",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.10",
"react-helmet-async": "^2.0.3",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
"react-helmet-async": "^2.0.4",
"react-leaflet": "^4.2.1",
"react-router-dom": "^6.14.2",
"react-router-dom": "^6.22.2",
"uuid": "^9.0.1",
"zod": "^3.22.4",
"zod-formik-adapter": "^1.2.0",
"zustand": "^4.4.7"
"zustand": "^4.5.2"
},
"scripts": {
"build:css": "npx tailwindcss -i node_modules/@pzh-ui/css/src/tailwind.src.css -o src/css/tailwind.css",
Expand Down Expand Up @@ -78,15 +76,14 @@
"@types/lodash.clonedeep": "^4.5.6",
"@types/lodash.debounce": "^4.0.7",
"@types/lodash.groupby": "^4.6.7",
"@types/node": "^20.10.5",
"@types/proj4leaflet": "^1.0.10",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-leaflet": "^3.0.0",
"@types/react-router-dom": "^5.3.2",
"@types/react-router-dom": "^5.3.3",
"@types/uuid": "^9.0.3",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.0.4",
"@vitest/coverage-v8": "^1.2.2",
"add": "^2.0.6",
"autoprefixer": "^10.4.4",
"c8": "^8.0.0",
Expand All @@ -96,23 +93,20 @@
"eslint-plugin-prettier": "^5.0.0",
"jsdom": "^22.1.0",
"msw": "^2.0.6",
"orval": "^6.22.1",
"orval": "^6.25.0",
"prettier": "2.8.8",
"rollup-plugin-visualizer": "^5.11.0",
"sass": "^1.63.6",
"tailwindcss": "^3.3.6",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3",
"vite": "^5.0.7",
"vite": "^5.2.11",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.2",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.0.4"
},
"msw": {
"workerDirectory": "public"
},
"resolutions": {
"csstype": "3.1.2"
},
"packageManager": "[email protected]",
"prettier": "@pzh-ui/config/prettier"
}
2 changes: 1 addition & 1 deletion public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* tslint:disable */

/**
* Mock Service Worker (2.1.1).
* Mock Service Worker (2.2.0).
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
Expand Down
14 changes: 12 additions & 2 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { Suspense } from 'react'
import { ErrorBoundary } from 'react-error-boundary'
import { Helmet, HelmetProvider } from 'react-helmet-async'
import { useLocation, useNavigate } from 'react-router-dom'

import Axe from '@/Axe'
import { LoaderContent } from '@/components/Loader'
import AuthProvider from '@/context/AuthContext'
import usePage from '@/hooks/usePage'
import { ErrorPage } from '@/pages/public'
import { BaseLayout } from '@/templates/BaseLayout'
import globalRouter from '@/utils/globalRouter'
import { toastNotification } from '@/utils/toastNotification'

import AppRoutes from './Routes'

import './appConfig'

const queryClient = new QueryClient({
Expand All @@ -31,6 +34,11 @@ const queryClient = new QueryClient({
})

const App = () => {
const location = useLocation()

const navigate = useNavigate()
globalRouter.navigate = navigate

const userIsInMuteerEnvironment = usePage('/muteer')
const isAdvancedSearchPage = usePage('/zoeken-op-kaart')
const isNetworkPage = usePage('/beleidsnetwerk')
Expand All @@ -40,7 +48,7 @@ const App = () => {
<QueryClientProvider client={queryClient}>
<AuthProvider>
<div
className="relative flex min-h-screen flex-col text-pzh-blue-dark"
className="text-pzh-blue-900 relative flex min-h-screen flex-col"
id="main-container">
<Helmet titleTemplate="%s - Omgevingsbeleid Provincie Zuid-Holland">
<meta charSet="utf-8" />
Expand All @@ -50,7 +58,9 @@ const App = () => {
</Helmet>

<BaseLayout hideFooter={isAdvancedSearchPage}>
<ErrorBoundary FallbackComponent={ErrorPage}>
<ErrorBoundary
key={location.pathname}
FallbackComponent={ErrorPage}>
<Suspense fallback={<LoaderContent />}>
<AppRoutes />
</Suspense>
Expand Down
54 changes: 54 additions & 0 deletions src/App/Routes/AppRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useCallback, useLayoutEffect } from 'react'
import { useErrorBoundary } from 'react-error-boundary'
import { useNavigate, useRoutes } from 'react-router-dom'

import * as models from '@/config/objects'
Expand All @@ -16,6 +17,9 @@ import {
ObjectDetail,
ObjectEdit,
ObjectWrite,
PublicationTemplateCreate,
PublicationTemplateEdit,
PublicationTemplateOverview,
Regulations,
UserDetail,
UsersOverview,
Expand All @@ -39,10 +43,15 @@ import {
ThemeDetail,
ThemeOverview,
} from '@/pages/public'
import MaintenancePage from '@/pages/public/MaintenancePage/MaintenancePage'
import globalErrorBoundary from '@/utils/globalErrorBoundary'

import ProtectedRoute from './ProtectedRoute'

const AppRoutes = () => {
const { showBoundary } = useErrorBoundary()
globalErrorBoundary.showBoundary = showBoundary

const routes = useRoutes([
/**
* Public pages
Expand Down Expand Up @@ -382,8 +391,53 @@ const AppRoutes = () => {
},
],
},
{
path: 'publicatietemplates',
children: [
{
index: true,
element: (
<ProtectedRoute
permissions={{
canViewPublicationTemplate: true,
}}
redirectTo="/muteer">
<PublicationTemplateOverview />
</ProtectedRoute>
),
},
{
path: ':uuid',
element: (
<ProtectedRoute
permissions={{
canViewPublicationTemplate: true,
}}
redirectTo="/muteer">
<PublicationTemplateEdit />
</ProtectedRoute>
),
},
{
path: 'nieuw',
element: (
<ProtectedRoute
permissions={{
canCreatePublicationTemplate: true,
}}
redirectTo="/muteer">
<PublicationTemplateCreate />
</ProtectedRoute>
),
},
],
},
],
},
{
path: '500',
element: <MaintenancePage />,
},
{
path: '*',
element: <NotFoundPage />,
Expand Down
Loading

0 comments on commit dfaf793

Please sign in to comment.