feedback updates
This commit is contained in:
parent
abfbdb94c0
commit
07e7a0da63
@ -289,7 +289,7 @@
|
||||
<mat-error *ngIf="shippingForm.get('deliveryType')?.errors?.['required']">
|
||||
Delivery Type is required
|
||||
</mat-error>
|
||||
<mat-hint align="start" *ngIf="deliveryEstimate" class="delivery-estimate">
|
||||
<mat-hint align="start" *ngIf="deliveryEstimate && !isViewMode" class="delivery-estimate">
|
||||
<span>{{ deliveryEstimate }}</span>
|
||||
</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
@ -129,7 +129,7 @@ export class TravelPlanComponent {
|
||||
title: 'For your information',
|
||||
message: country.actionMessage,
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel'
|
||||
hideCancel: true
|
||||
}
|
||||
});
|
||||
|
||||
@ -147,8 +147,8 @@ export class TravelPlanComponent {
|
||||
data: {
|
||||
title: 'Warning',
|
||||
message: country.actionMessage,
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel'
|
||||
confirmText: 'Yes',
|
||||
cancelText: 'No'
|
||||
}
|
||||
});
|
||||
|
||||
@ -171,8 +171,8 @@ export class TravelPlanComponent {
|
||||
data: {
|
||||
title: 'Act',
|
||||
message: country.actionMessage,
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel'
|
||||
confirmText: 'Yes',
|
||||
cancelText: 'No'
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
© {{ currentYear }} {{currentServiceProviderName}}. All rights reserved.
|
||||
© {{ currentYear }} alpha Omega Infosys. All rights reserved.
|
||||
</div>
|
||||
</div>
|
||||
</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 { CommonModule } from '@angular/common';
|
||||
import { User } from '../../core/models/user';
|
||||
import { UserService } from '../../core/services/common/user.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-footer',
|
||||
@ -12,20 +10,6 @@ import { UserService } from '../../core/services/common/user.service';
|
||||
})
|
||||
export class FooterComponent {
|
||||
currentYear = new Date().getFullYear();
|
||||
currentServiceProviderName: string = '';
|
||||
userDetails: User | null = {};
|
||||
|
||||
@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 {
|
||||
private apiUrl = environment.apiUrl;
|
||||
private applicationName = environment.appType;
|
||||
|
||||
private http = inject(HttpClient);
|
||||
private userService = inject(UserService);
|
||||
@ -24,7 +25,7 @@ export class AuthService {
|
||||
private errorHandler = inject(ApiErrorHandlerService);
|
||||
|
||||
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> {
|
||||
|
||||
@ -59,7 +59,7 @@ export class CommonService {
|
||||
}
|
||||
|
||||
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) =>
|
||||
response.map((item) => ({
|
||||
id: item.REGIONID,
|
||||
|
||||
@ -15,6 +15,7 @@ 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';
|
||||
import { HolderService } from '../../core/services/carnet/holder.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-basic-detail',
|
||||
@ -49,6 +50,7 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
||||
private errorHandler = inject(ApiErrorHandlerService);
|
||||
private storageService = inject(StorageService);
|
||||
private navigationService = inject(NavigationService);
|
||||
private carnetHolderService = inject(HolderService);
|
||||
|
||||
constructor() {
|
||||
this.basicDetailsForm = this.createForm();
|
||||
@ -133,6 +135,9 @@ export class BasicDetailComponent implements OnInit, OnDestroy {
|
||||
if (!this.isEditMode) {
|
||||
this.holderIdCreated.emit(basicData.HOLDERID);
|
||||
|
||||
// save the created holder for the current application
|
||||
this.saveHolderToApplication(basicData.HOLDERID);
|
||||
|
||||
// change to edit mode after creation
|
||||
this.isEditMode = true;
|
||||
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 { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { AngularMaterialModule } from '../../module/angular-material.module';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-dialog',
|
||||
imports: [AngularMaterialModule],
|
||||
imports: [AngularMaterialModule, CommonModule],
|
||||
template: `
|
||||
<h2 mat-dialog-title>{{ data.title }}</h2>
|
||||
<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">
|
||||
{{ data.confirmText || 'Confirm' }}
|
||||
</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>
|
||||
`,
|
||||
styles: [`
|
||||
@ -29,6 +30,7 @@ export class ConfirmDialogComponent {
|
||||
message: string;
|
||||
confirmText: string;
|
||||
cancelText: string;
|
||||
hideCancel: boolean;
|
||||
}
|
||||
) { }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user