Skip to content

Commit

Permalink
chore: update chart.js and add to modules (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig authored Mar 18, 2024
1 parent 65ad7b6 commit 0ebf434
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
1 change: 0 additions & 1 deletion client/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ cp $SrcDir/js/Env.js.example $DistDir/js
cp -r $SrcDir/js/modules $DistDir/js/modules
cd $SrcDir/js
uglifyjs \
'chart.min.js' \
'diff.js' \
'diff2html.min.js' \
'stigmanUtils.js' \
Expand Down
1 change: 1 addition & 0 deletions client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<link rel="stylesheet" type="text/css" href="css/init.css" />
<link rel="icon" type="image/svg+xml" href="img/shield-green-check.svg">
<script type="text/javascript" src="js/Env.js"></script>
<script type="importmap">{"imports": {"@kurkle/color": "./js/modules/node_modules/@kurkle/color/dist/color.esm.js"}}</script>
<script type="module" src="js/init.js"></script>
</head>
<body>
Expand Down
13 changes: 0 additions & 13 deletions client/src/js/chart.min.js

This file was deleted.

6 changes: 5 additions & 1 deletion client/src/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ async function loadResources() {
}
document.head.appendChild(link)
}

const { Chart } = await import('./modules/node_modules/chart.js/auto/auto.js')
window.Chart = Chart

for (const src of scripts) {
const script = document.createElement('script')
script.src = src
Expand All @@ -39,7 +43,7 @@ async function loadResources() {
const { serializeError } = await import('./modules/node_modules/serialize-error/index.js')
STIGMAN.serializeError = serializeError
STIGMAN.ClientModules = await import('./modules/node_modules/@nuwcdivnpt/stig-manager-client-modules/index.js')

STIGMAN.isMinimizedSource = isMinimizedSource
}

Expand Down
17 changes: 17 additions & 0 deletions client/src/js/modules/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 client/src/js/modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"dependencies": {
"@nuwcdivnpt/stig-manager-client-modules": "^1.4.1",
"chart.js": "^4.4.2",
"serialize-error": "^11.0.0"
}
}
1 change: 0 additions & 1 deletion client/src/js/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const scripts = [
'ext/adapter/ext/ext-base-debug.js',
'ext/ext-all-debug-w-comments.js',
'ext/ux/GroupSummary.js',
'js/chart.min.js',
'js/diff.js',
'js/diff2html.min.js',
'js/stigmanUtils.js',
Expand Down

0 comments on commit 0ebf434

Please sign in to comment.