feedback updates
This commit is contained in:
parent
cfcc565099
commit
d31084fad3
@ -0,0 +1 @@
|
||||
<p>additional-set works!</p>
|
||||
11
src/app/carnet/additional-set/additional-set.component.ts
Normal file
11
src/app/carnet/additional-set/additional-set.component.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-additional-set',
|
||||
imports: [],
|
||||
templateUrl: './additional-set.component.html',
|
||||
styleUrl: './additional-set.component.scss'
|
||||
})
|
||||
export class AdditionalSetComponent {
|
||||
|
||||
}
|
||||
@ -77,7 +77,7 @@ export class ApplicationComponent {
|
||||
name: this.applicationName,
|
||||
});
|
||||
|
||||
if (this.isEditMode) {
|
||||
if (this.isEditMode || this.isViewMode) {
|
||||
this.applicationDetailsForm.get('name')?.disable();
|
||||
this.disableSaveButton = true;
|
||||
}
|
||||
|
||||
1
src/app/carnet/duplicate/duplicate.component.html
Normal file
1
src/app/carnet/duplicate/duplicate.component.html
Normal file
@ -0,0 +1 @@
|
||||
<p>duplicate works!</p>
|
||||
0
src/app/carnet/duplicate/duplicate.component.scss
Normal file
0
src/app/carnet/duplicate/duplicate.component.scss
Normal file
11
src/app/carnet/duplicate/duplicate.component.ts
Normal file
11
src/app/carnet/duplicate/duplicate.component.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-duplicate',
|
||||
imports: [],
|
||||
templateUrl: './duplicate.component.html',
|
||||
styleUrl: './duplicate.component.scss'
|
||||
})
|
||||
export class DuplicateComponent {
|
||||
|
||||
}
|
||||
@ -174,6 +174,10 @@ export class GoodsComponent {
|
||||
horseUsed: data.horseUsed || false,
|
||||
authorizedRepresentatives: data.authorizedRepresentatives || ''
|
||||
});
|
||||
|
||||
if (this.isViewMode) {
|
||||
this.goodsForm.disable();
|
||||
}
|
||||
}
|
||||
|
||||
// Add new item to the table
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<p>replacement-set works!</p>
|
||||
11
src/app/carnet/replacement-set/replacement-set.component.ts
Normal file
11
src/app/carnet/replacement-set/replacement-set.component.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-replacement-set',
|
||||
imports: [],
|
||||
templateUrl: './replacement-set.component.html',
|
||||
styleUrl: './replacement-set.component.scss'
|
||||
})
|
||||
export class ReplacementSetComponent {
|
||||
|
||||
}
|
||||
78
src/app/carnet/shipping/fees-dialog.component.ts
Normal file
78
src/app/carnet/shipping/fees-dialog.component.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import { Component, inject, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { CarnetService } from '../../core/services/carnet/carnet.service';
|
||||
import { Fees } from '../../core/models/carnet/fee';
|
||||
import { ApiErrorHandlerService } from '../../core/services/common/api-error-handler.service';
|
||||
import { NotificationService } from '../../core/services/common/notification.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-fees-dialog',
|
||||
imports: [AngularMaterialModule, CommonModule, FormsModule],
|
||||
template: `
|
||||
<h3 mat-dialog-title>Fees and Charges</h3>
|
||||
<mat-dialog-content>
|
||||
<p> The following fees apply:</p>
|
||||
<ul>
|
||||
<li *ngIf="estimatedFees.basicFee">Basic fee: {{estimatedFees.basicFee | currency}}</li>
|
||||
<li *ngIf="estimatedFees.counterFoilFee">Counterfoil Fee: {{estimatedFees.counterFoilFee | currency}}
|
||||
</li>
|
||||
<li *ngIf="estimatedFees.continuationSheetFee">Continuation sheet fee:
|
||||
{{estimatedFees.continuationSheetFee | currency}}</li>
|
||||
<li *ngIf="estimatedFees.expeditedFee">Expedited fee: {{estimatedFees.expeditedFee | currency}}</li>
|
||||
<li *ngIf="estimatedFees.shippingFee">Shipping fee: {{estimatedFees.shippingFee | currency}}</li>
|
||||
<li *ngIf="estimatedFees.bondPremium">Bond Premium: {{estimatedFees.bondPremium | currency}}</li>
|
||||
<li *ngIf="estimatedFees.cargoPremium">Cargo Premium: {{estimatedFees.cargoPremium | currency}}</li>
|
||||
<li *ngIf="estimatedFees.ldiPremium">LDI Premium: {{estimatedFees.ldiPremium | currency}}</li>
|
||||
</ul>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
<button mat-raised-button color="primary" (click)="onClose()">
|
||||
Ok
|
||||
</button>
|
||||
</mat-dialog-actions>
|
||||
`,
|
||||
styles: [`
|
||||
li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
`]
|
||||
})
|
||||
export class FeesDialogComponent {
|
||||
estimatedFees: Fees = {};
|
||||
headerid: number | null = null;
|
||||
|
||||
private carnetService = inject(CarnetService);
|
||||
private notificationService = inject(NotificationService);
|
||||
private errorHandler = inject(ApiErrorHandlerService);
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<FeesDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { headerid: any }
|
||||
) {
|
||||
this.headerid = data.headerid;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.headerid && this.headerid > 0) {
|
||||
this.carnetService.getEstimatedFees(this.headerid).subscribe({
|
||||
next: (data: Fees) => {
|
||||
if (data) {
|
||||
this.estimatedFees = data;
|
||||
}
|
||||
},
|
||||
error: (error: any) => {
|
||||
let errorMessage = this.errorHandler.handleApiError(error, 'Failed to get estimated fees');
|
||||
this.notificationService.showError(errorMessage);
|
||||
console.error('Error getting estimated fees:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onClose(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
}
|
||||
@ -343,6 +343,16 @@
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button mat-raised-button color="primary" type="button" (click)="showEstimatedFees()"
|
||||
*ngIf="showEstimatedFeesButton && !isViewMode">
|
||||
<span>Estimated Fees</span>
|
||||
</button>
|
||||
|
||||
<button mat-raised-button color="primary" type="submit" *ngIf="!isViewMode"
|
||||
[disabled]="shippingForm.invalid || changeInProgress">
|
||||
Save
|
||||
</button>
|
||||
|
||||
<button mat-raised-button color="primary" type="button" (click)="processApplication()"
|
||||
[disabled]="!enableSubmitButton" *ngIf="showProcessButton && !isViewMode">
|
||||
<span>Process Application</span>
|
||||
@ -353,11 +363,6 @@
|
||||
<span>Submit Application</span>
|
||||
</button>
|
||||
|
||||
<button mat-raised-button color="primary" type="submit" *ngIf="!isViewMode"
|
||||
[disabled]="shippingForm.invalid || changeInProgress">
|
||||
Save
|
||||
</button>
|
||||
|
||||
<button mat-raised-button color="primary" type="button" (click)="returnToHome()" *ngIf="isViewMode">
|
||||
Back
|
||||
</button>
|
||||
|
||||
@ -26,6 +26,7 @@ import { StorageService } from '../../core/services/common/storage.service';
|
||||
import { FormOfSecurity } from '../../core/models/formofsecurity';
|
||||
import { CarnetService } from '../../core/services/carnet/carnet.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { FeesDialogComponent } from './fees-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-shipping',
|
||||
@ -62,7 +63,9 @@ export class ShippingComponent {
|
||||
deliveryEstimate: string = '';
|
||||
holderid: number = 0;
|
||||
holder: Holder | undefined | null = null;
|
||||
|
||||
showSubmitButton: boolean = environment.appType === 'client';
|
||||
showEstimatedFeesButton: boolean = environment.appType === 'client';
|
||||
showProcessButton: boolean = environment.appType === 'service-provider';
|
||||
|
||||
countriesHasStates = ['US', 'CA', 'MX'];
|
||||
@ -444,6 +447,10 @@ export class ShippingComponent {
|
||||
this.calculateDeliveryEstimate();
|
||||
this.shippingForm.markAsUntouched();
|
||||
this.completed.emit(this.shippingForm.valid);
|
||||
|
||||
if (this.isViewMode) {
|
||||
this.shippingForm.disable();
|
||||
}
|
||||
}
|
||||
|
||||
patchAddressContactData(): void {
|
||||
@ -460,7 +467,7 @@ export class ShippingComponent {
|
||||
if (this.holder?.holderType.trim() === 'GOV') {
|
||||
formOfSecurityControl?.setValue(this.govFormOfSecurities?.[0].value);
|
||||
formOfSecurityControl?.disable();
|
||||
} else {
|
||||
} else if (!this.isViewMode) {
|
||||
formOfSecurityControl?.enable();
|
||||
}
|
||||
|
||||
@ -688,6 +695,13 @@ export class ShippingComponent {
|
||||
});
|
||||
}
|
||||
|
||||
showEstimatedFees(): void {
|
||||
const dialogRef = this.dialog.open(FeesDialogComponent, {
|
||||
width: '500px',
|
||||
data: { headerid: this.headerid }
|
||||
});
|
||||
}
|
||||
|
||||
submitApplication(): void {
|
||||
this.onSubmit(true);
|
||||
}
|
||||
|
||||
@ -284,6 +284,9 @@ export class TravelPlanComponent {
|
||||
});
|
||||
|
||||
this.completed.emit(this.travelForm.valid);
|
||||
if (this.isViewMode) {
|
||||
this.travelForm.disable();
|
||||
}
|
||||
}
|
||||
|
||||
onSubmit(): void {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<span>{{ userEmail }}</span>
|
||||
</div>
|
||||
|
||||
<button mat-menu-item (click)="navigateTo('/usersettings')">
|
||||
<button mat-menu-item (click)="navigateTo('usersettings')">
|
||||
<mat-icon>settings</mat-icon>
|
||||
<span>User Preferences</span>
|
||||
</button>
|
||||
|
||||
@ -33,13 +33,13 @@ export class ShippingService {
|
||||
paymentMethod: shippingDetails.PAYMENTMETHOD,
|
||||
|
||||
//needsBond: shippingDetails.BONDPROTECTION === 'Y',
|
||||
needsInsurance: shippingDetails.INSPROTECTION === 'Y',
|
||||
needsLostDocProtection: shippingDetails.LDIPROTECTION === 'Y',
|
||||
needsInsurance: shippingDetails.INSPROTECTION === 'ACCEPT',
|
||||
needsLostDocProtection: shippingDetails.LDIPROTECTION === 'ACCEPT',
|
||||
formOfSecurity: shippingDetails.FORMOFSECURITY
|
||||
};
|
||||
|
||||
shippingData.address = {
|
||||
companyName: shippingDetails.P_SHIPNAME,
|
||||
companyName: shippingDetails.SHIPNAME,
|
||||
addressid: shippingDetails.SHIPADDRESSID,
|
||||
address1: shippingDetails.ADDRESS1,
|
||||
address2: shippingDetails.ADDRESS2,
|
||||
@ -77,8 +77,8 @@ export class ShippingService {
|
||||
P_PAYMENTMETHOD: shippingData.paymentMethod,
|
||||
|
||||
// P_BONDPROTECTION: shippingData.needsBond ? 'Y' : 'N',
|
||||
P_INSPROTECTION: shippingData.needsInsurance ? 'Y' : 'N',
|
||||
P_LDIPROTECTION: shippingData.needsLostDocProtection ? 'Y' : 'N',
|
||||
P_INSPROTECTION: shippingData.needsInsurance ? 'ACCEPT' : 'DECLINE',
|
||||
P_LDIPROTECTION: shippingData.needsLostDocProtection ? 'ACCEPT' : 'DECLINE',
|
||||
P_FORMOFSECURITY: shippingData.formOfSecurity,
|
||||
|
||||
P_SHIPNAME: shippingData.address?.companyName,
|
||||
|
||||
@ -38,7 +38,7 @@ export class HomeService {
|
||||
expiryDate: item.EXPDATE || null,
|
||||
orderType: item.ORDERTYPE,
|
||||
carnetStatus: item.CARNETSTATUS,
|
||||
headerId: item.HEADERID,
|
||||
headerid: item.HEADERID,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import { BasicDetailService } from '../../core/services/holder/basic-detail.serv
|
||||
import { BasicDetail } from '../../core/models/holder/basic-detail';
|
||||
import { StorageService } from '../../core/services/common/storage.service';
|
||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-basic-detail',
|
||||
@ -37,6 +38,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
||||
isLoading = false;
|
||||
changeInProgress = false;
|
||||
countriesHasStates = ['US', 'CA', 'MX'];
|
||||
returnTo: string = environment.appType === 'client' ? 'edit-carnet' : 'process-carnet';
|
||||
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
@ -215,7 +217,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
||||
|
||||
goBackToCarnetApplication(): void {
|
||||
this.storageService.removeItem('currentapplication')
|
||||
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
||||
this.navigationService.navigate([this.returnTo, this.currentApplicationDetails?.headerid],
|
||||
{
|
||||
state: { isEditMode: true },
|
||||
queryParams: {
|
||||
|
||||
@ -17,6 +17,7 @@ import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/c
|
||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||
import { StorageService } from '../../core/services/common/storage.service';
|
||||
import { finalize } from 'rxjs';
|
||||
import { environment } from '../../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-contacts',
|
||||
@ -47,6 +48,7 @@ export class ContactsComponent {
|
||||
showInactiveContacts = false;
|
||||
contacts: Contact[] = [];
|
||||
currentApplicationDetails: { headerid: number, applicationName: string } | null = null;
|
||||
returnTo: string = environment.appType === 'client' ? 'edit-carnet' : 'process-carnet';
|
||||
|
||||
contactReadOnlyFields: any = {
|
||||
lastChangedDate: null,
|
||||
@ -245,7 +247,7 @@ export class ContactsComponent {
|
||||
|
||||
goBackToCarnetApplication(): void {
|
||||
this.storageService.removeItem('currentapplication')
|
||||
this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid],
|
||||
this.navigationService.navigate([this.returnTo, this.currentApplicationDetails?.headerid],
|
||||
{
|
||||
state: { isEditMode: true },
|
||||
queryParams: {
|
||||
|
||||
@ -124,6 +124,25 @@
|
||||
matTooltip="Edit">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button matIconButton [matMenuTriggerFor]="carnetActions">
|
||||
<mat-icon>more_horiz</mat-icon>
|
||||
</button>
|
||||
<mat-menu #carnetActions="matMenu">
|
||||
<button mat-menu-item (click)="viewCarnet(item)">
|
||||
<mat-icon>article</mat-icon>
|
||||
<span>View Carnet</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="deleteCarnet(item.headerid)"
|
||||
*ngIf="getCarnetStatusLabel(item.carnetStatus) === 'Not Submitted'">
|
||||
<mat-icon>delete</mat-icon>
|
||||
<span>Delete Carnet</span>
|
||||
</button>
|
||||
<button mat-menu-item (click)="printGeneralList(item.headerid)">
|
||||
<mat-icon>print</mat-icon>
|
||||
<span>Print Carnet</span>
|
||||
</button>
|
||||
</mat-menu>
|
||||
<!--
|
||||
<button mat-icon-button color="primary" (click)="viewCarnet(item)" matTooltip="View">
|
||||
<mat-icon>article</mat-icon>
|
||||
</button>
|
||||
@ -134,7 +153,7 @@
|
||||
<button mat-icon-button color="primary" (click)="printGeneralList(item.headerid)"
|
||||
matTooltip="Print General List">
|
||||
<mat-icon>print</mat-icon>
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
@ -91,15 +91,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
.mat-column-actions {
|
||||
width: 135px;
|
||||
// .mat-column-actions {
|
||||
// width: 135px;
|
||||
|
||||
.action-buttons {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
// .action-buttons {
|
||||
// width: 100%;
|
||||
// display: flex;
|
||||
// gap: 4px;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
.no-data-message {
|
||||
|
||||
@ -166,8 +166,8 @@ export class HomeComponent {
|
||||
}
|
||||
|
||||
editCarnet(item: any): void {
|
||||
if (item && item.headerId) {
|
||||
this.navigateTo(['edit-carnet', item.headerId], {
|
||||
if (item && item.headerid) {
|
||||
this.navigateTo(['edit-carnet', item.headerid], {
|
||||
queryParams: { applicationname: item.applicationName }
|
||||
});
|
||||
} else {
|
||||
@ -176,8 +176,8 @@ export class HomeComponent {
|
||||
}
|
||||
|
||||
viewCarnet(item: any): void {
|
||||
if (item && item.headerId) {
|
||||
this.navigateTo(['view-carnet', item.headerId], {
|
||||
if (item && item.headerid) {
|
||||
this.navigateTo(['view-carnet', item.headerid], {
|
||||
queryParams: { applicationname: item.applicationName }
|
||||
});
|
||||
} else {
|
||||
@ -185,9 +185,9 @@ export class HomeComponent {
|
||||
}
|
||||
}
|
||||
|
||||
printGeneralList(headerId: number): void {
|
||||
if (headerId) {
|
||||
this.homeService.printGeneralList(headerId).subscribe({
|
||||
printGeneralList(headerid: number): void {
|
||||
if (headerid) {
|
||||
this.homeService.printGeneralList(headerid).subscribe({
|
||||
next: () => {
|
||||
|
||||
},
|
||||
@ -202,8 +202,8 @@ export class HomeComponent {
|
||||
}
|
||||
}
|
||||
|
||||
deleteCarnet(headerId: number): void {
|
||||
if (headerId) {
|
||||
deleteCarnet(headerid: number): void {
|
||||
if (headerid) {
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
width: '350px',
|
||||
data: {
|
||||
@ -216,7 +216,7 @@ export class HomeComponent {
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this.homeService.deleteCarnet(headerId).subscribe({
|
||||
this.homeService.deleteCarnet(headerid).subscribe({
|
||||
next: () => {
|
||||
this.notificationService.showSuccess('Carnet deleted successfully');
|
||||
this.loadCarnetData();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user