mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1506: #3895 Purchaseing Options Modal Selected branch check if correct branchType i...
#3895 Purchaseing Options Modal Selected branch check if correct branchType is selected
This commit is contained in:
committed by
Lorenz Hilpert
parent
fc5cf27bd1
commit
d804a744b6
@@ -37,3 +37,8 @@ p {
|
||||
@apply mx-auto;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
::ng-deep page-pick-up-option-list .option-chip:disabled,
|
||||
::ng-deep page-take-away-option-list .option-chip:disabled {
|
||||
@apply bg-disabled-branch border-disabled-branch text-white;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
|
||||
<ui-branch-dropdown
|
||||
[branches]="branches$ | async"
|
||||
[selected]="(selectedBranch$ | async)?.name"
|
||||
[selected]="selectedBranch$ | async"
|
||||
(selectBranch)="selectBranch($event)"
|
||||
></ui-branch-dropdown>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { BranchDTO } from '@swagger/checkout';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
import { PurchasingOptionsListModalStore } from '../purchasing-options-list-modal.store';
|
||||
|
||||
@Component({
|
||||
@@ -11,9 +12,20 @@ import { PurchasingOptionsListModalStore } from '../purchasing-options-list-moda
|
||||
})
|
||||
export class PickUpOptionListComponent {
|
||||
branches$ = this._store.branches$;
|
||||
selectedBranch$ = this._store.selectedPickUpBranch$;
|
||||
selectedBranch$ = this._store.selectedPickUpBranch$.pipe(
|
||||
map((branch) => {
|
||||
// Determins if branch is targetBranch
|
||||
if (branch?.branchType === 1) {
|
||||
return branch.name;
|
||||
}
|
||||
})
|
||||
);
|
||||
selectedOption$ = this._store.selectedFilterOption$;
|
||||
optionChipDisabled$ = this._store.fetchingAvailabilities$;
|
||||
optionChipDisabled$ = combineLatest([this._store.fetchingAvailabilities$, this.selectedBranch$]).pipe(
|
||||
map(([fetching, selectedBranch]) => {
|
||||
return fetching || !selectedBranch;
|
||||
})
|
||||
);
|
||||
|
||||
constructor(private _store: PurchasingOptionsListModalStore) {}
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@
|
||||
|
||||
<ui-branch-dropdown
|
||||
[branches]="branches$ | async"
|
||||
[selected]="(selectedBranch$ | async)?.name"
|
||||
[selected]="selectedBranch$ | async"
|
||||
(selectBranch)="selectBranch($event)"
|
||||
></ui-branch-dropdown>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { BranchDTO } from '@swagger/checkout';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { combineLatest } from 'rxjs';
|
||||
import { first, map } from 'rxjs/operators';
|
||||
import { PurchasingOptionsListModalStore } from '../purchasing-options-list-modal.store';
|
||||
|
||||
@Component({
|
||||
@@ -11,9 +12,20 @@ import { PurchasingOptionsListModalStore } from '../purchasing-options-list-moda
|
||||
})
|
||||
export class TakeAwayOptionListComponent {
|
||||
branches$ = this._store.branches$;
|
||||
selectedBranch$ = this._store.selectedTakeAwayBranch$;
|
||||
selectedBranch$ = this._store.selectedTakeAwayBranch$.pipe(
|
||||
map((branch) => {
|
||||
// Determins if branch is targetBranch
|
||||
if (branch?.branchType === 1) {
|
||||
return branch.name;
|
||||
}
|
||||
})
|
||||
);
|
||||
selectedOption$ = this._store.selectedFilterOption$;
|
||||
optionChipDisabled$ = this._store.fetchingAvailabilities$;
|
||||
optionChipDisabled$ = combineLatest([this._store.fetchingAvailabilities$, this.selectedBranch$]).pipe(
|
||||
map(([fetching, selectedBranch]) => {
|
||||
return fetching || !selectedBranch;
|
||||
})
|
||||
);
|
||||
|
||||
constructor(private _store: PurchasingOptionsListModalStore) {}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export class PickUpOptionComponent {
|
||||
selected$: Observable<string> = this._purchasingOptionsModalStore.selectBranch.pipe(
|
||||
map((branch) => {
|
||||
// Determins if branch is targetBranch
|
||||
if (branch.branchType === 1) {
|
||||
if (branch?.branchType === 1) {
|
||||
return branch.name;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user