Skip to content

Commit

Permalink
GH Action - Add workflow check concurrency, eslint only in assets/src…
Browse files Browse the repository at this point in the history
… for now
  • Loading branch information
Gustry committed Feb 4, 2025
1 parent 54ad5e2 commit 04d12c2
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 61 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
repository_dispatch:
types: [ run-e2e-branches ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
end2end:
# The first condition is triggered when we set the new label
Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/Snapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export default class Snapping {
if(layerConfig && layerConfig[0]) {
try {
visible = this._layerTree.getTreeLayerByName(layerConfig[0]).visibility
} catch( error){
} catch {
visible = false
}
}
Expand Down
127 changes: 69 additions & 58 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,76 @@ import js from "@eslint/js";
import jsdoc from "eslint-plugin-jsdoc";

export default [
js.configs.recommended,
jsdoc.configs['flat/recommended'],
js.configs.recommended,
jsdoc.configs['flat/recommended'],
{
name: "Global",
ignores: [
"assets/src/legacy/",
"assets/dist/",
"assets/node_modules/",
"build/",
"docs/",
"lizmap/vendor/",
"node_modules/",
"lizmap/www/assets/jelix/",
"lizmap/www/assets/js/",
"tests/end2end/cypress/", // Candidate for to be removed
"tests/end2end/playwright/", // Candidate for to be removed
"tests/js-units/node/",
"tests/units/vendor/",
"tests/qgis-projects/tests/", // Candidate for to be removed
],
}, {
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
OpenLayers: "readonly",
lizMap: "readonly",
lizDict: "readonly",
lizUrls: "readonly",
lizProj4: "readonly",

{
plugins: {
jsdoc,
},
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
OpenLayers: "readonly",
lizMap: "readonly",
lizDict: "readonly",
lizUrls: "readonly",
lizProj4: "readonly",
window: "readonly",
document: "readonly",
Document: "readonly",
HTMLElement: "readonly",
Node: "readonly",
console: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
Event: "readonly",
MouseEvent: "readonly",
Response: "readonly",
Element: "readonly",

window: "readonly",
document: "readonly",
Document: "readonly",
HTMLElement: "readonly",
Node: "readonly",
console: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
Event: "readonly",
MouseEvent: "readonly",
Response: "readonly",
Element: "readonly",
$: "readonly",
jQuery: "readonly",

$: "readonly",
jQuery: "readonly",

TemplateResult: "readonly",
SelectionTool: "readonly",
Digitizing: "readonly",
Geometry: "readonly",
Extent: "readonly",
ResponseError: "readonly",
HttpError: "readonly",
NetworkError: "readonly",
LocateByLayerConfig: "readonly",
Config: "readonly",
Layers: "readonly",
},
},
rules: {
"indent": ["error", 4, {
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral *"],
}],
"no-prototype-builtins": "off",
"no-undef": "off",
'jsdoc/require-description': 'warn',
},
ignores: [
'**/legacy/'
]
},
TemplateResult: "readonly",
SelectionTool: "readonly",
Digitizing: "readonly",
Geometry: "readonly",
Extent: "readonly",
ResponseError: "readonly",
HttpError: "readonly",
NetworkError: "readonly",
LocateByLayerConfig: "readonly",
Config: "readonly",
Layers: "readonly",
},
},
rules: {
"indent": ["error", 4, {
"SwitchCase": 1,
"ignoredNodes": ["TemplateLiteral *"],
}],
"no-prototype-builtins": "off",
"no-undef": "off",
'jsdoc/require-description': 'warn',
},
}
];
4 changes: 2 additions & 2 deletions tests/end2end/othersite/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ window.addEventListener('load', function() {
if (document.getElementById('cache-disabled').checked) {
request.setRequestHeader('Cache-Control', 'no-cache');
}
request.onload = function(oEvent) {
request.onload = function() {
document.getElementById('status').textContent = request.status?request.status:'no code';
document.getElementById('response').value = request.responseText;
};
Expand All @@ -24,7 +24,7 @@ window.addEventListener('load', function() {

var request = new XMLHttpRequest();
request.open("GET", unauthorizedUrl);
request.onload = function(oEvent) {
request.onload = function() {
document.getElementById('status_bad').textContent = request.status?request.status:'no code';
document.getElementById('response_bad').value = request.responseText;
};
Expand Down

0 comments on commit 04d12c2

Please sign in to comment.