merge conflicts and small bug of page number

pull/67/head
s8613 2025-06-15 12:05:07 +02:00
parent 5203d5b075
commit 6285be6d40
2 changed files with 29 additions and 15 deletions

View File

@ -286,18 +286,22 @@ export default function KennzahlenTable({
)} )}
</TableCell> </TableCell>
<TableCell align="center"> <TableCell align="center">
<Link {(row.extractedValues.at(0)?.page ?? 0) > 0 ? (
component="button" <Link
onClick={() => component="button"
onPageClick?.( onClick={() => {
Number(row.extractedValues.at(0)?.page), const extractedValue = row.extractedValues.at(0);
row.extractedValues.at(0)?.entity || "", if (extractedValue?.page && extractedValue.page > 0) {
) onPageClick?.(Number(extractedValue.page), extractedValue.entity || "");
} }
sx={{ cursor: "pointer" }} }}
> sx={{ cursor: "pointer" }}
{row.extractedValues.at(0)?.page} >
</Link> {row.extractedValues.at(0)?.page}
</Link>
) : (
""
)}
</TableCell> </TableCell>
</TableRow> </TableRow>
); );

View File

@ -30,8 +30,6 @@ import { useEffect, useState } from "react";
import PDFViewer from "../components/pdfViewer"; import PDFViewer from "../components/pdfViewer";
import { fetchPutKPI } from "../util/api"; import { fetchPutKPI } from "../util/api";
import { kpiQueryOptions } from "../util/query"; import { kpiQueryOptions } from "../util/query";
import ArrowBackIcon from "@mui/icons-material/ArrowBack";
import {fetchPutKPI} from "../util/api";
import { redirect } from "@tanstack/react-router"; import { redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/extractedResult_/$pitchBook/$kpi")({ export const Route = createFileRoute("/extractedResult_/$pitchBook/$kpi")({
@ -78,9 +76,21 @@ function ExtractedResultsPage() {
const { mutate: updateKPI } = useMutation({ const { mutate: updateKPI } = useMutation({
mutationFn: () => { mutationFn: () => {
const updatedData = { ...kpiData }; const updatedData = { ...kpiData };
let baseObject;
if (selectedIndex >= 0) {
baseObject = kpiValues[selectedIndex];
} else {
baseObject = {
label: kpi.toUpperCase(),
entity: selectedValue,
page: 0,
status: "single-source",
source: "manual",
};
}
updatedData[kpi.toUpperCase()] = [ updatedData[kpi.toUpperCase()] = [
{ {
...kpiValues[0], ...baseObject,
entity: selectedValue, entity: selectedValue,
}, },
]; ];