Skip to content

Commit 425c43d

Browse files
fix: TTA-147 fixing column format 'time in' in the reports page
1 parent e08c025 commit 425c43d

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ describe('Reports Page', () => {
1717
let fixture: ComponentFixture<TimeEntriesTableComponent>;
1818
let store: MockStore<EntryState>;
1919
let getReportDataSourceSelectorMock;
20-
let durationTime: number;
2120
let row: number;
2221
let node: number;
23-
let decimalValidator: RegExp;
2422
const timeEntry: Entry = {
2523
id: '123',
2624
start_date: new Date(),
@@ -102,10 +100,8 @@ describe('Reports Page', () => {
102100
);
103101

104102
beforeEach(() => {
105-
durationTime = new Date().setHours(5, 30);
106103
row = 0;
107104
node = 0;
108-
decimalValidator = /^\d+\.\d{0,2}$/;
109105
});
110106

111107
it('component should be created', async () => {
@@ -155,16 +151,6 @@ describe('Reports Page', () => {
155151
});
156152
});
157153

158-
it('The data should be displayed as a multiple of hour when column is equal to 4', () => {
159-
const column = 4;
160-
expect(component.bodyExportOptions(durationTime, row, column, node)).toMatch(decimalValidator);
161-
});
162-
163-
it('The data should not be displayed as a multiple of hour when column is different of 4', () => {
164-
const column = 5;
165-
expect(component.bodyExportOptions(durationTime, row, column, node)).toBe(durationTime.toString());
166-
});
167-
168154
it('The link Ticket must not contain the ticket URL enclosed with < > when export a file csv, excel or PDF', () => {
169155
const entry = '<a _ngcontent-vlm-c151="" class="is-url">https://TT-392-uri</a>';
170156
const column = 0;
@@ -247,7 +233,7 @@ describe('Reports Page', () => {
247233
'19',
248234
249235
'07/01/2022',
250-
'9.00',
236+
'09:00',
251237
'09:00',
252238
'18:00',
253239
'Project_Name',

src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
144144
}
145145

146146
bodyExportOptions(data, row, column, node) {
147-
const dataFormated = data.toString().replace(/<((.|\n){0,200}?)>/gi, '');
148-
const durationColumnIndex = 4;
149-
return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated;
147+
return data.toString().replace(/<((.|\n){0,200}?)>/gi, '') || '';
150148
}
151149

152150

0 commit comments

Comments
 (0)