mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Merge branch 'develop' of https://bitbucket.org/umwerk/hugendubel-instore-ma into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input, ChangeDetectorRef, ChangeDetectionStrategy, Output, EventEmitter, OnDestroy } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, AbstractControl } from '@angular/forms';
|
||||
import { Actions, ofActionSuccessful, Select, Store } from '@ngxs/store';
|
||||
import { Select, Store } from '@ngxs/store';
|
||||
import { take, takeUntil } from 'rxjs/operators';
|
||||
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
||||
import { SetUserDetails } from '../../../../core/store/actions/customer.actions';
|
||||
@@ -45,11 +45,11 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
|
||||
@Output() notificationInEditMode = new EventEmitter<boolean>();
|
||||
|
||||
constructor(private fb: FormBuilder, private store: Store, private cdr: ChangeDetectorRef, private actions: Actions) {}
|
||||
constructor(private fb: FormBuilder, private store: Store, private cdr: ChangeDetectorRef) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.customer) {
|
||||
const updateUserData = { ...this.customer };
|
||||
const updateUserData = {...this.customer};
|
||||
updateUserData.notificationSms = false;
|
||||
updateUserData.notificationEmail = false;
|
||||
if (this.customer.email) {
|
||||
@@ -95,17 +95,16 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
const sms = this.selected('sms');
|
||||
const email = this.selected('email');
|
||||
if ((this.notificationForm.get('sms.telephone').valid || !sms) && (this.notificationForm.get('email.email').valid || !email)) {
|
||||
const updateUserData = { ...this.customer };
|
||||
const updateUserData = {...this.customer};
|
||||
updateUserData.notificationSms = sms;
|
||||
updateUserData.notificationEmail = email || this.isDelivery;
|
||||
this.store.dispatch(new SetUserDetails(updateUserData, false));
|
||||
this.actions
|
||||
.pipe(ofActionSuccessful(SetUserDetails), take(1))
|
||||
this.store.dispatch(new SetUserDetails(updateUserData, false))
|
||||
.pipe(take(1))
|
||||
.subscribe(() => {
|
||||
if (this.customer.error) {
|
||||
return;
|
||||
}
|
||||
this.patchVariable(this.submitted$, { email: false, phone: false });
|
||||
this.patchVariable(this.submitted$, {email: false, phone: false});
|
||||
this.setEditMode(false);
|
||||
});
|
||||
}
|
||||
@@ -123,9 +122,8 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
mobile_number: phoneField.value,
|
||||
notificationSms: this.selected('sms')
|
||||
};
|
||||
this.store.dispatch(new SetUserDetails(c, false));
|
||||
this.actions
|
||||
.pipe(ofActionSuccessful(SetUserDetails), take(1))
|
||||
this.store.dispatch(new SetUserDetails(c, false))
|
||||
.pipe(take(1))
|
||||
.subscribe(() => {
|
||||
this.patchVariable(this.serverErrors$, {
|
||||
phone: this.customer.error
|
||||
@@ -135,10 +133,10 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
if (this.customer.error) {
|
||||
return;
|
||||
}
|
||||
this.patchVariable(this.submitted$, { phone: false });
|
||||
this.patchVariable(this.submitted$, {phone: false});
|
||||
});
|
||||
} else {
|
||||
this.patchVariable(this.submitted$, { phone: true });
|
||||
this.patchVariable(this.submitted$, {phone: true});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,9 +152,8 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
email: emailField.value,
|
||||
notificationEmail: this.selected('email') || this.isDelivery
|
||||
};
|
||||
this.store.dispatch(new SetUserDetails(c, false));
|
||||
this.actions
|
||||
.pipe(ofActionSuccessful(SetUserDetails), take(1))
|
||||
this.store.dispatch(new SetUserDetails(c, false))
|
||||
.pipe(take(1))
|
||||
.subscribe(() => {
|
||||
this.patchVariable(this.serverErrors$, {
|
||||
email: this.customer.error
|
||||
@@ -166,18 +163,18 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
if (this.customer.error) {
|
||||
return;
|
||||
}
|
||||
this.patchVariable(this.submitted$, { email: false });
|
||||
this.patchVariable(this.submitted$, {email: false});
|
||||
});
|
||||
} else {
|
||||
this.patchVariable(this.submitted$, { email: true });
|
||||
this.patchVariable(this.submitted$, {email: true});
|
||||
}
|
||||
}
|
||||
|
||||
onInputChange(value: string, type: string) {
|
||||
if (!value) {
|
||||
this.patchVariable(this.submitted$, { [type]: false });
|
||||
this.patchVariable(this.submitted$, {[type]: false});
|
||||
}
|
||||
this.patchVariable(this.serverErrors$, { [type]: null });
|
||||
this.patchVariable(this.serverErrors$, {[type]: null});
|
||||
}
|
||||
|
||||
buttonDisabled(typeField: string, typeServerError: string) {
|
||||
@@ -186,7 +183,7 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
|
||||
validSms(control: AbstractControl) {
|
||||
if (control.value && control.value.selected && !control.get('telephone').valid) {
|
||||
return { invalidSms: true };
|
||||
return {invalidSms: true};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -201,7 +198,7 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
|
||||
update(val, type: string) {
|
||||
if (!val) {
|
||||
this.patchVariable(this.submitted$, { [type === 'email' ? type : 'phone']: false });
|
||||
this.patchVariable(this.submitted$, {[type === 'email' ? type : 'phone']: false});
|
||||
}
|
||||
|
||||
this.notificationForm.get(type + '.selected').setValue(val);
|
||||
@@ -210,7 +207,7 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
setEmailNotification() {
|
||||
if (this.customer) {
|
||||
// If delivery type, then email is mandatory
|
||||
const updateUserData = { ...this.customer };
|
||||
const updateUserData = {...this.customer};
|
||||
updateUserData.notificationEmail = true;
|
||||
this.store.dispatch(new SetUserDetails(updateUserData, false));
|
||||
}
|
||||
@@ -221,13 +218,13 @@ export class NotificationSettingsComponent implements OnInit, OnDestroy {
|
||||
sms: fb.group(
|
||||
{
|
||||
selected: false,
|
||||
telephone: fb.control('', { validators: [Validators.required, CustomValidators.validateTelephone] })
|
||||
telephone: fb.control('', {validators: [Validators.required, CustomValidators.validateTelephone]})
|
||||
},
|
||||
{ validators: this.validSms }
|
||||
{validators: this.validSms}
|
||||
),
|
||||
email: fb.group({
|
||||
selected: this.isDelivery,
|
||||
email: fb.control('', { validators: [Validators.required, CustomValidators.validateEmail] })
|
||||
email: fb.control('', {validators: [Validators.required, CustomValidators.validateEmail]})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -705,8 +705,12 @@ export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
message: string;
|
||||
type: CheckoutType;
|
||||
};
|
||||
this.storeError = (error.type === CheckoutType.store) ? this.errorMessage : null;
|
||||
this.deliveryError = (error.type === CheckoutType.delivery) ? this.errorMessage : null;
|
||||
if (error.type === CheckoutType.store) {
|
||||
this.storeError = this.errorMessage;
|
||||
}
|
||||
if (error.type === CheckoutType.delivery) {
|
||||
this.deliveryError = this.errorMessage;
|
||||
}
|
||||
return of(null);
|
||||
}
|
||||
const item = response as {
|
||||
@@ -714,6 +718,12 @@ export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
type: CheckoutType;
|
||||
av: AvailabilityDTO[];
|
||||
};
|
||||
if (item.type === CheckoutType.store) {
|
||||
this.storeError = null;
|
||||
}
|
||||
if (item.type === CheckoutType.delivery) {
|
||||
this.deliveryError = null;
|
||||
}
|
||||
const preferredAvailability = this.getPreferedAvailability(item.av);
|
||||
if (!preferredAvailability) {
|
||||
return;
|
||||
|
||||
@@ -23,12 +23,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-row" *ngIf="isCompleted && shippingDocumentNumber">
|
||||
<div class="content-row" *ngIf="isCompleted && packageNumber">
|
||||
<div class="content-field">
|
||||
<span class="descriptor">Wannennummer</span>
|
||||
<span class="value">{{
|
||||
shippingDocumentNumber | shippingDocumentNumberFormatter
|
||||
}}</span>
|
||||
<span class="value">{{ packageNumber }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@ export class RemissionsOverviewCardContentComponent implements OnInit {
|
||||
isCompleted: boolean;
|
||||
|
||||
@Input()
|
||||
shippingDocumentNumber: string;
|
||||
packageNumber: string;
|
||||
|
||||
@Input()
|
||||
numberOfItems = 0;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
[isCompleted]="shippingDocumentIsCompleted"
|
||||
[supplier]="remissionProcess?.filter?.target?.name"
|
||||
[numberOfItems]="numberOfShippingDocumentProducts"
|
||||
[shippingDocumentNumber]="shippingDocumentNumber"
|
||||
[packageNumber]="packageNumber"
|
||||
[date]="remissionProcess?.startDate"
|
||||
></app-remissions-overview-card-content>
|
||||
</div>
|
||||
|
||||
@@ -70,4 +70,12 @@ export class RemissionsOverviewCardComponent implements OnInit {
|
||||
|
||||
return this.remissionProcess.shippingDocuments[0].shippingDocumentNumber;
|
||||
}
|
||||
|
||||
get packageNumber() {
|
||||
if (!this.shippingDocumentExists(this.remissionProcess)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.remissionProcess.shippingDocuments[0].packageNumber;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
[isCompleted]="(remissionProcess?.shippingDocuments)[0].isCompleted"
|
||||
[supplier]="remissionProcess?.filter?.target?.name"
|
||||
[numberOfItems]="
|
||||
(remissionProcess?.shippingDocuments)[0].products?.length
|
||||
(remissionProcess?.shippingDocuments)[0]?.products?.length
|
||||
"
|
||||
[shippingDocumentNumber]="
|
||||
(remissionProcess?.shippingDocuments)[0].shippingDocumentNumber
|
||||
[packageNumber]="
|
||||
(remissionProcess?.shippingDocuments)[0]?.packageNumber
|
||||
"
|
||||
alignRight="true"
|
||||
[date]="remissionProcess?.startDate"
|
||||
|
||||
@@ -93,7 +93,7 @@ export class RemissionFinishComponent implements OnInit, OnDestroy {
|
||||
subTitle = {
|
||||
0: 'Scannen Sie die Wannennummer um den Warenbegleitschein abzuschließen.',
|
||||
// tslint:disable-next-line: max-line-length
|
||||
1: 'Der Warenbegleitschein wird nach Abschluss der Remission versendet. Zum Öffnen eines neuen Warenbegleitscheins setzen Sie die Remission fort.',
|
||||
1: 'Legen Sie abschließend den "Blank Beizettel" in die abgeschlossene Wanne. Der Warenbegleitschein wird nach Abschluss der Remission versendet. Zum Öffnen eines neuen Warenbegleitscheins setzen Sie die Remission fort.',
|
||||
2: ''
|
||||
};
|
||||
|
||||
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1095,9 +1095,9 @@
|
||||
}
|
||||
},
|
||||
"@isa/remission": {
|
||||
"version": "0.3.9",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remission/-/remission-0.3.9.tgz",
|
||||
"integrity": "sha1-BOTjl9cgPbepJlaSaZDZfviz+KE=",
|
||||
"version": "0.3.10",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remission/-/remission-0.3.10.tgz",
|
||||
"integrity": "sha1-h/gNK619uOVnh4BKRBxFACgrI0s=",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@isa/catsearch-api": "^0.0.53",
|
||||
"@isa/print-api": "0.0.53",
|
||||
"@isa/remi-api": "^0.0.53",
|
||||
"@isa/remission": "^0.3.9",
|
||||
"@isa/remission": "^0.3.10",
|
||||
"@ng-idle/core": "^8.0.0-beta.4",
|
||||
"@ng-idle/keepalive": "^8.0.0-beta.4",
|
||||
"@ngxs/store": "^3.4.1",
|
||||
|
||||
Reference in New Issue
Block a user