mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1502: #3358 Disable Pick Up Option in purchasing Modal if no valid targetBranch is...
#3358 Disable Pick Up Option in purchasing Modal if no valid targetBranch is selected
This commit is contained in:
committed by
Lorenz Hilpert
parent
7508144e27
commit
24f6ba117d
@@ -35,3 +35,7 @@ p {
|
||||
.select-option {
|
||||
@apply mt-4 mb-4 border-2 border-solid border-brand text-brand text-cta-l font-bold bg-white rounded-full py-3 px-6;
|
||||
}
|
||||
|
||||
.select-option:disabled {
|
||||
@apply bg-disabled-branch border-disabled-branch text-white;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
</p>
|
||||
<span class="price" *ngIf="price$ | async; let price">{{ price?.value?.value | currency: price?.value?.currency:'code' }}</span>
|
||||
<ui-branch-dropdown
|
||||
class="min-h-[38px]"
|
||||
[branches]="branches$ | async"
|
||||
[selected]="selected$ | async"
|
||||
(selectBranch)="selectBranch($event)"
|
||||
@@ -18,7 +19,12 @@
|
||||
>
|
||||
<div class="grow"></div>
|
||||
<div>
|
||||
<button [disabled]="availability.price?.value?.value < 0" type="button" class="select-option" (click)="select()">
|
||||
<button
|
||||
[disabled]="availability.price?.value?.value < 0 || !(selected$ | async)"
|
||||
type="button"
|
||||
class="select-option"
|
||||
(click)="select()"
|
||||
>
|
||||
Auswählen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,14 @@ import { PurchasingOptionsModalStore } from '../purchasing-options-modal.store';
|
||||
})
|
||||
export class PickUpOptionComponent {
|
||||
branches$: Observable<BranchDTO[]> = this._purchasingOptionsModalStore.selectAvailableBranches;
|
||||
selected$: Observable<string> = this._purchasingOptionsModalStore.selectBranch.pipe(map((branch) => branch.name));
|
||||
selected$: Observable<string> = this._purchasingOptionsModalStore.selectBranch.pipe(
|
||||
map((branch) => {
|
||||
// Determins if branch is targetBranch
|
||||
if (branch.branchType === 1) {
|
||||
return branch.name;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
readonly item$ = this._purchasingOptionsModalStore.selectItem;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
cdkOverlayOrigin
|
||||
#trigger="cdkOverlayOrigin"
|
||||
>
|
||||
<span>{{ selected }}</span>
|
||||
<span>{{ selected ?? 'Filiale auswählen' }}</span>
|
||||
<div class="arrow-icon">
|
||||
<ui-icon size="15px" icon="arrow_head"></ui-icon>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user