Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBUI-1496: BACKPORT: remove usage of unsafe eval from csp #2338

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions addons/nuxeo-csv/elements/nuxeo-document-import-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Polymer({
<template is="dom-if" if="[[!hasFile]]">
<div class="vertical layout center center-justified flex">
<div class="dropzone-label horizontal layout center center-justified">
<a href="javascript:undefined" on-tap="_showUploadDialog"> [[i18n('csv.import.clickOrDrop')]]</a>
<a href="#" on-tap="_showUploadDialog"> [[i18n('csv.import.clickOrDrop')]]</a>
</div>
</div>
</template>
Expand Down Expand Up @@ -581,7 +581,8 @@ Polymer({
}
},

_showUploadDialog() {
_showUploadDialog(e) {
e.preventDefault();
this.$.uploadFiles.click();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Polymer({
is-available="{{isProviderAvailable}}"
></nuxeo-liveconnect-box-provider>
<template is="dom-if" if="[[isProviderAvailable]]">
<a href="javascript:undefined" on-tap="_openPicker">
<a href="#" on-tap="_openPicker">
<iron-icon src="[[importPath]]images/box.png"></iron-icon>
[[i18n('liveconnectImportActions.box', 'Box')]]
</a>
Expand All @@ -78,7 +78,8 @@ Polymer({
this.$.provider.updateProviderInfo();
},

_openPicker() {
_openPicker(e) {
e.preventDefault();
this.$.provider.openPicker();
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Polymer({
is-available="{{isProviderAvailable}}"
></nuxeo-liveconnect-google-drive-provider>
<template is="dom-if" if="[[isProviderAvailable]]">
<a href="javascript:undefined" on-tap="_openPicker">
<a href="#" on-tap="_openPicker">
<iron-icon src="[[importPath]]images/google_drive.png"></iron-icon>
[[i18n('liveconnectImportActions.googledrive', 'Google Drive')]]
</a>
Expand All @@ -78,7 +78,8 @@ Polymer({
this.$.provider.updateProviderInfo();
},

_openPicker() {
_openPicker(e) {
e.preventDefault();
this.$.provider.openPicker();
},
});
5 changes: 5 additions & 0 deletions addons/nuxeo-spreadsheet/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { resolve } = require('path');
const { ProvidePlugin } = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const htmlWebpackInjectAttributesPlugin = require('html-webpack-inject-attributes-plugin');

module.exports = {
entry: {
Expand All @@ -16,5 +17,9 @@ module.exports = {
chunks: ['spreadsheet.app'],
template: resolve(__dirname, 'app', 'index.html'),
}),
/* eslint-disable-next-line new-cap */
new htmlWebpackInjectAttributesPlugin({
nonce: 'dummy',
}),
],
};
10 changes: 6 additions & 4 deletions elements/nuxeo-selection/nuxeo-selection-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Polymer({
<span class="count" aria-live="polite">
[[i18n('selectionToolbar.selected.items', selectedItems.length)]]
</span>
<a class="selectionLink" on-tap="toogleSelectedItemsPopup" href="javascript:void(0)">
<a class="selectionLink" on-tap="toogleSelectedItemsPopup" href="#">
<span>[[i18n('selectionToolbar.display.selection')]]</span>
</a>
</template>
Expand All @@ -121,7 +121,7 @@ Polymer({
<template is="dom-if" if="[[selectAllActive]]">
<span class="count" aria-live="polite">[[i18n('selectionToolbar.selected.all', _resultsCount)]]</span>
</template>
<a class="selectionLink" on-tap="clearSelection" href="javascript:void(0)">
<a class="selectionLink" on-tap="clearSelection" href="#">
<span>[[i18n('command.clear')]]</span>
</a>
</div>
Expand Down Expand Up @@ -188,11 +188,13 @@ Polymer({
this.hidden = !this.selectedItems || this.selectedItems.length === 0;
},

toogleSelectedItemsPopup() {
toogleSelectedItemsPopup(e) {
e.preventDefault();
this.$$('#selectedItemsPopup').toggle();
},

clearSelection() {
clearSelection(e) {
e.preventDefault();
this.fire('clear-selected-items');
},
});
5 changes: 3 additions & 2 deletions elements/workflow/nuxeo-document-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Polymer({
</div>
</template>
</div>
<a href="javascript:undefined" on-tap="_toggleGraphDialog" class="view-graph">[[i18n('tasks.viewGraph')]]</a>
<a href="#" on-tap="_toggleGraphDialog" class="view-graph">[[i18n('tasks.viewGraph')]]</a>
<div class="horizontal spaced">
<span>[[i18n(tasks.directive)]]</span>
</div>
Expand Down Expand Up @@ -314,7 +314,8 @@ Polymer({
.finally(() => this._setProcessing(false));
},

_toggleGraphDialog() {
_toggleGraphDialog(e) {
e.preventDefault();
this.$.graph.show();
},

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"expose-loader": "^1.0.1",
"glob": "^7.1.3",
"html-loader": "^1.3.2",
"html-webpack-inject-attributes-plugin": "^1.0.6",
"html-webpack-plugin": "^5.6.0",
"http-server": "^0.11.1",
"husky": "^4.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ limitations under the License.
</div>
</nuxeo-app>

<script src="vendor/webcomponentsjs/webcomponents-loader.js"></script>
<script src="vendor/webcomponentsjs/webcomponents-loader.js" nonce="dummy"></script>

<script src="vendor/html-imports/html-imports.min.js"></script>
<script src="vendor/html-imports/html-imports.min.js" nonce="dummy"></script>

<script src="vendor/web-animations/web-animations-next-lite.min.js"></script>
<script src="vendor/web-animations/web-animations-next-lite.min.js" nonce="dummy"></script>

<script src="config.jsp"></script>
<script src="config.jsp" nonce="dummy"></script>

<script src="main.bundle.js"></script>
<script src="main.bundle.js" nonce="dummy"></script>

</body>

Expand Down
Loading