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

Upgrade packages #785

Merged
merged 16 commits into from
Oct 16, 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
83 changes: 39 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,52 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@chakra-ui/anatomy": "^2.1.2",
"@chakra-ui/icons": "^2.0.19",
"@chakra-ui/react": "^2.7.1",
"@chakra-ui/anatomy": "^2.3.4",
"@chakra-ui/icons": "^2.2.4",
"@chakra-ui/react": "~2.8.2",
"@emailjs/browser": "^4.1.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/address": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@lexical/code": "^0.13.1",
"@lexical/link": "^0.13.1",
"@lexical/list": "^0.13.1",
"@lexical/markdown": "^0.13.1",
"@lexical/overflow": "^0.13.1",
"@lexical/react": "^0.13.1",
"@lexical/rich-text": "^0.13.1",
"@lexical/selection": "^0.13.1",
"@lexical/utils": "^0.13.1",
"@lexical/code": "^0.18.0",
"@lexical/link": "^0.18.0",
"@lexical/list": "^0.18.0",
"@lexical/markdown": "^0.18.0",
"@lexical/overflow": "^0.18.0",
"@lexical/react": "^0.18.0",
"@lexical/rich-text": "^0.18.0",
"@lexical/selection": "^0.18.0",
"@lexical/utils": "^0.18.0",
"@rainbow-me/rainbowkit": "^1.1.3",
"@stripe/react-stripe-js": "^2.7.0",
"@stripe/stripe-js": "^3.3.0",
"@tanstack/react-query": "^5.37.1",
"@vocdoni/chakra-components": "^0.9.6",
"@vocdoni/rainbowkit-wallets": "^0.2.2",
"@vocdoni/sdk": "~0.9.0",
"chakra-react-select": "^4.6.0",
"date-fns": "^2.30.0",
"@vocdoni/sdk": "~0.9.1",
"chakra-react-select": "^5.0.1",
"date-fns": "^4.1.0",
"framer-motion": "^10.12.18",
"i18next": "^23.2.11",
"i18next-browser-languagedetector": "^7.2.0",
"latinize": "^0.5.0",
"lexical": "^0.13.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"i18next": "^23.16.0",
"i18next-browser-languagedetector": "^8.0.0",
"lexical": "^0.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.9",
"react-hook-form": "^7.45.1",
"react-i18next": "^13.0.1",
"react-icons": "^4.10.1",
"react-i18next": "^15.0.3",
"react-icons": "^5.3.0",
"react-markdown": "^8.0.7",
"react-player": "^2.14.1",
"react-router-dom": "^6.14.1",
"react-player": "^2.16.0",
"react-router-dom": "^6.27.0",
"remark-gfm": "^3.0.1",
"viem": "^1.16.6",
"vocdoni-admin-sdk": "^0.0.2",
"wagmi": "^1.4.5",
"web-vitals": "^3.3.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz"
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
},
"engines": {
"npm": "please use yarn",
Expand Down Expand Up @@ -80,29 +79,25 @@
]
},
"devDependencies": {
"@rollup/plugin-alias": "^5.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/jest": "^29.5.2",
"@types/latinize": "^0.2.15",
"@rollup/plugin-alias": "^5.1.1",
"@types/jest": "^29.5.13",
"@types/node": "^18.16.19",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react": "^4.0.3",
"i18next-parser": "^8.3.0",
"prettier": "^2.8.8",
"ts-deepmerge": "^6.2.0",
"typescript": "^5.0.2",
"@vitejs/plugin-react": "^4.3.2",
"i18next-parser": "^9.0.2",
"prettier": "^3.3.3",
"ts-deepmerge": "^7.0.1",
"typescript": "^5.6.3",
"vite": "^4.4.4",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.2.1"
},
"packageManager": "[email protected]",
"resolutions": {
"i18next": "^23.2.11",
"@vocdoni/sdk": "~0.9.0"
"i18next": "^23.16.0",
"@vocdoni/sdk": "~0.9.1"
}
}
4 changes: 2 additions & 2 deletions src/components/Editor/plugins/ToolbarPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ export default function ToolbarPlugin({ setIsLinkEditMode }: { setIsLinkEditMode
$isElementNode(matchingParent)
? matchingParent.getFormatType()
: $isElementNode(node)
? node.getFormatType()
: parent?.getFormatType() || 'left'
? node.getFormatType()
: parent?.getFormatType() || 'left'
)
}
}, [activeEditor])
Expand Down
5 changes: 4 additions & 1 deletion src/components/Editor/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ i.chevron-down {
z-index: 5;
display: block;
position: absolute;
box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
box-shadow:
0 12px 28px 0 rgba(0, 0, 0, 0.2),
0 2px 4px 0 rgba(0, 0, 0, 0.1),
inset 0 0 0 1px rgba(255, 255, 255, 0.5);
border-radius: 8px;
min-width: 100px;
min-height: 40px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export class SpreadsheetManager {
public workBook: WorkBook | undefined
public errors: number[] = []

constructor(public file: File, protected headed: boolean = false) {
constructor(
public file: File,
protected headed: boolean = false
) {
this.reader = new FileReader()
this.heading = []
this.filedata = [[]]
Expand Down
5 changes: 4 additions & 1 deletion src/components/ProcessCreate/Census/Spreadsheet/generator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
type DataType = string | number

export class CsvGenerator {
constructor(private headers: string[], private data: DataType[][]) {}
constructor(
private headers: string[],
private data: DataType[][]
) {}

public get url(): string {
let binaryData = 'data:application/csv,'
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProcessCreate/Steps/Confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ const electionFromForm = (form: StepsFormValues) => {
title: { default: q.option },
value: i,
})),
} as IQuestion)
}) as IQuestion
),
startDate: form.electionType.autoStart ? undefined : new Date(form.startDate).getTime(),
endDate: new Date(form.endDate).getTime(),
Expand Down
4 changes: 2 additions & 2 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends object | undefined
? RecursivePartial<T[P]>
: T[P]
? RecursivePartial<T[P]>
: T[P]
}
4 changes: 1 addition & 3 deletions src/i18n/locales/ca.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"{title}": "{title}",
"aside": {
"has_already_voted": "El teu vot s'ha registrat correctament",
"is_not_in_census": "No estàs en el cens",
Expand Down Expand Up @@ -885,8 +884,7 @@
"description": "Selecciona el tipus de votació per a aquesta elecció. Si no trobes el que necessites, pots contactar-nos.",
"title": "Tipus de Votació"
}
},
"tabcard_title": "{title}"
}
},
"rainbow": {
"group": {
Expand Down
4 changes: 1 addition & 3 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"{title}": "{title}",
"aside": {
"has_already_voted": "Your vote is properly cast",
"is_not_in_census": "You are not in the census",
Expand Down Expand Up @@ -873,8 +872,7 @@
"description": "Select the voting type for this election. If you don't find what you need can contact us.",
"title": "Voting Types"
}
},
"tabcard_title": "{title}"
}
},
"rainbow": {
"group": {
Expand Down
4 changes: 1 addition & 3 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"{title}": "{title}",
"aside": {
"has_already_voted": "Tu voto ha sido registrado correctamente",
"is_not_in_census": "No estás en el censo",
Expand Down Expand Up @@ -885,8 +884,7 @@
"description": "Selecciona el tipo de votación para esta elección. Si no encuentras lo que necesitas, puedes contactarnos.",
"title": "Tipos de Votación"
}
},
"tabcard_title": "{title}"
}
},
"rainbow": {
"group": {
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import en from './en.json'
import es from './es.json'

// no need to import english here, since it's date-fns default language
import { default as dca } from 'date-fns/locale/ca'
import { default as des } from 'date-fns/locale/es'
import { ca as dca } from 'date-fns/locale/ca'
import { es as des } from 'date-fns/locale/es'

export const translations: { [key: string]: any } = {
ca,
Expand Down
12 changes: 0 additions & 12 deletions src/test-utils.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions src/themes/onvote/components/Home/Voting.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Card, CardBody, CardFooter, Flex, Icon, Text } from '@chakra-ui/react'
import { Card, CardBody, CardFooter, Flex, Text } from '@chakra-ui/react'
import { useTranslation } from 'react-i18next'
import { BsArrowUpRight, BsStars } from 'react-icons/bs'
import { TbDiscountCheckFilled } from 'react-icons/tb'

const VotingTypesBanner = ({ app = 'Vocdoni App' }: { app?: string }) => {
const { t } = useTranslation()
return (
<Flex className='voting-type' maxW={'1250px'}>
<Card variant='types-voting'>
<CardBody>
<Icon as={TbDiscountCheckFilled} />
<Text>{t('banner_voting_types.anonymous_title')}</Text>
</CardBody>
<CardFooter>
Expand All @@ -18,7 +15,6 @@ const VotingTypesBanner = ({ app = 'Vocdoni App' }: { app?: string }) => {
</Card>
<Card variant='types-voting'>
<CardBody>
<Icon as={BsStars} />
<Text>{t('banner_voting_types.token_title')}</Text>
</CardBody>
<CardFooter>
Expand All @@ -27,7 +23,6 @@ const VotingTypesBanner = ({ app = 'Vocdoni App' }: { app?: string }) => {
</Card>
<Card variant='types-voting'>
<CardBody>
<Icon as={BsArrowUpRight} />
<Text>{t('banner_voting_types.flexible_title')}</Text>
</CardBody>
<CardFooter>
Expand Down
10 changes: 0 additions & 10 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ const viteconfig = ({ mode }) => {
if (!vocdoniEnvironment) {
vocdoniEnvironment = 'stg'
}
let stripePublicKey = process.env.STRIPE_PUBLIC_KEY
if (!stripePublicKey || stripePublicKey.length == 0) {
if (vocdoniEnvironment == 'dev') {
stripePublicKey =
'pk_test_51P6vaOI1T5UnHYElxQ2aqpc7DZET6spnYww8ItU7rOv94OTHlGzvh4fK3Z5HVTGT2KmGLnDCcUnvBUjODYiL61W600XBPAnoZZ'
} else if (vocdoniEnvironment == 'stg') {
stripePublicKey =
'pk_test_51PNuOtDW6VLep8WG8WFS7KZocugbzYbkuNn94WAxuGZUa1maPK7kv5BnEPN3x5bXLaCYhHRkBmmGJVVvcDkbbnbS00V4LExTPD'
}
}

const outDir = process.env.BUILD_PATH
const base = process.env.BASE_URL || '/'
Expand Down
2 changes: 1 addition & 1 deletion vite/features.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import merge from 'ts-deepmerge'
import { merge } from 'ts-deepmerge'
import ValidLanguages from '../src/i18n/languages.mjs'

// Define constants for valid values
Expand Down
Loading
Loading