Skip to content

Commit

Permalink
Merge branch 'main' into use-local-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
3keyroman authored Jul 6, 2024
2 parents fc78d12 + a1a5f56 commit 7d4ccf5
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 @@ -219,6 +220,12 @@ export const Assessment: React.FC<AssessmentProps> = ({ src }) => {
data.modules,
progress,
);
const url = generateURL(
progress,
assessmentName,
assessorName,
useCaseDescription,
);
exportToPDF(
progress,
chartRef.current,
Expand All @@ -228,6 +235,8 @@ export const Assessment: React.FC<AssessmentProps> = ({ src }) => {
assessmentName,
assessorName,
useCaseDescription,
url,
version,
).catch((error) => console.error("Error exporting to PDF:", error));
}
};
Expand Down
Loading

0 comments on commit 7d4ccf5

Please sign in to comment.