gramps-project / gramps-web

Frontend for Gramps Web
https://www.grampsweb.org
GNU Affero General Public License v3.0
439 stars 58 forks source link

Adding a group affiliation to a person #114

Closed Airick73 closed 2 years ago

Airick73 commented 2 years ago

Hello,

A feature I was looking to implement into Gramps.js, which as I have been experimenting may have to be implemented into the gramps web api as well, is the ability to add a group affiliation to a person. The nature of the group is unimportant for example: rotary club, fraternity, hockey club, etc. I simply want to determine the feasibility of the feature at this moment. A quick mock up is provided below. image Looking into the code behind adding a new person in the GrampsViewNewPerson.js file, I saw many references to this.person , person being an object that is declared in the file, but the reference to this.person.profile or this.person.profile.death.date I could not find reference to. After reading some of the Lit documentation, if I understand correctly, these references of this.person.profile are referring to JSON data provided by the gramps web api? Upon further research I found this issue: https://github.com/gramps-project/gramps-webapi/pull/4 in which adding an attribute to a person is mentioned. Looking into the swagger UI for gramps web api I was able to find reference to the PersonProfile spec: https://gramps-project.github.io/gramps-webapi/ image My question now is, if I wanted to implement this group affiliation feature would I also have to edit the gramps web api to hold an additional piece of data to the PersonProfile data model and access it through the frontend by calling this.person.profile.group for example.

DavidMStraub commented 2 years ago

Hi,

it's correct that the representation of the person object as JSON matches the format that is used by Gramps Web API, and the Swagger API spec is the right place to understand which fields are supported and which format they have.

However, it's important to point out that the API eventually just reproduces the underlying data structure of Gramps, as Gramps handles all the database schemas, references, etc. So having a a new property of a primary Gramps object like a person would require changing the Gramps database schema. It's not impossible, but it needs a lot of work and discussion.

But Gramps's data model is already very powerful, so in cases like this, I would suggest to ask a question in Discourse how other Gramps users would handle this use case.

Three options immediately come to my mind: attributes, events, and tags.

Membership in a club is mentioned in the Gramps Wiki as an example for a custom event type.

DavidMStraub commented 2 years ago

I should mention that adding events, tags, and attributes is possible in Gramps Web, but not in the "add new person" dialog, but only by editing a newly created person.

cdhorn commented 2 years ago

Personally I'd like to see a top level Group object in Gramps core. I think Family should have been Group from the start, as a family it is just a specific case of a type of group. That then would seem to more naturally support polygamous families for those who have a need to record them, as well as modeling mixed households, and other things like members of a church, fraternal organization, club and so forth.

I think making Group a top level research subject, and adding others like Artifact, Building and Animal, would have benefits and people have asked for all of those at various times.

DavidMStraub commented 2 years ago

In any case, it's not something we can solve in the Gramps Web frontend, so I'm closing this issue as not planned.

Still, I think using an event of type "Membership" would be a good solution that works today. Since we also treat "profession" as an event, it makes sense to me that memberships are found there as well, and they can have start/end dates and a place.