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

1843: Missing application labels #1855

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Jan 8, 2025

Short description

Some application labels were not resolved properly

Proposed changes

  • rename i18n keys according to how they will stored in the database to be able to resolve them properly,
  • adjust these keys in the form states where they will be set
  • fix key of goldenCardHonoredByMinisterPresidentEntitlement,
  • consider parents for resolving keys for attachments,
  • fix wrong label (Typo in the online application form- Bavaria #1852)

Side effects

  • Maybe some attachment labels may be affected so please check all labels of an application card properly

Testing

  1. Create applications with the different requirements, all possible for the blue card and all possible for the golden card
  2. Open the application list and check if all application labels were resolved correctly, due to the de.json, there were some keys like certificate resolved wrong because the parents wasn't used

Resolved issues

Fixes: #1843
Fixes: #1852

…ByMinisterPresidentEntitlement, consider parents for resolving keys for attachments, fix wrong label
Copy link
Member

@michael-markl michael-markl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The architecture of these translations keys seems quite fragile to me...

I haven't checked if you caught every translation key. I also did not test anything.

"juleicaNumber": "Kartennummer",
"juleicaExpiration": "Karte gültig bis",
"copyOfJuleicaFront": "Kopie der Karte (1)",
"copyOfJuleicaBack": "Kopie der Karte (2)",
"blueCardWorkAtOrganizationsEntitlement": "Ich engagiere mich ehrenamtlich seit mindestens zwei Jahren freiwillig mindestens fünf Stunden pro Woche oder bei Projektarbeiten mindestens 250 Stunden jährlich",
"goldenCardWorkAtOrganizationsEntitlement": "Ich bin seit mindestens 25 Jahren mindestens 5 Stunden pro Woche oder 250 Stunden pro Jahr bei einem Verein oder einer Organisation ehrenamtlich tätig",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also unsure why these strings are duplicated (once here and once in goldenCardEntitlementType.WorkAtOrganizations)

Copy link
Contributor Author

@f1sh1918 f1sh1918 Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the keys were stored like that in the database (example)
I believe this happens in the GoldenCardEntitlement.kt
If i change this structure i would also have to replace the keys in jsonField in the production database via migration or sth :/

{
          "name": "goldenCardHonoredByMinisterPresidentEntitlement",
          "type": "Array",
          "value": [
            {
              "name": "certificate",
              "type": "Attachment",
              "value": {
                "fileIndex": 0
              }
            }
          ]
        },

i don't see any other way now to resolve the other structure.
If you have any idea let me known @michael-markl

But i May delete some duplicates if I change the keys in the form that write it in the form state

Copy link
Contributor Author

@f1sh1918 f1sh1918 Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Okay i adjusted the keys that were used for the state (these keys will also be stored like that in the database, so we can properly resolve it again)
Removed the duplicates in the de.json

@f1sh1918 f1sh1918 force-pushed the 1843-missing-application-labels branch from fa961e2 to 55f5d48 Compare January 9, 2025 09:47
@f1sh1918 f1sh1918 requested a review from michael-markl January 9, 2025 09:48
@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Jan 9, 2025

@seluianova and @bahaaTuffaha this pr needs really proper testing, since we will have bad issues with wrong i18n keys in the database, if there is a mess.
So i suggest to create all types of applications /golden and blue with all possible requirements options before checking out this pr.
Then checkout this branch and create all types of applications again to check if old applications work and new applications (resolve all i18n labels)

If you have any questions don't hesitate to ask me

].includes(jsonField.name)
? `${jsonField.name}.title`
: jsonField.name

const children = jsonField.value.map((jsonFieldIt, index: number) => (
<JsonFieldView
jsonField={jsonFieldIt}
parentName={['organizationContact', 'organization'].includes(jsonField.name) ? jsonField.name : undefined}
parentName={
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since these keys are objects we need also the parent to resolve them properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typo in the online application form- Bavaria Label/Translation missing in Bavarian Volunteer Card
2 participants