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

Create parent from person view #227

Open
socphoenix opened this issue Jun 14, 2023 · 6 comments
Open

Create parent from person view #227

socphoenix opened this issue Jun 14, 2023 · 6 comments
Assignees

Comments

@socphoenix
Copy link

On the gramps desktop interface it automatically pops up a blank spot you can double click to add a parent. On the web-app this doesn't happen, and you can't add parents through person details. Looks like I have to add a person, then find the child in the tree, and link the parent. It would be much more convenient to be able to edit these details from the person detail view.

@DavidMStraub DavidMStraub added the enhancement New feature or request label Jun 15, 2023
@DavidMStraub DavidMStraub changed the title can't easily create parent Create parent from person view Jun 15, 2023
@DavidMStraub DavidMStraub self-assigned this Aug 9, 2023
@DavidMStraub DavidMStraub removed the enhancement New feature or request label Nov 26, 2024
@DavidMStraub DavidMStraub moved this to Medium Priority in Gramps Web Roadmap Jan 13, 2025
@cajturner
Copy link

Happy to support this work, where I can. @DavidMStraub Let me know if you have a direction in mind and any task I could contribute to

@DavidMStraub
Copy link
Member

DavidMStraub commented Jan 20, 2025

Sure!

I think the first step would be to create a new pop-up dialog for creating a new person. At the moment, we have two different ways of adding new objects: via a dedicated page/view or via a pop-up. To not duplicate code, both elements share a mixin. See here for events:

https://github.com/gramps-project/gramps-web/blob/main/src/views/GrampsjsViewNewEvent.js
https://github.com/gramps-project/gramps-web/blob/main/src/components/GrampsjsFormNewEvent.js
https://github.com/gramps-project/gramps-web/blob/main/src/mixins/GrampsjsNewEventMixin.js

For people, only the first one exists an the mixin has not been separated out yet. Once that is done, adding the form to the person view is similar to the "new event" form, which also allows creating an event. The logic for handling the completed & submitted form is in handleEditAction of https://github.com/gramps-project/gramps-web/blob/main/src/views/GrampsjsViewObject.js.

@cajturner
Copy link

I have opened a draft PR where I create a newPersonMixin. #575

Question about the next steps, should we allow a new person to be created within another dialog modal? For example, in the screenshot below should we add a + button next to father that opens a new dialog or should it expand the existing dialog.

Image

@DavidMStraub
Copy link
Member

DavidMStraub commented Jan 21, 2025

Stacking modals on top of each other is indeed something I would avoid. But maybe we can make the UI simpler than having a a big dialog with expanding sections. Instead of a single dialog to edit father, mother and relationship at the same time, we could have a single dialog to edit the relationship, one dialog for editing father and one for editing mother. For editing a parent, we could either have a single dialog where the user can switch between selecting an existing and adding a new person (by unhiding a NewPersonMixing form on a button click), or we could have two separate icon buttons in the UI for "link existing person as father/mother" and "create new person as father/mother", then the individual popups are even simpler. What do you think?

@cajturner
Copy link

That sounds good to me. I agree that stacking dialogs is to be avoided. Do you have any examples of big dialogs and expanding sections in the codebase? That would help to follow a defined pattern.

I like the idea of a single form that expands if required. Maybe the select a person select could display "Add a new Person", that when selected displays the NewPersonMixin.

I'll give that a go and then we can discuss improvements

@DavidMStraub
Copy link
Member

Do you have any examples of big dialogs and expanding sections in the codebase?

The expanding name form in the new person dialog itself is probably the best example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Medium Priority
Development

No branches or pull requests

3 participants