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

1609: Enable store import koblenz #1655

Merged
merged 9 commits into from
Oct 14, 2024
Merged

Conversation

f1sh1918
Copy link
Contributor

@f1sh1918 f1sh1918 commented Oct 1, 2024

Short description

As a store maintainer i want to upload the csv stores for koblenz

Proposed changes

  • move storeConfig to common and use it for koblenz and nuernberg
  • add runConfig for project store manager creation for koblenz
  • add nuernberg buildConfig as a placeholder for koblenz to get correct categories
  • add TODO for getting correct buildConfig in administration. Since nuernberg and koblenz have the same categories we can use the nuernberg build config for now

Side effects

  • none

Testing

  1. Create a store manager for koblenz
  2. login as store manager
  3. Go to Akzeptanzpartner verwalten
  4. Upload stores
    Find correct store file here: https://nextcloud.tuerantuer.org/index.php/apps/files/files/6468170
    But you can also use same test files as for nuernberg

Resolved issues

Fixes: #1609

@f1sh1918 f1sh1918 force-pushed the 1609-enable-store-import-koblenz branch 2 times, most recently from 78b2915 to 8161337 Compare October 1, 2024 13:04
@f1sh1918 f1sh1918 force-pushed the 1609-enable-store-import-koblenz branch from 8161337 to fa8902f Compare October 1, 2024 13:14
@f1sh1918 f1sh1918 marked this pull request as draft October 1, 2024 13:14
@f1sh1918 f1sh1918 marked this pull request as ready for review October 2, 2024 08:12
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.

  • Please add an example csv of the store upload to /administration/resources/stores

  • Tested and is not working, when using the csv from nextcloud i get this error: Die erforderlichen Spalten sind nicht vorhanden oder nicht in der richtigen Reihenfolge.

Whenever you are sharing a nextcloud link it only opens the landing page for me. I do not have this problem when others are sharing links, i think the correct nextcloud link is:
https://nextcloud.tuerantuer.org/index.php/apps/files/files/6518906?dir=/Projects/Digitale%20Berechtigungskarte/Stadt%20Koblenz/Akzeptanzpartner&openfile=true
Not sure what you are sharing, but it seems not to work.

@f1sh1918 f1sh1918 requested a review from ztefanie October 3, 2024 10:36
@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Oct 3, 2024

I have no clue why its not working for you.
I clicked the link you shared before and everything is working fine for me.
I attached a working video @ztefanie
I guess the links are broken from nextcloud or they changed their pattern. Some time ago it was only needed to share a link until the file number but it seems not to be enough anymore

Bildschirmaufnahme.2024-10-03.um.12.35.51.mov

I added a sample file to the repository since i don't want to upload the real csv from koblenz

@ztefanie
Copy link
Member

ztefanie commented Oct 4, 2024

Tested again, works as expected 🎉

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.

Tested on firefox, works as expected

administration/src/project-configs/storeConfig.ts Outdated Show resolved Hide resolved
administration/src/project-configs/storeConfig.ts Outdated Show resolved Hide resolved
@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Oct 8, 2024

Tested again, works as expected 🎉

can you please recheck and give me an approve if its fine @ztefanie

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.

The columns width is not really good. I do not like the hard coded widths, there are nice approaches to handle this dynamically, see here: palantir/blueprint#1863 (comment)

If entering chars (not numbers) or nothing for lat/long i get the wrong error message "Keine passenden Geodaten gefunden! Bitte prüfen sie die Adresse." If the lat/long is invalid, it should either show a message with the info lat/long is wrong or directly get it, if adress is valid.

Special chars should not be allowed in categoryId section, i can input there "10%" and get no error in the ui, but a 500 is thrown when clicking "import stores"

postalcode should only allow numbers

i did not check every field, but the field definitively need checks

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Oct 9, 2024

The columns width is not really good. I do not like the hard coded widths, there are nice approaches to handle this dynamically, see here: palantir/blueprint#1863 (comment)

If entering chars (not numbers) or nothing for lat/long i get the wrong error message "Keine passenden Geodaten gefunden! Bitte prüfen sie die Adresse." If the lat/long is invalid, it should either show a message with the info lat/long is wrong or directly get it, if adress is valid.

Special chars should not be allowed in categoryId section, i can input there "10%" and get no error in the ui, but a 500 is thrown when clicking "import stores"

postalcode should only allow numbers

i did not check every field, but the field definitively need checks

Thanks for testing!

  1. Dynamic column width is not part of this pr and therefore a new issue can be created. Your provided code snippet needs some additional code and adjustments to work, feel free to implement this is in a separate pr.
  2. i added a check if coordinates are not empty but not valid coordinates to show an error. If there are no coordinates you have to check that your location is a correct address which is not the case for the csv file in the resources. Empty coords with a valid address should result in getting coordinates from endpoint
  3. i added a regex check.
  4. I also added a check even if we allow varchars in database since a postalCode could also include characters (in other countries)

@f1sh1918 f1sh1918 requested a review from ztefanie October 9, 2024 10:08
…ort-koblenz

# Conflicts:
#	administration/src/project-configs/bayern/config.ts
#	administration/src/project-configs/getProjectConfig.ts
#	administration/src/project-configs/koblenz/config.ts
#	administration/src/project-configs/nuernberg/config.ts
#	administration/src/project-configs/showcase/config.ts
#	administration/src/util/getBuildConfig.ts
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 really happy with only a frontend check, but as this is an endpoint only for logged in users, I think it is oke, but still bad practice.

@f1sh1918
Copy link
Contributor Author

f1sh1918 commented Oct 14, 2024

Not really happy with only a frontend check, but as this is an endpoint only for logged in users, I think it is oke, but still bad practice.

there is an open issue for that and this functionality will not be served to end users for now. So everything is addressed

…ort-koblenz

# Conflicts:
#	administration/src/bp-modules/stores/StoresCSVInput.tsx
#	administration/src/bp-modules/stores/StoresImportController.tsx
#	administration/src/bp-modules/stores/__tests__/StoresCSVInput.test.tsx
#	administration/src/project-configs/helper/storeFieldValidation.ts
@f1sh1918 f1sh1918 merged commit 1b2c852 into main Oct 14, 2024
1 check passed
@f1sh1918 f1sh1918 deleted the 1609-enable-store-import-koblenz branch October 14, 2024 08:15
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.

Enable store import for koblenz
3 participants