Skip to content

Commit

Permalink
Rename needs_funds_for_travel to need_funds_for_travel
Browse files Browse the repository at this point in the history
  • Loading branch information
estyxx committed Nov 24, 2024
1 parent c854d3d commit 694dcd1
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 40 deletions.
8 changes: 4 additions & 4 deletions backend/api/grants/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _GrantErrors:
python_usage: list[str] = strawberry.field(default_factory=list)
community_contribution: list[str] = strawberry.field(default_factory=list)
been_to_other_events: list[str] = strawberry.field(default_factory=list)
needs_funds_for_travel: list[str] = strawberry.field(default_factory=list)
need_funds_for_travel: list[str] = strawberry.field(default_factory=list)
need_visa: list[str] = strawberry.field(default_factory=list)
need_accommodation: list[str] = strawberry.field(default_factory=list)
why: list[str] = strawberry.field(default_factory=list)
Expand Down Expand Up @@ -110,7 +110,7 @@ class SendGrantInput(BaseGrantInput):
python_usage: str
been_to_other_events: str
community_contribution: str
needs_funds_for_travel: bool
need_funds_for_travel: bool
need_visa: bool
need_accommodation: bool
why: str
Expand Down Expand Up @@ -147,7 +147,7 @@ class UpdateGrantInput(BaseGrantInput):
python_usage: str
been_to_other_events: str
community_contribution: str
needs_funds_for_travel: bool
need_funds_for_travel: bool
need_visa: bool
need_accommodation: bool
why: str
Expand Down Expand Up @@ -225,7 +225,7 @@ def send_grant(self, info: Info, input: SendGrantInput) -> SendGrantResult:
"python_usage": input.python_usage,
"been_to_other_events": input.been_to_other_events,
"community_contribution": input.community_contribution,
"needs_funds_for_travel": input.needs_funds_for_travel,
"need_funds_for_travel": input.need_funds_for_travel,
"need_visa": input.need_visa,
"need_accommodation": input.need_accommodation,
"why": input.why,
Expand Down
4 changes: 2 additions & 2 deletions backend/api/grants/tests/test_send_grant.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _send_grant(client, conference, conference_code=None, **kwargs):
validationPythonUsage: pythonUsage
validationCommunityContribution: communityContribution
validationBeenToOtherEvents: beenToOtherEvents
validationNeedsFundsForTravel: needsFundsForTravel
validationneedFundsForTravel: needFundsForTravel
validationNeedVisa: needVisa
validationNeedAccommodation: needAccommodation
validationWhy: why
Expand Down Expand Up @@ -62,7 +62,7 @@ def _send_grant(client, conference, conference_code=None, **kwargs):
"pythonUsage": grant.python_usage,
"communityContribution": grant.community_contribution,
"beenToOtherEvents": grant.been_to_other_events,
"needsFundsForTravel": grant.needs_funds_for_travel,
"needFundsForTravel": grant.need_funds_for_travel,
"needVisa": grant.need_visa,
"needAccommodation": grant.need_accommodation,
"why": grant.why,
Expand Down
6 changes: 3 additions & 3 deletions backend/api/grants/tests/test_update_grant.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _update_grant(graphql_client, grant, **kwargs):
validationPythonUsage: pythonUsage
validationCommunityContribution: communityContribution
validationBeenToOtherEvents: beenToOtherEvents
validationNeedsFundsForTravel: needsFundsForTravel
validationneedFundsForTravel: needFundsForTravel
validationNeedVisa: needVisa
validationNeedAccommodation: needAccommodation
validationWhy: why
Expand Down Expand Up @@ -60,7 +60,7 @@ def _update_grant(graphql_client, grant, **kwargs):
"pythonUsage": grant.python_usage,
"communityContribution": grant.community_contribution,
"beenToOtherEvents": grant.been_to_other_events,
"needsFundsForTravel": grant.needs_funds_for_travel,
"needFundsForTravel": grant.need_funds_for_travel,
"needVisa": grant.need_visa,
"needAccommodation": grant.need_accommodation,
"why": grant.why,
Expand Down Expand Up @@ -104,7 +104,7 @@ def test_update_grant(graphql_client, user):
pythonUsage="random",
communityContribution="Soft toys meetups",
beenToOtherEvents="no",
needsFundsForTravel=True,
needFundsForTravel=True,
needVisa=True,
needAccommodation=True,
why="why not",
Expand Down
4 changes: 2 additions & 2 deletions backend/api/grants/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Grant:
python_usage: str
community_contribution: str
been_to_other_events: str
needs_funds_for_travel: bool
need_funds_for_travel: bool
need_visa: bool
need_accommodation: bool
why: str
Expand Down Expand Up @@ -57,7 +57,7 @@ def from_model(cls, grant: GrantModel) -> Grant:
python_usage=grant.python_usage,
community_contribution=grant.community_contribution,
been_to_other_events=grant.been_to_other_events,
needs_funds_for_travel=grant.needs_funds_for_travel,
need_funds_for_travel=grant.need_funds_for_travel,
need_visa=grant.need_visa,
need_accommodation=grant.need_accommodation,
why=grant.why,
Expand Down
8 changes: 4 additions & 4 deletions backend/grants/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"grant_type",
"python_usage",
"been_to_other_events",
"needs_funds_for_travel",
"need_funds_for_travel",
"why",
"notes",
"travelling_from",
Expand Down Expand Up @@ -372,7 +372,7 @@ class Meta:
"grant_type",
"python_usage",
"been_to_other_events",
"needs_funds_for_travel",
"need_funds_for_travel",
"why",
"notes",
"travelling_from",
Expand Down Expand Up @@ -445,7 +445,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
"country_type",
"occupation",
"approved_type",
"needs_funds_for_travel",
"need_funds_for_travel",
"need_visa",
"need_accommodation",
IsProposedSpeakerFilter,
Expand Down Expand Up @@ -511,7 +511,7 @@ class GrantAdmin(ExportMixin, ConferencePermissionMixin, admin.ModelAdmin):
{
"fields": (
"grant_type",
"needs_funds_for_travel",
"need_funds_for_travel",
"need_visa",
"need_accommodation",
"travelling_from",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 5.1.1 on 2024-11-24 20:46

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0021_remove_grant_interested_in_volunteering'),
]

operations = [
migrations.RemoveField(
model_name='grant',
name='needs_funds_for_travel',
),
migrations.AddField(
model_name='grant',
name='need_funds_for_travel',
field=models.BooleanField(default=False, verbose_name='Needs funds for travel'),
),
]
4 changes: 3 additions & 1 deletion backend/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ class ApprovedType(models.TextChoices):
null=True,
choices=[(country.code, country.name) for country in countries],
)
needs_funds_for_travel = models.BooleanField(_("Needs funds for travel"))
need_funds_for_travel = models.BooleanField(
_("Needs funds for travel"), default=False
)
need_visa = models.BooleanField(_("Need visa/invitation letter?"), default=False)
need_accommodation = models.BooleanField(_("Need accommodation"), default=False)

