Merge tag '2.1.10' into develop

This commit is contained in:
Michael Auer
2022-11-07 15:07:34 +01:00
5 changed files with 24 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
import { HttpErrorResponse } from '@angular/common/http';
import { ErrorHandler, Injectable } from '@angular/core';
import { AuthService } from '@core/auth';
import { UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
import { DialogModel, UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
@Injectable()
export class IsaErrorHandler implements ErrorHandler {
@@ -22,9 +22,10 @@ export class IsaErrorHandler implements ErrorHandler {
content: UiDialogModalComponent,
title: 'Sitzung abgelaufen',
data: {
handleCommand: false,
content: 'Sie waren zu lange nicht in der ISA aktiv. Bitte melden Sie sich erneut an',
actions: [{ command: 'CLOSE', selected: true, label: 'Erneut anmelden' }],
},
} as DialogModel,
})
.afterClosed$.toPromise();

View File

@@ -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();
}
});

View File

@@ -8,7 +8,7 @@ import {
ReturnItemDTO,
ReturnSuggestionDTO,
} from '@swagger/remi';
import { UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
import { DialogModel, UiDialogModalComponent, UiErrorModalComponent, UiModalService } from '@ui/modal';
import { mapFromReturnItemDTO, mapFromReturnSuggestionDTO } from 'apps/domain/remission/src/lib/mappings';
import { BehaviorSubject, Subject } from 'rxjs';
import { first, takeUntil } from 'rxjs/operators';
@@ -93,11 +93,12 @@ export class RemissionListItemComponent implements OnDestroy {
} zu\nremittieren. Sind wirklich alle Exemplare in ${
this.item.placementType && this.item.placementType === 'Stapel' ? 'dem Stapel' : 'der Leistung'
}?`,
handleCommand: false,
actions: [
{ label: 'Ja', selected: true, command: 'remit' },
{ label: 'Abbrechen', command: 'close' },
],
},
} as DialogModel,
});
modal.afterClosed$.pipe(takeUntil(this._onDestroy$)).subscribe((result) => {

View File

@@ -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);
}
}

View File

@@ -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;
}