Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAP-2521: bump out of date dependencies #447

Merged
merged 8 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@next/next/no-server-import-in-page': 'off',
},
},
],
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@typescript-eslint/eslint-plugin": "5.59.11",
"@typescript-eslint/parser": "5.59.11",
"eslint": "8.42.0",
"eslint-config-next": "12.0.7",
"eslint-config-prettier": "8.5.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.3.1",
"@testing-library/user-event": "^14.5.2",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.57.0",
"eslint-config-next": "12.3.4",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "^8.0.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^12.3.8",
"lint-staged": "^12.5.0",
"prettier": "2.8.8"
},
"resolutions": {
Expand Down
36 changes: 18 additions & 18 deletions packages/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,42 @@
"postinstall": "node ./postinstall.js"
},
"dependencies": {
"@aws-crypto/client-node": "3.2.0",
"@contentful/rich-text-from-markdown": "15.16.6",
"@contentful/rich-text-react-renderer": "^15.12.1",
"@aws-crypto/client-node": "3.2.2",
"@contentful/rich-text-from-markdown": "15.16.15",
"@contentful/rich-text-react-renderer": "^15.19.6",
"@tinymce/tinymce-react": "4.3.2",
"axios": "1.6.8",
"body-parser": "1.20.2",
"cookie-parser": "^1.4.6",
"cypress-recurse": "^1.18.0",
"cypress-recurse": "^1.35.3",
"fs-extra": "11.2.0",
"gap-web-ui": "*",
"govuk-frontend": "^4.8",
"moment": "^2.29.4",
"moment-timezone": "^0.5.37",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"next": "13.5.6",
"next-logger": "3.0.1",
"next-logger": "3.0.2",
"nookies": "^2.5.2",
"number-to-words": "^1.2.4",
"pino": "^8.18.0",
"pino": "^8.20.0",
"react": "18.2.0",
"react-device-detect": "^2.1.2",
"react-device-detect": "^2.2.3",
"react-dom": "18.2.0",
"react-gtm-module": "^2.0.11",
"react-moment": "^1.1.1",
"tinymce": "6.8.2",
"react-moment": "^1.1.3",
"tinymce": "6.8.3",
"uuid": "9.0.1"
},
"devDependencies": {
"@types/cookie": "^0.5.1",
"@types/cookie-parser": "^1.4.3",
"@types/number-to-words": "^1.2.1",
"contentful-typescript-codegen": "^3.2.3",
"cypress": "^9.5.0",
"@types/cookie": "^0.6.0",
"@types/cookie-parser": "^1.4.7",
"@types/number-to-words": "^1.2.3",
"contentful-typescript-codegen": "^3.4.0",
"cypress": "^9.7.0",
"cypress-axe": "^0.14.0",
"isomorphic-fetch": "^3.0.0",
"sass": "1.62.1",
"typescript": "^4.6.3",
"sass": "1.75.0",
"typescript": "^4.9.5",
"urlpattern-polyfill": "^10.0.0"
},
"browserslist": {
Expand Down
1 change: 0 additions & 1 deletion packages/admin/src/middleware.page.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse, URLPattern } from 'next/server';
import { v4 } from 'uuid';
import { getLoginUrl, parseJwt } from './utils/general';
Expand Down
1 change: 0 additions & 1 deletion packages/admin/src/middleware.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import '@testing-library/jest-dom';
import { ResponseCookie } from 'next/dist/compiled/@edge-runtime/cookies';
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server';
import { NextURL } from 'next/dist/server/web/next-url';
import { middleware } from './middleware.page';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'moment-timezone';
import Link from 'next/link';
import Moment from 'react-moment';
import React from 'react';
import moment from 'moment';
import Link from 'next/link';
import moment from 'moment-timezone';

