Skip to content

Commit d83af2f

Browse files
committed
fix(test definitions): display labels from test type yaml
1 parent 00e6efb commit d83af2f

5 files changed

Lines changed: 16 additions & 5 deletions

File tree

testgen/template/dbsetup_test_types/test_types_Valid_Characters.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ test_types:
2121
default_parm_columns: threshold_value
2222
default_parm_values: |-
2323
0
24-
default_parm_prompts: null
24+
default_parm_prompts: |-
25+
Threshold Invalid Value Count
2526
default_parm_help: |-
2627
The acceptable number of records with invalid character values present.
2728
default_severity: Warning

testgen/template/dbsetup_test_types/test_types_Valid_US_Zip.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ test_types:
2121
default_parm_columns: threshold_value
2222
default_parm_values: |-
2323
0
24-
default_parm_prompts: null
24+
default_parm_prompts: |-
25+
Threshold Invalid Value Count
2526
default_parm_help: null
2627
default_severity: Warning
2728
run_type: CAT

testgen/template/dbsetup_test_types/test_types_Valid_US_Zip3.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ test_types:
2121
default_parm_columns: threshold_value
2222
default_parm_values: |-
2323
0
24-
default_parm_prompts: null
24+
default_parm_prompts: |-
25+
Threshold Invalid Value Count
2526
default_parm_help: null
2627
default_severity: Warning
2728
run_type: CAT

testgen/ui/components/frontend/js/pages/test_definitions.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { ProfilingResultsDialog } from '../shared/profiling_results_dialog.js';
2121
import { AXES, FACET_AXES, GROUP_BY_AXES, EMPTY, appliesToSelectedColumn } from '/app/static/js/components/test_picker_taxonomy.js';
2222
import { enterPage, exitPage, getPageSignal } from '/app/static/js/page_lifecycle.js';
2323
import { jsonObject, maxLength } from '/app/static/js/form_validators.js';
24+
import { capitalize } from '/app/static/js/display_utils.js';
2425

2526
const { button: btn, div, i: icon, span, strong } = van.tags;
2627

@@ -820,6 +821,8 @@ const DetailPanel = (row) => {
820821
const paramCols = row.default_parm_columns
821822
? row.default_parm_columns.split(',').map(c => c.trim()).filter(Boolean)
822823
: [];
824+
const paramLabels = (row.default_parm_prompts || '').split(',').map(v => v.trim());
825+
const paramHelp = (row.default_parm_help || '').split('|').map(v => v.trim());
823826

824827
return div(
825828
{ class: 'flex-column fx-gap-3 border border-radius-1 p-4 mt-2' },
@@ -836,7 +839,11 @@ const DetailPanel = (row) => {
836839
Attribute({ label: 'Lock Refresh', value: row.lock_refresh_display }),
837840
Attribute({ label: 'Urgency', value: row.urgency }),
838841
Attribute({ label: 'Export to Observability', value: row.export_to_observability_display }),
839-
...paramCols.map(col => Attribute({ label: col, value: String(row[col] ?? '') })),
842+
...paramCols.map((col, index) => Attribute({
843+
label: paramLabels[index] || capitalize(col.replaceAll('_', ' ')),
844+
help: paramHelp[index] || null,
845+
value: String(row[col] ?? ''),
846+
})),
840847
),
841848
div(
842849
{ class: 'flex-column fx-flex fx-gap-3' },

testgen/ui/static/js/components/test_definition_form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import { Textarea } from './textarea.js';
7373
import { RadioGroup } from './radio_group.js';
7474
import { Caption } from './caption.js';
7575
import { numberBetween, required } from '../form_validators.js';
76+
import { capitalize } from '../display_utils.js';
7677

7778
const { div, span } = van.tags;
7879

@@ -108,7 +109,7 @@ const TestDefinitionForm = (/** @type Properties */ props) => {
108109
.map((column, index) => ({
109110
...(PARAMETER_CONFIG[column] || { type: 'text' }),
110111
column,
111-
label: paramLabels[index] || column.replaceAll('_', ' '),
112+
label: paramLabels[index] || capitalize(column.replaceAll('_', ' ')),
112113
help: paramHelp[index] || null,
113114
validators: paramRequired[index] ? [required] : undefined,
114115
}))

0 commit comments

Comments
 (0)