mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1432: #3613 Wannennummer Scannen - Dialog erweitert
#3613 Wannennummer Scannen - Dialog erweitert
This commit is contained in:
@@ -3,7 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { BreadcrumbService } from '@core/breadcrumb';
|
||||
import { Config } from '@core/config';
|
||||
import { DomainRemissionService } from '@domain/remission';
|
||||
import { UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { DialogModel, UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
|
||||
import { UiSearchboxNextComponent } from '@ui/searchbox';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@@ -57,21 +57,22 @@ export class FinishShippingDocumentComponent implements OnInit, OnDestroy {
|
||||
content: UiDialogModalComponent,
|
||||
title: `Ist die Wannenummer korrekt oder möchten Sie die\nWannenummer erneut scannen?\n\n${query}`,
|
||||
data: {
|
||||
handleCommand: false,
|
||||
actions: [
|
||||
{ label: 'Erneut scannen', command: false },
|
||||
{ label: 'Nummer korrekt', selected: true, command: true },
|
||||
{ label: 'Erneut scannen', command: 'rescan' },
|
||||
{ label: 'Nummer korrekt', selected: true, command: 'correct' },
|
||||
],
|
||||
},
|
||||
} as DialogModel,
|
||||
});
|
||||
|
||||
modal.afterClosed$.pipe(takeUntil(this._onDestroy$)).subscribe(async (result) => {
|
||||
if (result?.data) {
|
||||
if (result?.data === 'correct') {
|
||||
if (await this.completeReceipt(query)) {
|
||||
await this.completeReturn();
|
||||
}
|
||||
|
||||
await this.navigateToFinishRemission();
|
||||
} else {
|
||||
} else if (result?.data === 'rescan') {
|
||||
this.searchboxComponent.clear();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -18,7 +18,11 @@ export class UiDialogModalComponent implements OnInit {
|
||||
this.modalRef.close();
|
||||
return;
|
||||
}
|
||||
await this._command.handleCommand(command, this.modalRef.data.context);
|
||||
|
||||
if (this.modalRef.data.handleCommand ?? true) {
|
||||
await this._command.handleCommand(command, this.modalRef.data.context);
|
||||
}
|
||||
|
||||
this.modalRef.close(command);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { DialogSettings, KeyValueDTOOfStringAndString } from '@swagger/crm';
|
||||
|
||||
export interface DialogModel<T> {
|
||||
export interface DialogModel<T = any> {
|
||||
actions?: Array<KeyValueDTOOfStringAndString>;
|
||||
actionsRequired?: number;
|
||||
area?: string;
|
||||
content?: string;
|
||||
description?: string;
|
||||
settings: DialogSettings;
|
||||
settings?: DialogSettings;
|
||||
subtitle?: string;
|
||||
title?: string;
|
||||
context?: T;
|
||||
/**
|
||||
* default: true
|
||||
*/
|
||||
handleCommand?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user