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

feat: checkboxes for campaign application organizer step (Epic #1842) #1866

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
6121132
feat: add remark in the stepper
teodorazhelyazkova Jun 22, 2024
9d3bddb
add translations for step one
teodorazhelyazkova Jun 23, 2024
2e891a8
refactor action buttons styles
teodorazhelyazkova Jun 23, 2024
3093849
create CampaignApplicationOrganizer component
teodorazhelyazkova Jun 23, 2024
619d528
edit CampaignApplicationOrganizer
teodorazhelyazkova Jun 23, 2024
a852547
add yup validation to campaign application organizer form
teodorazhelyazkova Jun 24, 2024
989c839
fix styles to be responsive
teodorazhelyazkova Jun 24, 2024
eaa166f
Merge branch 'master' into epic-1842-campaign-application-organizer-step
teodorazhelyazkova Jun 24, 2024
6c29886
fix: adjust spacing between fields and buttons to be the same
teodorazhelyazkova Jun 24, 2024
7e486e8
Merge branch 'master' into epic-1842-campaign-application-organizer-step
teodorazhelyazkova Jun 24, 2024
ae4ddb3
refactor organizer step form according to endpoint schema
teodorazhelyazkova Jun 24, 2024
53abcde
refactor action buttons styles
teodorazhelyazkova Jun 25, 2024
c037f6f
add checkboxes for accepting general terms and gdpr
teodorazhelyazkova Jun 25, 2024
2a1b447
rename checkbox values correctly
teodorazhelyazkova Jun 25, 2024
a27de46
remove not used import
teodorazhelyazkova Jun 25, 2024
c4041ab
Merge branch 'master' into epic-1842-checkboxes-for-campaign-applicat…
teodorazhelyazkova Jun 26, 2024
102dfcc
Merge branch 'master' into epic-1842-checkboxes-for-campaign-applicat…
teodorazhelyazkova Jun 26, 2024
ac74311
Merge branch 'master' into epic-1842-checkboxes-for-campaign-applicat…
teodorazhelyazkova Jul 1, 2024
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
3 changes: 2 additions & 1 deletion public/locales/bg/campaign-application.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"title": "Организатор",
"name": "Вашите име и фамилия",
"phone": "Телефон за връзка",
"email": "Email"
"email": "Email",
"transparencyTerms": "Потвърждавам, че кампанията отговаря на основните принципи за публикуване на платформата: да е законна, да е морална, да не е с бизнес насоченост."
}
},
"cta": {
Expand Down
2 changes: 1 addition & 1 deletion public/locales/bg/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"agree-with": "Съгласявам се с",
"informed-agree-with": "Запознат съм и се съгласявам с",
"terms-and-conditions": "общите условия",
"gdpr": "политиката за защита на личните данни.",
"gdpr": "политиката за защита на личните данни",
"newsletter": "Моля дайте своето съгласие",
"legal-entity": "Юридическо лице",
"unique-field-violation": "Полето `{1}` със тази стойност вече съществува в платформата.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const initialValues: CampaignApplicationFormData = {
name: '',
phone: '',
email: '',
acceptTermsAndConditions: false,
transparencyTermsAccepted: false,
personalInformationProcessingAccepted: false,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function CampaignApplicationFormActions({
const { t } = useTranslation('campaign-application')

return (
<Root container item xs={12} spacing={6} justifyContent="space-between">
<Root container item xs={12} spacing={6} sx={{ marginTop: 1 }} justifyContent="space-between">
<Grid item xs={12} md={6} flexWrap="nowrap">
{activeStep === 0 ? (
<ActionLinkButton
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Person } from 'gql/person'

export type Step = {
title: string
component: JSX.Element
Expand All @@ -16,6 +14,9 @@ export type CampaignApplicationOrganizer = {
name: string
phone: string
email: string
acceptTermsAndConditions: boolean
transparencyTermsAccepted: boolean
personalInformationProcessingAccepted: boolean
}

export type CampaignApplicationFormData = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { useTranslation } from 'next-i18next'

import { Grid } from '@mui/material'
import { FormControl, Grid, Typography } from '@mui/material'

import CheckboxField from 'components/common/form/CheckboxField'
import AcceptTermsField from 'components/common/form/AcceptTermsField'
import AcceptPrivacyPolicyField from 'components/common/form/AcceptPrivacyPolicyField'

import { StyledStepHeading, StyledFormTextField } from '../helpers/campaignApplication.styled'

Expand All @@ -13,7 +17,7 @@ export default function CampaignApplicationOrganizer() {
<StyledStepHeading variant="h4">{t('steps.organizer.title')}</StyledStepHeading>
</Grid>
<Grid item container spacing={6} justifyContent="space-between" direction="row">
<Grid item xs={12} flexWrap="nowrap">
<Grid item xs={12}>
<StyledFormTextField
label={t('steps.organizer.name')}
type="text"
Expand All @@ -23,15 +27,15 @@ export default function CampaignApplicationOrganizer() {
</Grid>
</Grid>
<Grid item container spacing={6} justifyContent="space-between" direction="row">
<Grid container item xs={12} md={6} flexWrap="nowrap">
<Grid container item xs={12} md={6}>
<StyledFormTextField
label={t('steps.organizer.phone')}
type="phone"
name="organizer.phone"
autoComplete="tel"
/>
</Grid>
<Grid container item xs={12} md={6} flexWrap="nowrap">
<Grid container item xs={12} md={6}>
<StyledFormTextField
label={t('steps.organizer.email')}
type="email"
Expand All @@ -40,6 +44,24 @@ export default function CampaignApplicationOrganizer() {
/>
</Grid>
</Grid>
<Grid item container spacing={2}>
<Grid item container xs={12}>
<AcceptTermsField name="organizer.acceptTermsAndConditions" />
</Grid>
<Grid item container xs={12}>
<FormControl component="fieldset">
<CheckboxField
name="organizer.transparencyTermsAccepted"
label={
<Typography variant="body2">{t('steps.organizer.transparencyTerms')}</Typography>
}
/>
</FormControl>
</Grid>
<Grid item container xs={12}>
<AcceptPrivacyPolicyField name="organizer.personalInformationProcessingAccepted" />
</Grid>
</Grid>
</Grid>
)
}
Loading