Merge branch 'release/2.3' into develop

This commit is contained in:
Lorenz Hilpert
2023-07-24 01:12:38 +02:00
6 changed files with 17 additions and 9 deletions

View File

@@ -154,7 +154,7 @@
</div>
<ui-form-control label="Vormerker" variant="inline">
<ui-select formControlName="isPrebooked">
<ui-select formControlName="isPrebooked" readonly="true">
<ui-select-option label="Ja" [value]="true"></ui-select-option>
<ui-select-option label="Nein" [value]="false"></ui-select-option>
</ui-select>

View File

@@ -169,6 +169,12 @@
/>
</div>
<ng-container *ngIf="canAddResult$ | async; let canAddResult">
<span *ngIf="!canAddResult.canAdd" class="inline-block font-bold text-[#BE8100] mt-[14px] max-w-[19rem]">
{{ canAddResult.message }}
</span>
</ng-container>
<span *ngIf="showMaxAvailableQuantity$ | async" class="font-bold text-[#BE8100] mt-[14px]">
{{ (availability$ | async)?.inStock }} Exemplare sofort lieferbar
</span>

View File

@@ -82,7 +82,7 @@ export function getCanAddForItemWithPurchaseOption(
): (state: PurchaseOptionsState) => CanAdd {
return (state: PurchaseOptionsState) => {
const canAddResults = getCanAddResults(state);
return canAddResults.find((ca) => ca.itemId === itemId && ca.purchaseOption === purchaseOption);
return canAddResults.find((ca) => ca.canAdd && ca.itemId === itemId && ca.purchaseOption === purchaseOption);
};
}

View File

@@ -7,10 +7,10 @@ button.clear {
}
.hint {
@apply text-brand text-p4 font-bold;
@apply text-brand font-bold;
&.readonly-hint {
@apply text-inactive-branch font-normal;
@apply text-ucla-blue font-normal;
}
}

View File

@@ -13,13 +13,15 @@ export abstract class UiFormControlDirective<T> {
private _readonly = false;
@Input()
@HostBinding('readonly')
@Input('readonly')
_isReadonly: BooleanInput = false;
get readonly(): boolean {
return this._readonly;
return coerceBooleanProperty(this._isReadonly);
}
set readonly(value: BooleanInput) {
this._readonly = coerceBooleanProperty(value);
set readonly(value: boolean) {
this._isReadonly = coerceBooleanProperty(value);
}
focused = new EventEmitter<boolean>();

View File

@@ -1,7 +1,7 @@
<button class="backdrop" [class.display-backdrop]="toggled" (click)="toggled = !toggled"></button>
<div class="ui-input-wrapper">
<div class="ui-select-value">{{ label }}</div>
<button type="button" class="ui-select-toggle" [disabled]="disabled" (click)="toggle()">
<button *ngIf="!readonly" type="button" class="ui-select-toggle" [disabled]="disabled || readonly" (click)="toggle()">
<ui-icon icon="arrow_head"></ui-icon>
</button>
</div>