diff --git a/ordinis-admin-ui/src/i18n.ts b/ordinis-admin-ui/src/i18n.ts index b40455c..a634c1d 100644 --- a/ordinis-admin-ui/src/i18n.ts +++ b/ordinis-admin-ui/src/i18n.ts @@ -159,8 +159,8 @@ i18n 'webhooks.field.scopeFilterHint': 'Пусто = все scope', 'webhooks.field.dictionaryFilter': 'Справочники (CSV)', 'webhooks.field.dictionaryFilterHint': 'Через запятую: spacecraft, satellite_type. Пусто = все', - 'webhooks.field.eventTypeFilter': 'Типы событий (CSV)', - 'webhooks.field.eventTypeFilterHint': 'record.created, record.updated, record.closed. Пусто = все', + 'webhooks.field.eventTypeFilter': 'Типы событий', + 'webhooks.field.eventTypeFilterHint': 'Record*, Definition*, SchemaDraft*. Пусто = все события.', 'webhooks.field.description': 'Описание', 'webhooks.field.createdBy': 'Создатель', 'webhooks.error.nameUrlRequired': 'Имя и URL обязательны', @@ -799,8 +799,8 @@ i18n 'webhooks.field.scopeFilterHint': 'Empty = all scopes', 'webhooks.field.dictionaryFilter': 'Dictionaries (CSV)', 'webhooks.field.dictionaryFilterHint': 'Comma-separated: spacecraft, satellite_type. Empty = all', - 'webhooks.field.eventTypeFilter': 'Event types (CSV)', - 'webhooks.field.eventTypeFilterHint': 'record.created, record.updated, record.closed. Empty = all', + 'webhooks.field.eventTypeFilter': 'Event types', + 'webhooks.field.eventTypeFilterHint': 'Record*, Definition*, SchemaDraft*. Empty = all events.', 'webhooks.field.description': 'Description', 'webhooks.field.createdBy': 'Created by', 'webhooks.error.nameUrlRequired': 'Name and URL are required', diff --git a/ordinis-admin-ui/src/routes/webhooks.index.tsx b/ordinis-admin-ui/src/routes/webhooks.index.tsx index 62591c5..f818318 100644 --- a/ordinis-admin-ui/src/routes/webhooks.index.tsx +++ b/ordinis-admin-ui/src/routes/webhooks.index.tsx @@ -49,6 +49,34 @@ const SCOPE_OPTIONS: SelectOption[] = [ { id: 'RESTRICTED', label: 'RESTRICTED' }, ] +/** + * Known outbox event types в порядке от самых частых (record CRUD) до + * реже встречающихся (schema workflow). Backend emit'ит PascalCase + * (см. DictionaryRecordService, DictionaryDefinitionService, + * SchemaDraftService). При новых событиях — добавлять сюда. + * + *
Pre-v2.4: hint текст в форме фигурировал dot-case формат
+ * `record.created` — это был docs bug, backend такие не emit'ит.
+ * Multi-select закрывает дыру и не даёт пользователю ввести неверное
+ * строковое имя.
+ */
+const EVENT_TYPE_OPTIONS: SelectOption[] = [
+ // Record CRUD
+ { id: 'RecordCreated', label: 'RecordCreated' },
+ { id: 'RecordUpdated', label: 'RecordUpdated' },
+ { id: 'RecordDeleted', label: 'RecordDeleted' },
+ // Dict definition / schema
+ { id: 'DefinitionCreated', label: 'DefinitionCreated' },
+ { id: 'DefinitionUpdated', label: 'DefinitionUpdated' },
+ // Schema workflow (v2.2.0+)
+ { id: 'SchemaDraftCreated', label: 'SchemaDraftCreated' },
+ { id: 'SchemaDraftUpdated', label: 'SchemaDraftUpdated' },
+ { id: 'SchemaDraftReviewRequested', label: 'SchemaDraftReviewRequested' },
+ { id: 'SchemaDraftDecided', label: 'SchemaDraftDecided' },
+ { id: 'SchemaDraftPublished', label: 'SchemaDraftPublished' },
+ { id: 'SchemaDraftWithdrawn', label: 'SchemaDraftWithdrawn' },
+]
+
function WebhooksPage() {
const { t } = useTranslation()
const { data, isLoading, error } = useWebhookSubscriptions()
@@ -206,7 +234,7 @@ function CreateWebhookDialog({ open, onClose, onSuccess }: CreateDialogProps) {
const [url, setUrl] = useState('')
const [scopeFilter, setScopeFilter] = useState