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

Bug/50677 users that are shared with a wp cannot be added as project members any more #14102

Conversation

ulferts
Copy link
Contributor

@ulferts ulferts commented Nov 6, 2023

Removes Members on entities like WorkPackages from two scopes and by that:

  • avoids them showing up in the administration page of a user where the current memberships in projects are listed:
image

https://community.openproject.org/wp/50677

@ulferts ulferts force-pushed the bug/50677-users-that-are-shared-with-a-wp-cannot-be-added-as-project-members-any-more branch from 2d8e7f1 to 9ae40a3 Compare November 6, 2023 16:12
@ulferts ulferts marked this pull request as ready for review November 6, 2023 16:13
@klaustopher
Copy link
Contributor

Would it maybe make sense that we add scopes on memberships?

scope :on_project, -> { where(entity: nil).where.not(project_id: nil) }
scope :global, -> { where(entity: nil).where(project_id: nil) }
scope :on_entity, -> { where.not(entity: nil, project_id: nil) }

Then we could use those instead of spreading where(entity: nil) in places outside of the model itself

@ulferts ulferts force-pushed the bug/50677-users-that-are-shared-with-a-wp-cannot-be-added-as-project-members-any-more branch 3 times, most recently from a0295a7 to fadb78e Compare November 20, 2023 17:14
@ulferts ulferts force-pushed the bug/50677-users-that-are-shared-with-a-wp-cannot-be-added-as-project-members-any-more branch from fadb78e to 84995ea Compare November 20, 2023 17:40
…re-shared-with-a-wp-cannot-be-added-as-project-members-any-more
@ulferts ulferts force-pushed the bug/50677-users-that-are-shared-with-a-wp-cannot-be-added-as-project-members-any-more branch from 3006c67 to e22618a Compare December 4, 2023 15:04
@ulferts
Copy link
Contributor Author

ulferts commented Dec 5, 2023

@klaustopher all the scopes should now be in as discussed.

@klaustopher klaustopher changed the base branch from dev to release/13.1 December 5, 2023 13:37
Copy link
Contributor

@klaustopher klaustopher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@ulferts ulferts merged commit 1f72014 into release/13.1 Dec 6, 2023
11 checks passed
@ulferts ulferts deleted the bug/50677-users-that-are-shared-with-a-wp-cannot-be-added-as-project-members-any-more branch December 6, 2023 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants