-
Notifications
You must be signed in to change notification settings - Fork 72
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
Display alternative place names #566
base: main
Are you sure you want to change the base?
Display alternative place names #566
Conversation
src/components/GrampsjsObject.js
Outdated
@@ -59,6 +60,11 @@ const _allTabs = { | |||
('placeref_list' in data && data?.backlinks?.place?.length >= 0), | |||
conditionEdit: data => 'placeref_list' in data, | |||
}, | |||
placeNames: { | |||
title: 'Alternate Names', | |||
condition: data => data.alt_names?.length > 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably it doesn't matter in practice, but since this function is also called for objects that are not places and thus don't have an alt_names
property, I find it clearer to add the ?.
also in front of alt_names
Hi, thanks for taking this on! Can you add the language as well? The main issue I see is with date formatting - unfortunately we don't have a proper way in Javascript to represent all of the complexity of Gramps' date formatting, and just using I'm afraid the only proper solution would be to add the formatted date to the place profile in the backend first, here: https://github.com/gramps-project/gramps-web-api/blob/master/gramps_webapi/api/resources/util.py#L362 A more radical alternate solution would be to add a new date formatting endpoint in the API where the frontend can post a date object and it returns a string... |
I added the 'Alternate Names' string to strings.js and can see the value translated correctly. Is anything else required?
I'm happy to add the formatted date to the place profile backend. I can see |
Perfect, let me know if you need guidance. |
Thanks @DavidMStraub I've been busy since last week but hope to still make the changes to the api. I was struggling a little to get the tests to run on my local machine (mac). I'll give it another go over the weekend |
The backend development docs haven't been updated in a while, if anything doesn't work as expected when setting up the dev environment, feel free to open an issue about it. |
Converted to draft as we first need to finish gramps-project/gramps-web-api#608. |
This is my first contribution and an attempt to solve issue: #27
I have decided to only tackle displaying alternative place names and not implementing edit functionality. This will be added in a future PR.
Any feedback or suggestions welcome
Screenshots
Place view when alternative name is present





Alternative name Tab when alternative name is present
Alternative name Tab when alternative name is present and in edit mode
Place view when alternative name is not present
Place view when alternative name is not present and in edit mode