|
| 1 | +import { InputSelectOption } from '~/libs/ui' |
| 2 | + |
| 3 | +/** |
| 4 | + * Track/type vocabularies for this page. |
| 5 | + * |
| 6 | + * These deliberately differ between the two panels, and the difference is not |
| 7 | + * cosmetic: |
| 8 | + * |
| 9 | + * - **Ingest** filters reach the v6 Challenges API (bulk ingestion paginates |
| 10 | + * `searchChallengesTool`), which resolves `tracks`/`types` against the |
| 11 | + * `challengeTrack`/`challengeType` tables' **abbreviation** column. Sending |
| 12 | + * "Development" there matches no row, so the filter silently widens to |
| 13 | + * "every track" instead of erroring. |
| 14 | + * - **Indexed Challenges** filters query stored chunk metadata, where |
| 15 | + * ingestion recorded the track's full **name** (`toFreeFormName(challenge.track)` |
| 16 | + * in challenge-ingestion-workflow.ts). Sending "Dev" there matches nothing. |
| 17 | + * |
| 18 | + * So: abbreviations going out to the search API, full names coming back from |
| 19 | + * the index. Do not "align" the two lists. |
| 20 | + */ |
| 21 | +export const BULK_TRACK_OPTIONS: InputSelectOption[] = [ |
| 22 | + { label: 'Any track', value: '' }, |
| 23 | + { label: 'Development', value: 'Dev' }, |
| 24 | + { label: 'Design', value: 'Des' }, |
| 25 | + { label: 'Data Science', value: 'DS' }, |
| 26 | + { label: 'Quality Assurance', value: 'QA' }, |
| 27 | +] |
| 28 | + |
| 29 | +/** |
| 30 | + * Challenge types are resolved by abbreviation too, but unlike tracks the |
| 31 | + * abbreviations here are unconfirmed — they are rows in `challengeType`, not |
| 32 | + * constants in any repo. These values are the type *names*; if bulk ingestion |
| 33 | + * ignores a type filter, this list is the first place to look. |
| 34 | + */ |
| 35 | +export const BULK_TYPE_OPTIONS: InputSelectOption[] = [ |
| 36 | + { label: 'Any type', value: '' }, |
| 37 | + { label: 'Challenge', value: 'Challenge' }, |
| 38 | + { label: 'First2Finish', value: 'First2Finish' }, |
| 39 | + { label: 'Marathon Match', value: 'Marathon Match' }, |
| 40 | + { label: 'Task', value: 'Task' }, |
| 41 | +] |
| 42 | + |
| 43 | +/** Mirrors the workflow's own default status set. */ |
| 44 | +export const BULK_STATUS_OPTIONS: InputSelectOption[] = [ |
| 45 | + { label: 'Active + Completed', value: '' }, |
| 46 | + { label: 'Active only', value: 'ACTIVE' }, |
| 47 | + { label: 'Completed only', value: 'COMPLETED' }, |
| 48 | +] |
| 49 | + |
| 50 | +/** |
| 51 | + * Indexed-challenge filters match stored metadata, so these carry the track's |
| 52 | + * full name — see the note on BULK_TRACK_OPTIONS. |
| 53 | + */ |
| 54 | +export const INDEXED_TRACK_OPTIONS: InputSelectOption[] = [ |
| 55 | + { label: 'All tracks', value: '' }, |
| 56 | + { label: 'Development', value: 'Development' }, |
| 57 | + { label: 'Design', value: 'Design' }, |
| 58 | + { label: 'Data Science', value: 'Data Science' }, |
| 59 | + { label: 'Quality Assurance', value: 'Quality Assurance' }, |
| 60 | +] |
| 61 | + |
| 62 | +export const INDEXED_TYPE_OPTIONS: InputSelectOption[] = [ |
| 63 | + { label: 'All types', value: '' }, |
| 64 | + { label: 'Challenge', value: 'Challenge' }, |
| 65 | + { label: 'First2Finish', value: 'First2Finish' }, |
| 66 | + { label: 'Marathon Match', value: 'Marathon Match' }, |
| 67 | + { label: 'Task', value: 'Task' }, |
| 68 | +] |
0 commit comments