From ca94c730a6eb3011ac4e5f6bd0d319ab23973f2f Mon Sep 17 00:00:00 2001 From: lesion Date: Tue, 10 Jan 2023 17:58:03 +0100 Subject: [PATCH] add nodejs v18 compatibility --- CHANGELOG | 10 +++++++--- package.json | 7 ++++--- tests/app.test.js | 30 +++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5b72fad8..5e3f721a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,12 @@ All notable changes to this project will be documented in this file. -### - - - models initialization refactored, better dev xperience as backend hmr is working +### UNRELEASED + - models initialization refactored, better dev experience as backend hmr is working + - add swipe gesture to move to next/prev event + - fix refresh collections, fix #219 + - add russian translation (thanks @drunkod) + - refactor search / filter / selection fix #225, 227, #224 + - add nodejs v18 compatibility ### 1.6.1 - 15 dec '22 - allow edit tags in admin panel, fix #170 diff --git a/package.json b/package.json index 461ab87a..cb8ff930 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "A shared agenda for local communities", "author": "lesion", "scripts": { - "build": "nuxt build --modern", + "build": "export NODE_OPTIONS=--openssl-legacy-provider; nuxt build --modern", "start:inspect": "NODE_ENV=production node --inspect node_modules/.bin/nuxt start --modern", - "dev": "nuxt dev", + "dev": "export NODE_OPTIONS=--openssl-legacy-provider; nuxt dev", "test-sqlite": "export NODE_ENV=test; export DB=sqlite; jest --testEnvironment=jest-environment-node --bail=1", "test-mariadb": "export NODE_ENV=test; export DB=mariadb; jest --testEnvironment=jest-environment-node --bail=1", "test-postgresql": "export NODE_ENV=test; export DB=postgresql; jest --testEnvironment=jest-environment-node --bail=1", @@ -27,10 +27,11 @@ "locales/", "store/", ".nuxt/", + "gancio_plugins", "yarn.lock" ], "engines": { - "node": ">=14 <=16" + "node": ">=14 <=18" }, "dependencies": { "@mdi/js": "^7.1.96", diff --git a/tests/app.test.js b/tests/app.test.js index b55656f9..0a008d04 100644 --- a/tests/app.test.js +++ b/tests/app.test.js @@ -415,5 +415,33 @@ describe('Collection', () => { expect(response.body.length).toBe(1) }) - +}) + +describe('Geocoding', () => { + test('should not be enabled by default', async () => { + await request(app) + .post('/api/settings') + .send({ key: 'allow_geolocation', value: false }) + .auth(token.access_token, { type: 'bearer' }) + .expect(200) + + const response = await request(app).get('/api/placeOSM/Nominatim/test') + .expect(403) + + expect(response.body).toBeDefined() + + }) + + test('should geocode when enabled', async () => { + await request(app) + .post('/api/settings') + .send({ key: 'allow_geolocation', value: true }) + .auth(token.access_token, { type: 'bearer' }) + .expect(200) + + const response = await request(app).get('/api/placeOSM/Nominatim/test') + .expect(200) + + expect(response.body).toBeDefined() + }) })