Skip to content

Commit

Permalink
Merge branch 'master' into upgrade_next_to_13.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-grit authored Oct 24, 2023
2 parents 276ad75 + 56293ea commit 37dad0b
Show file tree
Hide file tree
Showing 22 changed files with 201 additions and 28 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,15 @@
"contributions": [
"code"
]
},
{
"login": "RalitsaIlieva",
"name": "RalitsaIlieva",
"avatar_url": "https://avatars.githubusercontent.com/u/17964436?v=4",
"profile": "https://github.com/RalitsaIlieva",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 10,
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Watch releases of this repository to be notified about future updates:
## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-73-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-74-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Please check [contributors guide](https://github.com/podkrepi-bg/frontend/blob/master/CONTRIBUTING.md) for:
Expand Down Expand Up @@ -213,6 +213,7 @@ Thanks goes to these wonderful people:
<td align="center" valign="top" width="10%"><a href="https://github.com/yyosifov"><img src="https://avatars.githubusercontent.com/u/2012493?v=4?s=100" width="100px;" alt="yyosifov"/><br /><sub><b>yyosifov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=yyosifov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/dphilipov"><img src="https://avatars.githubusercontent.com/u/76788928?v=4?s=100" width="100px;" alt="Dimitar Filipov"/><br /><sub><b>Dimitar Filipov</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=dphilipov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/hiapetrov"><img src="https://avatars.githubusercontent.com/u/107921565?v=4?s=100" width="100px;" alt="Alexander"/><br /><sub><b>Alexander</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=hiapetrov" title="Code">💻</a></td>
<td align="center" valign="top" width="10%"><a href="https://github.com/RalitsaIlieva"><img src="https://avatars.githubusercontent.com/u/17964436?v=4?s=100" width="100px;" alt="RalitsaIlieva"/><br /><sub><b>RalitsaIlieva</b></sub></a><br /><a href="https://github.com/podkrepi-bg/frontend/commits?author=RalitsaIlieva" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Binary file added public/img/team-photos/IvayloPhilipov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/team-photos/MartaNeshova.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/team-photos/PetyaDimitrova.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/locales/bg/about-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"association-name": "Сдружение Подкрепи БГ",
"finance-report-page": {
"financeReport": "Финансови отчети за НПО Aсоциация Подкрепи.бг",
"finance-report-2021": "Финансов репорт за 2021:",
"finance-report-2022": "Финансов репорт за 2022 Януари-Юни:",
"finance-report-2021": "Финансов отчет за 2021:",
"finance-report-2022": "Финансов отчет за 2022 Януари-Юни:",
"download-from-here": "Свалете от тук"
}
}
1 change: 1 addition & 0 deletions public/locales/bg/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"alerts": {
"welcome": "Добре дошли!",
"invalid-login": "Грешен потребител / парола.",
"register-error": "Моля, попълнете необходимата информация",
"duplicate-email": "Потребител с такъв имейл вече съществува",
"re-login": "Моля, влезте отново в профила си.",
"forgotten-password-error": "Потребителя не е намерен, моля опитайте отново!",
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"alerts": {
"welcome": "Welcome!",
"invalid-login": "Wrong username / password.",
"register-error": "Please, fill in the necessary information",
"re-login": "Please login into your account.",
"forgotten-password-error": "User not found, please try again!",
"forgotten-password-success": "Please check your email!",
Expand Down
2 changes: 2 additions & 0 deletions src/common/form/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const customValidators = {
phone: () => ({ key: 'validation:phone' }),
name: () => ({ key: 'validation:invalid' }),
paymentRef: () => ({ key: 'validation:payment-reference' }),
terms: () => ({ key: 'validation:terms-of-use' }),
gdpr: () => ({ key: 'validation:terms-of-service' }),
}

setLocale({
Expand Down
17 changes: 15 additions & 2 deletions src/common/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ import {
ThemeOptions,
} from '@mui/material/styles'

import { Commissioner } from 'next/font/google'
import { Montserrat } from 'next/font/google'

export const commissioner = Commissioner({
subsets: ['latin', 'cyrillic'],
})

export const montserrat = Montserrat({
display: 'auto',
subsets: ['latin', 'cyrillic'],
Expand Down Expand Up @@ -182,8 +187,16 @@ export const themeOptions: ThemeOptions = {
},

typography: {
fontFamily: montserrat.style.fontFamily,
h3: { color: colors.blue.dark },
fontFamily: commissioner.style.fontFamily,

h1: { fontFamily: montserrat.style.fontFamily },
h2: { fontFamily: montserrat.style.fontFamily },
h3: {
color: colors.blue.dark,
fontFamily: montserrat.style.fontFamily,
},
h4: { fontFamily: montserrat.style.fontFamily },
h5: { fontFamily: montserrat.style.fontFamily },

body1: {
fontSize: '0.875rem',
Expand Down
12 changes: 12 additions & 0 deletions src/components/client/about/helpers/activeMembersData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,16 @@ export const data: TeamData[] = [
description: 'Кампании',
linkedInProfile: 'https://www.linkedin.com/in/zdravka-gornachka-3a0b3510/',
},
{
img: '/img/team-photos/PetyaDimitrova.png',
name: 'Петя Димитрова',
description: 'Маркетинг, Корпоративни дарения',
linkedInProfile: 'https://www.linkedin.com/in/petya-dimitrova-phd-59816a185/',
},
{
img: '/img/team-photos/MartaNeshova.png',
name: 'Марта Нешова',
description: 'Маркетинг, Корпоративни дарения',
linkedInProfile: 'https://www.linkedin.com/in/martaneshova/',
},
]
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,9 @@ export const data: TeamData[] = [
name: 'Александър Стоянов',
linkedInProfile: 'https://www.linkedin.com/in/alexander-stoyanov-37a98b6/',
},
{
img: '/img/team-photos/IvayloPhilipov.png',
name: 'Ивайло Филипов',
linkedInProfile: 'https://www.linkedin.com/in/phillipov',
},
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export const ТeamMemberWrapper = styled(Grid)(() => ({
flex: '1 0 30%',
},
[theme.breakpoints.up('lg')]: {
flex: '1 0 16%',
flex: '1 0 14%',
},
}))
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export const TeamMemberWrapper = styled(Grid)(() => ({
flex: '1 0 30%',
},
[theme.breakpoints.up('lg')]: {
flex: '1 0 12%',
flex: '1 0 16%',
},
}))
3 changes: 3 additions & 0 deletions src/components/client/campaigns/CampaignDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ const StyledGrid = styled(Grid)(({ theme }) => ({
paddingLeft: '0',
paddingRight: '0',
},
['& .ql-container']: {
fontFamily: theme.typography.fontFamily,
},

[`& .${classes.linkButton}`]: {
fontSize: theme.typography.pxToRem(10),
Expand Down
4 changes: 4 additions & 0 deletions src/components/client/campaigns/CampaignNewsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ const StyledTimeline = styled(Timeline)(({ theme }) => ({
fontStyle: 'normal',
padding: 0,
},

['& .ql-container']: {
fontFamily: theme.typography.fontFamily,
},
}))

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Statistics() {

const donatedMoney = fromMoney(totalDonatedMoney?.total || 0)
const unit = donatedMoney.toString().split('.')[0]
const fraction = donatedMoney.toString().split('.')[1]
const fraction = donatedMoney?.toFixed(2).toString().split('.')[1]

const sections: { value?: number; message: string }[] = [
{
Expand Down
40 changes: 36 additions & 4 deletions src/components/client/one-time-donation/RegisterDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, CircularProgress, Grid, Typography } from '@mui/material'
import { Button, CircularProgress, FormHelperText, Grid, Typography } from '@mui/material'
import React, { useContext, useState } from 'react'
import { signIn } from 'next-auth/react'
import { useTranslation } from 'next-i18next'
Expand All @@ -12,6 +12,9 @@ import { useFormikContext } from 'formik'
import { OneTimeDonation } from 'gql/donations'
import { RegisterFormData } from 'components/client/auth/register/RegisterForm'
import { StepsContext } from './helpers/stepperContext'
import AcceptPrivacyPolicyField from 'components/common/form/AcceptPrivacyPolicyField'
import AcceptTermsField from 'components/common/form/AcceptTermsField'
import AcceptNewsLetterField from 'components/common/form/AcceptNewsletterField'

export default function RegisterForm() {
const { t } = useTranslation()
Expand All @@ -28,20 +31,30 @@ export default function RegisterForm() {
confirmPassword: formik.values.confirmPassword as string,
terms: formik.values.terms as boolean,
gdpr: formik.values.gdpr as boolean,
newsletter: formik.values.newsletter as boolean,
}
const onClick = async () => {
try {
setLoading(true)

// Register in Keycloak
await register(values)

if (values.terms && values.gdpr && values.password === values.confirmPassword) {
await register(values)
} else if (!values.terms) {
throw new Error('Terms not accepted')
} else if (!values.gdpr) {
throw new Error('GDPR not accepted')
} else {
throw new Error('Confirm password doesn`t match')
}

// Authenticate
const resp = await signIn<'credentials'>('credentials', {
email: values.email,
password: values.password,
redirect: false,
})

if (resp?.error) {
throw new Error(resp.error)
}
Expand All @@ -54,7 +67,7 @@ export default function RegisterForm() {
} catch (error) {
console.error(error)
setLoading(false)
AlertStore.show(t('auth:alerts.invalid-login'), 'error')
AlertStore.show(t('auth:alerts.register-error'), 'error')
}
}

Expand Down Expand Up @@ -92,6 +105,25 @@ export default function RegisterForm() {
label="auth:account.confirm-password"
autoComplete="new-password"
/>
{formik.values.registerPassword !== formik.values.confirmPassword &&
formik.touched.confirmPassword && (
<FormHelperText sx={{ color: 'red' }}>
{t('validation:password-match')}
</FormHelperText>
)}
</Grid>
<Grid item xs={12}>
<AcceptTermsField name="terms" />
{!formik.values.terms && formik.touched.terms && (
<FormHelperText sx={{ color: 'red' }}>{t('validation:terms-of-use')}</FormHelperText>
)}
<AcceptPrivacyPolicyField name="gdpr" />
{!formik.values.gdpr && formik.touched.gdpr && (
<FormHelperText sx={{ color: 'red' }}>
{t('validation:terms-of-service')}
</FormHelperText>
)}
<AcceptNewsLetterField name="newsletter" />
</Grid>
<Grid item xs={12}>
<Button
Expand Down
4 changes: 4 additions & 0 deletions src/components/client/one-time-donation/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ const initialValues: OneTimeDonation = {
registerLastName: '',
registerFirstName: '',
registerPassword: '',
confirmPassword: '',
isRecurring: false,
terms: false,
gdpr: false,
newsletter: false,
}
interface DonationStepperProps {
onStepChange: () => void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export const validateSecond: yup.SchemaOf<SecondStep> = yup.object().defined().s
registerFirstName: yup.string().notRequired(),
registerLastName: yup.string().notRequired(),
registerPassword: password.notRequired(),
confirmPassword: yup.string().notRequired(),
terms: yup.boolean().notRequired(),
gdpr: yup.boolean().notRequired(),
newsletter: yup.boolean().notRequired(),
})

export const validateThird: yup.SchemaOf<ThirdStep> = yup.object().defined().shape({
Expand Down
4 changes: 4 additions & 0 deletions src/gql/donations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export type OneTimeDonation = {
confirmPassword?: string
terms?: boolean
gdpr?: boolean
newsletter?: boolean
}

export type DonationStep = {
Expand All @@ -162,6 +163,9 @@ export type SecondStep = {
personsLastName?: string
personsPhone?: string
personsEmail?: string
terms?: boolean
gdpr?: boolean
newsletter?: boolean
}

export type ThirdStep = {
Expand Down
Loading

0 comments on commit 37dad0b

Please sign in to comment.