Skip to content

Commit ec1eae0

Browse files
committed
fix: TT-178 isLinkExternal
1 parent 8a174e9 commit ec1eae0

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<td class="col md-col">{{ entry.customer_name }}</td>
4242
<td class="hidden-col">{{ entry.customer_id }}</td>
4343
<td class="col md-col">{{ entry.activity_name }}</td>
44-
<td class="col lg-col"><a (click)="getUri(entry.uri)">{{ entry.uri}}</a></td>
44+
<td class="col lg-col"><a (click)="isLinkExternal(entry.uri)">{{ entry.uri }}</a></td>
4545
<td class="col lg-col">{{ entry.description }}</td>
4646
<td class="col lg-col">{{ entry.technologies }}</td>
4747
</tr>

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,8 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
9393
}
9494
}
9595

96-
getUri(value: string) {
97-
const getValue = value;
98-
const filter = getValue.startsWith('http');
99-
if (filter) {
100-
window.location.href = getValue;
101-
} else {
102-
console.log('is no a rute');
103-
}
96+
isLinkExternal(uri: string) {
97+
const isValidUri = uri.startsWith('http' || 'https');
98+
return isValidUri ? window.open(uri, '_blank') : '';
10499
}
105100
}

0 commit comments

Comments
 (0)