feedback updates
This commit is contained in:
parent
abfbdb94c0
commit
07e7a0da63
@ -289,7 +289,7 @@
|
|||||||
<mat-error *ngIf="shippingForm.get('deliveryType')?.errors?.['required']">
|
<mat-error *ngIf="shippingForm.get('deliveryType')?.errors?.['required']">
|
||||||
Delivery Type is required
|
Delivery Type is required
|
||||||
</mat-error>
|
</mat-error>
|
||||||
<mat-hint align="start" *ngIf="deliveryEstimate" class="delivery-estimate">
|
<mat-hint align="start" *ngIf="deliveryEstimate && !isViewMode" class="delivery-estimate">
|
||||||
<span>{{ deliveryEstimate }}</span>
|
<span>{{ deliveryEstimate }}</span>
|
||||||
</mat-hint>
|
</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@ -129,7 +129,7 @@ export class TravelPlanComponent {
|
|||||||
title: 'For your information',
|
title: 'For your information',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Ok',
|
||||||
cancelText: 'Cancel'
|
hideCancel: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -147,8 +147,8 @@ export class TravelPlanComponent {
|
|||||||
data: {
|
data: {
|
||||||
title: 'Warning',
|
title: 'Warning',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Yes',
|
||||||
cancelText: 'Cancel'
|
cancelText: 'No'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ export class TravelPlanComponent {
|
|||||||
data: {
|
data: {
|
||||||
title: 'Act',
|
title: 'Act',
|
||||||
message: country.actionMessage,
|
message: country.actionMessage,
|
||||||
confirmText: 'Ok',
|
confirmText: 'Yes',
|
||||||
cancelText: 'Cancel'
|
cancelText: 'No'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
© {{ currentYear }} {{currentServiceProviderName}}. All rights reserved.
|
© {{ currentYear }} alpha Omega Infosys. All rights reserved.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
@ -1,8 +1,6 @@
|
|||||||
import { Component, effect, inject, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
import { AngularMaterialModule } from '../../shared/module/angular-material.module';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { User } from '../../core/models/user';
|
|
||||||
import { UserService } from '../../core/services/common/user.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-footer',
|
selector: 'app-footer',
|
||||||
@ -12,20 +10,6 @@ import { UserService } from '../../core/services/common/user.service';
|
|||||||
})
|
})
|
||||||
export class FooterComponent {
|
export class FooterComponent {
|
||||||
currentYear = new Date().getFullYear();
|
currentYear = new Date().getFullYear();
|
||||||
currentServiceProviderName: string = '';
|
|
||||||
userDetails: User | null = {};
|
|
||||||
|
|
||||||
@Input() isUserLoggedIn = false;
|
@Input() isUserLoggedIn = false;
|
||||||
|
|
||||||
private userService = inject(UserService);
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
) {
|
|
||||||
effect(() => {
|
|
||||||
this.userDetails = this.userService.userDetailsSignal();
|
|
||||||
if (this.userDetails?.userDetails) {
|
|
||||||
this.currentServiceProviderName = this.userDetails.userDetails.serviceProviderName || '';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -14,6 +14,7 @@ import { ApiErrorHandlerService } from './api-error-handler.service';
|
|||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
private apiUrl = environment.apiUrl;
|
private apiUrl = environment.apiUrl;
|
||||||
|
private applicationName = environment.appType;
|
||||||
|
|
||||||
private http = inject(HttpClient);
|
private http = inject(HttpClient);
|
||||||
private userService = inject(UserService);
|
private userService = inject(UserService);
|
||||||
@ -24,7 +25,7 @@ export class AuthService {
|
|||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
|
|
||||||
login(username: string, password: string): Observable<any> {
|
login(username: string, password: string): Observable<any> {
|
||||||
return this.http.post(`${this.apiUrl}/login`, { p_emailaddr: username, p_password: password });
|
return this.http.post(`${this.apiUrl}/login`, { p_emailaddr: username, p_password: password, P_APPLICATIONNAME: this.applicationName });
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshToken(): Observable<any> {
|
refreshToken(): Observable<any> {
|
||||||
|
|||||||
@ -59,7 +59,7 @@ export class CommonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRegions(): Observable<Region[]> {
|
getRegions(): Observable<Region[]> {
|
||||||
return this.http.get<any[]>(`${this.apiUrl}/${this.apiDb}/GetRegions`).pipe(
|
return this.http.get<any[]>(`${this.apiUrl}/${this.apiDb}/GetRegions/${this.userService.getUserSpid()}`).pipe(
|
||||||
map((response) =>
|
map((response) =>
|
||||||
response.map((item) => ({
|
response.map((item) => ({
|
||||||
id: item.REGIONID,
|
id: item.REGIONID,
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { BasicDetail } from '../../core/models/holder/basic-detail';
|
|||||||
import { StorageService } from '../../core/services/common/storage.service';
|
import { StorageService } from '../../core/services/common/storage.service';
|
||||||
import { NavigationService } from '../../core/services/common/navigation.service';
|
import { NavigationService } from '../../core/services/common/navigation.service';
|
||||||
import { environment } from '../../../environments/environment';
|
import { environment } from '../../../environments/environment';
|
||||||
|
import { HolderService } from '../../core/services/carnet/holder.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-basic-detail',
|
selector: 'app-basic-detail',
|
||||||
@ -49,6 +50,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
private errorHandler = inject(ApiErrorHandlerService);
|
private errorHandler = inject(ApiErrorHandlerService);
|
||||||
private storageService = inject(StorageService);
|
private storageService = inject(StorageService);
|
||||||
private navigationService = inject(NavigationService);
|
private navigationService = inject(NavigationService);
|
||||||
|
private carnetHolderService = inject(HolderService);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.basicDetailsForm = this.createForm();
|
this.basicDetailsForm = this.createForm();
|
||||||
@ -133,6 +135,9 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
if (!this.isEditMode) {
|
if (!this.isEditMode) {
|
||||||
this.holderIdCreated.emit(basicData.HOLDERID);
|
this.holderIdCreated.emit(basicData.HOLDERID);
|
||||||
|
|
||||||
|
// save the created holder for the current application
|
||||||
|
this.saveHolderToApplication(basicData.HOLDERID);
|
||||||
|
|
||||||
// change to edit mode after creation
|
// change to edit mode after creation
|
||||||
this.isEditMode = true;
|
this.isEditMode = true;
|
||||||
this.holderid = basicData.HOLDERID;
|
this.holderid = basicData.HOLDERID;
|
||||||
@ -226,4 +231,22 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveHolderToApplication(holderid: number): void {
|
||||||
|
this.changeInProgress = true;
|
||||||
|
const saveObservable = this.carnetHolderService.saveApplicationHolder(this.currentApplicationDetails?.headerid!, holderid);
|
||||||
|
|
||||||
|
saveObservable.pipe(finalize(() => {
|
||||||
|
this.changeInProgress = false;
|
||||||
|
})).subscribe({
|
||||||
|
next: (basicData: any) => {
|
||||||
|
},
|
||||||
|
error: (error: any) => {
|
||||||
|
let errorMessage = this.errorHandler.handleApiError(error, `Failed to save holder details`);
|
||||||
|
this.notificationService.showError(errorMessage);
|
||||||
|
console.error('Error saving holder details:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { AngularMaterialModule } from '../../module/angular-material.module';
|
import { AngularMaterialModule } from '../../module/angular-material.module';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-confirm-dialog',
|
selector: 'app-confirm-dialog',
|
||||||
imports: [AngularMaterialModule],
|
imports: [AngularMaterialModule, CommonModule],
|
||||||
template: `
|
template: `
|
||||||
<h2 mat-dialog-title>{{ data.title }}</h2>
|
<h2 mat-dialog-title>{{ data.title }}</h2>
|
||||||
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
<mat-dialog-content>{{ data.message }}</mat-dialog-content>
|
||||||
@ -12,7 +13,7 @@ import { AngularMaterialModule } from '../../module/angular-material.module';
|
|||||||
<button mat-raised-button color="warn" [mat-dialog-close]="true">
|
<button mat-raised-button color="warn" [mat-dialog-close]="true">
|
||||||
{{ data.confirmText || 'Confirm' }}
|
{{ data.confirmText || 'Confirm' }}
|
||||||
</button>
|
</button>
|
||||||
<button mat-button [mat-dialog-close]="false">{{ data.cancelText || 'Cancel' }}</button>
|
<button mat-button *ngIf="!data.hideCancel" [mat-dialog-close]="false">{{ data.cancelText || 'Cancel' }}</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
||||||
`,
|
`,
|
||||||
styles: [`
|
styles: [`
|
||||||
@ -29,6 +30,7 @@ export class ConfirmDialogComponent {
|
|||||||
message: string;
|
message: string;
|
||||||
confirmText: string;
|
confirmText: string;
|
||||||
cancelText: string;
|
cancelText: string;
|
||||||
|
hideCancel: boolean;
|
||||||
}
|
}
|
||||||
) { }
|
) { }
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user