Skip to content

Commit 44c736d

Browse files
authored
fix: TT-392 Exclude from reports tags </> in the Ticket column (#765)
1 parent 886a68b commit 44c736d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,21 @@ describe('Reports Page', () => {
120120

121121
it('The data should be displayed as a multiple of hour when column is equal to 3', () => {
122122
const column = 3;
123-
124123
expect(component.bodyExportOptions(durationTime, row, column, node)).toMatch(decimalValidator);
125124
});
126125

127126
it('The data should not be displayed as a multiple of hour when column is different of 3', () => {
128127
const column = 4;
129-
expect(component.bodyExportOptions(durationTime, row, column, node)).toBe(durationTime);
128+
expect(component.bodyExportOptions(durationTime, row, column, node)).toBe(durationTime.toString());
129+
});
130+
131+
it('The link Ticket must not contain the ticket URL enclosed with < > when export a file csv, excel or PDF', () => {
132+
const entry = '<a _ngcontent-vlm-c151="" class="is-url">https://TT-392-uri</a>';
133+
const column = 0;
134+
expect(component.bodyExportOptions(entry, row, column, node)).toBe('https://TT-392-uri');
130135
});
131136

137+
132138
afterEach(() => {
133139
fixture.destroy();
134140
});

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
9999
}
100100

101101
bodyExportOptions(data, row, column, node){
102+
const dataFormated = data.toString().replace(/<((.|\n){0,200}?)>/gi, '');
102103
const durationColumnIndex = 3;
103-
return column === durationColumnIndex ? moment.duration(data).asHours().toFixed(2) : data;
104+
return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated;
104105
}
105106
}
107+

0 commit comments

Comments
 (0)