Merged PR 505: Warenausgabe - bugfix bei leeren Actions und Toggle Button ausblenden

Warenausgabe - bugfix bei leeren Actions und Toggle Button ausblenden

Related work items: #1209
This commit is contained in:
Andreas Schickinger
2021-02-23 12:49:54 +00:00
committed by Lorenz Hilpert
4 changed files with 19 additions and 3 deletions

View File

@@ -39,7 +39,11 @@
<div class="detail">
<div class="name">Status</div>
<div class="value">
<button class="isa-btn isa-p-0 isa-btn-block isa-text-right isa-white-space-nowrap" (click)="statusDropdown.toggle()">
<button
*ngIf="processingKeys && processingKeys.size > 0"
class="isa-btn isa-p-0 isa-btn-block isa-text-right isa-white-space-nowrap"
(click)="statusDropdown.toggle()"
>
<lib-icon
class="isa-mr-8"
[ngClass]="icon"
@@ -56,6 +60,9 @@
[height]="'16px'"
></lib-icon>
</button>
<div *ngIf="processingKeys && processingKeys.size === 0" class="value align-right">
<strong>{{ orderDetails?.processingStatus | processingStatus }}</strong>
</div>
<app-ui-dropdown #statusDropdown [value]="orderDetails?.processingStatus" (valueChange)="changeProcessingStatus.emit($event)">
<ng-container *ngFor="let status of processingKeys | keyvalue | processingStatusOptionsKeyValuePipe">
<button

View File

@@ -21,6 +21,10 @@
font-weight: $font-weight-bold;
white-space: nowrap;
}
.align-right {
text-align: right;
}
}
.transistion {

View File

@@ -14,7 +14,10 @@ export class ShelfOrderDetailsCardComponent {
minDate = this.dateAdapter.addCalendarDays(new Date(), -1);
get processingKeys() {
return this.orderDetailsService.getAvailableProcessStatusRefact(this.actions.filter((a) => a.enabled === false));
if (this.actions && this.actions.length > 0) {
return this.orderDetailsService.getAvailableProcessStatusRefact(this.actions.filter((a) => a.enabled === false));
}
return new Map<number, { value: string; disabled: boolean }>();
}
get actions(): KeyValueDTOOfStringAndString[] {

View File

@@ -129,7 +129,9 @@ export class ShelfOrderDetailsComponent {
}
filterEnabledActions(actions: KeyValueDTOOfStringAndString[]): KeyValueDTOOfStringAndString[] {
return actions.filter((a) => !a.hasOwnProperty('enabled'));
if (actions && actions.length > 0) {
return actions.filter((a) => !a.hasOwnProperty('enabled'));
}
}
async changeProcessingStatus(