Skip to content

Commit 574daaf

Browse files
Backlog/v12 pipeline test moda (#2420)
* fix[frontend](testmodal/pipelines/rules): added changeable name on those sections of the test modal * fix[frontend](testmodal/pipelines/rules): added missing translations
1 parent bda9e2b commit 574daaf

12 files changed

Lines changed: 292 additions & 5 deletions

File tree

frontend/src/features/alerting-rules/components/rule-drawer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export function RuleDrawer({
181181
{showTestModal && (
182182
<TestPlaygroundModal
183183
mode="rule"
184+
titleKey="playground.titleRule"
184185
dataTypeOptions={form.dataTypes}
185186
draftContent={ruleFormToYaml(form)}
186187
onClose={() => setShowTestModal(false)}

frontend/src/features/alerting-rules/pages/AlertingRulesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function AlertingRulesPage() {
295295
{open && <RuleDrawer rule={open} dataTypeOptions={dataTypeOptions} onClose={() => setOpen(null)} onToggle={toggleActive} onDelete={remove} onSaved={() => { setOpen(null); refresh() }} t={t} />}
296296
{creating && <RuleDrawer create dataTypeOptions={dataTypeOptions} onClose={() => setCreating(false)} onSaved={() => { setCreating(false); refresh() }} t={t} />}
297297
{importResults && <ImportResultsDialog res={importResults} onClose={() => setImportResults(null)} t={t} />}
298-
{showTestModal && <TestPlaygroundModal mode="rule" dataTypeOptions={testDataTypes} onClose={() => setShowTestModal(false)} />}
298+
{showTestModal && <TestPlaygroundModal mode="rule" titleKey="playground.titleRule" dataTypeOptions={testDataTypes} onClose={() => setShowTestModal(false)} />}
299299
<ConfirmDialog
300300
open={pendingDelete != null}
301301
title={t('alertingRules.editor.delete') ?? 'Delete'}

frontend/src/features/parsing-filters/components/FilterFormDrawer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ export function FilterFormDrawer({ filter, creating, onClose, onSaved }: Props)
285285
{showTestModal && (
286286
<TestPlaygroundModal
287287
mode="filter"
288+
titleKey="playground.titleFilter"
288289
dataTypeOptions={model.dataTypes}
289290
draftContent={content}
290291
onClose={() => setShowTestModal(false)}

frontend/src/features/parsing-filters/pages/ParsingFiltersPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export function ParsingFiltersPage() {
292292
)}
293293

294294
{showTestModal && (
295-
<TestPlaygroundModal mode="filter" dataTypeOptions={dataTypeOptions} onClose={() => setShowTestModal(false)} />
295+
<TestPlaygroundModal mode="filter" titleKey="playground.titleFilter" dataTypeOptions={dataTypeOptions} onClose={() => setShowTestModal(false)} />
296296
)}
297297
</div>
298298
)

frontend/src/features/playground/components/TestPlaygroundModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ const MAX_BYTES = 1024 * 1024
1616

1717
interface Props {
1818
mode: PlaygroundMode
19+
/** i18n key for the modal header, e.g. `playground.titleFilter` or `playground.titleRule`. */
20+
titleKey: string
1921
/** Entry A: active dataTypes from the catalog. Entry B: `model.dataTypes` of the draft. */
2022
dataTypeOptions: string[]
2123
/** Present only for Entry B (unsaved draft content); omitted tests the live pipeline. */
2224
draftContent?: string
2325
onClose: () => void
2426
}
2527

26-
export function TestPlaygroundModal({ mode, dataTypeOptions, draftContent, onClose }: Props) {
28+
export function TestPlaygroundModal({ mode, titleKey, dataTypeOptions, draftContent, onClose }: Props) {
2729
const { t } = useTranslation()
2830
const [selectedDataType, setSelectedDataType] = useState(dataTypeOptions[0] ?? '')
2931
const [rawLog, setRawLog] = useState('')
@@ -87,7 +89,7 @@ export function TestPlaygroundModal({ mode, dataTypeOptions, draftContent, onClo
8789
>
8890
<header className="flex items-center justify-between gap-4 border-b border-border px-6 py-4">
8991
<h2 className="flex items-center gap-2 text-lg font-semibold">
90-
<PlayCircle size={16} className="text-primary" /> {t('playground.title')}
92+
<PlayCircle size={16} className="text-primary" /> {t(titleKey)}
9193
</h2>
9294
<button
9395
type="button"

frontend/src/shared/i18n/locales/de.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5178,5 +5178,52 @@
51785178
"level2": "Stufe 2",
51795179
"level3": "Stufe 3"
51805180
}
5181+
},
5182+
"playground": {
5183+
"titleFilter": "Pipeline testen",
5184+
"titleRule": "Regel testen",
5185+
"noDataTypes": "Dieser Pipeline sind noch keine Datentypen zugewiesen — füge einen hinzu, um sie zu testen.",
5186+
"dataTypeLabel": "Datentyp",
5187+
"dataTypePlaceholder": "Keine Datentypen verfügbar",
5188+
"dataTypeSingleHint": "Diese Pipeline hat nur einen Datentyp — füge weitere hinzu, um zwischen ihnen zu wählen.",
5189+
"rawLogLabel": "Rohprotokoll",
5190+
"rawLogPlaceholder": "Füge eine Beispielprotokollzeile ein…",
5191+
"rawLogCounter": "{{chars}} Zeichen · {{kb}} KB",
5192+
"rawLogTooLarge": "Dieses Protokoll überschreitet das 1-MB-Limit — kürze es vor dem Test.",
5193+
"run": {
5194+
"label": "Ausführen",
5195+
"running": "Wird getestet…",
5196+
"waitHint": "Dies kann bis zu 15 Sekunden dauern, während die Pipeline das Protokoll verarbeitet."
5197+
},
5198+
"errors": {
5199+
"busy": "Der Playground führt bereits einen anderen Test aus — bitte versuche es gleich erneut.",
5200+
"timeout": "Der Test hat das Zeitlimit überschritten — meist passt der gewählte Datentyp nicht zum Protokollformat.",
5201+
"validation": "Die Anfrage war ungültig — prüfe das Rohprotokoll und den Pipeline-Inhalt.",
5202+
"server": "Der Playground konnte den Test nicht abschließen — bitte erneut versuchen."
5203+
},
5204+
"result": {
5205+
"label": "Verarbeitetes Ergebnis",
5206+
"empty": "Führe einen Test aus, um das verarbeitete Ereignis hier zu sehen.",
5207+
"loading": "Warte auf das verarbeitete Ereignis…",
5208+
"tabs": {
5209+
"fields": "Felder",
5210+
"json": "JSON"
5211+
},
5212+
"fieldsCount_one": "{{count}} Feld",
5213+
"fieldsCount_other": "{{count}} Felder",
5214+
"copy": "Kopieren",
5215+
"copied": "Kopiert",
5216+
"elapsed": "Verarbeitet in {{time}}",
5217+
"elapsedHint": "Zeit von „Ausführen“ bis zum verarbeiteten Ergebnis",
5218+
"searchPlaceholder": "Felder suchen…",
5219+
"noMatch": "Keine Felder entsprechen deiner Suche."
5220+
},
5221+
"alerts": {
5222+
"label": "Alarme",
5223+
"empty": "Führe einen Test aus, um hier ausgelöste Alarme zu sehen.",
5224+
"none": "Es wurden keine Alarme ausgelöst.",
5225+
"count_one": "{{count}} Alarm",
5226+
"count_other": "{{count}} Alarme"
5227+
}
51815228
}
51825229
}

frontend/src/shared/i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4589,7 +4589,8 @@
45894589
"testPipeline": "Test pipeline"
45904590
},
45914591
"playground": {
4592-
"title": "Test pipeline",
4592+
"titleFilter": "Test pipeline",
4593+
"titleRule": "Test rule",
45934594
"noDataTypes": "This pipeline has no data types assigned yet — add one to test it.",
45944595
"dataTypeLabel": "Data type",
45954596
"dataTypePlaceholder": "No data types available",

frontend/src/shared/i18n/locales/es.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5140,5 +5140,52 @@
51405140
"level2": "Nivel 2",
51415141
"level3": "Nivel 3"
51425142
}
5143+
},
5144+
"playground": {
5145+
"titleFilter": "Probar pipeline",
5146+
"titleRule": "Probar regla",
5147+
"noDataTypes": "Este pipeline aún no tiene tipos de datos asignados — añade uno para probarlo.",
5148+
"dataTypeLabel": "Tipo de dato",
5149+
"dataTypePlaceholder": "No hay tipos de datos disponibles",
5150+
"dataTypeSingleHint": "Este pipeline solo tiene un tipo de dato — añade más para poder elegir.",
5151+
"rawLogLabel": "Log en crudo",
5152+
"rawLogPlaceholder": "Pega una línea de log de ejemplo…",
5153+
"rawLogCounter": "{{chars}} caracteres · {{kb}} KB",
5154+
"rawLogTooLarge": "Este log supera el límite de 1 MB — recórtalo antes de ejecutar la prueba.",
5155+
"run": {
5156+
"label": "Ejecutar",
5157+
"running": "Probando…",
5158+
"waitHint": "Esto puede tardar hasta 15 segundos mientras el pipeline procesa el log."
5159+
},
5160+
"errors": {
5161+
"busy": "El playground está ocupado con otra prueba — inténtalo de nuevo en un momento.",
5162+
"timeout": "La prueba agotó el tiempo — normalmente significa que el tipo de dato seleccionado no coincide con el formato del log.",
5163+
"validation": "La solicitud no era válida — revisa el log en crudo y el contenido del pipeline.",
5164+
"server": "El playground no pudo completar la prueba — inténtalo de nuevo."
5165+
},
5166+
"result": {
5167+
"label": "Resultado procesado",
5168+
"empty": "Ejecuta una prueba para ver aquí el evento procesado.",
5169+
"loading": "Esperando el evento procesado…",
5170+
"tabs": {
5171+
"fields": "Campos",
5172+
"json": "JSON"
5173+
},
5174+
"fieldsCount_one": "{{count}} campo",
5175+
"fieldsCount_other": "{{count}} campos",
5176+
"copy": "Copiar",
5177+
"copied": "Copiado",
5178+
"elapsed": "Procesado en {{time}}",
5179+
"elapsedHint": "Tiempo desde Ejecutar hasta el resultado procesado",
5180+
"searchPlaceholder": "Buscar campos…",
5181+
"noMatch": "Ningún campo coincide con tu búsqueda."
5182+
},
5183+
"alerts": {
5184+
"label": "Alertas",
5185+
"empty": "Ejecuta una prueba para ver aquí las alertas resultantes.",
5186+
"none": "No se activó ninguna alerta.",
5187+
"count_one": "{{count}} alerta",
5188+
"count_other": "{{count}} alertas"
5189+
}
51435190
}
51445191
}

frontend/src/shared/i18n/locales/fr.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5178,5 +5178,52 @@
51785178
"level2": "Niveau 2",
51795179
"level3": "Niveau 3"
51805180
}
5181+
},
5182+
"playground": {
5183+
"titleFilter": "Tester le pipeline",
5184+
"titleRule": "Tester la règle",
5185+
"noDataTypes": "Aucun type de données n'est encore attribué à ce pipeline — ajoutez-en un pour le tester.",
5186+
"dataTypeLabel": "Type de données",
5187+
"dataTypePlaceholder": "Aucun type de données disponible",
5188+
"dataTypeSingleHint": "Ce pipeline n'a qu'un seul type de données — ajoutez-en d'autres pour pouvoir choisir.",
5189+
"rawLogLabel": "Journal brut",
5190+
"rawLogPlaceholder": "Collez une ligne de journal d'exemple…",
5191+
"rawLogCounter": "{{chars}} car. · {{kb}} Ko",
5192+
"rawLogTooLarge": "Ce journal dépasse la limite de 1 Mo — réduisez-le avant d'exécuter le test.",
5193+
"run": {
5194+
"label": "Exécuter",
5195+
"running": "Test en cours…",
5196+
"waitHint": "Cela peut prendre jusqu'à 15 secondes pendant que le pipeline traite le journal."
5197+
},
5198+
"errors": {
5199+
"busy": "Le playground exécute déjà un autre test — veuillez réessayer sous peu.",
5200+
"timeout": "Le test a expiré — cela signifie généralement que le type de données sélectionné ne correspond pas au format du journal.",
5201+
"validation": "La requête est invalide — vérifiez le journal brut et le contenu du pipeline.",
5202+
"server": "Le playground n'a pas pu terminer le test — veuillez réessayer."
5203+
},
5204+
"result": {
5205+
"label": "Résultat analysé",
5206+
"empty": "Exécutez un test pour voir ici l'événement analysé.",
5207+
"loading": "En attente de l'événement analysé…",
5208+
"tabs": {
5209+
"fields": "Champs",
5210+
"json": "JSON"
5211+
},
5212+
"fieldsCount_one": "{{count}} champ",
5213+
"fieldsCount_other": "{{count}} champs",
5214+
"copy": "Copier",
5215+
"copied": "Copié",
5216+
"elapsed": "Analysé en {{time}}",
5217+
"elapsedHint": "Temps entre Exécuter et le résultat analysé",
5218+
"searchPlaceholder": "Rechercher des champs…",
5219+
"noMatch": "Aucun champ ne correspond à votre recherche."
5220+
},
5221+
"alerts": {
5222+
"label": "Alertes",
5223+
"empty": "Exécutez un test pour voir ici les alertes déclenchées.",
5224+
"none": "Aucune alerte n'a été déclenchée.",
5225+
"count_one": "{{count}} alerte",
5226+
"count_other": "{{count}} alertes"
5227+
}
51815228
}
51825229
}

frontend/src/shared/i18n/locales/it.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5178,5 +5178,52 @@
51785178
"level2": "Livello 2",
51795179
"level3": "Livello 3"
51805180
}
5181+
},
5182+
"playground": {
5183+
"titleFilter": "Prova pipeline",
5184+
"titleRule": "Prova regola",
5185+
"noDataTypes": "A questa pipeline non è ancora assegnato alcun tipo di dato — aggiungine uno per provarla.",
5186+
"dataTypeLabel": "Tipo di dato",
5187+
"dataTypePlaceholder": "Nessun tipo di dato disponibile",
5188+
"dataTypeSingleHint": "Questa pipeline ha un solo tipo di dato — aggiungine altri per poter scegliere.",
5189+
"rawLogLabel": "Log grezzo",
5190+
"rawLogPlaceholder": "Incolla una riga di log di esempio…",
5191+
"rawLogCounter": "{{chars}} caratteri · {{kb}} KB",
5192+
"rawLogTooLarge": "Questo log supera il limite di 1 MB — riducilo prima di eseguire il test.",
5193+
"run": {
5194+
"label": "Esegui",
5195+
"running": "Test in corso…",
5196+
"waitHint": "Può richiedere fino a 15 secondi mentre la pipeline elabora il log."
5197+
},
5198+
"errors": {
5199+
"busy": "Il playground sta eseguendo un altro test — riprova a breve.",
5200+
"timeout": "Il test è scaduto — di solito significa che il tipo di dato selezionato non corrisponde al formato del log.",
5201+
"validation": "La richiesta non è valida — controlla il log grezzo e il contenuto della pipeline.",
5202+
"server": "Il playground non è riuscito a completare il test — riprova."
5203+
},
5204+
"result": {
5205+
"label": "Risultato elaborato",
5206+
"empty": "Esegui un test per vedere qui l'evento elaborato.",
5207+
"loading": "In attesa dell'evento elaborato…",
5208+
"tabs": {
5209+
"fields": "Campi",
5210+
"json": "JSON"
5211+
},
5212+
"fieldsCount_one": "{{count}} campo",
5213+
"fieldsCount_other": "{{count}} campi",
5214+
"copy": "Copia",
5215+
"copied": "Copiato",
5216+
"elapsed": "Elaborato in {{time}}",
5217+
"elapsedHint": "Tempo tra Esegui e il risultato elaborato",
5218+
"searchPlaceholder": "Cerca campi…",
5219+
"noMatch": "Nessun campo corrisponde alla tua ricerca."
5220+
},
5221+
"alerts": {
5222+
"label": "Avvisi",
5223+
"empty": "Esegui un test per vedere qui gli avvisi generati.",
5224+
"none": "Nessun avviso è stato generato.",
5225+
"count_one": "{{count}} avviso",
5226+
"count_other": "{{count}} avvisi"
5227+
}
51815228
}
51825229
}

0 commit comments

Comments
 (0)