Expand Down
2 changes: 1 addition & 1 deletion backend/grants/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Meta:
python_usage = factory.Faker("text")
been_to_other_events = factory.Faker("text")

needs_funds_for_travel = factory.Faker("boolean")
need_funds_for_travel = factory.Faker("boolean")
why = factory.Faker("text")
notes = factory.Faker("text")
travelling_from = factory.fuzzy.FuzzyChoice([country.code for country in countries])
Expand Down
2 changes: 1 addition & 1 deletion backend/reviews/templates/grant-review.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h2>Grant</h2>

<div class="review-row">
<strong>Needs funds for travel</strong>
<div>{{grant.needs_funds_for_travel|yesno}}</div>
<div>{{grant.need_funds_for_travel|yesno}}</div>
</div>

<div class="review-row">
Expand Down
4 changes: 2 additions & 2 deletions backend/reviews/templates/grants-recap.html
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ <h3>
<li>VISA</li>
{% endif %} {% if item.need_accommodation %}
<li>Accommodation</li>
{% endif %} {% if item.needs_funds_for_travel %}
{% endif %} {% if item.need_funds_for_travel %}
<li>Funds for Travel</li>
{% endif %} {% if not item.need_visa and not item.need_accommodation and not item.needs_funds_for_travel %}
{% endif %} {% if not item.need_visa and not item.need_accommodation and not item.need_funds_for_travel %}
<li>Ticket only</li>
{% endif %}
</ul>
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/grant-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export type GrantFormFields = ParticipantFormFields & {
pythonUsage: string;
communityContribution: string;
beenToOtherEvents: string;
needsFundsForTravel: string;
needFundsForTravel: string;
needVisa: string;
needAccommodation: string;
why: string;
Expand Down Expand Up @@ -190,8 +190,8 @@ export const GrantForm = ({
formState.setField("communityContribution", grant.communityContribution);
formState.setField("beenToOtherEvents", grant.beenToOtherEvents);
formState.setField(
"needsFundsForTravel",
grant.needsFundsForTravel.toString(),
"needFundsForTravel",
grant.needFundsForTravel.toString(),
);
formState.setField("needVisa", grant.needVisa.toString());
formState.setField(
Expand Down Expand Up @@ -242,7 +242,7 @@ export const GrantForm = ({
beenToOtherEvents: formState.values.beenToOtherEvents,
notes: formState.values.notes,
grantType: formState.values.grantType,
needsFundsForTravel: formState.values.needsFundsForTravel === "true",
needFundsForTravel: formState.values.needFundsForTravel === "true",
why: formState.values.why,
travellingFrom: formState.values.travellingFrom,
occupation: formState.values.occupation,
Expand Down Expand Up @@ -475,13 +475,13 @@ export const GrantForm = ({

<InputWrapper
title={
<FormattedMessage id="grants.form.fields.needsFundsForTravel" />
<FormattedMessage id="grants.form.fields.needFundsForTravel" />
}
description={
<FormattedMessage id="grants.form.fields.needsFundsForTravel.description" />
<FormattedMessage id="grants.form.fields.needFundsForTravel.description" />
}
>
<Select {...select("needsFundsForTravel")}>
<Select {...select("needFundsForTravel")}>
<FormattedMessage id="global.no">
{(msg) => <option value="false">{msg}</option>}
</FormattedMessage>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/grant-form/submit-grant.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mutation SendGrant($input: SendGrantInput!) {
validationPythonUsage: pythonUsage
validationCommunityContribution: communityContribution
validationBeenToOtherEvents: beenToOtherEvents
validationNeedsFundsForTravel: needsFundsForTravel
validationneedFundsForTravel: needFundsForTravel
validationNeedVisa: needVisa
validationNeedAccommodation: needAccommodation
validationWhy: why
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const MyGrant = ({ grant, deadline }: Props) => {
<Sidebar
status={grant.status}
grantType={grant.grantType}
needsFundsForTravel={grant.needsFundsForTravel}
needFundsForTravel={grant.needFundsForTravel}
needAccommodation={grant.needAccommodation}
/>
{deadline?.status === DeadlineStatus.HappeningNow && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ query MyProfileWithGrant($conference: String!) {
applicantReplyDeadline

needVisa
needsFundsForTravel
needFundsForTravel
needAccommodation
grantType
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { FormattedMessage } from "react-intl";
type Props = {
status: GrantStatus;
grantType: GrantType;
needsFundsForTravel: boolean;
needFundsForTravel: boolean;
needAccommodation: boolean;
};

export const Sidebar = ({
status,
grantType,
needsFundsForTravel,
needFundsForTravel,
needAccommodation,
}: Props) => {
return (
Expand All @@ -43,7 +43,7 @@ export const Sidebar = ({
<VerticalStack gap="small">
<FormattedMessage id="profile.myGrant.appliedFor.ticket" />

{needsFundsForTravel && (
{needFundsForTravel && (
<Text size="label2" weight="strong">
<FormattedMessage id="profile.myGrant.appliedFor.travel" />
</Text>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,9 @@ We look forward to reading about you and hope to see you at PyCon Italia 2024!
"grants.form.fields.travellingFrom": "Where are you travelling from?",
"grants.form.fields.travellingFrom.description":
"Please indicate the city and country you will be travelling from to attend the conference.",
"grants.form.fields.needsFundsForTravel":
"grants.form.fields.needFundsForTravel":
"Do you need financial aid for travelling to PyCon Italia?",
"grants.form.fields.needsFundsForTravel.description":
"grants.form.fields.needFundsForTravel.description":
"We don’t have many funds but we will try to help as many people as we can, ask for this help only if absolutely needed!",
"grants.form.fields.needVisa":
"Do you require an invitation letter for a visa application?",
Expand Down Expand Up @@ -1454,9 +1454,9 @@ Non vediamo l'ora di leggere la tua storia e speriamo di vederti a PyCon Italia
"grants.form.fields.travellingFrom": "Da dove partirai?",
"grants.form.fields.travellingFrom.description":
"Indica la città e il paese da cui partirai per partecipare alla conferenza.",
"grants.form.fields.needsFundsForTravel":
"grants.form.fields.needFundsForTravel":
"Hai bisogno di aiuti finanziari per le spese di viaggio a Pycon Italia?",
"grants.form.fields.needsFundsForTravel.description":
"grants.form.fields.needFundsForTravel.description":
"I fondi a nostra disposizione sono limitati, ma faremo il possibile per aiutare tutti i richiedenti. Richiedi questo aiuto solo se ti è strettamente necessario!",
"grants.form.fields.needVisa":
"Hai bisogno di una lettera d'invito per la domanda di visto?",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/grants/edit/my-grant.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ query MyGrant($conference: String!) {
pythonUsage
communityContribution
beenToOtherEvents
needsFundsForTravel
needFundsForTravel
needVisa
needAccommodation
why
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/grants/edit/update-grant.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mutation UpdateGrant($input: UpdateGrantInput!) {
pythonUsage
communityContribution
beenToOtherEvents
needsFundsForTravel
needFundsForTravel
needVisa
notes
travellingFrom
Expand All @@ -31,7 +31,7 @@ mutation UpdateGrant($input: UpdateGrantInput!) {
validationPythonUsage: pythonUsage
validationCommunityContribution: communityContribution
validationBeenToOtherEvents: beenToOtherEvents
validationNeedsFundsForTravel: needsFundsForTravel
validationneedFundsForTravel: needFundsForTravel
validationNeedVisa: needVisa
validationNeedAccommodation: needAccommodation
validationWhy: why
Expand Down

0 comments on commit 694dcd1

Please sign in to comment.