From f484131cb7a084e1decee41eeb58894b38ed9e54 Mon Sep 17 00:00:00 2001 From: Cyril Joseph Date: Fri, 15 Aug 2025 22:33:05 -0300 Subject: [PATCH] duplicate, copy and additional sets --- src/app/app.routes.server.ts | 3 + src/app/app.routes.ts | 3 + .../carnet/edit/edit-carnet.component.html | 25 +++--- src/app/carnet/edit/edit-carnet.component.ts | 23 +++++- src/app/carnet/goods/goods.component.ts | 6 +- src/app/carnet/shipping/shipping.component.ts | 44 ++++++++++- .../terms-conditions.component.ts | 17 +++- .../travel-plan/travel-plan.component.html | 6 ++ .../travel-plan/travel-plan.component.scss | 4 + .../travel-plan/travel-plan.component.ts | 37 ++++++++- .../core/services/carnet/carnet.service.ts | 78 +++++++++++++++++++ .../common/api-error-handler.service.ts | 7 +- src/app/core/services/home.service.ts | 42 ---------- src/app/holder/contacts/contacts.component.ts | 2 +- .../search/search-holder.component.scss | 1 + .../holder/search/search-holder.component.ts | 2 + src/app/home/home.component.html | 12 +-- src/app/home/home.component.ts | 26 +++++-- .../preparer/contacts/contacts.component.ts | 2 +- .../basic-fee/basic-fee.component.ts | 2 +- .../carnet-fee/carnet-fee.component.scss | 4 +- .../carnet-fee/carnet-fee.component.ts | 2 +- .../contacts/contacts.component.ts | 2 +- .../continuation-sheet-fee.component.ts | 2 +- .../counterfoil-fee.component.ts | 2 +- .../expedited-fee/expedited-fee.component.ts | 2 +- .../security-deposit.component.ts | 4 +- 27 files changed, 265 insertions(+), 95 deletions(-) diff --git a/src/app/app.routes.server.ts b/src/app/app.routes.server.ts index 750eeba..b0eb517 100644 --- a/src/app/app.routes.server.ts +++ b/src/app/app.routes.server.ts @@ -13,6 +13,9 @@ export const serverRoutes: ServerRoute[] = [ { path: ':appId/country-messages', renderMode: RenderMode.Client }, { path: ':appId/add-preparer', renderMode: RenderMode.Client }, { path: ':appId/process-carnet/:headerid', renderMode: RenderMode.Client }, + { path: ':appId/process-duplicate-carnet/:headerid', renderMode: RenderMode.Client }, + { path: ':appId/process-extend-carnet/:headerid', renderMode: RenderMode.Client }, + { path: ':appId/process-additional-sets/:headerid', renderMode: RenderMode.Client }, { path: ':appId/view-carnet/:headerid', renderMode: RenderMode.Client }, { path: ':appId/add-holder', renderMode: RenderMode.Client }, { path: ':appId/edit-holder/:holderid', renderMode: RenderMode.Client }, diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index e65a414..7f2864a 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -22,6 +22,9 @@ export const routes: Routes = [ { path: 'param-record/:id', loadComponent: () => import('./param/manage-param-record/manage-param-record.component').then(m => m.ManageParamRecordComponent) }, { path: 'country-messages', loadComponent: () => import('./param/manage-country/manage-country.component').then(m => m.ManageCountryComponent) }, { path: 'process-carnet/:headerid', loadComponent: () => import('./carnet/edit/edit-carnet.component').then(m => m.EditCarnetComponent), canDeactivate: [CarnetCleanupGuard] }, + { path: 'process-duplicate-carnet/:headerid', loadComponent: () => import('./carnet/edit/edit-carnet.component').then(m => m.EditCarnetComponent), canDeactivate: [CarnetCleanupGuard] }, + { path: 'process-extend-carnet/:headerid', loadComponent: () => import('./carnet/edit/edit-carnet.component').then(m => m.EditCarnetComponent), canDeactivate: [CarnetCleanupGuard] }, + { path: 'process-additional-sets/:headerid', loadComponent: () => import('./carnet/edit/edit-carnet.component').then(m => m.EditCarnetComponent), canDeactivate: [CarnetCleanupGuard] }, { path: 'view-carnet/:headerid', loadComponent: () => import('./carnet/view/view-carnet.component').then(m => m.ViewCarnetComponent), canDeactivate: [CarnetCleanupGuard] }, { path: 'add-holder', loadComponent: () => import('./holder/add/add-holder.component').then(m => m.AddHolderComponent), canDeactivate: [CarnetCleanupGuard] }, { path: 'edit-holder/:holderid', loadComponent: () => import('./holder/edit/edit-holder.component').then(m => m.EditHolderComponent), canDeactivate: [CarnetCleanupGuard] }, diff --git a/src/app/carnet/edit/edit-carnet.component.html b/src/app/carnet/edit/edit-carnet.component.html index d9aabc0..05f0aa1 100644 --- a/src/app/carnet/edit/edit-carnet.component.html +++ b/src/app/carnet/edit/edit-carnet.component.html @@ -4,36 +4,36 @@ [selectedIndex]="currentStep"> - + Application Name - + Holder Selection + [isViewMode]="applicationType !== 'edit'" [applicationName]="applicationName" + (updated)="onHolderSelectionUpdated($event)"> - + Goods Section - - + Travel Plan - + @@ -41,7 +41,8 @@ Shipping & Payment + [applicationType]="applicationType" [applicationName]="applicationName" + [enableSubmitButton]="allSectionsCompleted"> diff --git a/src/app/carnet/edit/edit-carnet.component.ts b/src/app/carnet/edit/edit-carnet.component.ts index 5cb1750..143072f 100644 --- a/src/app/carnet/edit/edit-carnet.component.ts +++ b/src/app/carnet/edit/edit-carnet.component.ts @@ -22,7 +22,7 @@ import { UserPreferencesService } from '../../core/services/user-preference.serv export class EditCarnetComponent { currentStep = 0; isLinear = false; - applicationType: 'new' | 'additional' | 'duplicate' | 'extend' | null = 'new'; + applicationType: 'new' | 'edit' | 'additional' | 'duplicate' | 'extend' | null = 'edit'; isEditMode = true; // Set to true for edit mode headerid: number = 0; userPreferences: UserPreferences; @@ -55,10 +55,27 @@ export class EditCarnetComponent { let returnTo = this.route.snapshot.queryParamMap.get('return'); + // set application type based on the route url + const urlSegments = this.route.snapshot.url.map(segment => segment.path); + if (urlSegments.includes('duplicate-carnet') || urlSegments.includes('process-duplicate-carnet')) { + this.applicationType = 'duplicate'; + } else if (urlSegments.includes('extend-carnet') || urlSegments.includes('process-extend-carnet')) { + this.applicationType = 'extend'; + } + else if (urlSegments.includes('additional-sets') || urlSegments.includes('process-additional-sets')) { + this.applicationType = 'additional'; + } else { + this.applicationType = 'edit'; + } + if (returnTo === 'holder') { this.currentStep = 1; } else if (returnTo === 'shipping') { this.currentStep = 4; + } else if (this.applicationType === 'additional') { + this.currentStep = 3; + } else if (this.applicationType === 'duplicate') { + this.currentStep = 4; } } @@ -94,6 +111,10 @@ export class EditCarnetComponent { this.isAllSectionsCompleted(); } + onNeedsInsurance(data: boolean): void { + this.shippingComponent?.refreshInsuranceData(data); + } + isAllSectionsCompleted() { this.allSectionsCompleted = this.stepsCompleted.applicationDetail && this.stepsCompleted.holderSelection && this.stepsCompleted.goodsSection diff --git a/src/app/carnet/goods/goods.component.ts b/src/app/carnet/goods/goods.component.ts index c29b6f7..9472d8d 100644 --- a/src/app/carnet/goods/goods.component.ts +++ b/src/app/carnet/goods/goods.component.ts @@ -107,7 +107,7 @@ export class GoodsComponent { next: (goodsDetail: Goods) => { if (goodsDetail) { this.patchFormData(goodsDetail); - this.completed.emit(this.goodsForm.valid && this.dataSource.data.length > 0); + this.completed.emit((this.goodsForm.valid || this.goodsForm.disabled) && this.dataSource.data.length > 0); } }, error: (error: any) => { @@ -129,7 +129,7 @@ export class GoodsComponent { })).subscribe({ next: (items: GoodsItem[]) => { this.dataSource.data = items; - this.completed.emit(this.goodsForm.valid && this.dataSource.data.length > 0); + this.completed.emit((this.goodsForm.valid || this.goodsForm.disabled) && this.dataSource.data.length > 0); }, error: (error: any) => { let errorMessage = this.errorHandler.handleApiError(error, 'Failed to load goods items'); @@ -238,7 +238,6 @@ export class GoodsComponent { this.notificationService.showSuccess(`Goods ${this.isEditing ? 'updated' : 'added'} successfully`); this.loadGoodsItems(); this.cancelEdit(); - this.completed.emit(this.goodsForm.valid && this.dataSource.data.length > 0); }, error: (error) => { let errorMessage = this.errorHandler.handleApiError(error, `Failed to ${this.isEditing ? 'update' : 'add'} goods items`); @@ -336,7 +335,6 @@ export class GoodsComponent { this.notificationService.showSuccess(`Goods uploaded successfully`); this.loadGoodsItems(); this.cancelEdit(); - this.completed.emit(this.goodsForm.valid && this.dataSource.data.length > 0); this.fileToUpload = null; }, error: (error) => { diff --git a/src/app/carnet/shipping/shipping.component.ts b/src/app/carnet/shipping/shipping.component.ts index 695760c..f7015ff 100644 --- a/src/app/carnet/shipping/shipping.component.ts +++ b/src/app/carnet/shipping/shipping.component.ts @@ -40,6 +40,7 @@ export class ShippingComponent { @Input() isViewMode = false; @Input() enableSubmitButton = false; @Input() applicationName: string = ''; + @Input() applicationType: 'new' | 'edit' | 'additional' | 'duplicate' | 'extend' | null = 'edit'; @Output() completed = new EventEmitter(); @@ -61,6 +62,7 @@ export class ShippingComponent { showAddressForm = false; showContactForm = false; deliveryEstimate: string = ''; + needsInsurance = true; holderid: number = 0; holder: Holder | undefined | null = null; @@ -126,7 +128,6 @@ export class ShippingComponent { this.shippingForm.get('deliveryType')?.valueChanges.subscribe(() => { this.calculateDeliveryEstimate(); }); - } ngOnInit(): void { @@ -164,6 +165,21 @@ export class ShippingComponent { shippingData.formOfSecurity = this.govFormOfSecurities?.[0].value; } + if (this.applicationType === 'duplicate' && this.shippingFromDB) { + shippingData.needsInsurance = this.shippingFromDB.needsInsurance; + shippingData.needsLostDocProtection = this.shippingFromDB.needsLostDocProtection; + shippingData.formOfSecurity = this.shippingFromDB.formOfSecurity; + } + + if (this.applicationType === 'additional' && this.shippingFromDB) { + shippingData.needsLostDocProtection = this.shippingFromDB.needsLostDocProtection; + shippingData.formOfSecurity = this.shippingFromDB.formOfSecurity; + + if (!this.needsInsurance) { + shippingData.needsInsurance = this.shippingFromDB.needsInsurance; + } + } + this.shippingService.saveShippingDetails(this.headerid, shippingData).pipe(finalize(() => { this.changeInProgress = false; })).subscribe({ @@ -172,7 +188,11 @@ export class ShippingComponent { this.completed.emit(true); if (this.enableSubmitButton && this.headerid && submitApp) { - let currentApplicationDetails = { headerid: this.headerid, applicationName: this.applicationName } + let currentApplicationDetails = { + headerid: this.headerid, + applicationName: this.applicationName, + applicationType: this.applicationType + } this.storageService.set("currentapplication", currentApplicationDetails); this.navigationService.navigate(["terms"]) @@ -215,6 +235,17 @@ export class ShippingComponent { } } + public refreshInsuranceData(needsInsurance: boolean): void { + this.needsInsurance = needsInsurance; + if (this.applicationType === 'additional') { + if (this.needsInsurance) { + this.shippingForm.get('needsInsurance')?.enable(); + } else { + this.shippingForm.get('needsInsurance')?.disable(); + } + } + } + editAddressForm(): void { this.showAddressForm = true; let shipTo = this.shippingForm.get('shipTo')?.value; @@ -451,10 +482,15 @@ export class ShippingComponent { if (this.isViewMode) { this.shippingForm.disable(); } + + if (this.applicationType === 'duplicate' || this.applicationType === 'additional') { + this.shippingForm.get('formOfSecurity')?.disable(); + this.shippingForm.get('needsLostDocProtection')?.disable(); + this.shippingForm.get('needsInsurance')?.disable(); + } } patchAddressContactData(): void { - if (!this.shippingFromDB) { return } @@ -467,7 +503,7 @@ export class ShippingComponent { if (this.holder?.holderType.trim() === 'GOV') { formOfSecurityControl?.setValue(this.govFormOfSecurities?.[0].value); formOfSecurityControl?.disable(); - } else if (!this.isViewMode) { + } else if (!this.isViewMode && this.applicationType === 'edit') { formOfSecurityControl?.enable(); } diff --git a/src/app/carnet/terms-conditions/terms-conditions.component.ts b/src/app/carnet/terms-conditions/terms-conditions.component.ts index 46af8fa..22291d1 100644 --- a/src/app/carnet/terms-conditions/terms-conditions.component.ts +++ b/src/app/carnet/terms-conditions/terms-conditions.component.ts @@ -29,7 +29,7 @@ export class TermsConditionsComponent { currentDate = new Date(); hasReadAllTerms = false; - currentApplicationDetails: { headerid: number, applicationName: string } | null = null; + currentApplicationDetails: { headerid: number, applicationName: string, applicationType: string } | null = null; changeInProgress: boolean = false; estimatedFees: Fees = {}; @@ -40,7 +40,7 @@ export class TermsConditionsComponent { private carnetService = inject(CarnetService); constructor() { - this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string }>('currentapplication') + this.currentApplicationDetails = this.storageService.get<{ headerid: number, applicationName: string, applicationType: string }>('currentapplication') } ngOnInit(): void { @@ -80,7 +80,18 @@ export class TermsConditionsComponent { onDecline(): void { this.storageService.removeItem('currentapplication'); - this.navigationService.navigate(["edit-carnet", this.currentApplicationDetails?.headerid], + + let route: string = 'edit-carnet'; + if (this.currentApplicationDetails?.applicationType === 'duplicate') { + route = 'duplicate-carnet'; + } + else if (this.currentApplicationDetails?.applicationType === 'extend') { + route = 'extend-carnet'; + } else if (this.currentApplicationDetails?.applicationType === 'additional') { + route = 'additional-sets'; + } + + this.navigationService.navigate([route, this.currentApplicationDetails?.headerid], { state: { isEditMode: true }, queryParams: { diff --git a/src/app/carnet/travel-plan/travel-plan.component.html b/src/app/carnet/travel-plan/travel-plan.component.html index 889b45c..e3d245b 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.html +++ b/src/app/carnet/travel-plan/travel-plan.component.html @@ -142,6 +142,12 @@ +
+ + At least one of the sets to be entered. (either number of times entering & leaving, Foreign sets or + Transit sets) + +
diff --git a/src/app/carnet/travel-plan/travel-plan.component.scss b/src/app/carnet/travel-plan/travel-plan.component.scss index dd3a1c3..5c3c6e1 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.scss +++ b/src/app/carnet/travel-plan/travel-plan.component.scss @@ -126,6 +126,10 @@ } } } + + .message-section { + font-size: 0.875rem; + } } } diff --git a/src/app/carnet/travel-plan/travel-plan.component.ts b/src/app/carnet/travel-plan/travel-plan.component.ts index 4493b48..3ba8efa 100644 --- a/src/app/carnet/travel-plan/travel-plan.component.ts +++ b/src/app/carnet/travel-plan/travel-plan.component.ts @@ -20,8 +20,10 @@ import { ConfirmDialogComponent } from '../../shared/components/confirm-dialog/c export class TravelPlanComponent { @Input() headerid: number = 0; @Input() isViewMode = false; + @Input() applicationType: 'new' | 'edit' | 'additional' | 'duplicate' | 'extend' | null = 'edit'; @Output() completed = new EventEmitter(); + @Output() needsInsurance = new EventEmitter(); private fb = inject(FormBuilder); private dialog = inject(MatDialog); @@ -33,6 +35,7 @@ export class TravelPlanComponent { travelForm: FormGroup; isLoading = false; changeInProgress = false; + showAdditionalSetsValidationMessage: boolean = false; visitsCount = 1; transitsCount = 1; @@ -109,6 +112,10 @@ export class TravelPlanComponent { ...this.selectedAvailableVisitCountry, visits: this.visitsCount }); + + if (this.applicationType === 'additional') { + this.needsInsurance.emit(this.selectedVisitCountries.length > 0); + } } this.visitsCount = 1; @@ -219,6 +226,10 @@ export class TravelPlanComponent { this.selectedVisitCountries = this.selectedVisitCountries.filter( c => c.value !== this.selectedVisitCountry!.value ); + + if (this.applicationType === 'additional') { + this.needsInsurance.emit(this.selectedVisitCountries.length > 0); + } } // Remove country from transits @@ -276,17 +287,30 @@ export class TravelPlanComponent { this.selectedVisitCountries = plan?.entries; this.selectedTransitCountries = plan?.transits; + if (this.applicationType === 'additional') { + this.needsInsurance.emit(this.selectedVisitCountries.length > 0) + } + // Patch form values this.travelForm.patchValue({ - usaEntries: plan?.usSets, + usaEntries: plan?.usSets === 0 ? '' : plan?.usSets, visitsInput: 1, transitsInput: 1 // Reset to default }); - this.completed.emit(this.travelForm.valid); if (this.isViewMode) { this.travelForm.disable(); } + + if (this.applicationType === 'additional') { + const usentriesControl = this.travelForm.get('usaEntries'); + usentriesControl?.setValidators([Validators.min(1), Validators.max(99)]); + usentriesControl?.updateValueAndValidity(); + } + + this.completed.emit(this.travelForm.valid || this.travelForm.disabled + || (this.applicationType === 'additional' && (this.travelForm.value.usaEntries + || this.selectedVisitCountries.length > 0 || this.selectedTransitCountries.length > 0))); } onSubmit(): void { @@ -295,6 +319,15 @@ export class TravelPlanComponent { return; } + this.showAdditionalSetsValidationMessage = false; + if (this.applicationType === 'additional' && (!this.travelForm.value.usaEntries && + this.selectedVisitCountries.length === 0 && + this.selectedTransitCountries.length === 0 + )) { + this.showAdditionalSetsValidationMessage = true; + return; + } + const travelPlan: TravelPlan = { usSets: this.travelForm.value.usaEntries, entries: this.selectedVisitCountries, diff --git a/src/app/core/services/carnet/carnet.service.ts b/src/app/core/services/carnet/carnet.service.ts index ab57530..a39e4aa 100644 --- a/src/app/core/services/carnet/carnet.service.ts +++ b/src/app/core/services/carnet/carnet.service.ts @@ -56,4 +56,82 @@ export class CarnetService { return this.http.patch(`${this.apiUrl}/${this.apiDb}//ProcessCarnet`, appData); } + + deleteCarnet(headerid: number): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + return this.http.delete(`${this.apiUrl}/${this.apiDb}/DeleteCarnet`, { body: data }); + } + + printCarnet(headerid: number): Observable { + const data = { + P_SPID: this.userService.getUserSpid(), + P_HEADERID: headerid, + P_PRINTGL: 'N' + } + return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintCarnet`, data); + } + + printGeneralList(headerid: number): Observable { + const data = { + P_SPID: this.userService.getUserSpid(), + P_HEADERID: headerid + } + return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintGL`, data, { + responseType: 'blob', // Important: Set responseType to 'blob' + }); + } + + duplicateCarnet(carnetNumber: string): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_CARNETNO: carnetNumber + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/DuplicateCarnet`, data, { + responseType: 'blob', // Important: Set responseType to 'blob' + }); + } + + extendCarnet(carnetNumber: string): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_CARNETNO: carnetNumber + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/ExtendCarnet`, data); + } + + additionalSets(carnetNumber: string): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_CARNETNO: carnetNumber + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/AddlSets`, data); + } + + copyCarnet(headerid: number, applicationName: string): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid, + P_APPLICATIONNAME: applicationName + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/CopyCarnet`, data); + } + + resetCarnet(headerid: number): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/ResetCarnet`, data); + } + + voidCarnet(headerid: number): Observable { + const data = { + P_USERID: this.userService.getUser(), + P_HEADERID: headerid + } + return this.http.patch(`${this.apiUrl}/${this.apiDb}/VoidCarnet`, data); + } } diff --git a/src/app/core/services/common/api-error-handler.service.ts b/src/app/core/services/common/api-error-handler.service.ts index 9cf5301..1e76cd5 100644 --- a/src/app/core/services/common/api-error-handler.service.ts +++ b/src/app/core/services/common/api-error-handler.service.ts @@ -36,7 +36,12 @@ export class ApiErrorHandlerService { return this.genericErrorMessage; } - return messageString.slice(0, -1); + // slice off the last pipe character only if the last character is a pipe + if (messageString.endsWith('|')) { + return messageString.slice(0, -1); + } + + return messageString; // .split('|') // .map(msg => msg.trim()) // .filter(msg => msg.length > 0); diff --git a/src/app/core/services/home.service.ts b/src/app/core/services/home.service.ts index c6f3be9..2b002c4 100644 --- a/src/app/core/services/home.service.ts +++ b/src/app/core/services/home.service.ts @@ -43,46 +43,4 @@ export class HomeService { locationid: item.LOCATIONID, })); } - - deleteCarnet(headerid: number): Observable { - const data = { - P_USERID: this.userService.getUser(), - P_HEADERID: headerid - } - return this.http.delete(`${this.apiUrl}/${this.apiDb}/DeleteCarnet`, { body: data }); - } - - resetCarnet(headerid: number): Observable { - const data = { - P_USERID: this.userService.getUser(), - P_HEADERID: headerid - } - return this.http.patch(`${this.apiUrl}/${this.apiDb}/ResetCarnet`, data); - } - - voidCarnet(headerid: number): Observable { - const data = { - P_USERID: this.userService.getUser(), - P_HEADERID: headerid - } - return this.http.patch(`${this.apiUrl}/${this.apiDb}/VoidCarnet`, data); - } - - printCarnet(headerid: number): Observable { - const data = { - P_SPID: this.userService.getUserSpid(), - P_HEADERID: headerid, - P_PRINTGL: 'N' - } - return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintCarnet`, data); - } - - printGeneralList(headerid: number): Observable { - const data = { - P_SPID: this.userService.getUserSpid(), - P_HEADERID: headerid, - P_PRINTGL: 'Y' - } - return this.http.post(`${this.apiUrl}/${this.apiDb}/PrintCarnet`, data); - } } diff --git a/src/app/holder/contacts/contacts.component.ts b/src/app/holder/contacts/contacts.component.ts index 01bcf1f..e02221c 100644 --- a/src/app/holder/contacts/contacts.component.ts +++ b/src/app/holder/contacts/contacts.component.ts @@ -176,7 +176,7 @@ export class ContactsComponent { renderContacts(): void { if (this.showInactiveContacts) { - this.dataSource.data = this.contacts; + this.dataSource.data = this.contacts.filter(contact => contact.isInactive); } else { this.dataSource.data = this.contacts.filter(contact => !contact.isInactive); } diff --git a/src/app/holder/search/search-holder.component.scss b/src/app/holder/search/search-holder.component.scss index 3a2dbd5..112e49f 100644 --- a/src/app/holder/search/search-holder.component.scss +++ b/src/app/holder/search/search-holder.component.scss @@ -50,6 +50,7 @@ position: relative; overflow: auto; border-radius: 8px; + margin-top: 0.5rem; .loading-shade { position: absolute; diff --git a/src/app/holder/search/search-holder.component.ts b/src/app/holder/search/search-holder.component.ts index ce21071..90f2b12 100644 --- a/src/app/holder/search/search-holder.component.ts +++ b/src/app/holder/search/search-holder.component.ts @@ -185,6 +185,8 @@ export class SearchHolderComponent { renderHolders() { if (this.showInactiveHolders) { + this.dataSource.data = this.holders.filter((holder: any) => holder?.isInactive); + } else if (this.isViewMode) { this.dataSource.data = this.holders; } else { this.dataSource.data = this.holders.filter((holder: any) => !holder?.isInactive); diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html index fbc8e77..5a0636e 100644 --- a/src/app/home/home.component.html +++ b/src/app/home/home.component.html @@ -99,32 +99,32 @@