Skip to content

Commit a67b3e3

Browse files
authored
frontend changes (#689)
1 parent c30284b commit a67b3e3

29 files changed

Lines changed: 656 additions & 238 deletions

uptrain/dashboard/frontend/dashboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"react": "18.2.0",
2020
"react-calendly": "^4.3.0",
2121
"react-chartjs-2": "^5.2.0",
22+
"react-csv": "^2.2.2",
2223
"react-dom": "18.2.0",
2324
"react-redux": "^9.1.0",
2425
"tailwindcss": "3.3.5"

uptrain/dashboard/frontend/dashboard/src/components/CompareSection/CompareSection.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const CompareSection = (props) => {
4343
evaluationId2={props.projectData[secondIndex].evaluation_id}
4444
version1={props.projectData[firstIndex].prompt_version}
4545
version2={props.projectData[secondIndex].prompt_version}
46+
data1={props.projectData[firstIndex]}
47+
data2={props.projectData[secondIndex]}
4648
heading="Compare"
4749
/>
4850
)}
@@ -57,6 +59,7 @@ const CompareSection = (props) => {
5759
}
5860
selected={firstIndex}
5961
OnClick={handleFirstSelect}
62+
prelable="V "
6063
/>
6164
{firstIndex != null && (
6265
<SingleSelect
@@ -68,6 +71,7 @@ const CompareSection = (props) => {
6871
}
6972
selected={secondIndex}
7073
OnClick={handleSecondSelect}
74+
prelable="V "
7175
/>
7276
)}
7377
<p className="text-red-500">{error}</p>

