From 5be3f005ac9c988de450d814399ab455b4628a3e Mon Sep 17 00:00:00 2001 From: Cyril Joseph Date: Sun, 3 Aug 2025 18:28:28 -0300 Subject: [PATCH] carnet ad holder updates --- .../application/application.component.html | 2 +- .../application/application.component.ts | 1 + src/app/carnet/goods/goods.component.html | 15 +- src/app/carnet/goods/goods.component.ts | 1 + src/app/carnet/holder/holder.component.html | 2 +- src/app/carnet/holder/holder.component.ts | 1 + .../carnet/shipping/shipping.component.html | 19 +- src/app/carnet/shipping/shipping.component.ts | 169 ++++++++++++------ .../terms-conditions.component.ts | 1 - .../travel-plan/travel-plan.component.html | 10 +- .../travel-plan/travel-plan.component.ts | 2 + .../carnet/view/view-carnet.component.html | 42 +++++ .../carnet/view/view-carnet.component.scss | 8 + src/app/carnet/view/view-carnet.component.ts | 46 +++++ src/app/core/models/carnet/holder.ts | 1 + .../core/services/carnet/carnet.service.ts | 11 ++ .../core/services/carnet/holder.service.ts | 3 +- .../core/services/carnet/shipping.service.ts | 26 +-- .../search/search-holder.component.html | 20 ++- .../holder/search/search-holder.component.ts | 1 + src/environments/environment.development.ts | 3 +- src/environments/environment.ts | 3 +- 22 files changed, 291 insertions(+), 96 deletions(-) create mode 100644 src/app/carnet/view/view-carnet.component.html create mode 100644 src/app/carnet/view/view-carnet.component.scss create mode 100644 src/app/carnet/view/view-carnet.component.ts diff --git a/src/app/carnet/application/application.component.html b/src/app/carnet/application/application.component.html index 6a17cce..342eb28 100644 --- a/src/app/carnet/application/application.component.html +++ b/src/app/carnet/application/application.component.html @@ -21,7 +21,7 @@
- diff --git a/src/app/carnet/application/application.component.ts b/src/app/carnet/application/application.component.ts index 89a09da..fa99e4d 100644 --- a/src/app/carnet/application/application.component.ts +++ b/src/app/carnet/application/application.component.ts @@ -17,6 +17,7 @@ import { ActivatedRoute } from '@angular/router'; }) export class ApplicationComponent { @Input() isEditMode = false; + @Input() isViewMode = false; @Input() headerid: number = 0; @Input() applicationName: string = ''; diff --git a/src/app/carnet/goods/goods.component.html b/src/app/carnet/goods/goods.component.html index efe4539..963033e 100644 --- a/src/app/carnet/goods/goods.component.html +++ b/src/app/carnet/goods/goods.component.html @@ -38,12 +38,13 @@

Goods Items

-
-
@@ -102,10 +103,12 @@ Actions - - @@ -219,7 +222,7 @@
- @@ -229,7 +232,7 @@
- diff --git a/src/app/carnet/goods/goods.component.ts b/src/app/carnet/goods/goods.component.ts index 1f4647d..2659b9a 100644 --- a/src/app/carnet/goods/goods.component.ts +++ b/src/app/carnet/goods/goods.component.ts @@ -28,6 +28,7 @@ import { Goods, GoodsItem } from '../../core/models/carnet/goods'; }) export class GoodsComponent { @Input() headerid: number = 0; + @Input() isViewMode = false; @Input() userPreferences: UserPreferences = {}; @Input() isEditMode: boolean = false; @Output() completed = new EventEmitter(); diff --git a/src/app/carnet/holder/holder.component.html b/src/app/carnet/holder/holder.component.html index d152820..71e6104 100644 --- a/src/app/carnet/holder/holder.component.html +++ b/src/app/carnet/holder/holder.component.html @@ -1,2 +1,2 @@ \ No newline at end of file + [headerid]="headerid" [selectedHolderId]="selectedHolderId" [isViewMode]="isViewMode"> \ No newline at end of file diff --git a/src/app/carnet/holder/holder.component.ts b/src/app/carnet/holder/holder.component.ts index 3ddc13e..ff852d7 100644 --- a/src/app/carnet/holder/holder.component.ts +++ b/src/app/carnet/holder/holder.component.ts @@ -13,6 +13,7 @@ import { ApiErrorHandlerService } from '../../core/services/common/api-error-han styleUrl: './holder.component.scss' }) export class HolderComponent { + @Input() isViewMode = false; @Input() headerid: number = 0; @Input() applicationName: string = ''; @Input() userPreferences: UserPreferences = {}; diff --git a/src/app/carnet/shipping/shipping.component.html b/src/app/carnet/shipping/shipping.component.html index 86ce007..247e96c 100644 --- a/src/app/carnet/shipping/shipping.component.html +++ b/src/app/carnet/shipping/shipping.component.html @@ -2,7 +2,7 @@
- +
@@ -49,8 +49,8 @@ -
@@ -343,15 +343,24 @@
+ + - + +
\ No newline at end of file diff --git a/src/app/carnet/shipping/shipping.component.ts b/src/app/carnet/shipping/shipping.component.ts index 65d9815..4fdc336 100644 --- a/src/app/carnet/shipping/shipping.component.ts +++ b/src/app/carnet/shipping/shipping.component.ts @@ -24,6 +24,8 @@ import { Holder } from '../../core/models/carnet/holder'; import { NavigationService } from '../../core/services/common/navigation.service'; 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'; @Component({ selector: 'app-shipping', @@ -34,6 +36,7 @@ import { FormOfSecurity } from '../../core/models/formofsecurity'; export class ShippingComponent { @Input() headerid: number = 0; @Input() isEditMode = false; + @Input() isViewMode = false; @Input() enableSubmitButton = false; @Input() applicationName: string = ''; @@ -49,6 +52,7 @@ export class ShippingComponent { private holderService = inject(HolderService); private navigationService = inject(NavigationService); private storageService = inject(StorageService); + private carnetService = inject(CarnetService); shippingForm: FormGroup; isLoading = false; @@ -58,6 +62,8 @@ export class ShippingComponent { deliveryEstimate: string = ''; holderid: number = 0; holder: Holder | undefined | null = null; + showSubmitButton: boolean = environment.appType === 'client'; + showProcessButton: boolean = environment.appType === 'service-provider'; countriesHasStates = ['US', 'CA', 'MX']; countries: Country[] = []; @@ -68,6 +74,7 @@ export class ShippingComponent { formOfSecurities: FormOfSecurity[] = []; govFormOfSecurities: FormOfSecurity[] = []; nonGovFormOfSecurities: FormOfSecurity[] = []; + shippingFromDB: Shipping | null = null; private destroy$ = new Subject(); @@ -126,7 +133,7 @@ export class ShippingComponent { this.loadPaymentTypes(); this.loadFormOfSecurities(); - if (this.headerid) { + if (this.headerid && this.headerid > 0) { this.loadShippingData(); } } @@ -190,7 +197,7 @@ export class ShippingComponent { public refreshShippingData(): void { if (this.headerid > 0) { - this.loadShippingData(); + this.loadAddressContactData(); } } @@ -218,7 +225,7 @@ export class ShippingComponent { this.showAddressForm = false; this.showContactForm = false; - this.updateShippingValidation(shipTo); + this.updateAddressContactValidation(shipTo); if (shipTo === '3RDPARTY') { this.shippingForm.get('contact')?.reset(); @@ -321,6 +328,30 @@ export class ShippingComponent { loadShippingData(): void { this.isLoading = true; + this.shippingService.getShippingData(this.headerid).pipe( + finalize(() => { + this.isLoading = false; + }) + ).subscribe({ + next: (results: Shipping) => { + + if (!results) { // do nothing if empty + return; + } + this.shippingFromDB = results; + this.patchShippingData(); + this.loadAddressContactData(); + }, + error: (error: any) => { + console.error('Error loading shipping data', error); + const errorMessage = this.errorHandler.handleApiError(error, 'Failed to load shipping data'); + this.notificationService.showError(errorMessage); + } + }); + } + + loadAddressContactData(): void { + this.isLoading = true; this.holderService.getHolder(this.headerid).pipe( switchMap((holder: Holder) => { @@ -333,10 +364,9 @@ export class ShippingComponent { return forkJoin({ holderContacts: this.shippingService.getHolderContactsById(holder.holderid), - holderAddress: this.shippingService.getHolderAddressById(holder.holderid), + holderAddress: this.shippingService.getHolderAddress(holder), preparerAddress: this.shippingService.getPreparerAddress(), - preparerContacts: this.shippingService.getPreparerContacts(), - shippingData: this.shippingService.getShippingData(this.headerid) + preparerContacts: this.shippingService.getPreparerContacts() }).pipe( // Combine the forkJoin results with the original holder object map((apiResults: any) => ({ ...apiResults, holder })) @@ -346,7 +376,7 @@ export class ShippingComponent { ).subscribe({ next: (results) => { - if (!results) { // do nothing if empty + if (!results && !this.shippingFromDB) { // do nothing if empty return; } @@ -357,20 +387,19 @@ export class ShippingComponent { this.preparerAddress = results.preparerAddress; // Set holder contact - if (results.shippingData?.shipTo === 'HOLDER' && results.shippingData?.contact?.contactid) { - this.holderContact = this.holderContacts.find(hc => hc.contactid === results.shippingData?.contact?.contactid); + if (this.shippingFromDB?.shipTo === 'HOLDER' && this.shippingFromDB?.contact?.contactid) { + this.holderContact = this.holderContacts.find(hc => hc.contactid === this.shippingFromDB?.contact?.contactid); } else { this.holderContact = this.holderContacts?.[0]; } // Set preparer contact - if (results.shippingData?.shipTo === 'PREPARER' && results.shippingData?.contact?.contactid) { - this.preparerContact = this.preparerContacts.find(pc => pc.contactid === results.shippingData?.contact?.contactid); + if (this.shippingFromDB?.shipTo === 'PREPARER' && this.shippingFromDB?.contact?.contactid) { + this.preparerContact = this.preparerContacts.find(pc => pc.contactid === this.shippingFromDB?.contact?.contactid); } else { this.preparerContact = this.preparerContacts.find(pc => pc.defaultContact); } - - this.patchShippingData(results.shippingData); + this.patchAddressContactData(); }, error: (error: any) => { console.error('Error loading shipping data', error); @@ -380,25 +409,40 @@ export class ShippingComponent { }); } - patchShippingData(shipping: Shipping): void { - this.shippingForm.patchValue({ - // needsBond: shipping.needsBond, - needsInsurance: shipping.needsInsurance, - needsLostDocProtection: shipping.needsLostDocProtection, - formOfSecurity: shipping.formOfSecurity, - shipTo: shipping.shipTo, - deliveryType: shipping.deliveryType, - deliveryMethod: shipping.deliveryMethod, - courierAccount: shipping.courierAccount, - paymentMethod: shipping.paymentMethod - }); - - if (shipping.address?.country) { - this.loadStates(shipping.address?.country); + patchShippingData(): void { + if (!this.shippingFromDB) { + return; } - if (shipping.deliveryMethod === 'CLC') { - this.onDeliveryMethodChange(shipping.deliveryMethod); + this.shippingForm.patchValue({ + // needsBond: shipping.needsBond, + needsInsurance: this.shippingFromDB.needsInsurance, + needsLostDocProtection: this.shippingFromDB.needsLostDocProtection, + formOfSecurity: this.shippingFromDB.formOfSecurity, + shipTo: this.shippingFromDB.shipTo, + deliveryType: this.shippingFromDB.deliveryType, + deliveryMethod: this.shippingFromDB.deliveryMethod, + courierAccount: this.shippingFromDB.courierAccount, + paymentMethod: this.shippingFromDB.paymentMethod + }); + + if (this.shippingFromDB.deliveryMethod === 'CLC') { + this.onDeliveryMethodChange(this.shippingFromDB.deliveryMethod); + } + + this.calculateDeliveryEstimate(); + this.shippingForm.markAsUntouched(); + this.completed.emit(this.shippingForm.valid); + } + + patchAddressContactData(): void { + + if (!this.shippingFromDB) { + return + } + + if (this.shippingFromDB.address?.country) { + this.loadStates(this.shippingFromDB.address?.country); } let formOfSecurityControl = this.shippingForm.get('formOfSecurity'); @@ -410,9 +454,9 @@ export class ShippingComponent { } this.calculateDeliveryEstimate(); - this.updateShippingValidation(shipping.shipTo); + this.updateAddressContactValidation(this.shippingFromDB.shipTo); - if (shipping.shipTo === '3RDPARTY') { + if (this.shippingFromDB.shipTo === '3RDPARTY') { this.showAddressForm = true; this.showContactForm = true; @@ -420,35 +464,35 @@ export class ShippingComponent { const contactGroup = this.shippingForm.get('contact') as FormGroup; addressGroup.patchValue({ - addressid: shipping.address?.addressid, - companyName: shipping.address?.companyName, - address1: shipping.address?.address1, - address2: shipping.address?.address2, - city: shipping.address?.city, - state: shipping.address?.state, - zip: shipping.address?.zip, - country: shipping.address?.country + addressid: this.shippingFromDB.address?.addressid, + companyName: this.shippingFromDB.address?.companyName, + address1: this.shippingFromDB.address?.address1, + address2: this.shippingFromDB.address?.address2, + city: this.shippingFromDB.address?.city, + state: this.shippingFromDB.address?.state, + zip: this.shippingFromDB.address?.zip, + country: this.shippingFromDB.address?.country }) contactGroup.patchValue({ - contactid: shipping.contact?.contactid, - firstName: shipping.contact?.firstName, - lastName: shipping.contact?.lastName, - middleInitial: shipping.contact?.middleInitial, - title: shipping.contact?.title, - phone: shipping.contact?.phone, - mobile: shipping.contact?.mobile, - fax: shipping.contact?.fax, - email: shipping.contact?.email, - refNumber: shipping.contact?.refNumber, - notes: shipping.contact?.notes, + contactid: this.shippingFromDB.contact?.contactid, + firstName: this.shippingFromDB.contact?.firstName, + lastName: this.shippingFromDB.contact?.lastName, + middleInitial: this.shippingFromDB.contact?.middleInitial, + title: this.shippingFromDB.contact?.title, + phone: this.shippingFromDB.contact?.phone, + mobile: this.shippingFromDB.contact?.mobile, + fax: this.shippingFromDB.contact?.fax, + email: this.shippingFromDB.contact?.email, + refNumber: this.shippingFromDB.contact?.refNumber, + notes: this.shippingFromDB.contact?.notes, }) } this.shippingForm.markAsUntouched(); this.completed.emit(this.shippingForm.valid); } - updateShippingValidation(shipTo: string): void { + updateAddressContactValidation(shipTo: string): void { const addressGroup = this.shippingForm.get('address') as FormGroup; const contactGroup = this.shippingForm.get('contact') as FormGroup; @@ -641,4 +685,25 @@ export class ShippingComponent { this.navigationService.navigate(["terms"]) } + + returnToHome(): void { + this.navigationService.navigate(["home"]) + } + + processApplication(): void { + this.changeInProgress = true; + this.carnetService.processApplication(this.headerid).pipe(finalize(() => { + this.changeInProgress = false; + })).subscribe({ + next: () => { + this.notificationService.showSuccess('Application processed successfully'); + this.navigationService.navigate(["home"]); + }, + error: (error) => { + let errorMessage = this.errorHandler.handleApiError(error, 'Failed to submit application'); + this.notificationService.showError(errorMessage); + console.error('Error submitting the application', error); + } + }); + } } \ No newline at end of file diff --git a/src/app/carnet/terms-conditions/terms-conditions.component.ts b/src/app/carnet/terms-conditions/terms-conditions.component.ts index 67aece0..46af8fa 100644 --- a/src/app/carnet/terms-conditions/terms-conditions.component.ts +++ b/src/app/carnet/terms-conditions/terms-conditions.component.ts @@ -61,7 +61,6 @@ export class TermsConditionsComponent { } onAccept(): void { - this.changeInProgress = true; this.carnetService.submitApplication(this.currentApplicationDetails?.headerid!).pipe(finalize(() => { this.changeInProgress = false; diff --git a/src/app/carnet/travel-plan/travel-plan.component.html b/src/app/carnet/travel-plan/travel-plan.component.html index 72d17fe..889b45c 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.html +++ b/src/app/carnet/travel-plan/travel-plan.component.html @@ -46,11 +46,11 @@
- @@ -101,11 +101,11 @@
- @@ -142,7 +142,7 @@
-
diff --git a/src/app/carnet/travel-plan/travel-plan.component.ts b/src/app/carnet/travel-plan/travel-plan.component.ts index bace1b3..4ef21fe 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.ts +++ b/src/app/carnet/travel-plan/travel-plan.component.ts @@ -19,6 +19,8 @@ import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/c }) export class TravelPlanComponent { @Input() headerid: number = 0; + @Input() isViewMode = false; + @Output() completed = new EventEmitter(); private fb = inject(FormBuilder); diff --git a/src/app/carnet/view/view-carnet.component.html b/src/app/carnet/view/view-carnet.component.html new file mode 100644 index 0000000..6b9b54e --- /dev/null +++ b/src/app/carnet/view/view-carnet.component.html @@ -0,0 +1,42 @@ +
+ + +
+ + + + Application Name + + + + + + + + Holder Selection + + + + + + + + Goods Section + + + + + + + Travel Plan + + + + + + Shipping & Payment + + + + + \ No newline at end of file diff --git a/src/app/carnet/view/view-carnet.component.scss b/src/app/carnet/view/view-carnet.component.scss new file mode 100644 index 0000000..bb26aa7 --- /dev/null +++ b/src/app/carnet/view/view-carnet.component.scss @@ -0,0 +1,8 @@ +.carnet-headers-align .mat-expansion-panel-header-description { + justify-content: space-between; + align-items: center; +} + +.carnet-headers-align .mat-mdc-form-field+.mat-mdc-form-field { + margin-left: 8px; +} \ No newline at end of file diff --git a/src/app/carnet/view/view-carnet.component.ts b/src/app/carnet/view/view-carnet.component.ts new file mode 100644 index 0000000..ebbedc5 --- /dev/null +++ b/src/app/carnet/view/view-carnet.component.ts @@ -0,0 +1,46 @@ +import { afterNextRender, Component, inject, viewChild } from '@angular/core'; +import { AngularMaterialModule } from '../../shared/module/angular-material.module'; +import { MatAccordion } from '@angular/material/expansion'; +import { UserPreferences } from '../../core/models/user-preference'; +import { CommonModule } from '@angular/common'; +import { ActivatedRoute } from '@angular/router'; +import { UserPreferencesService } from '../../core/services/user-preference.service'; +import { ReactiveFormsModule } from '@angular/forms'; +import { ApplicationComponent } from '../application/application.component'; +import { GoodsComponent } from '../goods/goods.component'; +import { HolderComponent } from '../holder/holder.component'; +import { ShippingComponent } from '../shipping/shipping.component'; +import { TravelPlanComponent } from '../travel-plan/travel-plan.component'; + +@Component({ + selector: 'app-view-carnet', + imports: [AngularMaterialModule, CommonModule, ReactiveFormsModule, + ApplicationComponent, HolderComponent, GoodsComponent, TravelPlanComponent, ShippingComponent], + templateUrl: './view-carnet.component.html', + styleUrl: './view-carnet.component.scss' +}) +export class ViewCarnetComponent { + accordion = viewChild.required(MatAccordion); + isViewMode = true; + headerid: number = 0; + applicationName: string = ''; + userPreferences: UserPreferences; + + private route = inject(ActivatedRoute); + + constructor(userPrefenceService: UserPreferencesService) { + this.userPreferences = userPrefenceService.getPreferences(); + + afterNextRender(() => { + // Open all panels + this.accordion().openAll(); + }); + } + + ngOnInit(): void { + const idParam = this.route.snapshot.paramMap.get('headerid'); + this.headerid = idParam ? parseInt(idParam, 10) : 0; + + this.applicationName = this.route.snapshot.queryParamMap.get('applicationname') || ''; + } +} diff --git a/src/app/core/models/carnet/holder.ts b/src/app/core/models/carnet/holder.ts index 85fdb1b..79f97d9 100644 --- a/src/app/core/models/carnet/holder.ts +++ b/src/app/core/models/carnet/holder.ts @@ -1,5 +1,6 @@ export interface Holder { holderid: number; + locationid?: number; holderName: string; dbaName?: string | null; holderNumber: string; diff --git a/src/app/core/services/carnet/carnet.service.ts b/src/app/core/services/carnet/carnet.service.ts index ee382b4..339e2b9 100644 --- a/src/app/core/services/carnet/carnet.service.ts +++ b/src/app/core/services/carnet/carnet.service.ts @@ -45,4 +45,15 @@ export class CarnetService { return this.http.post(`${this.apiUrl}/${this.apiDb}/TransmitApplicationtoProcess`, appData); } + + processApplication(headerid: number): Observable { + + let appData = { + // P_SPID: this.userService.getUserSpid(), + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + + return this.http.post(`${this.apiUrl}/${this.apiDb}//ProcessCarnet`, appData); + } } diff --git a/src/app/core/services/carnet/holder.service.ts b/src/app/core/services/carnet/holder.service.ts index d3c8172..caba5b9 100644 --- a/src/app/core/services/carnet/holder.service.ts +++ b/src/app/core/services/carnet/holder.service.ts @@ -23,10 +23,11 @@ export class HolderService { private mapToHolder(holder: any): Holder { return { holderid: holder.HOLDERID, + locationid: holder.LOCATIONID, holderNumber: holder.HOLDERNO, holderType: holder.HOLDERTYPE, uscibMember: holder.USCIBMEMBERFLAG === 'Y', - // govAgency: holder.GOVAGENCYFLAG === 'Y', + // govAgency: holder.GOVAGENCYFLAG === 'Y', holderName: holder.HOLDERNAME, //NAMEQUALIFIER: holder.NAMEQUALIFIER || null, dbaName: holder.ADDLNAME || null, diff --git a/src/app/core/services/carnet/shipping.service.ts b/src/app/core/services/carnet/shipping.service.ts index d60524e..37c24b7 100644 --- a/src/app/core/services/carnet/shipping.service.ts +++ b/src/app/core/services/carnet/shipping.service.ts @@ -1,11 +1,12 @@ import { inject, Injectable } from '@angular/core'; import { environment } from '../../../../environments/environment'; import { HttpClient } from '@angular/common/http'; -import { filter, map, Observable } from 'rxjs'; +import { filter, map, Observable, of } from 'rxjs'; import { UserService } from '../common/user.service'; import { Shipping } from '../../models/carnet/shipping'; import { ShippingContact } from '../../models/carnet/shipping-contact'; import { ShippingAddress } from '../../models/carnet/shipping-address'; +import { Holder } from '../../models/carnet/holder'; @Injectable({ providedIn: 'root' @@ -75,7 +76,7 @@ export class ShippingService { P_CUSTCOURIERNO: shippingData.courierAccount, P_PAYMENTMETHOD: shippingData.paymentMethod, - // P_BONDPROTECTION: shippingData.needsBond ? 'Y' : 'N', + // P_BONDPROTECTION: shippingData.needsBond ? 'Y' : 'N', P_INSPROTECTION: shippingData.needsInsurance ? 'Y' : 'N', P_LDIPROTECTION: shippingData.needsLostDocProtection ? 'Y' : 'N', P_FORMOFSECURITY: shippingData.formOfSecurity, @@ -137,21 +138,20 @@ export class ShippingService { map(response => this.mapToAddress(response?.[0]))); } - getHolderAddressById(id: number): ShippingAddress | any { - return this.http.get(`${this.apiUrl}/${this.apiDb}/GetHolderRecord/${this.userService.getUserSpid()}/${id}`).pipe( - map(response => this.mapToAddress(response))); + getHolderAddress(holder: Holder): ShippingAddress | any { + return of(this.mapToAddress(holder)); } private mapToAddress(address: any): ShippingAddress { return { - companyName: address.NAMEOF ?? address.HOLDERNAME, - addressid: address.LOCATIONID ?? address.LOCATIONID, - address1: address.ADDRESS1, - address2: address.ADDRESS2, - city: address.CITY, - state: address.STATE, - zip: address.ZIP, - country: address.COUNTRY + companyName: address.NAMEOF ?? address.holderName, + addressid: address.LOCATIONID ?? address.locationid, + address1: address.ADDRESS1 ?? address.address1, + address2: address.ADDRESS2 ?? address.address2, + city: address.CITY ?? address.city, + state: address.STATE ?? address.state, + zip: address.ZIP ?? address.zip, + country: address.COUNTRY ?? address.country }; } } diff --git a/src/app/holder/search/search-holder.component.html b/src/app/holder/search/search-holder.component.html index 51f0b0b..3ffe5dd 100644 --- a/src/app/holder/search/search-holder.component.html +++ b/src/app/holder/search/search-holder.component.html @@ -22,7 +22,7 @@ Clear Search - @@ -78,20 +78,21 @@
+ [checked]="selectedHolderId === holder.holderid" *ngIf="!isViewMode" + (change)="onHolderSelection(holder)" aria-label="Select row" [hidden]="holder.isInactive"> - - -
@@ -117,7 +118,8 @@
-
diff --git a/src/app/holder/search/search-holder.component.ts b/src/app/holder/search/search-holder.component.ts index 526775f..7323ff2 100644 --- a/src/app/holder/search/search-holder.component.ts +++ b/src/app/holder/search/search-holder.component.ts @@ -44,6 +44,7 @@ export class SearchHolderComponent { this.dataSource.sort = value; } + @Input() isViewMode = false; @Input() headerid: number = 0; @Input() selectedHolderId: number = 0; @Input() applicationName: string = ''; diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index ee5c116..3e9903f 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -1,5 +1,6 @@ export const environment = { production: false, apiUrl: 'https://dev.alphaomegainfosys.com/test-api', - apiDb: 'oracle' + apiDb: 'oracle', + appType: 'client', }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index ea91a24..c6d71ac 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,5 +1,6 @@ export const environment = { production: true, apiUrl: 'https://dev.alphaomegainfosys.com/test-api', - apiDb: 'oracle' + apiDb: 'oracle', + appType: 'client', }; \ No newline at end of file