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

Resolve vulnerabilities #1167

Merged
merged 16 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 12 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
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
test_script: npx jest tests/static/ --coverage
comparison_branch: master
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
call_run_tests:
uses: yext/slapshot-reusable-workflows/.github/workflows/run_tests.yml@v1
with:
build_script: ''
build_script: ''
2 changes: 1 addition & 1 deletion .github/workflows/wcag_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ jobs:
call_wcag_test:
uses: yext/slapshot-reusable-workflows/.github/workflows/wcag_test.yml@v1
with:
build_script: npm run setup-test-site && npm run build-test-site
build_script: npm run setup-test-site && npm run build-test-site
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ node_modules
/playwright-report/
/blob-report/
/playwright/.cache/
**/.env
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions static/js/theme-map/Maps/Providers/Baidu.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class BaiduPin extends ProviderPin {

// Load Function

const yextAPIKey = 'bxNEoKKmzVSORkUQGwRxLbtis4Wwokdg';
const yextAPIKey = process.env.BAIDU_API_KEY;
likimmy marked this conversation as resolved.
Show resolved Hide resolved
const baseUrl = 'https://api.map.baidu.com/getscript';

/**
Expand Down Expand Up @@ -350,7 +350,7 @@ function load(resolve, reject, apiKey, {
}

const negativeLngFixStyle = document.createElement('style');
negativeLngFixStyle.innerHTML = negativeLngFixCSS;
negativeLngFixStyle.innerText = negativeLngFixCSS;
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved

document.head.appendChild(negativeLngFixStyle);
}
Expand Down
4 changes: 2 additions & 2 deletions static/js/theme-map/Util/Accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export class AccessibilityHelpers {
export const AccessibilityChecks = {
checkAltTags: function () {
const accessibilityStyleSheet = document.createElement('style');
accessibilityStyleSheet.innerHTML = `img:not([alt]) { outline: ${outlineStyle}; }`;
accessibilityStyleSheet.innerText = `img:not([alt]) { outline: ${outlineStyle}; }`;
likimmy marked this conversation as resolved.
Show resolved Hide resolved
for (let selector of whitelist) {
accessibilityStyleSheet.innerHTML += `${selector} img:not([alt]) { outline: none; }`;
accessibilityStyleSheet.innerText += `${selector} img:not([alt]) { outline: none; }`;
}
document.head.appendChild(accessibilityStyleSheet);
}
Expand Down
976 changes: 467 additions & 509 deletions static/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"comment-json": "^4.1.1",
"css-loader": "^3.4.2",
"currency-symbol-map": "^5.0.1",
"dotenv": "^16.4.1",
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved
"esbuild-loader": "^2.13.1",
"file-system": "^2.2.2",
"fs-extra": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion static/webpack-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function () {
...cssRtlPlugin,
...htmlPlugins,
new webpack.DefinePlugin({
'process.env.JAMBO_INJECTED_DATA': JSON.stringify(jamboInjectedData)
'process.env.JAMBO_INJECTED_DATA': JSON.stringify(jamboInjectedData),
}),
new RemovePlugin({
after: {
Expand Down
6 changes: 3 additions & 3 deletions static/webpack/InlineAssetHtmlPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InlineAssetHtmlPlugin {
* HTML elements are only replaced with inlined versions if they have the data attribute
* "data-webpack-inline"
*
* @param {String} html The html of the page to analyze tags and replace with inlined
* @param {String} html The html of the page to analyze tags and replace with inlined
* @param {Object<String, Source>} assetsMap Mapping from asset name to asset content,
* provided by webpack compilation
*/
Expand All @@ -48,7 +48,7 @@ class InlineAssetHtmlPlugin {
const scriptSource = scriptNode.src;
const fileContents = this._getAssetContents(scriptSource, assetsMap);

scriptNode.innerHTML = fileContents;
scriptNode.textContent = fileContents;
scriptNode.dataset.fileName = scriptSource;
scriptNode.removeAttribute('src');
});
Expand All @@ -68,7 +68,7 @@ class InlineAssetHtmlPlugin {
const transformedCss = this._transformCssUrls(rawContents, relativePath);

const styleNode = dom.window.document.createElement('style');
styleNode.innerHTML = transformedCss;
styleNode.textContent = transformedCss;
styleNode.dataset.fileName = linkNode.href;
styleNode.dataset.webpackInline = '';
linkNode.parentNode.insertBefore(styleNode, linkNode.nextSibling);
Expand Down
2 changes: 1 addition & 1 deletion test-site/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set_working_dir_to_test_site () {

set_working_dir_to_test_site

npx jambo build && npx grunt webpack
npx jambo build && npx grunt webpack
Loading