From f195f7e539fe9a2db7a88b84c4cf2c3589a95170 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Wed, 6 Dec 2023 12:33:03 +0100 Subject: [PATCH] fix: run all func --- .../src/components/Playground/Views/TestView.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/agenta-web/src/components/Playground/Views/TestView.tsx b/agenta-web/src/components/Playground/Views/TestView.tsx index ba34c49c78..3244a70240 100644 --- a/agenta-web/src/components/Playground/Views/TestView.tsx +++ b/agenta-web/src/components/Playground/Views/TestView.tsx @@ -1,9 +1,9 @@ -import React, {useState} from "react" +import React, {useEffect, useState} from "react" import {Button, Input, Card, Row, Col, Space} from "antd" import {CaretRightOutlined, PlusOutlined} from "@ant-design/icons" import {callVariant} from "@/lib/services/api" import {ChatMessage, ChatRole, GenericObject, Parameter, Variant} from "@/lib/Types" -import {randString, removeKeys, renameVariables, safeParse} from "@/lib/helpers/utils" +import {randString, removeKeys, renameVariables} from "@/lib/helpers/utils" import LoadTestsModal from "../LoadTestsModal" import AddToTestSetDrawer from "../AddToTestSetDrawer/AddToTestSetDrawer" import {DeleteOutlined} from "@ant-design/icons" @@ -210,6 +210,15 @@ const App: React.FC = ({inputParams, optParams, variant, isChatVa const [params, setParams] = useState | null>(null) const classes = useStylesApp() + useEffect(() => { + setResultsList((prevResultsList) => { + const newResultsList = testList.map((_, index) => { + return index < prevResultsList.length ? prevResultsList[index] : "" + }) + return newResultsList + }) + }, [testList]) + const setResultForIndex = (value: string, index: number) => { if (isChatVariant) { setTestList((prevState) =>