mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 962: #2374 Reorder Modal Fix Disable Order Button if Store And TakeAway Availabili...
#2374 Reorder Modal Fix Disable Order Button if Store And TakeAway Availabilites don't exist
This commit is contained in:
committed by
Andreas Schickinger
parent
bc1fc27a5d
commit
a4a4fc344a
@@ -77,7 +77,11 @@
|
||||
Nicht lieferbar
|
||||
</ui-spinner>
|
||||
</button>
|
||||
<button class="cta-reorder cta-action-primary" [disabled]="ctaDisabled$ | async" (click)="reorder()">
|
||||
<button
|
||||
class="cta-reorder cta-action-primary"
|
||||
[disabled]="(ctaDisabled$ | async) || ((storeAvailabilityError$ | async) && (takeAwayAvailabilityError$ | async))"
|
||||
(click)="reorder()"
|
||||
>
|
||||
<ui-spinner [show]="ctaDisabled$ | async">
|
||||
Bestellen
|
||||
</ui-spinner>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ComponentStore } from '@ngrx/component-store';
|
||||
import { AvailabilityDTO2, OrderItemListItemDTO } from '@swagger/oms';
|
||||
import { UiModalRef } from '@ui/modal';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { catchError, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { catchError, map, shareReplay, switchMap, tap } from 'rxjs/operators';
|
||||
import { ReorderResult } from './reorder.result';
|
||||
|
||||
interface GoodsInListReorderModalState {
|
||||
@@ -47,8 +47,8 @@ export class ReorderModalComponent extends ComponentStore<GoodsInListReorderModa
|
||||
}
|
||||
readonly ctaDisabled$ = this.select((s) => s.ctaDisabled);
|
||||
|
||||
readonly storeAvailabilityError$ = this.select((s) => s.storeAvailabilityError);
|
||||
readonly takeAwayAvailabilityError$ = this.select((s) => s.takeAwayAvailabilityError);
|
||||
readonly storeAvailabilityError$ = this.select((s) => s.storeAvailabilityError).pipe(shareReplay());
|
||||
readonly takeAwayAvailabilityError$ = this.select((s) => s.takeAwayAvailabilityError).pipe(shareReplay());
|
||||
|
||||
readonly currentBranch$ = this.domainAvailabilityService.getCurrentBranch();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user