const PreviewSearchResultCard = ({ grant }: PreviewSearchResultCardProps) => {
const { adjustedOpenDate, adjustedCloseDate } = adjustDate(
Expand Down Expand Up @@ -113,13 +111,7 @@ const PreviewSearchResultCard = ({ grant }: PreviewSearchResultCardProps) => {
data-testid="ApplicationOpenDateValue"
>
{grant.grantApplicationOpenDate.length ? (
<Moment
format="D MMMM YYYY, h:mma"
tz="GMT"
data-testid="openDate"
>
{adjustedOpenDate}
</Moment>
<time data-testid="openDate">{adjustedOpenDate}</time>
) : (
''
)}
Expand All @@ -137,13 +129,7 @@ const PreviewSearchResultCard = ({ grant }: PreviewSearchResultCardProps) => {
data-testid="ApplicationCloseDateValue"
>
{grant.grantApplicationCloseDate.length ? (
<Moment
format="D MMMM YYYY, h:mma"
tz="GMT"
data-testid="closeDate"
>
{adjustedCloseDate}
</Moment>
<time data-testid="closeDate">{adjustedCloseDate}</time>
) : (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we preserving the formatting here? There were a couple tickets recently around this so just making sure we're not regressing that

Copy link
Contributor Author

@ConorFayleTCO ConorFayleTCO Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be, there are tests for it that I ensured were passing
newDate.tz('GMT').format('D MMMM YYYY, h:mma'); is the same formatting and timezone as was originally present, and <Moment/> is rendered as <time/> so everything should be exactly the same

''
)}
Expand Down Expand Up @@ -171,19 +157,34 @@ const parseDate = (date: string[]) => {
};

function adjustDate(openDate: string[], closeDate: string[]) {
const openDateFormatted = moment(parseDate(openDate));
const closeDateFormatted = moment(parseDate(closeDate));
const openDateMoment = moment(parseDate(openDate));
const closeDateMoment = moment(parseDate(closeDate));

const adjustedOpenDate = moment.utc(openDateFormatted).startOf('day');
const adjustedCloseDate = moment.utc(closeDateFormatted).startOf('day');
const openDateMidnight = moment.utc(openDateMoment).startOf('day');
const closeDateMidnight = moment.utc(closeDateMoment).startOf('day');

const adjustForMidnightAndFormat = (
date: moment.Moment,
midnight: moment.Moment,
isOpeningDate: boolean
) => {
const newDate = midnight.isSame(moment.utc(date))
? midnight.add(isOpeningDate ? 1 : -1, 'minute')
: moment.utc(date);
return newDate.tz('GMT').format('D MMMM YYYY, h:mma');
};

return {
adjustedOpenDate: adjustedOpenDate.isSame(moment.utc(openDateFormatted))
? adjustedOpenDate.add(1, 'minute')
: moment.utc(openDateFormatted),
adjustedCloseDate: adjustedCloseDate.isSame(moment.utc(closeDateFormatted))
? adjustedCloseDate.subtract(1, 'minute')
: moment.utc(closeDateFormatted),
adjustedOpenDate: adjustForMidnightAndFormat(
openDateMoment,
openDateMidnight,
true
),
adjustedCloseDate: adjustForMidnightAndFormat(
closeDateMoment,
closeDateMidnight,
false
),
};
}

Expand Down
1 change: 0 additions & 1 deletion packages/admin/src/utils/csrfMiddleware/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server';
import {
createSecret,
Expand Down
1 change: 0 additions & 1 deletion packages/admin/src/utils/csrfMiddleware/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @next/next/no-server-import-in-page
import type { NextRequest } from 'next/server';

export type TokenValueFunction = {
Expand Down
1 change: 0 additions & 1 deletion packages/admin/src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server';
import { GetServerSidePropsContext, NextApiRequest } from 'next';
import pino from 'pino';
Expand Down
54 changes: 27 additions & 27 deletions packages/applicant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,52 +13,52 @@
"contentful-typescript-codegen": "contentful-typescript-codegen --output @types/generated/contentful.d.ts"
},
"dependencies": {
"@aws-crypto/client-node": "3.2.0",
"@aws-sdk/client-secrets-manager": "^3.554.0",
"@aws-crypto/client-node": "3.2.2",
"@aws-sdk/client-secrets-manager": "^3.556.0",
"@aws-sdk/credential-providers": "^3.556.0",
"@contentful/rich-text-from-markdown": "15.16.6",
"@contentful/rich-text-react-renderer": "^15.11.1",
"@contentful/rich-text-from-markdown": "15.16.15",
"@contentful/rich-text-react-renderer": "^15.19.6",
"axios": "^0.27.2",
"body-parser": "1.20.2",
"cookie": "^0.5.0",
"cookie": "^0.6.0",
"cookie-parser": "^1.4.6",
"cypress-recurse": "^1.18.0",
"dotenv": "^16.0.0",
"cypress-recurse": "^1.35.3",
"dotenv": "^16.4.5",
"form-data": "^4.0.0",
"formidable": "2.1.0",
"formidable": "2.1.2",
"gap-web-ui": "*",
"govuk-frontend": "^4.8",
"imap-simple": "^5.1.0",
"mailparser": "^3.4.0",
"moment": "^2.29.4",
"moment-timezone": "^0.5.37",
"mailparser": "^3.7.0",
"moment": "^2.30.1",
"moment-timezone": "^0.5.45",
"next": "13.5.6",
"next-logger": "^3.0.1",
"nodemailer": "^6.7.3",
"next-logger": "^3.0.2",
"nodemailer": "^6.9.13",
"nookies": "^2.5.2",
"pino": "8.18.0",
"pino": "8.20.0",
"react": "18.2.0",
"react-device-detect": "^2.1.2",
"react-device-detect": "^2.2.3",
"react-dom": "18.2.0",
"react-gtm-module": "^2.0.11",
"react-moment": "^1.1.1",
"react-moment": "^1.1.3",
"uuid": "9.0.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.4",
"@types/cookie": "^0.5.1",
"@types/cookie-parser": "^1.4.3",
"axios-mock-adapter": "^1.21.1",
"contentful-typescript-codegen": "^3.2.3",
"cypress": "^9.5.0",
"@testing-library/jest-dom": "^6.4.2",
"@types/cookie": "^0.6.0",
"@types/cookie-parser": "^1.4.7",
"axios-mock-adapter": "^1.22.0",
"contentful-typescript-codegen": "^3.4.0",
"cypress": "^9.7.0",
"cypress-axe": "^0.14.0",
"cypress-postgres": "^1.1.1",
"eslint": "8.42.0",
"eslint-config-next": "12.0.7",
"eslint-config-prettier": "^8.5.0",
"eslint": "8.57.0",
"eslint-config-next": "12.3.4",
"eslint-config-prettier": "^8.10.0",
"isomorphic-fetch": "3.0.0",
"sass": "1.62.1",
"typescript": "^4.6.3",
"sass": "1.75.0",
"typescript": "^4.9.5",
"urlpattern-polyfill": "9.0.0"
},
"browserslist": {
Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/middleware.page.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cookieParser from 'cookie-parser';
import { v4 } from 'uuid';
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse, URLPattern } from 'next/server';
import { verifyToken } from './services/JwtService';
import { csrfMiddleware } from './utils/csrfMiddleware';
Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/middleware.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { middleware, buildMiddlewareResponse } from './middleware.page';
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest } from 'next/server';
import { verifyToken } from './services/JwtService';
import { NextURL } from 'next/dist/server/web/next-url';
Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/utils/csrfMiddleware/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server';
import {
getTokenFromRequest,
Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/utils/csrfMiddleware/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line @next/next/no-server-import-in-page
import type { NextRequest } from 'next/server';

export type TokenValueFunction = {
Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/utils/jwt.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { IncomingMessage } from 'http';
import { NextApiRequest } from 'next';
import { axiosConfig, getJwtFromCookies } from './jwt';
// eslint-disable-next-line @next/next/no-server-import-in-page
import cookieParser from 'cookie-parser';
import { NextApiRequestCookies } from 'next/dist/server/api-utils';

Expand Down
1 change: 0 additions & 1 deletion packages/applicant/src/utils/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
// eslint-disable-next-line @next/next/no-server-import-in-page
import { NextRequest, NextResponse } from 'next/server';
import { GetServerSidePropsContext, NextApiRequest } from 'next';
import pino from 'pino';
Expand Down
Loading
Loading