Skip to content

Conversation

@luizhf42
Copy link
Member

@luizhf42 luizhf42 commented Dec 2, 2025

This PR introduces a complete invitations management system for team collaboration, separating invitation logic from the members module and providing a comprehensive UI for both managing and responding to namespace invitations.

🎯 Overview

  • Created dedicated invitations store and API layer
  • Built invitations menu for users to view and respond to pending invitations
  • Implemented full-featured invitations management view for namespace administrators
  • Added comprehensive test coverage for all new components

✨ New Features

1. Invitations Store & API Layer

  • New Store: store/modules/invitations.ts - Centralized state management for invitations
  • New API Layer: store/api/invitations.ts - Separated invitation-related API calls
  • Interface: interfaces/IInvitation.ts - Type definitions for invitation entities
  • Actions:
    • fetchUserPendingInvitationList - Get user's pending invitations
    • fetchNamespaceInvitationList - Get namespace's sent invitations
    • acceptInvitation / declineInvitation - Respond to invitations
    • editInvitation / cancelInvitation - Manage sent invitations
    • sendInvitationEmail / generateInvitationLink - Create invitations

2. User-Facing Invitations Menu

  • Component: InvitationsMenu.vue - Dropdown menu in AppBar for pending invitations

  • Features:

    • Badge indicator showing pending invitation count
    • Side drawer with list of pending invitations
    • Quick accept/decline actions from the menu
    • Auto-refresh on drawer open
    • Empty state when no pending invitations
  • Sub-Components:

    • InvitationsMenuItem.vue - Individual invitation item with expandable details
    • InvitationAccept.vue - Accept invitation dialog with confirmation
    • InvitationDecline.vue - Decline invitation dialog with warning

3. Admin Invitations Management View

  • View: TeamInvitations.vue - Full invitations management page

  • Features:

    • Status filter (Pending, Cancelled, Accepted, Rejected) in header
    • Integrated "Invite Member" button
    • Comprehensive invitations table with sorting and pagination
  • Component: InvitationList.vue - DataTable for displaying invitations

    • Displays: email, role, status, created_at, expires_at
    • Color-coded status chips
    • Conditional actions menu based on invitation status
    • Tooltips for non-actionable invitations
  • Action Components:

    • InvitationEdit.vue - Edit invitation role (pending only)
    • InvitationCancel.vue - Cancel invitation (pending only)
    • InvitationResend.vue - Resend invitation (expired pending or cancelled)
      • Smart enable/disable: only enabled for cancelled invitations or expired pending invitations

4. Utilities

  • utils/invitations.ts - Helper functions:
    • isInvitationExpired - Check if invitation has expired
    • getInvitationStatusFilter - Generate filter for API calls
    • orderInvitationsByCreatedAt - Sort invitations by creation date

🔄 Refactoring

Member Module

  • Removed status field from INamespaceMember interface
  • Removed status column from MemberList.vue table
  • Updated MemberInvite.vue to use invitationsStore instead of namespacesStore

Namespaces Module

  • Removed invitation-related actions from namespacesStore (sendEmailInvitation, generateInvitationLink, acceptInvite)
  • Removed invitation-related interfaces (INamespaceAddMember, INamespaceAcceptInvite)
  • Cleaned up API layer to focus purely on namespace management

NamespaceInviteCard

  • Updated to use the new invitationsStore for accept/decline actions
  • Improved UX with a separate decline button and confirmation

🧪 Testing

Comprehensive test suite following existing patterns:

  • InvitationsMenu.spec.ts - Menu drawer toggle, badge display, fetching
  • InvitationsMenuItem.spec.ts - Individual item display and events
  • InvitationList.spec.ts - List rendering, loading, actions visibility
  • InvitationEdit.spec.ts - Edit functionality, success/error scenarios
  • InvitationCancel.spec.ts - Cancel with proper API mocking
  • InvitationResend.spec.ts - Resend for expired/cancelled invitations

🎨 UX Improvements

  1. Clear Status Indication: Color-coded chips for invitation statuses
  2. Smart Action Availability: Actions only shown when applicable
  3. Helpful Tooltips: Explain why certain actions are disabled
  4. Permission Guards: UI respects user authorization levels
  5. Responsive Design: Works on different screen sizes with Vuetify's responsive utilities
  6. Loading States: Proper loading indicators during async operations
  7. Error Handling: User-friendly error messages for all failure scenarios

@luizhf42 luizhf42 self-assigned this Dec 2, 2025
@luizhf42 luizhf42 added kind/feature New feature or request area/ui status/work-in-progress javascript Pull requests that update Javascript code openapi labels Dec 2, 2025
@luizhf42 luizhf42 force-pushed the feat/invites-menu-and-view branch 8 times, most recently from f4421dc to c62e87c Compare December 4, 2025 21:05
heiytor and others added 4 commits December 5, 2025 07:26
- Migrate from embedded namespace.members to standalone
  membership_invitations collection
- Add environment-specific prefixes ([cloud] vs [community|enterprise])
  to member service tests
- Update AddNamespaceMember tests to use MembershipInvitationResolve for
  cloud environments
- Refactor addMember tests to validate MembershipInvitationCreate
  instead of direct membership
- Add cloud-specific UpdateNamespaceMember tests for invitation
  management
- Update RemoveNamespaceMember tests with invitation cancellation logic
  using MembershipInvitationStatusCancelled
- Fix mock.MatchedBy matchers to validate invitation status changes
- Add envMock.AssertExpectations to all refactored test functions
- Create audit trail for all membership operations across environments
@luizhf42 luizhf42 force-pushed the feat/invites-menu-and-view branch 5 times, most recently from d5a6edb to 9d5c7d1 Compare December 5, 2025 14:31
@luizhf42 luizhf42 force-pushed the feat/invites-menu-and-view branch from 9d5c7d1 to 2b6db50 Compare December 5, 2025 14:40
@luizhf42 luizhf42 changed the title feat(ui): implement new invitations feat(ui): implement new invitations menu, view, dialogs and management system Dec 5, 2025
@luizhf42 luizhf42 marked this pull request as ready for review December 5, 2025 14:49
@luizhf42 luizhf42 requested review from a team as code owners December 5, 2025 14:49
@luizhf42 luizhf42 requested a review from heiytor December 5, 2025 14:55
@luizhf42 luizhf42 force-pushed the feat/invites-menu-and-view branch from 2b6db50 to 7dc89bc Compare December 5, 2025 18:08
@luizhf42 luizhf42 force-pushed the feat/invites-menu-and-view branch from 7dc89bc to 5c58884 Compare December 5, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants