mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#4250 Vorgänge zählen nicht hoch
This commit is contained in:
@@ -68,15 +68,19 @@ export class ShellProcessBarComponent implements OnInit {
|
||||
setTimeout(() => this.scrollToEnd(), 25);
|
||||
}
|
||||
|
||||
static REGEX_PROCESS_NAME = /^Vorgang \d+$/;
|
||||
|
||||
async createCartProcess() {
|
||||
const processes = await this._app.getProcesses$('customer').pipe(first()).toPromise();
|
||||
|
||||
const count = processes.filter((x) => x.type === 'cart' && x.name.startsWith('Vorgang ')).length;
|
||||
const processIds = processes.filter((x) => ShellProcessBarComponent.REGEX_PROCESS_NAME.test(x.name)).map((x) => +x.name.split(' ')[1]);
|
||||
|
||||
const maxId = processIds.length > 0 ? Math.max(...processIds) : 0;
|
||||
|
||||
const process: ApplicationProcess = {
|
||||
id: Date.now(),
|
||||
type: 'cart',
|
||||
name: `Vorgang ${count + 1}`,
|
||||
name: `Vorgang ${maxId + 1}`,
|
||||
section: 'customer',
|
||||
closeable: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user