Skip to content

Commit

Permalink
#161 sort businessObjects according to id
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHeckert committed Sep 25, 2024
1 parent c9928c4 commit d2133bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/tools/export/services/export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d2133bb

Please sign in to comment.