Skip to content
Snippets Groups Projects
Commit d53026c6 authored by deep1401's avatar deep1401
Browse files

Fix field names and fix bug in View CSV Modal for single scores

parent 244f2f0b
No related branches found
No related tags found
No related merge requests found
...@@ -464,8 +464,8 @@ function CustomAutocompleteWidget<T = any, S extends StrictRJSFSchema = RJSFSche ...@@ -464,8 +464,8 @@ function CustomAutocompleteWidget<T = any, S extends StrictRJSFSchema = RJSFSche
type EvaluationField = { type EvaluationField = {
name: string; name: string;
regex: string; expression: string;
outputType: 'boolean' | 'number'; return_type: 'boolean' | 'number';
}; };
const CustomEvaluationWidget = (props: WidgetProps<any>) => { const CustomEvaluationWidget = (props: WidgetProps<any>) => {
...@@ -480,7 +480,7 @@ const CustomEvaluationWidget = (props: WidgetProps<any>) => { ...@@ -480,7 +480,7 @@ const CustomEvaluationWidget = (props: WidgetProps<any>) => {
const handleAddField = () => { const handleAddField = () => {
setEvalMetrics([ setEvalMetrics([
...evalMetrics, ...evalMetrics,
{ name: '', regex: '', outputType: 'boolean' } { name: '', expression: '', return_type: 'boolean' }
]); ]);
}; };
...@@ -522,18 +522,18 @@ const CustomEvaluationWidget = (props: WidgetProps<any>) => { ...@@ -522,18 +522,18 @@ const CustomEvaluationWidget = (props: WidgetProps<any>) => {
/> />
<Textarea <Textarea
placeholder="Regular Expression" placeholder="Regular Expression"
value={evaluation.regex} value={evaluation.expression}
onChange={(e) => onChange={(e) =>
handleFieldChange(index, 'regex', e.target.value) handleFieldChange(index, 'expression', e.target.value)
} }
disabled={disabled || readonly} disabled={disabled || readonly}
style={{ marginBottom: '0.5rem' }} style={{ marginBottom: '0.5rem' }}
/> />
<Select <Select
placeholder="Output Type" placeholder="Output Type"
value={evaluation.outputType} value={evaluation.return_type}
onChange={(e, newValue) => onChange={(e, newValue) =>
handleFieldChange(index, 'outputType', newValue as string) handleFieldChange(index, 'return_type', newValue as string)
} }
disabled={disabled || readonly} disabled={disabled || readonly}
style={{ marginBottom: '0.5rem' }} style={{ marginBottom: '0.5rem' }}
......
...@@ -75,7 +75,8 @@ function formatEvalData(data) { ...@@ -75,7 +75,8 @@ function formatEvalData(data) {
} }
function formatArrayOfScores(scores) { function formatArrayOfScores(scores) {
const formattedScores = scores.map((score) => { const scoresArray = Array.isArray(scores) ? scores : [scores];
const formattedScores = scoresArray.map((score) => {
const metricName = Object.keys(score)[0]; const metricName = Object.keys(score)[0];
const value = Object.values(score)[0]; const value = Object.values(score)[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment