Skip to content

Commit

Permalink
upgrading packages for security (#1472)
Browse files Browse the repository at this point in the history
* updated jest and eslint for semver upgrade

* formatting fixes
  • Loading branch information
quantum-grit authored Jul 10, 2023
1 parent 078b08f commit 759c925
Show file tree
Hide file tree
Showing 8 changed files with 2,654 additions and 2,846 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions public/locales/bg/breadcrumb.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"campaigns": "Кампании",
"news": "Всички новини"
}
"campaigns": "Кампании",
"news": "Всички новини"
}
70 changes: 35 additions & 35 deletions public/locales/bg/news.json
Original file line number Diff line number Diff line change
@@ -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": "Новината беше успешно изтрита"
}
}
}
"select-campaign": "Изберете кампания",
"source-link": {
"label": "Линк към източник",
"field-description": "Това поле е нужно само, в случай че статията е взета от друг източник.\nОставете празно ако вие сте автора на статията."
},
"actions": {
"header": "Действия",
"no-access": "Нямате достъп до това действие\nСвържете се с координатора на кампанията",
"deleted-successfully": "Новината беше успешно изтрита"
}
}
}
6 changes: 3 additions & 3 deletions public/locales/en/breadcrumb.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"campaigns": "Campaigns",
"news": "All news"
}
"campaigns": "Campaigns",
"news": "All news"
}
66 changes: 33 additions & 33 deletions public/locales/en/news.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
"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"
}
}
}
114 changes: 57 additions & 57 deletions src/components/client/campaigns/CampaignProgress.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<StyledGrid className={classes.donationProgress} container>
<Grid item xs={12}>
<BorderLinearProgress
variant="determinate"
value={percentage > 100 ? 100 : percentage}
aria-labelledby={`campaign-${campaignId}--donations-progressbar`}
classes={{
root: classes.root,
bar: classes.bar,
}}
/>
</Grid>
</StyledGrid>
)
}
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 (
<StyledGrid className={classes.donationProgress} container>
<Grid item xs={12}>
<BorderLinearProgress
variant="determinate"
value={percentage > 100 ? 100 : percentage}
aria-labelledby={`campaign-${campaignId}--donations-progressbar`}
classes={{
root: classes.root,
bar: classes.bar,
}}
/>
</Grid>
</StyledGrid>
)
}
Loading

0 comments on commit 759c925

Please sign in to comment.