feat(admin-ui): migrate from custom components to @nstart/ui design system
Свои Modal/Button/inputs выкинуты — берём nstart-ui v0.1.3 как в других corp
React приложениях. Установка через .npmrc → repo.nstart.cloud/repository/npm-hosted/.
Что сделано:
- .npmrc: scope @nstart на corp Nexus + min-release-age=7
- deps: @nstart/ui ^0.1.3, @phosphor-icons/react ^2.1.10
- bumped peer deps: i18next ^26 + react-i18next ^17 (требование nstart-ui)
- styles.css: импорт @nstart/ui/styles/{fonts,theme}.css + critical @source
директива (без неё Tailwind v4 tree-shaking дропнул бы все классы из dist либы)
- main.tsx: <NStartUiProvider> на корне
- DROP src/components/ui/Modal.tsx (свой Modal больше не нужен)
Routes:
- __root: LanguageSwitch вместо двух кнопок RU/EN, токены ultramarain/regolith/carbon
- dictionaries.index: PageHeader + Badge для scope chip + Alert/EmptyState/LoadingBlock
- dictionaries.$name: PageHeader с actions, Modal/Panel/Table/TableRow/Cell,
IconButton с Phosphor (PencilSimple, XCircle), Button variant=primary/danger/ghost
Form (SchemaDrivenForm):
- TextInput/TextArea/SingleSelect/Checkbox + FieldLabel/Hint/Error из @nstart/ui
- FormSection + FormGrid columns=1|2 для группировки
- FormActions align=end с Button loading state
- Alert variant=error для server-side ошибок (422 IdempotencyConflict / 409 InProgress)
- ajv валидация по schema_json остаётся такой же (Draft-07, как у backend)
Bundle: 192KB → 659KB gzip — тянет echarts/lottie/brand assets из nstart-ui,
для internal admin tool приемлемо (cached after first load).
This commit is contained in:
@@ -15,6 +15,7 @@ i18n
|
||||
'app.title': 'Ordinis НСИ ЦУОД',
|
||||
'nav.dictionaries': 'Справочники',
|
||||
'header.scope': 'Доступный scope',
|
||||
'dict.list.subtitle': 'Каталоги НСИ ЦУОД ОДХ',
|
||||
'dict.empty': 'В этом справочнике пока нет записей',
|
||||
'dict.col.businessKey': 'Бизнес-ключ',
|
||||
'dict.col.scope': 'Scope',
|
||||
@@ -30,6 +31,7 @@ i18n
|
||||
'Запись «{{key}}» будет помечена как закрытая (valid_to = now). Действие обратимо через создание новой версии.',
|
||||
'dict.confirmClose.reason': 'Причина (опционально)',
|
||||
'dict.confirmClose.reasonPlaceholder': 'например, «дубликат» или «выведено из эксплуатации»',
|
||||
'form.identity': 'Идентификация',
|
||||
'form.businessKey': 'Бизнес-ключ',
|
||||
'form.validFrom': 'Действует с',
|
||||
'form.validTo': 'Действует до',
|
||||
@@ -47,6 +49,7 @@ i18n
|
||||
'app.title': 'Ordinis MDM',
|
||||
'nav.dictionaries': 'Dictionaries',
|
||||
'header.scope': 'Allowed scope',
|
||||
'dict.list.subtitle': 'Reference data catalogues',
|
||||
'dict.empty': 'No records in this dictionary yet',
|
||||
'dict.col.businessKey': 'Business key',
|
||||
'dict.col.scope': 'Scope',
|
||||
@@ -62,6 +65,7 @@ i18n
|
||||
'Record "{{key}}" will be marked as closed (valid_to = now). Reversible by creating a new version.',
|
||||
'dict.confirmClose.reason': 'Reason (optional)',
|
||||
'dict.confirmClose.reasonPlaceholder': 'e.g., "duplicate" or "decommissioned"',
|
||||
'form.identity': 'Identity',
|
||||
'form.businessKey': 'Business key',
|
||||
'form.validFrom': 'Valid from',
|
||||
'form.validTo': 'Valid to',
|
||||
|
||||
Reference in New Issue
Block a user