Skip to content

Commit

Permalink
Merge branch 'main' into MIJN-7134-nieuwe-svwi-tegel
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarBakker authored Feb 14, 2024
2 parents d1a34fa + b577cae commit b7f49da
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 31 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 0 additions & 14 deletions src/client/components/DirectLinks/DirectLinks.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { ExternalUrls } from '../../config/app';
export interface DirectLink {
title: string;
url?: string;
isPhoneScreenLink?: true;
isExternalLink?: true;
id?: string;
isActive: boolean;
Expand All @@ -17,12 +16,6 @@ const GenericLinks: Record<string, DirectLink> = {
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,
Expand All @@ -41,13 +34,6 @@ const GenericLinks: Record<string, DirectLink> = {
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/',
Expand Down
6 changes: 5 additions & 1 deletion src/client/components/DirectLinks/DirectLinks.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
@include select(amsterdam-heading) {
margin-bottom: 1.6rem;
}

@include mq-phone() {
margin-top: 2rem;
}
}

.LinkList {
Expand Down Expand Up @@ -72,4 +76,4 @@
svg {
margin-right: 0.5rem;
}
}
}
5 changes: 0 additions & 5 deletions src/client/components/DirectLinks/DirectLinks.test.tsx
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -20,8 +19,4 @@ describe('<DirectLinks />', () => {
it('renders commercial links', () => {
expect(getMountHtml('commercial')).toMatchSnapshot();
});
it('renders additional links on phone', () => {
(usePhoneScreen as vi.Mock).mockReturnValueOnce(true);
expect(getMountHtml('private')).toMatchSnapshot();
});
});
5 changes: 0 additions & 5 deletions src/client/components/DirectLinks/DirectLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ 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',
className,
profileType,
...otherProps
}: HTMLAttributes<HTMLDivElement> & { profileType: ProfileType }) {
const isPhoneScreen = usePhoneScreen();
return (
<div
{...otherProps}
Expand All @@ -27,9 +25,6 @@ export default function DirectLinks({
<ul className={styles.LinkList}>
{entries(LINKS[profileType])
.filter(([, { url, isActive }]) => !!url && isActive)
.filter(([, { isPhoneScreenLink }]) =>
isPhoneScreen ? isPhoneScreenLink : true
)
.map((link) => {
const [linkName, { url, title, isExternalLink, id }] = link;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const afvalUrls: Record<string, string> = {
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',
Expand Down
6 changes: 6 additions & 0 deletions src/client/pages/ApplicationError/ApplicationError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</p>
<p>
Gebruikt u Google Translate?
<br />
Deze browser extensie veroorzaakt soms problemen, mogelijk werkt de
pagina beter wanneer u deze extensie niet gebruikt.
</p>
<p>
Als het probleem zich blijft voordoen maak melding bij “Uw mening”
aan de rechter zijkant van deze pagina.
Expand Down
6 changes: 4 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down Expand Up @@ -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,
},
Expand Down
11 changes: 10 additions & 1 deletion src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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());

Expand Down
4 changes: 2 additions & 2 deletions src/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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<string, string> = {
'Permissions-Policy':
'geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()',
'Referrer-Policy': 'same-origin',
Expand Down

0 comments on commit b7f49da

Please sign in to comment.