diff --git a/apps/backoffice-v2/src/common/components/molecules/Map/Map.tsx b/apps/backoffice-v2/src/common/components/molecules/Map/Map.tsx index 0f7f2d9d0..6755c902a 100644 --- a/apps/backoffice-v2/src/common/components/molecules/Map/Map.tsx +++ b/apps/backoffice-v2/src/common/components/molecules/Map/Map.tsx @@ -1,16 +1,24 @@ import { FunctionComponent } from 'react'; -import { LatLngTuple } from 'leaflet'; -import { AlertDescription } from '../../atoms/Alert/Alert.Description'; +import L, { LatLngTuple } from 'leaflet'; +import icon from 'leaflet/dist/images/marker-icon.png'; +import iconShadow from 'leaflet/dist/images/marker-shadow.png'; import { MapContainer, Marker, Popup, TileLayer } from 'react-leaflet'; + +import { AlertDescription } from '../../atoms/Alert/Alert.Description'; import { IMapProps } from './interfaces'; export const Map: FunctionComponent = ({ latitude, longitude, popupContent }) => { - const position: LatLngTuple = [latitude, longitude]; - if (!latitude || !longitude) { return Invalid coordinates.; } + const position: LatLngTuple = [latitude, longitude]; + + L.Marker.prototype.options.icon = L.icon({ + iconUrl: icon, + shadowUrl: iconShadow, + }); + return ( =14.0.0'} + dependencies: + '@aws-sdk/middleware-endpoint': 3.325.0 + '@aws-sdk/protocol-http': 3.310.0 + '@aws-sdk/signature-v4-multi-region': 3.310.0 + '@aws-sdk/smithy-client': 3.325.0 + '@aws-sdk/types': 3.310.0 + '@aws-sdk/util-format-url': 3.310.0 + tslib: 2.5.2 + transitivePeerDependencies: + - '@aws-sdk/signature-v4-crt' + dev: false + /@aws-sdk/service-error-classification@3.310.0: resolution: {integrity: sha512-PuyC7k3qfIKeH2LCnDwbttMOKq3qAx4buvg0yfnJtQOz6t1AR8gsnAq0CjKXXyfkXwNKWTqCpE6lVNUIkXgsMw==} engines: {node: '>=14.0.0'} @@ -3364,7 +3382,6 @@ packages: engines: {node: '>=14.0.0'} dependencies: tslib: 2.5.2 - dev: false /@aws-sdk/url-parser@3.310.0: resolution: {integrity: sha512-mCLnCaSB9rQvAgx33u0DujLvr4d5yEm/W5r789GblwwQnlNXedVu50QRizMLTpltYWyAUoXjJgQnJHmJMaKXhw==} @@ -3437,6 +3454,15 @@ packages: '@aws-sdk/types': 3.310.0 tslib: 2.5.2 + /@aws-sdk/util-format-url@3.310.0: + resolution: {integrity: sha512-NBOvmvvVR3ydquHmznfgtakiSgDhq8Ww6fq8TUaEjM+Es6+iqY4AwZo0rZ9xTX3GpCcoZy391HUi6kiXRAFzuA==} + engines: {node: '>=14.0.0'} + dependencies: + '@aws-sdk/querystring-builder': 3.310.0 + '@aws-sdk/types': 3.310.0 + tslib: 2.5.2 + dev: false + /@aws-sdk/util-hex-encoding@3.310.0: resolution: {integrity: sha512-sVN7mcCCDSJ67pI1ZMtk84SKGqyix6/0A1Ab163YKn+lFBQRMKexleZzpYzNGxYzmQS6VanP/cfU7NiLQOaSfA==} engines: {node: '>=14.0.0'} @@ -6380,10 +6406,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.21.3 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-module-transforms': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-validator-identifier': 7.19.1 transitivePeerDependencies: - supports-color dev: true @@ -6395,10 +6421,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-module-transforms': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-validator-identifier': 7.19.1 transitivePeerDependencies: - supports-color dev: true @@ -6438,8 +6464,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.21.3 - '@babel/helper-module-transforms': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 transitivePeerDependencies: - supports-color dev: true @@ -6451,8 +6477,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helper-plugin-utils': 7.20.2 transitivePeerDependencies: - supports-color dev: true diff --git a/services/workflows-service/src/common/middlewares/request-id.middleware.ts b/services/workflows-service/src/common/middlewares/request-id.middleware.ts index 563153b0f..5562b60fe 100644 --- a/services/workflows-service/src/common/middlewares/request-id.middleware.ts +++ b/services/workflows-service/src/common/middlewares/request-id.middleware.ts @@ -16,7 +16,12 @@ export class RequestIdMiddleware implements NestMiddleware { delete cleanHeaders.authorization; delete cleanHeaders.cookie; - this.cls.set('requestId', request.id); + try { + this.cls.set('requestId', request.id); + } catch (e) { + // Mainly for debugging purposes. See https://github.com/Papooch/nestjs-cls/issues/67 + this.logger.log('Could not set requestId'); + } this.logger.log(`Incoming request`, { request: { diff --git a/services/workflows-service/src/common/middlewares/user-session-audit.middleware.intg.test.ts b/services/workflows-service/src/common/middlewares/user-session-audit.middleware.intg.test.ts index db08519c6..65ad68fdc 100644 --- a/services/workflows-service/src/common/middlewares/user-session-audit.middleware.intg.test.ts +++ b/services/workflows-service/src/common/middlewares/user-session-audit.middleware.intg.test.ts @@ -95,10 +95,12 @@ describe('UserSessionAuditMiddleware', () => { }); it('will not be changed when lastActiveAt not expired', async () => { - const nonExpiredDate = dayjs().subtract(middleware.UPDATE_INTERVAL - 10, 'ms'); + const nonExpiredDateString = dayjs() + .subtract(middleware.UPDATE_INTERVAL - 10, 'ms') + .toISOString(); testUser = await userService.updateById(testUser.id, { - data: { lastActiveAt: nonExpiredDate.toDate() }, + data: { lastActiveAt: nonExpiredDateString }, }); await middleware.use( @@ -109,7 +111,7 @@ describe('UserSessionAuditMiddleware', () => { const user = await userService.getById(testUser.id); - expect(Number(user.lastActiveAt)).toEqual(Number(nonExpiredDate)); + expect(user.lastActiveAt?.toISOString()).toBe(nonExpiredDateString); expect(callback).toBeCalledTimes(1); });