From 425c43d781bbf3ff0985170ccc0963bfc466d443 Mon Sep 17 00:00:00 2001 From: Jimmy Jaramillo Date: Mon, 29 Aug 2022 17:44:00 -0500 Subject: [PATCH] fix: TTA-147 fixing column format 'time in' in the reports page --- .../time-entries-table.component.spec.ts | 16 +--------------- .../time-entries-table.component.ts | 4 +--- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts index 01f49ae06..30c2d7882 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts @@ -17,10 +17,8 @@ describe('Reports Page', () => { let fixture: ComponentFixture; let store: MockStore; let getReportDataSourceSelectorMock; - let durationTime: number; let row: number; let node: number; - let decimalValidator: RegExp; const timeEntry: Entry = { id: '123', start_date: new Date(), @@ -102,10 +100,8 @@ describe('Reports Page', () => { ); beforeEach(() => { - durationTime = new Date().setHours(5, 30); row = 0; node = 0; - decimalValidator = /^\d+\.\d{0,2}$/; }); it('component should be created', async () => { @@ -155,16 +151,6 @@ describe('Reports Page', () => { }); }); - it('The data should be displayed as a multiple of hour when column is equal to 4', () => { - const column = 4; - expect(component.bodyExportOptions(durationTime, row, column, node)).toMatch(decimalValidator); - }); - - it('The data should not be displayed as a multiple of hour when column is different of 4', () => { - const column = 5; - expect(component.bodyExportOptions(durationTime, row, column, node)).toBe(durationTime.toString()); - }); - it('The link Ticket must not contain the ticket URL enclosed with < > when export a file csv, excel or PDF', () => { const entry = 'https://TT-392-uri'; const column = 0; @@ -247,7 +233,7 @@ describe('Reports Page', () => { '19', 'user@ioet.com', '07/01/2022', - '9.00', + '09:00', '09:00', '18:00', 'Project_Name', diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts index 419958560..7f7135bbd 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts @@ -144,9 +144,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn } bodyExportOptions(data, row, column, node) { - const dataFormated = data.toString().replace(/<((.|\n){0,200}?)>/gi, ''); - const durationColumnIndex = 4; - return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated; + return data.toString().replace(/<((.|\n){0,200}?)>/gi, '') || ''; }