Skip to content

Commit

Permalink
Merge pull request #13 from pkic/improve-pdf-layout
Browse files Browse the repository at this point in the history
Improve PDF data and layout
  • Loading branch information
vanbroup authored Jul 6, 2024
2 parents 9b17714 + 1443066 commit a1a5f56
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 33 deletions.
10 changes: 10 additions & 0 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@react-pdf/renderer": "^3.4.4",
"date-fns": "^3.6.0",
"js-yaml": "^4.1.0",
"react": "^18.3.1",
"react-chartjs-2": "^5.2.0",
Expand Down
9 changes: 9 additions & 0 deletions src/components/Assessment/Assessment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Assessment: React.FC<AssessmentProps> = ({ src }) => {
applicability: true,
};

const version = "0.0.1";
const [data, setData] = useState<AssessmentData | null>(null);
const [progress, setProgress] = useState<Record<string, ProgressData>>({});
const [currentTab, setCurrentTab] = useState<string | null>(null);
Expand Down Expand Up @@ -173,6 +174,12 @@ export const Assessment: React.FC<AssessmentProps> = ({ src }) => {
data.modules,
progress,
);
const url = generateURL(
progress,
assessmentName,
assessorName,
useCaseDescription,
);
exportToPDF(
progress,
chartRef.current,
Expand All @@ -182,6 +189,8 @@ export const Assessment: React.FC<AssessmentProps> = ({ src }) => {
assessmentName,
assessorName,
useCaseDescription,
url,
version,
);
}
};
Expand Down
Loading

0 comments on commit a1a5f56

Please sign in to comment.