Skip to content

Commit

Permalink
Update dependencies and fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Krusche committed May 23, 2023
1 parent 5dd638e commit 31c8ebc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"private": true,
"main": "index.js",
"repository": "git@github.com:ls1intum/Apollon_standalone.git",
"author": "Tobias Priesching <tobias.priesching@gmail.com>",
"license": "MIT",
"author": {
"name": "Stephan Krusche",
"email": "krusche@tum.de",
"url": "https://ase.cit.tum.de/krusche"
},
"workspaces": {
"packages": [
"packages/*"
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/main/resources/conversion-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export class ConversionResource {
if (typeof model === 'string') {
model = JSON.parse(model);
}
const { svg, clip } = await this.conversionService.convertToSvg(<UMLModel>(<unknown>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,
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/main/resources/diagram-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@ import { ApollonEditor, SVG, UMLModel } from '@ls1intum/apollon';

export class ConversionService {
convertToSvg = async (model: UMLModel): Promise<SVG> => {
//@ts-ignore
document.body.innerHTML = '<!doctype html><html><body><div></div></body></html>';
document.body.innerHTML = '<!doctype html><html lang="en"><body><div></div></body></html>';

//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();
};
}
2 changes: 1 addition & 1 deletion packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 31c8ebc

Please sign in to comment.