gramps-web icon indicating copy to clipboard operation
gramps-web copied to clipboard

Improve names edit handling (fixes #123) (fixes #149)

Open BlitzundBogen opened this issue 11 months ago • 6 comments

Added some fixes and improvements in names' edit handling.

Fixes:

  • name-type not selected
  • fix show-more feature

Features:

  • add sort to surname
  • add delete to name and surname

UX/UI improvements:

  • use editable list for names
  • add name edit form validation
  • improve name-type vs. custom-type handling
  • some minor styling

Fixes:

  • https://github.com/gramps-project/gramps-web/issues/149
  • https://github.com/gramps-project/gramps-web/issues/123

BlitzundBogen avatar Mar 15 '24 04:03 BlitzundBogen

Great, thanks! Let me know when it's ready for review.

One comment: please don't modify the langugage JSONs, they are updated via Weblate. Unfortunately changing the english string is only possible by adding a new one (unless I'm mistaken).

DavidMStraub avatar Mar 15 '24 07:03 DavidMStraub

Great, thanks! Let me know when it's ready for review.

One comment: please don't modify the langugage JSONs, they are updated via Weblate. Unfortunately changing the english string is only possible by adding a new one (unless I'm mistaken).

I was also unsure about the language jsons. I will change it.

Generally I am not a JavaScript crack at all, so I am really happy for feedback for improvements. 😄 Also I have still issues getting the test locally to run. I guess after fixing this, I might be review ready. I let you know when I am ready.

BlitzundBogen avatar Mar 15 '24 15:03 BlitzundBogen

Also I have still issues getting the test locally to run. I guess after fixing this, I might be review ready. I let you know when I am ready.

Unfortunately there are no unit tests for this repo as I'm not good with Javascript unit tests :slightly_frowning_face: . Are you referring to the Web API (Python) tests?

DavidMStraub avatar Mar 15 '24 16:03 DavidMStraub

I couldn't resist to already add a couple of comments. The code looks really good overall!

DavidMStraub avatar Mar 16 '24 08:03 DavidMStraub

Also I have still issues getting the test locally to run. I guess after fixing this, I might be review ready. I let you know when I am ready.

Unfortunately there are no unit tests for this repo as I'm not good with Javascript unit tests 🙁 . Are you referring to the Web API (Python) tests?

I haven't really gotten into this by now. I just thought there were some, because there is this "test"-script in the package.json. But okay, then I will ignore this. Maybe I can add some someday 😄

BlitzundBogen avatar Mar 21 '24 17:03 BlitzundBogen

Great, thanks! Let me know when it's ready for review.

One comment: please don't modify the langugage JSONs, they are updated via Weblate. Unfortunately changing the english string is only possible by adding a new one (unless I'm mistaken).

I am still not quite sure how to introduce new strings. I found the strings.js, but those translations seem to come from the backend. I saw in one commit a string added to the en.json? So this seems to be the way to go!?!

Or does Weblate identifies them inside the code? (I doubt it. 😄 )

BlitzundBogen avatar Mar 21 '24 18:03 BlitzundBogen

Yes, just add new strings to en.json.

DavidMStraub avatar Mar 25 '24 20:03 DavidMStraub

I tried out your code, great work! It brings the whole name editing experience to a new level. Just two small things:

  • The only feature that's still missing is changing the primary name. That would be relatively simple to implement I guess using e.g. a "star" button. Up to you if you want to add it, we can always add it later
  • I was confused by the presence of the delete and up/down buttons if the name details are not expanded yet, because they have no effect/meaning:

image

Can you hide them?

DavidMStraub avatar Mar 25 '24 20:03 DavidMStraub

I tried out your code, great work! It brings the whole name editing experience to a new level. Just two small things:

* The only feature that's still missing is changing the primary name. That would be relatively simple to implement I guess using e.g. a "star" button. Up to you if you want to add it, we can always add it later

* I was confused by the presence of the delete and up/down buttons if the name details are not expanded yet, because they have no effect/meaning:

Can you hide them?

Thanks a lot! And yes!

1.I wanted to add changing the primary name. Thanks for the hint. Just forgot it last week. 😄 2. You are right. I will hide the editing options until the details are shown. When you have more names in the list, it's not so bad. But I definitely see the point.

BlitzundBogen avatar Mar 27 '24 19:03 BlitzundBogen

Hi @BlitzundBogen should we merge it as is right now or two you want to implement the two points above? However there is a conflict right now.

DavidMStraub avatar Apr 15 '24 16:04 DavidMStraub

Hi @BlitzundBogen should we merge it as is right now or two you want to implement the two points above? However there is a conflict right now.

I am sorry, I didn't have the time to improve. I will try to at least solve the conflicts this week. If I do not find the time I will definitely find it the week after. Then I could also do the improvements.

BlitzundBogen avatar Apr 21 '24 19:04 BlitzundBogen

I had some issues with my dev environment again, which took me some time to solve. For now only the order of names/changing primary name is missing. I would suggest, if you are ready to merge, just do it and I will open a new PR for this issue. If I am faster, i will add it here. But currently I doubt that. 😄

PS: David, what happened to you profile? I cannot find you anymore. 😱

BlitzundBogen avatar May 14 '24 10:05 BlitzundBogen

I am a big fan of these changes, thank you for taking care. Looking forward to do thorough testing and giving feedback. (I have no dev setup yet, so I will have to wait until the release. Is there documentation for a proper dev setup?)

m-breitbach avatar Jun 14 '24 06:06 m-breitbach

Is there documentation for a proper dev setup

Not sure about the "proper" :wink: but here is the documentation: https://www.grampsweb.org/dev-frontend/setup/

DavidMStraub avatar Jun 14 '24 06:06 DavidMStraub

PS: David, what happened to you profile? I cannot find you anymore. 😱

Yes, Github (or its AI) suspended my account (in error) and it took them one month to process my appeal :sob:

DavidMStraub avatar Jun 29 '24 09:06 DavidMStraub

I'm rebasing now.

DavidMStraub avatar Jun 29 '24 09:06 DavidMStraub

:tada:

DavidMStraub avatar Jun 29 '24 11:06 DavidMStraub