Skip to content

Commit

Permalink
Fix typo and JS lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Nov 14, 2024
1 parent 5d98d9e commit dba5428
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion assets/src/components/Print.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/legacy/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,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();
Expand Down
8 changes: 4 additions & 4 deletions assets/src/modules/FeaturesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {

Expand Down Expand Up @@ -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 {aCallBack} aCallBack Callback function
*/
openPopup(layerId, feature, uniqueField, targetElement, aCallBack) {

Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/config/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/config/LayerTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/utils/Enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/end2end/playwright/draw.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion tests/end2end/playwright/embed.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-check
import { test, expect } from '@playwright/test';
import { test } from '@playwright/test';
import { gotoMap } from './globals';

test.describe('Embed', () => {
Expand Down
6 changes: 3 additions & 3 deletions tests/end2end/playwright/google-basemap.spec.js
Original file line number Diff line number Diff line change
@@ -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 }) => {
Expand All @@ -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++;
}
});
Expand All @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions tests/end2end/playwright/media.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/end2end/playwright/n_to_m_relations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ test.describe('N to M relations', () => {
await getFeatureRequestPromise;

// open birds spots attribute table panel
let birdSpotRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeature') === true);
await page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeature') === true);
await page.locator('#nav-tab-attribute-summary').click();
await page.locator('#attribute-layer-list button[value="birds_spots"]').click();
await getFeatureRequestPromise;

// open birds attribute table panel
let birdsRequestPromise = page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeature') === true);
await page.waitForRequest(request => request.method() === 'POST' && request.postData()?.includes('GetFeature') === true);
await page.locator('#nav-tab-attribute-summary').click();
await page.locator('#attribute-layer-list button[value="birds"]').click();
await getFeatureRequestPromise;
Expand Down

0 comments on commit dba5428

Please sign in to comment.