Skip to content

Add user status and last connection columns to admin users table #118

Description

@kaluxxx

Summary

Add two new columns to the admin users table to improve user management:

  1. Status column: Show if user is "Active" or "Invite sent"
  2. Last connection column: Display when user last logged in

Current State Analysis

Based on the current database schema:

Status Column (Can be implemented now)

  • Active: emailVerified: true
  • Invite sent: emailVerified: false

Last Connection Column (Partially possible)

  • Current Session.updatedAt field can show last session activity
  • Not ideal as it represents session update, not login time

Proposed Implementation

Option 1: Use Current Schema

Implement columns using existing fields as a quick solution.

Option 2: Improve Database Schema (Recommended)

  1. Add lastLoginAt: DateTime? field to User model
  2. Optional: Add UserStatus enum for better status management
  3. Update authentication flow to track login times

Files to Modify

  • src/components/admin/settings/users/usersTableColumns.tsx
  • prisma/schema.prisma (if choosing Option 2)
  • User type definitions in src/feature/user/types/user.ts

Acceptance Criteria

  • Users table shows status column (Active/Invite sent)
  • Users table shows last connection column
  • Columns are sortable where applicable
  • Status is clearly visible with appropriate styling
  • Last connection shows "Never" for users who haven't logged in

Priority

Medium - Improves admin user management experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions