diff --git a/src/app/carnet/application/application.component.html b/src/app/carnet/application/application.component.html index cf3f29c..6a17cce 100644 --- a/src/app/carnet/application/application.component.html +++ b/src/app/carnet/application/application.component.html @@ -15,7 +15,7 @@ Name is required - Maximum 100 characters allowed + Maximum 50 characters allowed diff --git a/src/app/carnet/application/application.component.ts b/src/app/carnet/application/application.component.ts index 299e904..89a09da 100644 --- a/src/app/carnet/application/application.component.ts +++ b/src/app/carnet/application/application.component.ts @@ -67,7 +67,7 @@ export class ApplicationComponent { createForm(): FormGroup { return this.fb.group({ - name: ['', [Validators.required, Validators.maxLength(100)]], + name: ['', [Validators.required, Validators.maxLength(50)]], }); } diff --git a/src/app/carnet/goods/goods.component.html b/src/app/carnet/goods/goods.component.html index 2b66aeb..9dc83db 100644 --- a/src/app/carnet/goods/goods.component.html +++ b/src/app/carnet/goods/goods.component.html @@ -122,8 +122,8 @@ - + @@ -219,10 +219,10 @@
- +
diff --git a/src/app/carnet/shipping/contact-dialog.component.ts b/src/app/carnet/shipping/contact-dialog.component.ts index c6dbb1c..a870f41 100644 --- a/src/app/carnet/shipping/contact-dialog.component.ts +++ b/src/app/carnet/shipping/contact-dialog.component.ts @@ -17,10 +17,10 @@ import { FormsModule } from '@angular/forms'; - + `, styles: [` @@ -39,8 +39,10 @@ export class ContactDialogComponent { constructor( public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: { contacts: any[] } - ) { } + @Inject(MAT_DIALOG_DATA) public data: { contacts: any[], currentContact: any } + ) { + this.selectedContact = data.currentContact; + } get contacts() { return this.data.contacts; diff --git a/src/app/carnet/shipping/shipping.component.ts b/src/app/carnet/shipping/shipping.component.ts index 3b9580f..8516478 100644 --- a/src/app/carnet/shipping/shipping.component.ts +++ b/src/app/carnet/shipping/shipping.component.ts @@ -583,10 +583,11 @@ export class ShippingComponent { let shipTo = this.shippingForm.get('shipTo')?.value; const contacts = shipTo === 'PREPARER' ? this.preparerContacts : this.holderContacts; + const currentContact = shipTo === 'PREPARER' ? this.preparerContact : this.holderContact; const dialogRef = this.dialog.open(ContactDialogComponent, { width: '500px', - data: { contacts } + data: { contacts: contacts, currentContact: currentContact } }); dialogRef.afterClosed().subscribe(selectedItem => { diff --git a/src/app/carnet/travel-plan/travel-plan.component.ts b/src/app/carnet/travel-plan/travel-plan.component.ts index 2d10235..d375614 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.ts +++ b/src/app/carnet/travel-plan/travel-plan.component.ts @@ -148,6 +148,12 @@ export class TravelPlanComponent { } takeAction(country: Country): void { + + if (this.IsCountryExists('transit', country)) { + this.addVisitCountryToCollection(); + return; + } + const dialogRef = this.dialog.open(ConfirmDialogComponent, { width: '560px', data: { @@ -160,7 +166,9 @@ export class TravelPlanComponent { dialogRef.afterClosed().subscribe(result => { if (result) { + this.selectedAvailableTransitCountry = this.selectedAvailableVisitCountry; this.addVisitCountryToCollection(); + this.addTransitCountryToCollection(); } }); } @@ -186,6 +194,17 @@ export class TravelPlanComponent { } } + IsCountryExists(countryType: string, country: Country): boolean { + + const existingIndex = countryType === 'transit' ? this.selectedTransitCountries.findIndex( + c => c.value === country!.value + ) : this.selectedVisitCountries.findIndex( + c => c.value === country!.value + ); + + return existingIndex > -1; + } + // Remove country from visits removeVisitCountry(): void { if (!this.selectedVisitCountry) return; diff --git a/src/app/holder/contacts/contacts.component.html b/src/app/holder/contacts/contacts.component.html index a66169c..b37ee3c 100644 --- a/src/app/holder/contacts/contacts.component.html +++ b/src/app/holder/contacts/contacts.component.html @@ -100,8 +100,9 @@ - + @@ -255,10 +256,10 @@
- +
diff --git a/src/app/holder/search/search-holder.component.html b/src/app/holder/search/search-holder.component.html index c26b983..e20a677 100644 --- a/src/app/holder/search/search-holder.component.html +++ b/src/app/holder/search/search-holder.component.html @@ -77,6 +77,11 @@
+ + + @@ -89,11 +94,6 @@ (click)="reactivateHolder(holder.holderid)"> loupe - - -
@@ -110,8 +110,9 @@ - + diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index 0a392d6..168fbde 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -27,7 +27,7 @@
- Did you lose your carnet? Are you looking for + Did you loose your carnet? Are you looking for duplicates? Yes No @@ -138,7 +138,8 @@ -
diff --git a/src/app/home/home.component.scss b/src/app/home/home.component.scss index 7dd0a34..e29d501 100644 --- a/src/app/home/home.component.scss +++ b/src/app/home/home.component.scss @@ -20,7 +20,7 @@ } .questions-section { - flex: 0 0 70%; + flex: 0 0 65%; padding: 12px 16px; margin-bottom: 46px; margin-left: 1rem; diff --git a/src/app/shared/components/confirm-dialog/confirm-dialog.component.ts b/src/app/shared/components/confirm-dialog/confirm-dialog.component.ts index 5f3862b..06b3f12 100644 --- a/src/app/shared/components/confirm-dialog/confirm-dialog.component.ts +++ b/src/app/shared/components/confirm-dialog/confirm-dialog.component.ts @@ -9,10 +9,10 @@ import { AngularMaterialModule } from '../../module/angular-material.module';

{{ data.title }}

{{ data.message }} - + `, styles: [`