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

Not obvious that deleting a person deletes them from entire tree #2070

Open
richardolsson opened this issue Jul 1, 2024 · 2 comments · May be fixed by #2209
Open

Not obvious that deleting a person deletes them from entire tree #2070

richardolsson opened this issue Jul 1, 2024 · 2 comments · May be fixed by #2209
Assignees
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.

Comments

@richardolsson
Copy link
Member

Description

There are two ways of removing people in Zetkin:

  • Disconnecting a person from an organization makes them unavailable to the current organization and it's children, but does not delete the information associated with that person. This is useful when the person has moved away from a local branch but is still a member of the overall organization.
  • Deleting a person deletes them and their associated data from the entire tree. This is useful when a person wants to leave the organization, and lets their local organizer know about this, expecting all data associated with them to be deleted from the entire organization, not just the local branch.

Steps to reproduce

  1. Go to https://app.dev.zetkin.org/organize/1/people/123
  2. Click on the "Manage" tab
  3. Click "Remove person"

Expected Behaviour

At some point the user should be informed that deleting the person will delete them from the entire organization tree, perhaps even include the name of the parent organization?

Actual Behaviour

Neither the "Remove person" nor the message in the confirmation dialog makes it clear that the person will be fully deleted from all other parts of the organization as well.

Screenshots

None

@richardolsson richardolsson added 🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue. labels Jul 1, 2024
@MattettaM
Copy link
Collaborator

Giving this a shot

@MattettaM MattettaM self-assigned this Sep 29, 2024
@MattettaM
Copy link
Collaborator

Tried making a solution like this to get the root organization of the user, but it doesn't work due to hooks not being allowed to be called in this way. Will make a PR with the new warning message, but I think implementing this feature is beyond me at the moment.

const getRootOrgById = (orgId: number): ZetkinOrganization | null => {
  var organization = useOrganization(orgId).data;
  if (organization?.parent) {
    organization = getRootOrgById(organization?.id);
  }
  return organization;
};

@MattettaM MattettaM linked a pull request Sep 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐜 bug Something isn't working 🚪 entry-level Good for newcomers 🐬 Medium Just a nice sized issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants