Skip to content

Commit

Permalink
added router as a dep
Browse files Browse the repository at this point in the history
  • Loading branch information
cecoeco committed Aug 4, 2024
1 parent b2a195b commit 3e3ca8d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RUN julia -e 'using Pkg;\
"PRISMA"\
]);'

CMD julia app.jl
CMD ["julia", "app.jl"]
10 changes: 7 additions & 3 deletions app/backend/app.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Oxygen.post("/checklist/export") do req::HTTP.Request
end
end

function bytes(fd::PRISMA.FlowDiagram, format::AbstractString)
function bytes(fd::PRISMA.FlowDiagram, format::AbstractString)::String
tempfile::String = Base.Filesystem.tempname() * "." * format
flow_diagram_save(tempfile, fd)
try
Expand Down Expand Up @@ -99,7 +99,9 @@ Oxygen.post("/flow_diagram/generate") do req::HTTP.Request
arrow_width = flow_diagram_options["arrow_width"]
)

return Oxygen.json(status=200, Dict{String,String}("svg" => bytes(flow_diagram_dot, "svg")))
flow_diagram_svg::String = bytes(flow_diagram_dot, "svg")

return Oxygen.json(status=200, Dict{String,String}("svg" => flow_diagram_svg))
catch error
return Oxygen.json(status=500, Dict{String,String}("error" => "error generating flow diagram: $error"))
end
Expand Down Expand Up @@ -136,7 +138,9 @@ Oxygen.post("/flow_diagram/export") do req::HTTP.Request
arrow_width = flow_diagram_options["arrow_width"]
)

return Oxygen.json(status=200, Dict{String,String}("flow_diagram" => bytes(flow_diagram_dot, flow_diagram_options["format"])))
flow_diagram_bytes::String = bytes(flow_diagram_dot, flow_diagram_options["format"])

return Oxygen.json(status=200, Dict{String,String}("flow_diagram" => flow_diagram_bytes))
catch error
return Oxygen.json(status=500, Dict{String,String}("error" => "error generating flow diagram: $error"))
end
Expand Down
12 changes: 6 additions & 6 deletions app/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"vite-plugin-solid-svg": "0.8.1"
},
"dependencies": {
"@solidjs/router": "^0.14.1",
"solid-js": "1.8.11"
}
}
37 changes: 18 additions & 19 deletions app/frontend/src/pages/checklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { createSignal } from "solid-js";

import "../assets/css/checklist.css";

import Cloud from "../assets/svgs/cloud.svg";
import CircleX from "../assets/svgs/circle-x.svg";
import MagnifyingGlass from "../assets/svgs/magnifying-glass.svg";
import X from "../assets/svgs/x.svg";
import Square from "../assets/svgs/square.svg";
import SquareCheck from "../assets/svgs/square-check.svg";
import AtoZ from "../assets/svgs/atoz.svg";
import ZtoA from "../assets/svgs/ztoa.svg";
import Edit from "../assets/svgs/edit.svg";
import DoubleLeft from "../assets/svgs/double-left.svg";
import Left from "../assets/svgs/left.svg";
import Right from "../assets/svgs/right.svg";
import DoubleRight from "../assets/svgs/double-right.svg";
import Download from "../assets/svgs/download.svg";
import Trash from "../assets/svgs/trash.svg";
import Cloud from "../assets/svgs/cloud.svg?component-solid";
import CircleX from "../assets/svgs/circle-x.svg?component-solid";
import MagnifyingGlass from "../assets/svgs/magnifying-glass.svg?component-solid";
import X from "../assets/svgs/x.svg?component-solid";
import Square from "../assets/svgs/square.svg?component-solid";
import SquareCheck from "../assets/svgs/square-check.svg?component-solid";
import AtoZ from "../assets/svgs/atoz.svg?component-solid";
import ZtoA from "../assets/svgs/ztoa.svg?component-solid";
import Edit from "../assets/svgs/edit.svg?component-solid";
import DoubleLeft from "../assets/svgs/double-left.svg?component-solid";
import Left from "../assets/svgs/left.svg?component-solid";
import Right from "../assets/svgs/right.svg?component-solid";
import DoubleRight from "../assets/svgs/double-right.svg?component-solid";
import Download from "../assets/svgs/download.svg?component-solid";
import Trash from "../assets/svgs/trash.svg?component-solid";

export default function Checklist() {
const [files, setFiles] = createSignal([]);
Expand Down Expand Up @@ -197,7 +197,7 @@ export default function Checklist() {
return (
<tbody class="files-table-body">
{filtered.slice(start, end).map((file, index) => (
<tr class="file-table-body-row" key={index}>
<tr class="file-table-body-row">
<td title="select file" class="file-select">
{file.selected ? (
<SquareCheck
Expand Down Expand Up @@ -308,7 +308,6 @@ export default function Checklist() {
<span class="upload-file">
{file().name}
<CircleX
title="remove file"
class="remove-file-icon"
onMouseDown={handleFileRemove}
/>
Expand Down Expand Up @@ -359,9 +358,9 @@ export default function Checklist() {
onMouseDown={toggleAllFilesSelection}
>
{allSelected() ? (
<SquareCheck title="deselect all" class="file-select-icon" />
<SquareCheck class="file-select-icon" />
) : (
<Square title="select all" class="file-select-icon" />
<Square class="file-select-icon" />
)}
</th>
<th
Expand Down

0 comments on commit 3e3ca8d

Please sign in to comment.