diff --git a/LICENSE b/LICENSE index 9002ac24..0c7db494 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Chair for Applied Software Engineering +Copyright (c) 2023 TUM Applied Software Engineering Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 11de8b44..49128039 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,12 @@ "private": true, "main": "index.js", "repository": "git@github.com:ls1intum/Apollon_standalone.git", - "author": "Tobias Priesching ", "license": "MIT", + "author": { + "name": "Stephan Krusche", + "email": "krusche@tum.de", + "url": "https://ase.cit.tum.de/krusche" + }, "workspaces": { "packages": [ "packages/*" diff --git a/packages/server/src/main/resources/conversion-resource.ts b/packages/server/src/main/resources/conversion-resource.ts index eaba2410..7f5ef2a0 100644 --- a/packages/server/src/main/resources/conversion-resource.ts +++ b/packages/server/src/main/resources/conversion-resource.ts @@ -15,10 +15,10 @@ export class ConversionResource { if (typeof model === 'string') { model = JSON.parse(model); } - const { svg, clip } = await this.conversionService.convertToSvg((model)); + const { svg, clip } = await this.conversionService.convertToSvg((model as unknown) as UMLModel); const { width, height } = clip; pdfMake.vfs = pdfFonts.pdfMake.vfs; - var doc = pdfMake.createPdf({ + const doc = pdfMake.createPdf({ content: [ { svg, diff --git a/packages/server/src/main/resources/diagram-resource.ts b/packages/server/src/main/resources/diagram-resource.ts index d424abb8..60e4fd24 100644 --- a/packages/server/src/main/resources/diagram-resource.ts +++ b/packages/server/src/main/resources/diagram-resource.ts @@ -3,7 +3,7 @@ import { Request, Response } from 'express'; import pdfMake from 'pdfmake/build/pdfmake.min'; // @ts-ignore import pdfFonts from 'pdfmake/build/vfs_fonts'; -import { DiagramDTO } from '../../../../shared/src/main/diagram-dto'; +import { DiagramDTO } from 'shared/src/main/diagram-dto'; import { DiagramService } from '../services/diagram-service/diagram-service'; import { DiagramFileStorageService } from '../services/diagram-storage/diagram-file-storage-service'; @@ -47,7 +47,7 @@ export class DiagramResource { } else { pdfMake.vfs = pdfFonts.pdfMake.vfs; const svg = req.body.svg; - var doc = pdfMake.createPdf({ + const doc = pdfMake.createPdf({ content: [ { svg, diff --git a/packages/server/src/main/services/collaboration-service/collaboration-service.ts b/packages/server/src/main/services/collaboration-service/collaboration-service.ts index abeff8ff..e2e504e0 100644 --- a/packages/server/src/main/services/collaboration-service/collaboration-service.ts +++ b/packages/server/src/main/services/collaboration-service/collaboration-service.ts @@ -11,7 +11,7 @@ export class CollaborationService { private wsServer: any; private clients: { [key: string]: Client } = {}; private diagramService: DiagramFileStorageService; - private interval: NodeJS.Timeout; + private readonly interval: NodeJS.Timeout; constructor() { this.wsServer = new WebSocket.Server({ noServer: true }); this.diagramService = new DiagramFileStorageService(); diff --git a/packages/server/src/main/services/conversion-service/conversion-service.ts b/packages/server/src/main/services/conversion-service/conversion-service.ts index d8809281..3c42e196 100644 --- a/packages/server/src/main/services/conversion-service/conversion-service.ts +++ b/packages/server/src/main/services/conversion-service/conversion-service.ts @@ -3,27 +3,24 @@ import { ApollonEditor, SVG, UMLModel } from '@ls1intum/apollon'; export class ConversionService { convertToSvg = async (model: UMLModel): Promise => { - //@ts-ignore - document.body.innerHTML = '
'; + document.body.innerHTML = '
'; - //JSDOM does not support getBBox so we have to mock it here - //@ts-ignore + // JSDOM does not support getBBox so we have to mock it here + // @ts-ignore window.SVGElement.prototype.getBBox = () => ({ x: 0, y: 0, width: 10, - heigth: 10, + height: 10, }); - //@ts-ignore + // @ts-ignore const container = document.querySelector('div')!; const editor = new ApollonEditor(container, {}); editor.model = model; - const svg: SVG = await editor.exportAsSVG(); - - return svg; + return editor.exportAsSVG(); }; } diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 0e45b097..667b92ac 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -12,7 +12,7 @@ "build:local": "yarn clean && DEPLOYMENT_URL=http://localhost:8080 webpack --config ./webpack/webpack.prod.js" }, "engines": { - "node": ">=14.1.0", + "node": ">=18.14.0", "yarn": ">=1.22.0" }, "dependencies": {