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

3121: Possibility to have several contacts in a POI #3138

Merged
merged 10 commits into from
Mar 11, 2025

Conversation

LeandraH
Copy link
Contributor

@LeandraH LeandraH commented Mar 4, 2025

Short Description

With the contact management system, the CMS now gives municipalities the option to add several contacts to a single POI. This PR implements that behavior also in the app.

Proposed Changes

  • Changed the POI model to have a contacts field, and removed the fields email, phone, and website
  • Pulled the Contact Collapsible into a separate component (well, two, one in native and one in web)
  • Mapped over the contacts to show all of them

Side Effects

  • It's not a side effect but I couldn't leave this awful mix of empty lines and no empty lines in the DatabaseConnector and the types.

Testing

Test against the Test CMS! These changes aren't live yet!
In native and web, go to a POI with some contacts (e.g. http://localhost:9000/testumgebung/de/locations/herkules) and see several contacts

Resolved Issues

Fixes: #3121


LeandraH added 4 commits March 4, 2025 11:55
Copy link
Contributor

@lunars97 lunars97 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR! Looks really nice 🚀 Tested on Chrome and Android Emulator.

@f1sh1918
Copy link
Contributor

f1sh1918 commented Mar 6, 2025

@LeandraH
can you give me a hint how to maintain the contact data in the cms :)
I'm wondering a bit that we don't have any mandatory fields for contact? Does this really make sense?

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Left some comments. but need more testing instructions for proper review :)

@steffenkleinle
Copy link
Member

Perhaps you could also add some tests here? Thanks :)

@LeandraH
Copy link
Contributor Author

LeandraH commented Mar 6, 2025

@LeandraH can you give me a hint how to maintain the contact data in the cms :)

You can create contacts here. They need to be assigned to a POI, and they can be used in the categories via "Einfügen". Does that answer your question? 😅

I'm wondering a bit that we don't have any mandatory fields for contact? Does this really make sense?

image According to the CMS, at least one of the fields has to be filled in, but there isn't a single mandatory one.

LeandraH added 2 commits March 6, 2025 16:44
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 and android, works mostly as expected. On native, the url to book an appointment is missing e.g. on this poi: https://webnext.integreat.app/testumgebung/de/locations/rathaus-augsburg
However, this might not be due to your PR

Comment on lines 143 to 149
type ContactJsonType = {
name: string | null
area_of_responsibility: string | null
email: string | null
phone_number: string | null
website: string | null
}
Copy link
Member

Choose a reason for hiding this comment

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

💭 We are very inconsistent with camelCase vs pascal_case atm... Not something introduced in this issue though. I think we should decide on something at some point, not sure if migrating existing keys is necessary though. Personally I'd prefer camelCase since we have some linting rules in place to prevent other naming styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aren't the pascal_cases just what we get from the CMS?

Copy link
Member

@steffenkleinle steffenkleinle Mar 11, 2025

Choose a reason for hiding this comment

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

This is code written by us to save things to the offline database, so it does not really have anything to do with things we get from the CMS. I mean, its the same data, but we can name it in any way we want.

return this._website
}

get headline(): string | null {
Copy link
Member

Choose a reason for hiding this comment

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

🙃 I'd prefer naming by functionality instead of usage. How about nameWithResponsibility or nameWithTitle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think in this case, it's useful to know why we are making an entire method for a specific combination of strings, so I prefer saying what it is used for here :)

@LeandraH
Copy link
Contributor Author

On native, the url to book an appointment is missing e.g. on this poi: https://webnext.integreat.app/testumgebung/de/locations/rathaus-augsburg However, this might not be due to your PR

That happens on the production app too, I opened the ticket that has just been linked :)

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.

Not tested again

@LeandraH LeandraH enabled auto-merge March 11, 2025 10:37
@LeandraH LeandraH merged commit 5c4ba72 into main Mar 11, 2025
6 checks passed
@LeandraH LeandraH deleted the 3121-several-contacts-in-pois branch March 11, 2025 10:42
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.

Display all contact details related to a POI delivered via the API
4 participants