diff --git a/package-lock.json b/package-lock.json index 8be1d42e29..f020f3c706 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,6 +58,7 @@ "concurrently": "^8.2.2", "cookie-parser": "^1.4.6", "cookie-session": "^2.0.0", + "cors": "^2.8.5", "cron": "^3.1.6", "cross-env": "^7.0.3", "date-fns": "^2.27.0", @@ -6150,6 +6151,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", diff --git a/package.json b/package.json index ba0304eade..5344a3646d 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "concurrently": "^8.2.2", "cookie-parser": "^1.4.6", "cookie-session": "^2.0.0", + "cors": "^2.8.5", "cron": "^3.1.6", "cross-env": "^7.0.3", "date-fns": "^2.27.0", diff --git a/src/client/components/DirectLinks/DirectLinks.constants.ts b/src/client/components/DirectLinks/DirectLinks.constants.ts index 6f6a0ffa10..b8558ea02f 100644 --- a/src/client/components/DirectLinks/DirectLinks.constants.ts +++ b/src/client/components/DirectLinks/DirectLinks.constants.ts @@ -4,7 +4,6 @@ import { ExternalUrls } from '../../config/app'; export interface DirectLink { title: string; url?: string; - isPhoneScreenLink?: true; isExternalLink?: true; id?: string; isActive: boolean; @@ -17,12 +16,6 @@ const GenericLinks: Record = { id: 'Uitleg', isActive: true, }, - MIJN_SUBSIDIE: { - title: 'Mijn Subsidies', - url: ExternalUrls.MIJN_SUBSIDIES, - isExternalLink: true, - isActive: true, - }, STADSBANK_VAN_LENING: { title: 'Stadsbank van Lening', url: ExternalUrls.STADSBANK_VAN_LENING, @@ -41,13 +34,6 @@ const GenericLinks: Record = { isExternalLink: true, isActive: true, }, - MIJN_OMGEVING: { - title: 'Mijn omgeving', - url: AppRoutes.BUURT, - isPhoneScreenLink: true, - id: 'MyAreaHeader', - isActive: true, - }, MIJN_OVERHEID_ONDERNEMERS: { title: 'MijnOverheid voor ondernemers', url: 'https://www.digitaleoverheid.nl/dossiers/movo-mijn-overheid-voor-ondernemers/', diff --git a/src/client/components/DirectLinks/DirectLinks.module.scss b/src/client/components/DirectLinks/DirectLinks.module.scss index 948b1e8a8a..21cfac0671 100644 --- a/src/client/components/DirectLinks/DirectLinks.module.scss +++ b/src/client/components/DirectLinks/DirectLinks.module.scss @@ -4,6 +4,10 @@ @include select(amsterdam-heading) { margin-bottom: 1.6rem; } + + @include mq-phone() { + margin-top: 2rem; + } } .LinkList { @@ -72,4 +76,4 @@ svg { margin-right: 0.5rem; } -} \ No newline at end of file +} diff --git a/src/client/components/DirectLinks/DirectLinks.test.tsx b/src/client/components/DirectLinks/DirectLinks.test.tsx index 58a3328067..fb95e6e324 100644 --- a/src/client/components/DirectLinks/DirectLinks.test.tsx +++ b/src/client/components/DirectLinks/DirectLinks.test.tsx @@ -1,6 +1,5 @@ import { render } from '@testing-library/react'; import { BrowserRouter } from 'react-router-dom'; -import { usePhoneScreen } from '../../hooks/media.hook'; import DirectLinks from './DirectLinks'; vi.mock('../../hooks/media.hook'); @@ -20,8 +19,4 @@ describe('', () => { it('renders commercial links', () => { expect(getMountHtml('commercial')).toMatchSnapshot(); }); - it('renders additional links on phone', () => { - (usePhoneScreen as vi.Mock).mockReturnValueOnce(true); - expect(getMountHtml('private')).toMatchSnapshot(); - }); }); diff --git a/src/client/components/DirectLinks/DirectLinks.tsx b/src/client/components/DirectLinks/DirectLinks.tsx index b8958098b0..db1f9cb651 100644 --- a/src/client/components/DirectLinks/DirectLinks.tsx +++ b/src/client/components/DirectLinks/DirectLinks.tsx @@ -6,7 +6,6 @@ import Linkd from '../Button/Button'; import classnames from 'classnames'; import { entries } from '../../../universal/helpers'; import styles from './DirectLinks.module.scss'; -import { usePhoneScreen } from '../../hooks/media.hook'; export default function DirectLinks({ id = 'DirectLinks', @@ -14,7 +13,6 @@ export default function DirectLinks({ profileType, ...otherProps }: HTMLAttributes & { profileType: ProfileType }) { - const isPhoneScreen = usePhoneScreen(); return (
{entries(LINKS[profileType]) .filter(([, { url, isActive }]) => !!url && isActive) - .filter(([, { isPhoneScreenLink }]) => - isPhoneScreen ? isPhoneScreenLink : true - ) .map((link) => { const [linkName, { url, title, isExternalLink, id }] = link; return ( diff --git a/src/client/components/MyArea/LegendPanel/PanelContent/Afval.tsx b/src/client/components/MyArea/LegendPanel/PanelContent/Afval.tsx index 4f71ea9877..0e4137cac4 100644 --- a/src/client/components/MyArea/LegendPanel/PanelContent/Afval.tsx +++ b/src/client/components/MyArea/LegendPanel/PanelContent/Afval.tsx @@ -5,7 +5,7 @@ const afvalUrls: Record = { rest: 'https://www.amsterdam.nl/veelgevraagd/?productid=%7BC5AC6694-CB65-4ED8-B5B3-6794BEA279FD%7D', glas: 'https://www.amsterdam.nl/veelgevraagd/?productid=%7B881CBA8B-AB9F-43DF-910F-6B5DF7A91080%7D', papier: - 'https://www.amsterdam.nl/veelgevraagd/?productid=%7B95B69586-623A-4333-9322-A48FF8424B77%7D', + 'https://www.amsterdam.nl/veelgevraagd/dit-mag-wel-en-niet-in-de-papiercontainer-944aa-kp', textiel: 'https://www.amsterdam.nl/veelgevraagd/?caseid=%7BD68460AA-EB08-4132-A69F-7763CD8431A2%7D', gft: 'https://www.amsterdam.nl/veelgevraagd/?caseid=%7B4FDB05A6-EA6F-4475-A359-C19AD3578CF5%7D', diff --git a/src/client/pages/ApplicationError/ApplicationError.tsx b/src/client/pages/ApplicationError/ApplicationError.tsx index 5506bf093f..05a8be9ccf 100644 --- a/src/client/pages/ApplicationError/ApplicationError.tsx +++ b/src/client/pages/ApplicationError/ApplicationError.tsx @@ -86,6 +86,12 @@ export default function ApplicationError({ error }: FallbackProps) { Excuses, er gaat iets mis. Probeer om de pagina opnieuw te laden. Lukt het dan nog niet? Probeer het dan later nog eens.

+

+ Gebruikt u Google Translate? +
+ Deze browser extensie veroorzaakt soms problemen, mogelijk werkt de + pagina beter wanneer u deze extensie niet gebruikt. +

Als het probleem zich blijft voordoen maak melding bij “Uw mening” aan de rechter zijkant van deze pagina. diff --git a/src/index.tsx b/src/index.tsx index f37dec214f..5a90e97ce8 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,6 +5,7 @@ import App from './client/App'; import ApplicationError from './client/pages/ApplicationError/ApplicationError'; import './client/styles/main.scss'; import { IS_AZ, IS_DEVELOPMENT, OTAP_ENV } from './universal/config/env'; +import { ErrorInfo } from 'react'; if ( /MSIE (\d+\.\d+);/.test(navigator.userAgent) || @@ -45,8 +46,9 @@ Sentry.init({ }, }); -const sendToSentry = (error: Error, info: { componentStack: string }) => { - Sentry.captureException(error, { +const sendToSentry = (error: Error, info: ErrorInfo) => { + Sentry.captureMessage(`Kritieke applicatie fout: ${error.message}`, { + level: 'fatal', extra: { componentStack: info.componentStack, }, diff --git a/src/server/app.ts b/src/server/app.ts index 2a47dbcd1a..443a66c7f8 100644 --- a/src/server/app.ts +++ b/src/server/app.ts @@ -30,7 +30,7 @@ import express, { } from 'express'; import rateLimit from 'express-rate-limit'; import morgan from 'morgan'; - +import cors from 'cors'; import { BFF_BASE_PATH, BFF_PORT, @@ -98,6 +98,15 @@ app.use( ) ); +if (IS_DEVELOPMENT) { + app.use( + cors({ + origin: process.env.MA_FRONTEND_URL, + credentials: true, + }) + ); +} + // Json body parsing app.use(express.json()); diff --git a/src/server/config.ts b/src/server/config.ts index 4965924196..d13034175c 100644 --- a/src/server/config.ts +++ b/src/server/config.ts @@ -4,7 +4,7 @@ import fs from 'fs'; import https from 'https'; import * as jose from 'jose'; import { FeatureToggle } from '../universal/config'; -import { IS_AZ, IS_OT, IS_TAP } from '../universal/config/env'; +import { IS_AZ, IS_DEVELOPMENT, IS_OT, IS_TAP } from '../universal/config/env'; import { TokenData } from './helpers/app'; export function getCertificateSync(envVarName: string | undefined) { @@ -575,7 +575,7 @@ export const DEV_JWK_PRIVATE: any = { export const DEV_JWT = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; -export const securityHeaders = { +export const securityHeaders: Record = { 'Permissions-Policy': 'geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()', 'Referrer-Policy': 'same-origin',