From 1851130707a5a69576087e43532143d652b05502 Mon Sep 17 00:00:00 2001 From: Bharath Kumar Date: Mon, 5 Aug 2024 18:10:33 +0530 Subject: [PATCH 1/2] changes in the delay and sorting --- .../components/designations/designations.component.ts | 9 ++++++++- .../import-designation/import-designation.component.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts b/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts index 9a3e14b18..435b956af 100644 --- a/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts @@ -202,7 +202,14 @@ export class DesignationsComponent implements OnInit { this.filteredDesignationsList = this.designationsList .filter((designation: any) => designation.name.toLowerCase().includes(key.toLowerCase())) } else { - this.filteredDesignationsList = this.designationsList + let filteredData: any = this.designationsList.sort((a: any, b: any) => { + const timestampA = a.additionalProperties && a.additionalProperties.timeStamp ? new Date(Number(a.additionalProperties.timeStamp)).getTime() : 0 + const timestampB = b.additionalProperties && b.additionalProperties.timeStamp ? new Date(Number(b.additionalProperties.timeStamp)).getTime() : 0 + + return timestampB - timestampA + + }) + this.filteredDesignationsList = filteredData } } diff --git a/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts b/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts index 651d905c0..41dbd7097 100644 --- a/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts @@ -272,7 +272,7 @@ export class ImportDesignationComponent implements OnInit, OnDestroy { if (response) { setTimeout(() => { this.dialogRef.close() - }, 2000) + }, 10000) } }, error: (error: HttpErrorResponse) => { From 6a176332ff07d9e9bd4e4c77b2fd1d275b9f990c Mon Sep 17 00:00:00 2001 From: Bharath Kumar Date: Mon, 5 Aug 2024 18:24:09 +0530 Subject: [PATCH 2/2] changes in the delay and sorting --- .../components/designations/designations.component.ts | 10 ++++++---- .../import-designation/import-designation.component.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts b/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts index 435b956af..303f18aab 100644 --- a/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/designation/components/designations/designations.component.ts @@ -135,7 +135,7 @@ export class DesignationsComponent implements OnInit { } else { setTimeout(() => { this.getOrgReadData() - }, 10000) + }, 10000) } // console.log('orgFramework Details', res) }) @@ -202,9 +202,11 @@ export class DesignationsComponent implements OnInit { this.filteredDesignationsList = this.designationsList .filter((designation: any) => designation.name.toLowerCase().includes(key.toLowerCase())) } else { - let filteredData: any = this.designationsList.sort((a: any, b: any) => { - const timestampA = a.additionalProperties && a.additionalProperties.timeStamp ? new Date(Number(a.additionalProperties.timeStamp)).getTime() : 0 - const timestampB = b.additionalProperties && b.additionalProperties.timeStamp ? new Date(Number(b.additionalProperties.timeStamp)).getTime() : 0 + const filteredData: any = this.designationsList.sort((a: any, b: any) => { + const timestampA = a.additionalProperties && a.additionalProperties.timeStamp ? + new Date(Number(a.additionalProperties.timeStamp)).getTime() : 0 + const timestampB = b.additionalProperties && b.additionalProperties.timeStamp ? + new Date(Number(b.additionalProperties.timeStamp)).getTime() : 0 return timestampB - timestampA diff --git a/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts b/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts index 41dbd7097..76b2b39bb 100644 --- a/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts +++ b/project/ws/app/src/lib/routes/home/routes/designation/components/import-designation/import-designation.component.ts @@ -272,7 +272,7 @@ export class ImportDesignationComponent implements OnInit, OnDestroy { if (response) { setTimeout(() => { this.dialogRef.close() - }, 10000) + }, 10000) } }, error: (error: HttpErrorResponse) => {