From 138cd3aae711a1fbeb5ee747cbeba0114302d36f Mon Sep 17 00:00:00 2001 From: quantum-grit <91589884+quantum-grit@users.noreply.github.com> Date: Mon, 10 Jul 2023 08:12:42 +0300 Subject: [PATCH] upgrading packages for security (#1472) * updated jest and eslint for semver upgrade * formatting fixes --- package.json | 19 +- public/locales/bg/breadcrumb.json | 6 +- public/locales/bg/news.json | 70 +- public/locales/en/breadcrumb.json | 6 +- public/locales/en/news.json | 66 +- .../client/campaigns/CampaignProgress.tsx | 114 +- .../terms-of-service/TermsOfServicePage.tsx | 34 +- yarn.lock | 5185 ++++++++--------- 8 files changed, 2654 insertions(+), 2846 deletions(-) diff --git a/package.json b/package.json index 782df16bc..462c00d0b 100644 --- a/package.json +++ b/package.json @@ -89,18 +89,19 @@ "@types/tryghost__content-api": "^1.3.11", "@types/uuid": "^9.0.0", "@types/yup": "0.29.11", - "@typescript-eslint/eslint-plugin": "4.26.0", - "@typescript-eslint/parser": "4.26.0", + "@typescript-eslint/eslint-plugin": "^5.61.0", + "@typescript-eslint/parser": "^5.61.0", "all-contributors-cli": "^6.20.0", "depcheck": "^1.4.3", - "eslint": "7.27.0", - "eslint-config-next": "^11.0.1", - "eslint-config-prettier": "8.3.0", - "eslint-plugin-prettier": "3.4.0", - "eslint-plugin-react": "7.24.0", - "eslint-plugin-react-hooks": "^4.2.0", + "eslint": "^8.44.0", + "eslint-config-next": "^13.4.9", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "^7.32.2", + "eslint-plugin-react-hooks": "^4.6.0", "husky": "7.0.1", - "jest": "^27.3.1", + "jest": "^29.6.1", + "jest-environment-jsdom": "^29.6.1", "lint-staged": "11.0.0", "next-sitemap": "^3.1.52", "prettier": "2.3.0", diff --git a/public/locales/bg/breadcrumb.json b/public/locales/bg/breadcrumb.json index 8630eac2a..b2d7af4ae 100644 --- a/public/locales/bg/breadcrumb.json +++ b/public/locales/bg/breadcrumb.json @@ -1,4 +1,4 @@ { - "campaigns": "Кампании", - "news": "Всички новини" -} \ No newline at end of file + "campaigns": "Кампании", + "news": "Всички новини" +} diff --git a/public/locales/bg/news.json b/public/locales/bg/news.json index c73aa8f30..16b429412 100644 --- a/public/locales/bg/news.json +++ b/public/locales/bg/news.json @@ -1,37 +1,37 @@ { - "news": "Новини", - "form-heading": "Създайте нова статия", - "edit-form-heading": "Редактирайте статия", - "read-more": "Прочети повече", - "read-less": "Прочети по-малко", - "see-all-news": "Виж всички новини", - "news-not-found": "Не бяха намерени новини за тази кампания", - "write-new-article": "Напишете нова статия", - "status" : { - "draft": "Чернова", - "published": "Публикувана" + "news": "Новини", + "form-heading": "Създайте нова статия", + "edit-form-heading": "Редактирайте статия", + "read-more": "Прочети повече", + "read-less": "Прочети по-малко", + "see-all-news": "Виж всички новини", + "news-not-found": "Не бяха намерени новини за тази кампания", + "write-new-article": "Напишете нова статия", + "status": { + "draft": "Чернова", + "published": "Публикувана" + }, + "article": { + "title": "Заглавие", + "author": "Автор", + "createdAt": "Създадена на", + "publishedAt": "Публикувана на", + "lastEdit": "Последно променена", + "status": "Статут", + "slug": { + "name": "Кратко наименование на статия", + "warning": "Редактирането на това поле ще измени линка към статията и ще направи текущия невалиден", + "placeholder": "Стойността по подразбиране е същата като 'Заглавие на статия'" }, - "article": { - "title": "Заглавие", - "author": "Автор", - "createdAt": "Създадена на", - "publishedAt": "Публикувана на", - "lastEdit": "Последно променена", - "status": "Статут", - "slug": { - "name": "Кратко наименование на статия", - "warning": "Редактирането на това поле ще измени линка към статията и ще направи текущия невалиден", - "placeholder": "Стойността по подразбиране е същата като 'Заглавие на статия'" - }, - "select-campaign": "Изберете кампания", - "source-link": { - "label": "Линк към източник", - "field-description": "Това поле е нужно само, в случай че статията е взета от друг източник.\nОставете празно ако вие сте автора на статията." - }, - "actions": { - "header": "Действия", - "no-access": "Нямате достъп до това действие\nСвържете се с координатора на кампанията", - "deleted-successfully": "Новината беше успешно изтрита" - } - } -} \ No newline at end of file + "select-campaign": "Изберете кампания", + "source-link": { + "label": "Линк към източник", + "field-description": "Това поле е нужно само, в случай че статията е взета от друг източник.\nОставете празно ако вие сте автора на статията." + }, + "actions": { + "header": "Действия", + "no-access": "Нямате достъп до това действие\nСвържете се с координатора на кампанията", + "deleted-successfully": "Новината беше успешно изтрита" + } + } +} diff --git a/public/locales/en/breadcrumb.json b/public/locales/en/breadcrumb.json index 9c521ae0d..64d423022 100644 --- a/public/locales/en/breadcrumb.json +++ b/public/locales/en/breadcrumb.json @@ -1,4 +1,4 @@ { - "campaigns": "Campaigns", - "news": "All news" -} \ No newline at end of file + "campaigns": "Campaigns", + "news": "All news" +} diff --git a/public/locales/en/news.json b/public/locales/en/news.json index 5f925e8a6..e6ced436a 100644 --- a/public/locales/en/news.json +++ b/public/locales/en/news.json @@ -1,35 +1,35 @@ { - "news": "News", - "read-more": "Read more", - "read-less": "Read less", - "see-all-news": "See all news", - "news-not-found": "No news articles were found for this campaign", - "write-new-article": "Write an article", - "status" : { - "draft": "Draft", - "published": "Published" + "news": "News", + "read-more": "Read more", + "read-less": "Read less", + "see-all-news": "See all news", + "news-not-found": "No news articles were found for this campaign", + "write-new-article": "Write an article", + "status": { + "draft": "Draft", + "published": "Published" + }, + "article": { + "title": "Title", + "author": "Author", + "createdAt": "Created at", + "publishedAt": "Published at", + "lastEdit": "Last edited at", + "status": "Status", + "slug": { + "name": "Short name of the article", + "warning": "Editing this field is going to change the link to the news article, and make the current one invalid", + "placeholder": "The default value is the same as 'Article title'" }, - "article": { - "title": "Title", - "author": "Author", - "createdAt": "Created at", - "publishedAt": "Published at", - "lastEdit": "Last edited at", - "status": "Status", - "slug": { - "name": "Short name of the article", - "warning": "Editing this field is going to change the link to the news article, and make the current one invalid", - "placeholder": "The default value is the same as 'Article title'" - }, - "select-campaign": "Select campaign", - "source-link": { - "label": "Link to source", - "field-description": "This field is only necessary if the article is taken from another source.\nLeave empty if you are the author of this article" - }, - "actions": { - "header": "Actions", - "no-access": "No access to this action\nPlease contact campaign's coordinator", - "deleted-successfully": "The article was successfully deleted" - } - } -} \ No newline at end of file + "select-campaign": "Select campaign", + "source-link": { + "label": "Link to source", + "field-description": "This field is only necessary if the article is taken from another source.\nLeave empty if you are the author of this article" + }, + "actions": { + "header": "Actions", + "no-access": "No access to this action\nPlease contact campaign's coordinator", + "deleted-successfully": "The article was successfully deleted" + } + } +} diff --git a/src/components/client/campaigns/CampaignProgress.tsx b/src/components/client/campaigns/CampaignProgress.tsx index 4b863e2fd..9ef1150ea 100644 --- a/src/components/client/campaigns/CampaignProgress.tsx +++ b/src/components/client/campaigns/CampaignProgress.tsx @@ -1,57 +1,57 @@ -import React, { useMemo } from 'react' - -import { styled } from '@mui/material/styles' -import LinearProgress from '@mui/material/LinearProgress' -import { Grid } from '@mui/material' - -import { UUID } from 'gql/types' - -const PREFIX = 'CampaignProgress' - -const classes = { - root: `${PREFIX}-root`, - bar: `${PREFIX}-bar`, - donationProgress: `${PREFIX}-donationProgress`, - cardActions: `${PREFIX}-cardActions`, -} - -const StyledGrid = styled(Grid)(({ theme }) => ({ - [`&.${classes.donationProgress}`]: { - width: '100%', - '> div p': { - color: theme.palette.text.secondary, - padding: theme.spacing(1), - }, - }, - - [`& .${classes.cardActions}`]: { - padding: '0', - }, -})) - -const BorderLinearProgress = LinearProgress - -type Props = { - campaignId: UUID - raised: number - target: number -} -export default function CampaignProgress({ campaignId, raised, target }: Props) { - const percentage = useMemo(() => (raised / target) * 100, [raised, target]) - - return ( - - - 100 ? 100 : percentage} - aria-labelledby={`campaign-${campaignId}--donations-progressbar`} - classes={{ - root: classes.root, - bar: classes.bar, - }} - /> - - - ) -} +import React, { useMemo } from 'react' + +import { styled } from '@mui/material/styles' +import LinearProgress from '@mui/material/LinearProgress' +import { Grid } from '@mui/material' + +import { UUID } from 'gql/types' + +const PREFIX = 'CampaignProgress' + +const classes = { + root: `${PREFIX}-root`, + bar: `${PREFIX}-bar`, + donationProgress: `${PREFIX}-donationProgress`, + cardActions: `${PREFIX}-cardActions`, +} + +const StyledGrid = styled(Grid)(({ theme }) => ({ + [`&.${classes.donationProgress}`]: { + width: '100%', + '> div p': { + color: theme.palette.text.secondary, + padding: theme.spacing(1), + }, + }, + + [`& .${classes.cardActions}`]: { + padding: '0', + }, +})) + +const BorderLinearProgress = LinearProgress + +type Props = { + campaignId: UUID + raised: number + target: number +} +export default function CampaignProgress({ campaignId, raised, target }: Props) { + const percentage = useMemo(() => (raised / target) * 100, [raised, target]) + + return ( + + + 100 ? 100 : percentage} + aria-labelledby={`campaign-${campaignId}--donations-progressbar`} + classes={{ + root: classes.root, + bar: classes.bar, + }} + /> + + + ) +} diff --git a/src/components/client/terms-of-service/TermsOfServicePage.tsx b/src/components/client/terms-of-service/TermsOfServicePage.tsx index 4679909c0..4f9639e52 100644 --- a/src/components/client/terms-of-service/TermsOfServicePage.tsx +++ b/src/components/client/terms-of-service/TermsOfServicePage.tsx @@ -37,7 +37,7 @@ export default function AboutPage() { Употребените по-долу думи, термини и съкращения, имат следното значение: -