From 12226e5a7874dcc1d5b4cdb305188391b4b97cc5 Mon Sep 17 00:00:00 2001 From: Kruthi Bhat Date: Fri, 9 Oct 2020 00:37:39 +0530 Subject: Sorting functionality on audit info screen Change-Id: If2fed947ccc0cbcb68ad656fb6010aa9cb829acd Issue-ID: VID-904 Signed-off-by: rachitha.ramappa@att.com --- .../components/auditInfoModal/auditInfoModal.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vid-webpack-master/src/app/shared/components') diff --git a/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.ts b/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.ts index d8d3c32ac..bd2d77d99 100644 --- a/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.ts +++ b/vid-webpack-master/src/app/shared/components/auditInfoModal/auditInfoModal.component.ts @@ -151,6 +151,7 @@ export class AuditInfoModalComponent { .subscribe((res: AuditStatus[][]) => { this.vidInfoData = res[0]; this.msoInfoData = res[1]; + this.msoInfoData.sort(this.getSortOrder("startTime")); this.isLoading = false; }); } @@ -186,6 +187,17 @@ export class AuditInfoModalComponent { this.dataIsReady = true; } + + //Comparer Function + getSortOrder(timestamp) { + return (obj1, obj2) =>{ + + let firstObj = obj1[timestamp]; + let secondObj = obj2[timestamp]; + return ((secondObj < firstObj) ? -1 : ((secondObj > firstObj) ? 1 : 0)); + + } + } readOnlyRetryUrl = (): string => `../../serviceModels.htm?more#/servicePlanning/RETRY?serviceModelId=${this.serviceModelId}&jobId=${this.jobId}` -- cgit 1.2.3-korg