From d2133bbcc9a7de7bf4574e7ad7a09d9fe19f69bd Mon Sep 17 00:00:00 2001 From: Daniel Heckert Date: Wed, 25 Sep 2024 10:06:43 +0200 Subject: [PATCH] #161 sort businessObjects according to id --- src/app/tools/export/services/export.service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/tools/export/services/export.service.ts b/src/app/tools/export/services/export.service.ts index d42ffce0..a3d47f38 100644 --- a/src/app/tools/export/services/export.service.ts +++ b/src/app/tools/export/services/export.service.ts @@ -24,6 +24,7 @@ import { import { ModelerService } from '../../modeler/services/modeler.service'; import { MatSnackBar } from '@angular/material/snack-bar'; import { DialogService } from '../../../domain/services/dialog.service'; +import { BusinessObject } from '../../../domain/entities/businessObject'; @Injectable({ providedIn: 'root', @@ -217,7 +218,15 @@ export class ExportService implements OnDestroy { } private getStoryForDownload(): unknown[] { - const story = this.rendererService.getStory() as unknown[]; + let story = this.rendererService + .getStory() + .sort((objA: BusinessObject, objB: BusinessObject) => { + if (objA.id !== undefined && objB.id !== undefined) { + return objA.id.localeCompare(objB.id); + } else { + return 0; + } + }) as unknown[]; story.push({ info: this.titleService.getDescription() }); story.push({ version: environment.version }); return story;