From 24bb33538a18cc06fa37bdc452cc758e7aec0a06 Mon Sep 17 00:00:00 2001 From: "W. Ross White" Date: Fri, 30 Aug 2024 09:56:54 -0700 Subject: [PATCH] init commit --- .../dashboard/dashboard.component.ts | 17 +++++++++++------ .../dfa-application.component.ts | 7 ++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dfa/src/UI/embc-dfa/src/app/feature-components/dashboard/dashboard.component.ts b/dfa/src/UI/embc-dfa/src/app/feature-components/dashboard/dashboard.component.ts index 2d4ca38ae..7f7fe2e34 100644 --- a/dfa/src/UI/embc-dfa/src/app/feature-components/dashboard/dashboard.component.ts +++ b/dfa/src/UI/embc-dfa/src/app/feature-components/dashboard/dashboard.component.ts @@ -125,18 +125,23 @@ export class DashboardComponent implements OnInit { } countAppData(lstApp: Object): void { - var res = JSON.parse(JSON.stringify(lstApp)); - let lstApplications = res; - this.currentApplicationsCount = 0; this.pastApplicationsCount = 0; + + let lstApplications = JSON.parse(JSON.stringify(lstApp)); + + this.currentApplicationsCount = 0; + this.pastApplicationsCount = 0; + lstApplications.forEach(x => { if ( (x.status.toLowerCase() === "dfa decision made" || x.status.toLowerCase() === "closed: inactive" || x.status.toLowerCase() === "closed: withdrawn") && - (x.dateFileClosed && (this.sixtyOneDaysAgo <= new Date(x.dateFileClosed).getTime()))) { + (x.dateFileClosed && (new Date(x.dateFileClosed).getTime() <= this.sixtyOneDaysAgo))) { this.pastApplicationsCount++; - } else this.currentApplicationsCount++; - }) + } else { + this.currentApplicationsCount++; + } + }); } navigateToDFAPrescreening(): void { diff --git a/dfa/src/UI/embc-dfa/src/app/sharedModules/dashboard-components/dfa-application/dfa-application.component.ts b/dfa/src/UI/embc-dfa/src/app/sharedModules/dashboard-components/dfa-application/dfa-application.component.ts index 43258894f..0885eb8d9 100644 --- a/dfa/src/UI/embc-dfa/src/app/sharedModules/dashboard-components/dfa-application/dfa-application.component.ts +++ b/dfa/src/UI/embc-dfa/src/app/sharedModules/dashboard-components/dfa-application/dfa-application.component.ts @@ -106,14 +106,15 @@ export class DfaApplicationComponent implements OnInit { } mapData(lstApp: Object): void { - var res = JSON.parse(JSON.stringify(lstApp)); - this.lstApplications = res; + + this.lstApplications = JSON.parse(JSON.stringify(lstApp)); + this.lstApplications.forEach(x => { if ( (x.status.toLowerCase() === "dfa decision made" || x.status.toLowerCase() === "closed: inactive" || x.status.toLowerCase() === "closed: withdrawn") && - (x.dateFileClosed && (this.sixtyOneDaysAgo <= new Date(x.dateFileClosed).getTime()))) { + (x.dateFileClosed && (new Date(x.dateFileClosed).getTime() <= this.sixtyOneDaysAgo))) { x.currentApplication = false; } else x.currentApplication = true; })