-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use MembershipList with Projects (#793)
* feat: Switch projects to use membership list; skip failing tests * feat: Create mutation to update membership list of project * feat: Restrict membership roles during creation * feat: Add mutation for removing users from project * test: Test permissions for deleting memberships * test: Test user not member of project cannot update * test: Test user can remove themself from project * feat: Add mutation for updating membership role * test: Add test for user not part of project updating role * test: Reactivate skipped project tests * feat: Move projects graphql into projects app * refactor: Define and use project management collaboration roles * chore: Make migration for project membership list * fix: Enum types for ProjectMemberships, PR fixups * feat: Use mixins to allow customizing MembershipNodes * feat: Use enum for project update mutations * fix: Restore missing membership_lists filter This can be done be reusing the filterset class with DjangoFilterConnectionField. It would be worthwhile checking if this work can be encapsulated in a resuable function, as there is now a lot of custom code whose function is not obvious. * fix: Fix schema errors with ProjectMembership The ProjectMembershipList was being a bunch of places where we did not want it to be used, like Story Maps! I tried creating using some Django proxy inheritance and that seems to have helped Graphene figure things out. * fix: Change Project model to point to proxy * fix: Fix malfunctioning ProjectMembershipListNode Somewhat confusing. * fix: Fix project filter to correct memberships Previously it was just returning all memberships for every project! * chore: Reorder migrations
- Loading branch information
David Code Howard
authored
Sep 27, 2023
1 parent
98bcf54
commit 4170565
Showing
26 changed files
with
1,121 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ | |
|
||
membership_added_signal = Signal() | ||
membership_updated_signal = Signal() | ||
membership_deleted_signal = Signal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
terraso_backend/apps/project_management/collaboration_roles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright © 2023 Technology Matters | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published | ||
# by the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see https://www.gnu.org/licenses/. | ||
|
||
ROLE_MANAGER = "manager" | ||
ROLE_CONTRIBUTOR = "contributor" | ||
ROLE_VIEWER = "viewer" |
Oops, something went wrong.