docling-studio/frontend/src/shared/routing/names.ts
Pier-Jean Malandrino 93be01db5f feat(#251): API client typé create/update/delete + StoreForm + Create/Edit pages
Frontend store API client :
- Types StoreInfo (avec slug + isDefault + embedder), StoreDetail, StoreCreatePayload, StoreUpdatePayload
- Fonctions createStore (POST), updateStore (PATCH), deleteStore (DELETE), fetchStore (GET /:slug)
- Tests Vitest étendus pour les 4 nouveaux endpoints

Composants formulaire (features/store/ui/) :
- StoreForm : champs communs (name/slug/kind/embedder/isDefault) avec validation slug locale, lock du slug pour 'default'
- StoreConfigForm : dispatcher dynamique par kind (extensible)
- OpenSearchConfigForm : champ indexName, validation requise

Pages CRUD :
- StoreCreatePage (/index/new) : formulaire + redirect liste
- StoreEditPage (/index/:store/edit) : préremplit via fetchStore, redirige vers la fiche

Routes + i18n :
- Routes ROUTES.STORE_CREATE et ROUTES.STORE_EDIT ajoutées (names + routes.ts)
- Clés i18n FR/EN sous stores.* et storeForm.*
2026-05-04 12:28:27 +02:00

37 lines
999 B
TypeScript

/**
* Canonical route name constants — typed to keep callers honest.
*
* Use:
*
* router.push({ name: ROUTES.DOC_WORKSPACE, params: { id } })
*
* instead of stringly-typed names. Adding a route requires touching
* exactly two places: the router definition and this file.
*/
export const ROUTES = {
// Existing legacy routes — kept until E3/E4/E5 replace them.
HOME: 'home',
STUDIO: 'studio',
HISTORY: 'history',
DOCUMENTS: 'documents',
SEARCH: 'search',
REASONING: 'reasoning',
REASONING_DOC: 'reasoning-doc',
SETTINGS: 'settings',
NOT_FOUND: 'not-found',
// 0.6.0 — Document-centric routes (#207).
DOCS_LIBRARY: 'docs-library',
DOCS_NEW: 'docs-new',
DOC_WORKSPACE: 'doc-workspace',
STORES_LIST: 'stores-list',
STORE_CREATE: 'store-create',
STORE_DETAIL: 'store-detail',
STORE_EDIT: 'store-edit',
STORE_QUERY: 'store-query',
RUNS: 'runs',
RUN_DETAIL: 'run-detail',
} as const
export type RouteName = (typeof ROUTES)[keyof typeof ROUTES]