All files / features / repositories repositoriesCrudConfig.ts

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

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 1866x   2x             2x         2x      
import type { CrudFieldConfig, CrudFieldType, EntitySelectSource } from '@/layers/interfaces'
 
export const REPOSITORY_FIELD_SET: CrudFieldConfig[] = [
  { field: 'name', title: 'Name', validation: { required: true, minLength: 3, maxLength: 100 } },
  { field: 'description', title: 'Description', validation: { maxLength: 5000 } },
  { field: 'url', title: 'URL', validation: { required: true } },
  { field: 'bot_account_id', title: 'Bot Account', validation: { required: true } },
]
 
export const REPOSITORY_FIELD_TYPES: Record<string, CrudFieldType> = {
  description: 'textarea',
  bot_account_id: 'entity-select',
}
 
export const REPOSITORY_ENTITY_SELECT_SOURCES: Record<string, EntitySelectSource> = {
  bot_account_id: { entityPath: 'bot-accounts', idField: 'id', nameField: 'name', descriptionField: 'description' },
}