#2284 Packstück Id generieren ausblenden wenn ZL

This commit is contained in:
Lorenz Hilpert
2021-10-13 17:09:51 +02:00
parent 472716d06d
commit dd91b7c023
2 changed files with 7 additions and 1 deletions

View File

@@ -9,7 +9,9 @@
</div>
<div class="actions">
<app-button [outline]="true" (action)="shippingDocumentWithGeneratedId()">Packstück-ID generieren</app-button>
<app-button *ngIf="this.showGenerateIdButton$ | async" [outline]="true" (action)="shippingDocumentWithGeneratedId()"
>Packstück-ID generieren</app-button
>
<lib-remission-shipping-document-scanner
*ngIf="showScanningButton$ | async"
(scan)="shippingDocumentScanned($event)"

View File

@@ -38,6 +38,8 @@ export class ShippingDocumentCreationComponent implements OnInit {
@ViewChild(UiSearchboxNextComponent, { static: false })
searchbox: UiSearchboxNextComponent;
showGenerateIdButton$: Observable<boolean>;
constructor(
private appService: AppService,
private nativeService: NativeContainerService,
@@ -51,6 +53,8 @@ export class ShippingDocumentCreationComponent implements OnInit {
map((allowScan) => !!allowScan && this.appService.isIPadEnv() && this.nativeService.isUiWebview())
);
this.showGenerateIdButton$ = this.currentRemissionProcess$.pipe(map((process) => process?.filter?.target?.name === 'Blank'));
this.showSearchbox$ = this.showScanningButton$.pipe(map((s) => !s));
}