uptrain/dashboard/frontend/dashboard/src/components/DropDowns/CustomMultiSelect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const CustomMultiSelect = (props) => {
4949
<DownArrow Selected={selected} />
5050
</div>
5151
{selected && (
52-
<div className="relative z-10 bg-[#171721]">
52+
<div className="relative z-10 bg-[#171721] overflow-x-scroll">
5353
<div className="bg-[#40404A] w-full h-[1px] my-2"></div>
5454
{/* <div className="flex justify-end items-center">
5555
<button className="text-[#5587FD] text-base">

uptrain/dashboard/frontend/dashboard/src/components/DropDowns/CustomSingleCheckBox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from "react";
22

3-
const CustomSingleCheckBox = ({ title, isChecked, handleCheckboxChange }) => {
3+
const CustomSingleCheckBox = ({ title, isChecked, handleCheckboxChange, prelable }) => {
44
return (
55
<div className="flex gap-3 items-center">
66
<input
77
type="checkbox"
88
checked={isChecked}
99
onChange={handleCheckboxChange}
1010
/>
11-
<label className="text-[#B6B6B9] font-medium">{title}</label>
11+
<label className="text-[#B6B6B9] font-medium">{prelable} {title}</label>
1212
</div>
1313
);
1414
};

uptrain/dashboard/frontend/dashboard/src/components/DropDowns/SingleSelect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const SingleSelect = (props) => {
3232
>
3333
<p className="text-[#F5F5F5]">
3434
{props.selections && props.selections[props.selected]
35-
? props.selections[props.selected]
35+
? `${props.prelable != undefined ? props.prelable : ""} ${
36+
props.selections[props.selected]
37+
}`
3638
: props.placeholder}
3739
</p>
3840
<DownArrow Selected={selected} />
@@ -54,6 +56,7 @@ const SingleSelect = (props) => {
5456
: () => props.OnClick(index)
5557
: () => props.OnClick(index)
5658
}
59+
prelable={props.prelable}
5760
/>
5861
))}
5962
</div>

uptrain/dashboard/frontend/dashboard/src/components/Evaluations/ChartPage/ChartPage.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,48 @@ const ChartPage = (props) => {
240240
});
241241
}
242242

243+
if (filteredData) {
244+
Object.entries(projectFilters).map(([key, value]) => {
245+
if (key != "index" && key != "scores" && key != "confidence") {
246+
if (
247+
projectFilters[key].filterCondition == "contains" &&
248+
projectFilters[key].filterinput
249+
) {
250+
filteredData[0] = filteredData[0].filter((item) => {
251+
return item[key].includes(projectFilters[key].filterinput);
252+
});
253+
}
254+
255+
if (
256+
projectFilters[key].filterCondition == "does not contain" &&
257+
projectFilters[key].filterinput
258+
) {
259+
filteredData[0] = filteredData[0].filter((item) => {
260+
return item[key].indexOf(projectFilters[key].filterinput) == -1;
261+
});
262+
}
263+
264+
if (
265+
projectFilters[key].filterCondition == "starts with" &&
266+
projectFilters[key].filterinput
267+
) {
268+
filteredData[0] = filteredData[0].filter((item) => {
269+
return item[key].startsWith(projectFilters[key].filterinput);
270+
});
271+
}
272+
273+
if (
274+
projectFilters[key].filterCondition == "ends with" &&
275+
projectFilters[key].filterinput
276+
) {
277+
filteredData[0] = filteredData[0].filter((item) => {
278+
return item[key].endsWith(projectFilters[key].filterinput);
279+
});
280+
}
281+
}
282+
});
283+
}
284+
243285
return (
244286
<Layout
245287
heading="Evaluations"
@@ -283,6 +325,7 @@ const ChartPage = (props) => {
283325
<TableSection
284326
projectData={filteredData}
285327
selectedTab={selectedTab}
328+
evaluationId={evaluationId}
286329
/>
287330
</>
288331
) : (

uptrain/dashboard/frontend/dashboard/src/components/Evaluations/Logs/AllLogs.js renamed to uptrain/dashboard/frontend/dashboard/src/components/Evaluations/ChartPage/Logs/AllLogs.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import React from "react";
22
import AllLogsRow from "./AllLogsRow";
3+
import TopBar from "./TopBar";
34

45
const AllLogs = (props) => {
56
return (
67
<div>
7-
{/* <TopBar /> */}
8+
<TopBar projectData={props.projectData} selectedTab={props.selectedTab} />
89
{props.projectData &&
910
props.projectData[0] &&
1011
props.projectData[0].map((item, index) => (
1112
<AllLogsRow
1213
key={index}
13-
index={index}
14+
index={item.id}
15+
id={item.id}
1416
question={item.question}
1517
response={item.response}
1618
item={item}
@@ -23,6 +25,7 @@ const AllLogs = (props) => {
2325
uuid={item["row_uuid"]}
2426
AiConfidence={item[`score_confidence_${props.selectedTab}`]}
2527
projectName={item.project}
28+
evaluationId={props.evaluationId}
2629
/>
2730
))}
2831
</div>

uptrain/dashboard/frontend/dashboard/src/components/Evaluations/Logs/AllLogsRow.js renamed to uptrain/dashboard/frontend/dashboard/src/components/Evaluations/ChartPage/Logs/AllLogsRow.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import AllLogsRowTop from "./AllLogsRowTop";
33
import Divider from "./Divider";
44
import DataRow from "./DataRow";
55
import DataModal from "./DataModal";
6-
import LikeModal from "./LikeModal";
76

87
const AllLogsRow = (props) => {
98
const [expand, setExpand] = useState(false);
109
const [showFull, setShowFull] = useState(false);
11-
const [showLikeModal, setShowLikeModal] = useState(false);
1210

1311
let index =
1412
typeof props.index !== "string" ? String(props.index + 1) : props.index;
@@ -17,7 +15,12 @@ const AllLogsRow = (props) => {
1715
}
1816

1917
return (
20-
<div className="bg-[#23232D] py-2.5 px-4 rounded-xl mb-4 ">
18+
<div
19+
className={`bg-[#23232D] py-2.5 px-4 rounded-xl mb-4 border border-[#23232D] hover:bg-[#171721] hover:border-[#5587fd] text-left`}
20+
onClick={() => {
21+
!expand && setExpand(true);
22+
}}
23+
>
2124
{!props.inModal && showFull && (
2225
<DataModal
2326
onClick={() => setShowFull(!showFull)}
@@ -36,15 +39,7 @@ const AllLogsRow = (props) => {
3639
projectName={props.projectName}
3740
/>
3841
)}
39-
{showLikeModal && (
40-
<LikeModal
41-
onClick={() => setShowLikeModal(false)}
42-
uuid={props.uuid}
43-
selectedTab={props.selectedTab}
44-
score={props.score}
45-
projectName={props.projectName}
46-
/>
47-
)}
42+
4843
<AllLogsRowTop
4944
index={index}
5045
question={props.question}
@@ -54,11 +49,11 @@ const AllLogsRow = (props) => {
5449
setExpand={setExpand}
5550
inModal={props.inModal}
5651
selectedTab={props.selectedTab}
57-
setShowLikeModal={setShowLikeModal}
5852
updated={props.updated}
5953
uuid={props.uuid}
6054
projectName={props.projectName}
6155
AiConfidence={props.AiConfidence}
56+
evaluationId={props.evaluationId}
6257
/>
6358
{expand || props.inModal ? (
6459
<>

0 commit comments

Comments
 (0)