-
Notifications
You must be signed in to change notification settings - Fork 12k
fix: Consistently remove a member from organization/sub-team/team - through all the APIs and webapp actions #22806
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f60f01c
Fix membership deletion handling and add tests
hariombalhara d97ae91
fixes
hariombalhara 262ffe4
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 8a7b758
revert api-v2 specific changes
hariombalhara 5cd93f3
Add more tests
hariombalhara 867d295
refactor: Move removeMember function into TeamService as private stat…
hariombalhara 9fec1bc
refactor: Rename memberId to userId in TeamService methods
hariombalhara 3fef285
test: add service unit tests and simplify e2e tests for membership de…
hariombalhara e653219
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 02f82e1
package.json version
hariombalhara add44b5
fix unit teswtes
hariombalhara 0f6ec3f
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 0d1c0f9
No specs file
hariombalhara d705d2a
fix unit tests
hariombalhara d5a04db
fix: Add platform-libraries build step to E2E API v2 workflow
devin-ai-integration[bot] f9a932c
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 4042c66
Merge branch 'fix-api-v2-org-user-membership-deletion' of https://git…
hariombalhara 7b50b3e
Making tests clearer and easier to undestand
hariombalhara c54a3f0
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 1c22f42
Merge branch 'main' into fix-api-v2-org-user-membership-deletion
hariombalhara a7b14e3
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 3d1d820
Merge branch 'main' into fix-api-v2-org-user-membership-deletion
ThyMinimalDev 73c7c13
chore: bump platform libs
ThyMinimalDev de66e05
Merge branch 'main' into fix-api-v2-org-user-membership-deletion
ThyMinimalDev 8e3bf68
chore: bump platform libs
ThyMinimalDev de7ca2e
Merge branch 'main' into fix-api-v2-org-user-membership-deletion
hariombalhara 729861b
Merge remote-tracking branch 'origin/main' into fix-api-v2-org-user-m…
hariombalhara 07bd81c
chore: bump platform library
ThyMinimalDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -156,17 +156,4 @@ export class TeamsEventTypesService { | |
|
|
||
| return this.eventTypesRepository.deleteEventType(eventTypeId); | ||
| } | ||
|
|
||
| async deleteUserTeamEventTypesAndHosts(userId: number, teamId: number) { | ||
| try { | ||
| await this.teamsEventTypesRepository.deleteUserManagedTeamEventTypes(userId, teamId); | ||
| await this.teamsEventTypesRepository.removeUserFromTeamEventTypesHosts(userId, teamId); | ||
| } catch (err) { | ||
| this.logger.error("Could not remove user from all team event-types.", { | ||
| error: err, | ||
| userId, | ||
| teamId, | ||
| }); | ||
| } | ||
| } | ||
| } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use TeamService.removeMembers now |
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
1 change: 0 additions & 1 deletion
1
apps/web/app/(use-page-wrapper)/settings/organizations/new/layout.tsx
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,11 +1,7 @@ | ||
| import removeMember from "@calcom/features/ee/teams/lib/removeMember"; | ||
| import { TeamService } from "@calcom/lib/server/service/teamService"; | ||
|
|
||
| const removeUserFromOrg = async ({ userId, orgId }: { userId: number; orgId: number }) => { | ||
| return removeMember({ | ||
| memberId: userId, | ||
| teamId: orgId, | ||
| isOrg: true, | ||
| }); | ||
| return TeamService.removeMembers({ teamIds: [orgId], userIds: [userId], isOrg: true }); | ||
| }; | ||
|
|
||
| export default removeUserFromOrg; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Controller shouldn't orchestrate service calls, so it is hanlded inside deleteOrgTeamMembership and that too via TeamService.removeMembers, that makes it consistent with webapp