Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(RV-447): Add toolbar to extraction flows #454

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {

const apiUrl = import.meta.env.VITE_API_URL || "http://localhost:8000/";
const middlewareURL =
import.meta.env.VITE_MIDDLEWARE_URL || "http://localhost:8080/";
import.meta.env.VITE_MIDDLEWARE_URL || "http://localhost:8000/";

export const AlignImage = async (
args: AlignImageArgs,
Expand Down Expand Up @@ -45,7 +45,7 @@ export const ImageToText = async (
labels: JSON.stringify(fieldNames),
});

const imageToTextURL = `${middlewareURL}api/image_file_to_text`;
const imageToTextURL = `${middlewareURL}image_to_text`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to put dashes (-) instead of underscores (_) here? For example the url will come back as http://localhost:8000/image-to-text versus http://localhost:8000/image_to_text.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change the URL in the middleware at a later point. For now this should be ok.

try {
const response = await fetch(imageToTextURL, {
method: "POST",
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/ReviewTable.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.table-container-half {
background-color: white;
}

.information-display {
width: 100vw;
background-color: white;
}
14 changes: 3 additions & 11 deletions frontend/src/components/ReviewTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ErrorIcon from "../assets/error_icon.svg";
import { useNavigate } from "react-router-dom";

import "./ReviewTable.scss";
import Toolbar from "./Toolbar";

interface ReviewTableProps {
isSingle: boolean;
Expand Down Expand Up @@ -53,7 +54,6 @@ const ReviewTable = ({
maskShape,
index,
images,
setImages,
setIndex,
handleSubmit,
handleBack,
Expand All @@ -80,7 +80,7 @@ const ReviewTable = ({
<ExtractStepper currentStep={ExtractStep.Review} />
</div>

<div className="display-flex flex-justify-between padding-top-4">
<div className="display-flex flex-justify-between padding-top-4 information-display">
<div className="width-50 height-full table-container-half">
<div className="display-flex flex-column review-template-header-container">
<h2>Extracted Data</h2>
Expand Down Expand Up @@ -180,15 +180,7 @@ const ReviewTable = ({
<div className="image-container">
<div className="width-full bg-white border-gray-5 border-1px">
<div>
{images.map((_, index) => (
<Button
key={index}
onClick={() => handleImageChange(index)}
type="button"
>
Image {index + 1}
</Button>
))}
<Toolbar totalPages={images.length} onPageChange={(index) => handleImageChange(index - 1)} />
</div>
{images.map((image, innerIndex) => (
<svg
Expand Down
Loading