-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(invitations): added invitations query hook, migrated all tool files to use absolute imports #3092
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
Conversation
…les to use absolute imports
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@greptile |
Greptile OverviewGreptile SummaryThis PR introduces a centralized invitations query hook and migrates 269 tool files from relative to absolute imports for improved maintainability and consistency. Key Changes
Technical Improvements
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant InviteModal
participant InvitationsHooks
participant TanstackQuery
participant API
participant PermissionsProvider
User->>InviteModal: Open invite modal
InviteModal->>InvitationsHooks: usePendingInvitations(workspaceId)
InvitationsHooks->>TanstackQuery: useQuery(invitationKeys.list())
TanstackQuery->>API: GET /api/workspaces/invitations
API-->>TanstackQuery: Return pending invitations
TanstackQuery-->>InviteModal: Display existing invitations
User->>InviteModal: Add email(s) and set permissions
User->>InviteModal: Click "Invite"
InviteModal->>InvitationsHooks: useBatchSendWorkspaceInvitations()
InvitationsHooks->>TanstackQuery: useMutation()
TanstackQuery->>API: POST /api/workspaces/invitations (parallel)
API-->>TanstackQuery: Return results
TanstackQuery->>TanstackQuery: Invalidate invitationKeys.list()
TanstackQuery-->>InviteModal: Success/failure results
InviteModal-->>User: Show updated invitation list
User->>InviteModal: Modify member permissions
User->>InviteModal: Click "Save Changes"
InviteModal->>InvitationsHooks: useUpdateWorkspacePermissions()
InvitationsHooks->>TanstackQuery: useMutation()
TanstackQuery->>API: PATCH /api/workspaces/{id}/permissions
API-->>TanstackQuery: Return updated permissions
TanstackQuery->>TanstackQuery: Invalidate workspaceKeys.permissions()
TanstackQuery->>PermissionsProvider: Refresh permissions context
PermissionsProvider-->>InviteModal: Updated permissions
InviteModal-->>User: Show success
User->>InviteModal: Cancel invitation
InviteModal->>InvitationsHooks: useCancelWorkspaceInvitation()
InvitationsHooks->>TanstackQuery: useMutation()
TanstackQuery->>API: DELETE /api/workspaces/invitations/{id}
API-->>TanstackQuery: Confirmation
TanstackQuery->>TanstackQuery: Invalidate invitationKeys.list()
TanstackQuery-->>InviteModal: Removed from list
InviteModal-->>User: Show updated list
|
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.
5 files reviewed, no comments
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.ts
Show resolved
Hide resolved
...d]/w/components/sidebar/components/workspace-header/components/invite-modal/invite-modal.tsx
Outdated
Show resolved
Hide resolved
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
Type of Change
Testing
Tested manually
Checklist