diff --git a/assets/src/components/FeaturesTable.js b/assets/src/components/FeaturesTable.js index c28b52b590..546094de62 100644 --- a/assets/src/components/FeaturesTable.js +++ b/assets/src/components/FeaturesTable.js @@ -201,7 +201,6 @@ export default class FeaturesTable extends HTMLElement { * * @param {Event} event Click event on a feature item * @param {Object} feature WFS feature - * @param {number} lineId Line number of the item in the features table */ onItemClick(event, feature) { if (!this.openPopup) {return true;} diff --git a/assets/src/components/Print.js b/assets/src/components/Print.js index 749d1cfbdb..f9e06f16f4 100644 --- a/assets/src/components/Print.js +++ b/assets/src/components/Print.js @@ -446,7 +446,7 @@ export default class Print extends HTMLElement { * @param {string | number} index */ set printTemplate(index){ - // No print templats defined do nothing + // No print templates defined do nothing if (this._printTemplates.length == 0) { return; } diff --git a/assets/src/legacy/map.js b/assets/src/legacy/map.js index 8a8915abbe..31f6da366b 100644 --- a/assets/src/legacy/map.js +++ b/assets/src/legacy/map.js @@ -432,7 +432,7 @@ window.lizMap = function() { * config * * Returns: - * {Integer} the layer's order + * {int} the layer's order * @param nested */ function getLayerOrder(nested) { @@ -1568,7 +1568,7 @@ window.lizMap = function() { GEOMETRYNAME: 'extent' }; - wfsParams['EXP_FILTER'] = '"' + config.relations.pivot[rLayerId][layerId] + '" = ' + "'" + feat.properties[relation.referencedField] + "'";; + wfsParams['EXP_FILTER'] = '"' + config.relations.pivot[rLayerId][layerId] + '" = ' + "'" + feat.properties[relation.referencedField] + "'"; // Calculate bbox if (config.options?.limitDataToBbox == 'True') { wfsParams['BBOX'] = lizMap.mainLizmap.map.getView().calculateExtent(); diff --git a/assets/src/modules/Action.js b/assets/src/modules/Action.js index 06672a4fb8..f98ad3ed56 100644 --- a/assets/src/modules/Action.js +++ b/assets/src/modules/Action.js @@ -638,7 +638,7 @@ export default class Action { * @param {object} action - The action configuration object * @param {string} layerId - The layer ID * @param {string} featureId - The feature ID - * @param {string} popupItem - The popup item HTML element + * @param {string} popupContainerId - The popup container ID */ addPopupActionButton(action, layerId, featureId, popupContainerId) { diff --git a/assets/src/modules/FeaturesTable.js b/assets/src/modules/FeaturesTable.js index f481d3e266..b4b267af03 100644 --- a/assets/src/modules/FeaturesTable.js +++ b/assets/src/modules/FeaturesTable.js @@ -34,9 +34,9 @@ export default class FeaturesTable { * @param {string|null} fields List of field names separated by comma * * @returns — A Promise that resolves with the result of parsing the response body text as JSON. - * @throws — {ResponseError} In case of invalid content type (not application/json or application/vnd.geo+json) or Invalid JSON - * @throws — {HttpError} In case of not successful response (status not in the range 200 – 299) - * @throws — {NetworkError} In case of catch exceptions + * @throws {ResponseError} In case of invalid content type (not application/json or application/vnd.geo+json) or Invalid JSON + * @throws {HttpError} In case of not successful response (status not in the range 200 – 299) + * @throws {NetworkError} In case of catch exceptions */ getFeatures(layerId, filter = null, withGeometry = false, fields = 'null') { @@ -83,7 +83,7 @@ export default class FeaturesTable { * @param {object} feature WFS Feature * @param {string} uniqueField Field containing unique values (used to set the filter for the WMS request) * @param {HTMLElement} targetElement Target HTML element to display the popup content for the given feature - * @param {callBack} callBack Callback function + * @param {requestCallback} aCallBack Callback function */ openPopup(layerId, feature, uniqueField, targetElement, aCallBack) { diff --git a/assets/src/modules/config/Layer.js b/assets/src/modules/config/Layer.js index 91ba8c13ab..c5a327e750 100644 --- a/assets/src/modules/config/Layer.js +++ b/assets/src/modules/config/Layer.js @@ -345,7 +345,7 @@ export class LayerConfig extends BaseObjectConfig { } /** - * The layer layer external access (layer only) + * The layer external access (layer only) * @type {?object} */ get externalAccess() { diff --git a/assets/src/modules/config/LayerTree.js b/assets/src/modules/config/LayerTree.js index 212e30da73..58480fec3d 100644 --- a/assets/src/modules/config/LayerTree.js +++ b/assets/src/modules/config/LayerTree.js @@ -420,7 +420,7 @@ function buildLayerTreeGroupConfigItems(wmsCapaLayerGroup, layersCfg, level) { const groupItems = buildLayerTreeGroupConfigItems(wmsCapaLayer, layersCfg, level+1); items.push(new LayerTreeGroupConfig(cfg.name, level+1, groupItems, wmsCapaLayer, cfg)); } else { - // avoid to add the baseLayers group to the map if doesn't contains any layer. + // avoid to add the baseLayers group to the map if it doesn't contain any layer. if(wmsName.toLowerCase() != 'baselayers') { items.push(new LayerTreeLayerConfig(cfg.name, level+1, wmsCapaLayer, cfg)); } diff --git a/assets/src/modules/utils/Enums.js b/assets/src/modules/utils/Enums.js index 5a9c394cc0..d2a396b6b2 100644 --- a/assets/src/modules/utils/Enums.js +++ b/assets/src/modules/utils/Enums.js @@ -25,7 +25,7 @@ * 'Undefined': undefined, * }); * @param {object} structure - The enum structure - * @throws {TypeError} Will throws an error if the structure is not an oject and the values + * @throws {TypeError} Will throws an error if the structure is not an object and the values * associated to the structure keys are not 'number', 'string', 'boolean' or 'undefined'. * @returns {Proxy} The enum based on the structure */ diff --git a/lizmap/www/assets/js/dataviz/dataviz.js b/lizmap/www/assets/js/dataviz/dataviz.js index d9342dbf87..03e4a70e1e 100644 --- a/lizmap/www/assets/js/dataviz/dataviz.js +++ b/lizmap/www/assets/js/dataviz/dataviz.js @@ -39,7 +39,7 @@ let lizDataviz = function () { * Get the percentage of an element covering the viewport * * @param {HTMLElement} element The element to test - * @return {integer} Percentage + * @return {int} Percentage */ function getViewPercentage(element) { const viewport = { @@ -311,7 +311,7 @@ let lizDataviz = function () { * or in a user-defined plot container if the HTML template * has been configured inside Lizmap plugin * - * @param {integer} plot_id The plot id + * @param {int} plot_id The plot id */ function addPlotContainer(plot_id) { let dataviz_plot_id = 'dataviz_plot_' + plot_id; @@ -340,7 +340,7 @@ let lizDataviz = function () { * Get the plot data from the backend * and draw the plot with the buildPlot method * - * @param {integer} plot_id The id of the plot. + * @param {int} plot_id The id of the plot. * @param {string} exp_filter The optional data filter. * @param {string} target_id The ID of the target dom element. * @@ -465,9 +465,9 @@ let lizDataviz = function () { * It is responsible for rendering the plot and * adding it in the document. * - * @param {integer} targetId The ID of the plot HTML container element. + * @param {int} targetId The ID of the plot HTML container element. * @param {object} data The plot data as given by the backend - * @param {integer} pid The plot integer ID + * @param {int} pid The plot integer ID * @param {object} layout The plot layout defined by the user * */ @@ -567,7 +567,7 @@ let lizDataviz = function () { * Return the plot integer ID by passing the plot element container ID? * * @param {string} id The plot integer ID - * @return {integer} The container HTML element ID + * @return {int} The container HTML element ID */ function getPlotIdByContainerId(id) { let pid = null; @@ -599,7 +599,7 @@ let lizDataviz = function () { * * @param {string} targetId The ID of the plot HTML container element. * @param {object} conf The plot configuration with data and layout properties. - * @param {integer} pid The plot integer ID + * @param {int} pid The plot integer ID */ function buildPlot(targetId, conf, pid = null) { @@ -719,7 +719,7 @@ let lizDataviz = function () { * based on the source OpenLayers layer visibility * depending on the parameter display_when_layer_visible * - * @param {integer} plotId The plot integer ID + * @param {int} plotId The plot integer ID * @return {boolean} True if the plot must be visible */ function setPlotContainerVisibilityFromLayerVisibility(plotId) { diff --git a/tests/end2end/cypress/integration/requests-metadata-ghaction.js b/tests/end2end/cypress/integration/requests-metadata-ghaction.js index b63aac568f..b6f2b46532 100644 --- a/tests/end2end/cypress/integration/requests-metadata-ghaction.js +++ b/tests/end2end/cypress/integration/requests-metadata-ghaction.js @@ -2,7 +2,7 @@ describe('Request JSON metadata', function () { it('As anonymous', function () { cy.logout(); - var metadata = cy.request({ + const metadata = cy.request({ url: 'index.php/view/app/metadata', failOnStatusCode: false, }).then((response) => { @@ -15,7 +15,7 @@ describe('Request JSON metadata', function () { it('As admin using basic auth', function () { cy.logout() - var request = cy.request({ + const request = cy.request({ url: 'index.php/view/app/metadata', headers: { authorization: 'Basic YWRtaW46YWRtaW4=', @@ -107,7 +107,7 @@ describe('Request JSON metadata', function () { it('As admin after login using the UI', function () { cy.loginAsAdmin() - var request = cy.request({ + const request = cy.request({ url: 'index.php/view/app/metadata', failOnStatusCode: false, }).then((response) => { @@ -124,7 +124,7 @@ describe('Request JSON metadata', function () { it('As normal user using UI', function () { cy.loginAsUserA() - var request = cy.request({ + const request = cy.request({ url: 'index.php/view/app/metadata', failOnStatusCode: false, }).then((response) => { @@ -140,7 +140,7 @@ describe('Request JSON metadata', function () { it('As publisher user using UI', function () { cy.loginAsPublisher() - var request = cy.request({ + const request = cy.request({ url: 'index.php/view/app/metadata', failOnStatusCode: false, }).then((response) => { @@ -205,7 +205,7 @@ describe('Request JSON metadata', function () { }) it('As publisher using BASIC Auth with wrong credentials', function () { - var request = cy.request({ + const request = cy.request({ url: 'index.php/view/app/metadata', headers: { authorization: 'Basic dXNlcl9pbl9ncm91cF9hOm1hdXZhaXM=', diff --git a/tests/end2end/playwright/draw.spec.js b/tests/end2end/playwright/draw.spec.js index 680c95d949..449d475d21 100644 --- a/tests/end2end/playwright/draw.spec.js +++ b/tests/end2end/playwright/draw.spec.js @@ -163,7 +163,7 @@ test.describe('Draw', () => { // Change color await page.locator('input[type="color"]').evaluate(input => { input.value = '#000'; // Cast input to HTMLInputElement for TypeScript - var event = new Event('input', { + let event = new Event('input', { bubbles: true, cancelable: true, }); diff --git a/tests/end2end/playwright/embed.spec.js b/tests/end2end/playwright/embed.spec.js index 005ac4c844..713a59e862 100644 --- a/tests/end2end/playwright/embed.spec.js +++ b/tests/end2end/playwright/embed.spec.js @@ -1,5 +1,5 @@ // @ts-check -import { test, expect } from '@playwright/test'; +import { test } from '@playwright/test'; import { gotoMap } from './globals'; test.describe('Embed', () => { diff --git a/tests/end2end/playwright/globals.js b/tests/end2end/playwright/globals.js index 80d9a61048..85f2673b87 100644 --- a/tests/end2end/playwright/globals.js +++ b/tests/end2end/playwright/globals.js @@ -15,7 +15,7 @@ async function NoErrors(page, checkLayerTreeView = true) { * CatchErrors function * Some checks when the map is on error * @param page The page object - * @param int layersInTreeView The number of layers to find in the treeview. + * @param {int} layersInTreeView The number of layers to find in the treeview. */ async function CatchErrors(page, layersInTreeView = 0) { // Error @@ -30,11 +30,11 @@ async function CatchErrors(page, layersInTreeView = 0) { /** * gotoMap function * Helper to load a map and do some basic checks - * @param string url The URL of the map to load - * @param page The page object - * @param boolean mapMustLoad If the loading of the map must be successful or not. Some error might be triggered when loading the map, on purpose. - * @param int layersInTreeView The number of layers to find in the treeview if the map is on error. - * @param boolean waitForGetLegendGraphics + * @param {string} url The URL of the map to load + * @param {page} page The page object + * @param {boolean} mapMustLoad If the loading of the map must be successful or not. Some error might be triggered when loading the map, on purpose. + * @param {int} layersInTreeView The number of layers to find in the treeview if the map is on error. + * @param {boolean} waitForGetLegendGraphics */ export async function gotoMap(url, page, mapMustLoad = true, layersInTreeView = 0, waitForGetLegendGraphics = true) { // TODO keep this function synchronized with the Cypress equivalent diff --git a/tests/end2end/playwright/google-basemap.spec.js b/tests/end2end/playwright/google-basemap.spec.js index f51528478e..9f1a163381 100644 --- a/tests/end2end/playwright/google-basemap.spec.js +++ b/tests/end2end/playwright/google-basemap.spec.js @@ -1,6 +1,6 @@ import { test, expect } from '@playwright/test'; -import { gotoMap } from './globals';; +import { gotoMap } from './globals'; test.describe('Google Maps Baselayers', () => { test('Load map with no API Key', async ({ page }) => { @@ -16,7 +16,7 @@ test.describe('Google Maps Baselayers', () => { // listen to the requests to intercept failing ones let initGoogleRequestsCount = 0; page.on('response', response => { - if(response.url().includes('createSession?key=dummy') && response.status() != 200) { + if(response.url().includes('createSession?key=dummy') && response.status() !== 200) { initGoogleRequestsCount++; } }); @@ -29,7 +29,7 @@ test.describe('Google Maps Baselayers', () => { // baselayers group should be visible... await expect(page.locator('#switcher-baselayer')).toBeVisible(); - //.. and should contains the three Google base layers (not loaded) + //.. and should contain the three Google base layers (not loaded) let options = page.locator('#switcher-baselayer').getByRole('combobox').locator('option'); await expect(options).toHaveCount(3); expect(await options.nth(0).getAttribute('value')).toBe('Google Streets'); diff --git a/tests/end2end/playwright/media.spec.js b/tests/end2end/playwright/media.spec.js index 5c13293cdc..7b10f64c81 100644 --- a/tests/end2end/playwright/media.spec.js +++ b/tests/end2end/playwright/media.spec.js @@ -5,15 +5,15 @@ import { gotoMap } from './globals'; test.describe('Media', () => { test('Tests media are deleted', async ({ page }) => { - var baseUrl = 'index.php/view/media/getMedia?repository=testsrepository&project=form_edition_all_field_type&path='; + const baseUrl = 'index.php/view/media/getMedia?repository=testsrepository&project=form_edition_all_field_type&path='; // on the feature from the "form_edition_upload" layer - var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/text_file_mandatory/lorem-2.txt'); + let response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/text_file_mandatory/lorem-2.txt'); await expect(response).toBeOK(); - var response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/image_file_mandatory/random-2.jpg'); + response = await page.request.get(baseUrl + 'media/upload/form_edition_all_field_type/form_edition_upload/image_file_mandatory/random-2.jpg'); await expect(response).toBeOK(); - var response = await page.request.get(baseUrl + '../media/specific_media_folder/random-4.jpg'); + response = await page.request.get(baseUrl + '../media/specific_media_folder/random-4.jpg'); await expect(response).toBeOK(); // Open the attribute table