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

1430: Extend card add params #1803

Merged
merged 18 commits into from
Dec 2, 2024
Merged

1430: Extend card add params #1803

merged 18 commits into from
Dec 2, 2024

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Nov 27, 2024

Short description

As a user i want the forms in the self service portal to be prefilled with my personal information if i click "Karte verlängern" with an existing card

Note

I'm not super happy with this solution, but since we can not generate proper functions from the frontend/build-configs/index to the buildConfig.dart to provide a function for each project to generate the applicationUrl with (or without) queryParams i didn't find a better solution.

I mean we could maybe adjust the build config generation to be able to generate functions with parameters but this means lots of effort.

At least this solution avoids multiple linting ignore that would be needed if we provide a query param key object instead of single string values that can be null. Feel free to suggest a better solution but beware that you should run the buildConfig for all the projects to ensure that nothing breaks.

Proposed changes

  • pass query params keys to the app, ensure that they are the same as in administration
  • provide a function that return the applicationUrl with queryParams
  • open the self service portal with queryParams if a card exists
  • add tests
  • workaround for Fix more actions button not properly displayed #1802

Side effects

  • may create a wrong applicationUrl for other projects. so open "Beantragen" for other projects

Testing

  • Create a card for koblenz that is less than 90 days valid from now
  • Activate this card
  • Change the end date in "UserEntitlements" to a later date (or in the csv file and reimport the csv)
  • Click on the "Karte verlängern" Button or go to more actions and extend the card there
  • All form fields should be prefilled with valid information
  • Note: I also tested "Umlaute and dots" and everything worked fine. Please also test that properly

Resolved issues

partially fixes: #1430

@f1sh1918 f1sh1918 marked this pull request as ready for review November 27, 2024 13:18
Base automatically changed from 1430-extend-card to main November 28, 2024 09:38
Copy link
Member

@ztefanie ztefanie left a comment

Choose a reason for hiding this comment

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

Tried to test this, the query params are set correctly, but the fields are not prefilled for me.

image

the url is: localhost:3000/erstellen?Name=Stefanie+Test&Geburtsdatum=10.06.2003&Referenznummer=123K

frontend/build-configs/types.ts Outdated Show resolved Hide resolved
frontend/build-configs/constants/index.ts Show resolved Hide resolved
@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Nov 28, 2024

Tried to test this, the query params are set correctly, but the fields are not prefilled for me.

image

the url is: localhost:3000/erstellen?Name=Stefanie+Test&Geburtsdatum=10.06.2003&Referenznummer=123K

Interesting I tested this on ios and worked fine even this shouldn't be related to this pr.
Will test this again (and on android)

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Dec 2, 2024

@ztefanie
i can not reproduce it on android. even dunno why inapp browser is opening maybe this is the issue

Bildschirmfoto 2024-12-02 um 11 53 21

@f1sh1918 f1sh1918 requested a review from ztefanie December 2, 2024 10:54
frontend/build-configs/bayern/index.ts Outdated Show resolved Hide resolved
frontend/lib/util/get_application_url.dart Outdated Show resolved Hide resolved
frontend/lib/util/get_application_url.dart Outdated Show resolved Hide resolved
frontend/lib/util/get_application_url.dart Outdated Show resolved Hide resolved
Comment on lines 15 to 21
String getApplicationUrlWithParameters(
String applicationUrl,
CardInfo cardInfo,
String projectId,
String? applicationUrlQueryKeyName,
String? applicationUrlQueryKeyBirthday,
String? applicationUrlQueryKeyReferenceNumber) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
String getApplicationUrlWithParameters(
String applicationUrl,
CardInfo cardInfo,
String projectId,
String? applicationUrlQueryKeyName,
String? applicationUrlQueryKeyBirthday,
String? applicationUrlQueryKeyReferenceNumber) {
String getApplicationUrlWithParameters(BuildContext context, CardInfo cardInfo) {
final applicationUrl = getApplicationUrl(context);
final projectId = buildConfig.projectId.production;
final applicationUrlQueryKeyName = buildConfig.applicationUrlQueryKeyName;
final applicationUrlQueryKeyBirthday = buildConfig.applicationUrlQueryKeyBirthday;
final applicationUrlQueryKeyReferenceNumber = buildConfig.applicationUrlQueryKeyReferenceNumber;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if i change that, we need some linting ignores for null checks, since these values don't exist for all projects

frontend/build-configs/types.ts Outdated Show resolved Hide resolved
@seluianova
Copy link
Contributor

seluianova commented Dec 2, 2024

Tried to test this, the query params are set correctly, but the fields are not prefilled for me.

it seems I have the same issue on the current branch.
but on main it works if I apply this: #1806
this particular fix is probably not related, but I think we can try to merge it and update the current branch... 🤔

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Dec 2, 2024

Tried to test this, the query params are set correctly, but the fields are not prefilled for me.

it seems I have the same issue on the current branch. but on main it works if I apply this: #1806 this particular fix is probably not related, but I think we can try to merge it and update the current branch... 🤔

ok i will merge recent main when you pr was merged

Copy link
Member

@ztefanie ztefanie left a comment

Choose a reason for hiding this comment

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

Not tested again.

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

I had to run yarn tsc --build once to get administration to pick up the changes in frontend/build-configs. Tested on firefox, works as expected! Thanks for putting time into this, seems like quite a nasty thing...

@f1sh1918 f1sh1918 force-pushed the 1430-extend-card-add-params branch from 30a205f to 5c1d8b5 Compare December 2, 2024 14:42
@seluianova
Copy link
Contributor

seluianova commented Dec 2, 2024

Just added a couple of optional nit-picks, because overall it looks good 👍
But I'm concerned about the following:

ok i will merge recent main when you pr was merged

The form is still not being filled out for me 🤔
Even if I open the link with params in the desktop browser, the form is not filled out, so it doesn't seem to be related to the app or emulator.
It works on main for me, but doesn't work on the current branch...
Especially strange if it's only reproduced for me and Steffi...

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Dec 2, 2024

Just added a couple of optional nit-picks, because overall it looks good 👍 But I'm concerned about the following:

ok i will merge recent main when you pr was merged

The form is still not being filled out for me 🤔 Even if I open the link with params in the desktop browser, the form is not filled out, so it doesn't seem to be related to the app or emulator. It works on main for me, but doesn't work on the current branch... Especially strange if it's only reproduced for me and Steffi...

Did you run npm i on root folder? Because i set the queryParam keys in frontend buildConfig and only if you run node modules installation these new keys can be found in administration module.
Maybe thats the issue. I tested the queryParam init on all browser (chrome, firefox, safari)

image

@seluianova
Copy link
Contributor

Did you run npm i on root folder?

Ah, no I haven't. I will be available tomorrow only from 2 pm, so feel free to merge if you want to deploy it earlier, I basically tested everything except that. I believe it should be good to go.

@f1sh1918 f1sh1918 merged commit 014ef5d into main Dec 2, 2024
2 checks passed
@f1sh1918 f1sh1918 deleted the 1430-extend-card-add-params branch December 2, 2024 22:24
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.

Extend card
4 participants