Skip to content

Commit c2e6c68

Browse files
derick-montaguerfrandse
authored andcommitted
Resolve Content-Security-Policy error
In Firefox there was an no unsafe eval error which was caused when users had the vue dev tools extenstion installed and enabled. The other issue was the loading of a resrouce at inline (style-src) which was caused by the SVG icons coming from the Carbon icons vue library. - Updated the Carbon icons to the latest version to resolve the CSP issue. - Remove chainwebpack option only used for prefecth as this is not needed. Originally this was an issue when using code splitting. Changing how we import views for routes and creating a single bundle removes the need for this option. - Update how fill color is applied to StatusIcon component. The Carbon icons update results in adding the fill property to the svg container does not cascade resulting in all icons rendering as their default fill color. GitHub Issue: openbmc#32 Signed-off-by: Derick Montague <[email protected]> Change-Id: I4846f80c993c129d5e88fceda13d53fab51d7c8a
1 parent 717d7a9 commit c2e6c68

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
1515
},
1616
"dependencies": {
17-
"@carbon/icons-vue": "10.6.1",
17+
"@carbon/icons-vue": "10.19.0",
1818
"@novnc/novnc": "1.2.0",
1919
"axios": "0.19.0",
2020
"bootstrap": "4.4.1",

public/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4+
<meta http-equiv="Content-Security-Policy">
45
<meta charset="utf-8">
56
<meta http-equiv="X-UA-Compatible" content="IE=edge">
67
<meta name="viewport" content="width=device-width,initial-scale=1.0">

src/components/Global/StatusIcon.vue

+11-9
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,26 @@ export default {
3636
<style lang="scss" scoped>
3737
.status-icon {
3838
vertical-align: text-bottom;
39+
3940
&.info {
40-
fill: theme-color('info');
41+
color: theme-color('info');
4142
}
4243
&.success {
43-
fill: theme-color('success');
44+
color: theme-color('success');
4445
}
4546
&.danger {
46-
fill: theme-color('danger');
47+
color: theme-color('danger');
4748
}
4849
&.secondary {
49-
fill: gray('600');
50-
51-
svg {
52-
transform: rotate(-45deg);
53-
}
50+
color: gray('600');
51+
transform: rotate(-45deg);
5452
}
5553
&.warning {
56-
fill: theme-color('warning');
54+
color: theme-color('warning');
55+
}
56+
57+
svg {
58+
fill: currentColor;
5759
}
5860
}
5961
</style>

vue.config.js

-6
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ module.exports = {
8585
);
8686
}
8787
},
88-
chainWebpack: config => {
89-
if (process.env.NODE_ENV === 'production') {
90-
config.plugins.delete('prefetch');
91-
config.plugins.delete('preload');
92-
}
93-
},
9488
pluginOptions: {
9589
i18n: {
9690
localeDir: 'locales',

0 commit comments

Comments
 (0)