All files / src/schemas member-schema.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                2x                                                                  
import type { SystemField } from '@/types/systemField'
 
/**
 * Field schema for the Member list. See src/types/systemField.ts.
 * `roleChips`, `avatarUrl` and `nicknameDisplay` are derived — see
 * utils/systemListViewModels.ts:toMemberViewModel. `status` and `joinedAt`
 * are read directly off `FlowMember` (stores/flows.ts).
 */
export const MEMBER_SCHEMA: SystemField[] = [
  {
    fieldId: 'name',
    name: { en: 'Name', fr: 'Nom' },
    type: 'text',
    width: 3,
    avatarFieldId: 'avatarUrl',
    avatarFallbackIcon: 'fa-solid fa-user',
    secondaryFieldId: 'nicknameDisplay'
  },
  {
    fieldId: 'roleChips',
    name: { en: 'Roles', fr: 'Rôles' },
    type: 'chips',
    width: 4,
    chipsDefaultColor: 'primary',
    emptyLabel: { en: 'No roles', fr: 'Aucun rôle' }
  },
  {
    fieldId: 'status',
    name: { en: 'Status', fr: 'Statut' },
    type: 'badge',
    width: 2,
    badgeOptions: [{ value: 'active', label: { en: 'Active', fr: 'Actif' }, color: 'success' }],
    badgeDefaultColor: 'secondary'
  },
  {
    fieldId: 'joinedAt',
    name: { en: 'Joined', fr: 'Rejoint le' },
    type: 'date',
    width: 2
  }
]