This commit is contained in:
Lorenz Hilpert
2023-07-24 11:26:55 +02:00
8 changed files with 21 additions and 11 deletions

View File

@@ -116,6 +116,7 @@ export class AppComponent implements OnInit {
checkForUpdate() {
interval(this._checkForUpdates).subscribe(() => {
this._swUpdate.checkForUpdate().then((value) => {
console.log('check for update', value);
if (value) {
this._notifications.updateNotification();
}
@@ -125,6 +126,7 @@ export class AppComponent implements OnInit {
initialCheckForUpdate() {
this._swUpdate.checkForUpdate().then((value) => {
console.log('initial check for update', value);
if (value) {
location.reload();
}

View File

@@ -1,7 +1,7 @@
{
"title": "ISA - Integration",
"silentRefresh": {
"interval": 300000
"interval": 60000
},
"@cdn/product-image": {
"url": "https://produktbilder.paragon-data.net"
@@ -66,7 +66,7 @@
"assortment": 6000
}
},
"checkForUpdates": 3600000,
"checkForUpdates": 900000,
"licence": {
"scandit": "AZ7zLw2eLmFWHbYP4RDq8VAEgAxmNGYcPU8YpOc3DryEXj4zMzYQFrQuUm0YewGQYEESXjpRwGX1NYmKY3pXHnAn2DeqIzh2an+FUu9socQlbQnJiHJHoWBAqcqWSua+P12tc95P3s9aaEEYvSjUy7Md88f7N+sk6zZbUmqbMXeXqmZwdkmRoUY/2w0CiiiA4gBFHgu4sMeNQ9dWyfxKTUPf5AnsxnuYpCt5KLxJWSYDv8HHj0mx8DCJTe1m2ony97Lge3JbJ5Dd+Zz6SCwqik7fv53Qole9s/3m66lYFWKAzWRKkHN1zts78CmPxPb+AAHVoqlBM3duvYmnCxxGOmlXabKUNuDR2ExaMu/nlo532jqqy25Cet/FP1UAs96ZGRgzEcHxGPp6kA53lJ15zd+cxz6G93E83AmYJkhddXBQElWEaGtQRfrEzRGmvcksR+V8MMYjGmhkVbQxGGqpnfP4IxbuEFcef6bxxTiulzo75gXoqZTt+7C1qpDcrMM3Yp0Z8RBw3JlV2tLk4FYFZpxY8QrXIcjvRYKExtQ9e5sSbST4Vx95YhEUd6iX0SBPDzcmgR4/Ef6gvJfoWgz68+rqhBGckphdHi2Mf/pYuAlh2jbwtrkErE2xWARBejR/UcU/A3F7k9RkFd5/QZC7qhsE6bZH7uhpkptIbi5XkXagwYy1oJD7yJs4VLOJteYWferRm8h1auxXew5tL8VLHciF+lLj6h8PTUDt2blLgUjHtualqlCwdSTzJyYwk4oswGGDk6E48X7LXpzuhtR8TYTOi2REN0uuTbO/slFBRw+CaYUnD0LjB9p2lb8ndcdV9adzBKmwPxiOtlOELQ=="
},

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>