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

Package updates 2 #3807

Open
wants to merge 8 commits into
base: production
Choose a base branch
from
Open
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,838 changes: 833 additions & 1,005 deletions client/package-lock.json

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"version": "0.1.0",
"private": true,
"overrides": {
"react-refresh": "0.11.0"
"react-refresh": "0.11.0"
},
"engines": {
"node": "22.x",
"npm":"10.x"
"npm": "10.x"
},
"dependencies": {
"@emotion/react": "^11.13.5",
"@emotion/styled": "^11.13.5",
"@sentry/browser": "^7.120.0",
"@sentry/react": "^7.120.0",
"@sentry/browser": "^8.47.0",
"@sentry/react": "^8.47.0",
"@sentry/tracing": "^7.17.4",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
Expand All @@ -22,8 +22,8 @@
"axios": "^1.7.8",
"eslint-config-react-app": "^7.0.1",
"google-libphonenumber": "^3.2.31",
"i18next": "^22.0.6",
"i18next-browser-languagedetector": "^7.0.1",
"i18next": "^24.2.0",
"i18next-browser-languagedetector": "^8.0.2",
"moment": "^2.30.1",
"react": "^18.3.1",
"react-beautiful-dnd": "^13.1.1",
Expand All @@ -32,11 +32,10 @@
"react-dom": "^18.3.1",
"react-ga4": "^2.1.0",
"react-helmet": "^6.1.0",
"react-i18next": "^12.0.0",
"react-responsive": "^9.0.0",
"react-i18next": "^15.4.0",
"react-responsive": "^10.0.0",
"react-router-dom": "^6.4.3",
"react-scripts": "^5.0.1",
"video.js": "^7.20.3",
"web-vitals": "^3.0.4"
},
"scripts": {
Expand Down Expand Up @@ -115,7 +114,7 @@
"ts-jest": "^29.0.3",
"typescript": "^4.8.4",
"webpack": "^5.96.1",
"yup": "^0.32.11"
"yup": "^1.6.1"
},
"proxy": "http://localhost:8080/"
}
3 changes: 1 addition & 2 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import App from './App';
import reportWebVitals from './reportWebVitals';
import * as Sentry from '@sentry/react';
import ReactGA from 'react-ga4';
import { BrowserTracing } from '@sentry/tracing';
import './i18n';

import ErrorBoundary from './ErrorBoundary';
Expand All @@ -13,7 +12,7 @@ if (process.env.NODE_ENV === 'production') {
// SENTRY
Sentry.init({
dsn: process.env.REACT_APP_SENTRY_DSN,
integrations: [new BrowserTracing()],
integrations: [browserTracingIntegration()],
tracesSampleRate: 0.5,
});

Expand Down
71 changes: 53 additions & 18 deletions client/src/validation/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ export const goalsArrayAtLeastOne = array()

export const biography = string().when('useMeanBio', {
is: false,
then: requiredText,
otherwise: optionalText,
then: (schema) =>
schema
.typeError(errMsgs.DEFAULT_REQUIRED)
.required(errMsgs.DEFAULT_REQUIRED),
otherwise: (schema) => schema.typeError(errMsgs.DEFAULT_REQUIRED).nullable(),
});

export const optionalCheckbox = boolean()
Expand All @@ -174,12 +177,13 @@ export const optionalCheckbox = boolean()

export const videoLink = string().when('video', {
is: (v) => v.name && v.key && v.url,
then: optionalText,
otherwise: string()
.matches(URLregex, {
message: errMsgs.INVALID_LINK,
})
.required(errMsgs.DEFAULT_REQUIRED),
then: (schema) => schema.typeError(errMsgs.DEFAULT_REQUIRED).nullable(),
otherwise: (schema) =>
schema
.matches(URLregex, {
message: errMsgs.INVALID_LINK,
})
.required(errMsgs.DEFAULT_REQUIRED),
});

export const numberField = number()
Expand All @@ -188,8 +192,11 @@ export const numberField = number()

export const optionalRate = number().when('noDemos', {
is: true,
then: number().nullable(),
otherwise: numberField,
then: (schema) => schema.nullable(),
otherwise: (schema) =>
schema
.typeError(errMsgs.DEFAULT_REQUIRED)
.required(errMsgs.DEFAULT_REQUIRED),
});

export const textMax300Required = string()
Expand All @@ -199,10 +206,27 @@ export const textMax300Required = string()

// step form

// export const optionalPhoneNumber = string().when((value, schema) => {
// if (value) {
// return schema.phone();
// }
// return schema.nullable();
// });

export const linkOrPhone = string().when('type', {
is: whereDoYouNeedToGoTypes.PHONE,
then: optionalPhoneNumber,
otherwise: urlOptional,
then: (schema) =>
schema.when((value, schema) => {
if (value) {
return schema.phone();
}
return schema.nullable();
}),
otherwise: (schema) =>
schema.matches(URLregex, {
message: errMsgs.INVALID_LINK,
excludeEmptyString: true,
}),
});

export const whereDoYouNeedToGo = object().shape({
Expand All @@ -219,6 +243,7 @@ export const thingsContent = array().of(
tips: array().of(string().nullable()).nullable(),
})
);

export const contactLinks = array()
.of(
object().shape({
Expand All @@ -227,18 +252,28 @@ export const contactLinks = array()
description: requiredText,
link: string().when('type', {
is: (v) => v === 'WEBCHAT_LINK',
then: urlRequired,
otherwise: string().nullable(),
then: (schema) =>
schema
.matches(URLregex, {
message: errMsgs.INVALID_LINK,
})
.required(errMsgs.DEFAULT_REQUIRED),
otherwise: (schema) => schema.nullable(),
}),
phoneNumber: string().when('type', {
is: (v) => v === 'PHONE',
then: string().phone().required(errMsgs.DEFAULT_REQUIRED),
otherwise: string().optionalPhone(),
then: (schema) => schema.phone().required(errMsgs.DEFAULT_REQUIRED),
otherwise: (schema) => schema.optionalPhone(),
}),
email: string().when('type', {
is: (v) => v === 'EMAIL',
then: email,
otherwise: string().nullable(),
then: (schema) =>
schema
.email(errMsgs.INVALID_EMAIL)
.max(100, errMsgs.TOO_LONG_MAX_100)
.required(errMsgs.DEFAULT_REQUIRED)
.typeError(errMsgs.DEFAULT_REQUIRED),
otherwise: (schema) => schema.nullable(),
}),
})
)
Expand Down
Loading