Skip to content

Commit

Permalink
fixed arrow 21 to 22
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed Aug 6, 2024
1 parent 23bade4 commit 6ddc289
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PRISMA"
uuid = "7b67a8d2-c4f5-4933-b91c-0fc427024db5"
authors = ["Ceco Elijah Maples <[email protected]>", "PRISMA.jl Contributors"]
version = "0.0.3"
version = "0.0.4"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand All @@ -10,6 +10,7 @@ Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Poppler_jll = "9c32591e-4766-534b-9725-b71a8799265b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
TidierStrings = "248e6834-d0f8-40ef-8fbb-8e711d883e9c"
Transformers = "21ca0261-441d-5938-ace7-c90938fde4d4"

[compat]
Expand All @@ -21,6 +22,7 @@ Graphviz_jll = "2.50"
LinearAlgebra = "1"
Poppler_jll = "24.6"
Statistics = "1"
TidierStrings = "0.2"
Transformers = "0.3"
XLSX = "0.10"
julia = "1"
Expand Down
18 changes: 13 additions & 5 deletions app/frontend/src/pages/checklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function Checklist() {

if (!response.ok) {
const errorData = await response.json();
const errorMessage = `Error submitting file: ${errorData.error}`;
const errorMessage = `Error generating checklist: ${errorData.error}`;
alert(errorMessage);
throw new Error(errorMessage);
}
Expand All @@ -100,9 +100,13 @@ export default function Checklist() {
setOpenedFile(newFile);
handleFileRemove();
} catch (error) {
console.error("Error submitting file:", error);
console.error("Error generating checklist:", error);
handleFileRemove();
alert(`File could not be sent to the server: ${error.message}`);
if (error instanceof Error) {
alert(`Error generating checklist: ${error.message}`);
} else {
alert("Error generating checklist: An unknown error occurred.");
}
}
};

Expand Down Expand Up @@ -272,8 +276,12 @@ export default function Checklist() {
a.remove();
}
} catch (error) {
console.error("Error exporting files:", error);
alert(`Error exporting files: ${error.message}`);
console.error("Error exporting checklist(s):", error);
if (error instanceof Error) {
alert(`Error exporting checklist(s): ${error.message}`);
} else {
alert("Error exporting checklist(s): An unknown error occurred.");
}
}
};

Expand Down
21 changes: 13 additions & 8 deletions app/frontend/src/pages/flow_diagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,14 @@ export default function FlowDiagram() {
container.innerHTML = svgData;
} else {
console.error("Flow diagram container element not found");
alert("Flow diagram container element not found.");
}
} catch (error) {
console.error("Error generating flow diagram:", error);
alert(`Error generating flow diagram: ${error.message}`);
console.error("Error fetching data:", error);
if (error instanceof Error) {
alert(`Error fetching flow diagram: ${error.message}`);
} else {
alert("Error fetching flow diagram: An unknown error occurred.");
}
}
}

Expand All @@ -415,7 +418,7 @@ export default function FlowDiagram() {

if (!response.ok) {
const errorData = await response.json();
const errorMessage = `Error fetching flow diagram: ${errorData.error}`;
const errorMessage = `Error downloading flow diagram: ${errorData.error}`;
alert(errorMessage);
throw new Error(errorMessage);
}
Expand All @@ -424,9 +427,7 @@ export default function FlowDiagram() {
const flowDiagramBytes = data.flow_diagram;

if (!flowDiagramBytes) {
const errorMessage = "No binary data received from the server.";
alert(errorMessage);
throw new Error(errorMessage);
throw new Error("No binary data received from the server.");
}

const mimeTypeMap: { [key: string]: string } = {
Expand All @@ -448,7 +449,11 @@ export default function FlowDiagram() {
URL.revokeObjectURL(url);
} catch (error) {
console.error("Error downloading flow diagram:", error);
alert(`Error downloading flow diagram: ${error.message}`);
if (error instanceof Error) {
alert(`Error downloading flow diagram: ${error.message}`);
} else {
alert("Error downloading flow diagram: An unknown error occurred.");
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/PRISMA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using Graphviz_jll: neato
using LinearAlgebra: norm, dot
using Poppler_jll: pdfinfo, pdftotext
using Statistics: mean
using TidierStrings
using Transformers: encode, @hgf_str

export checklist_df, checklist, Checklist
Expand Down
2 changes: 1 addition & 1 deletion src/flow_diagram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function flow_diagram(
if !(from in excluded_boxes) && !(to in excluded_boxes)
dot_lang *= """
$from -> $to [
arrowhead=$(from in Set([7, 21]) ? "none" : arrow_head),
arrowhead=$(from in Set([7, 21]) && to != 22 ? "none" : arrow_head),
arrowsize="$arrow_size",
color="$arrow_color",
penwidth="$arrow_width"
Expand Down

0 comments on commit 6ddc289

Please sign in to comment.