Skip to content

Commit f655655

Browse files
author
thegreatyamori
committed
fix: TT-178 applied styles to http|s ticket column
1 parent ecebc3c commit f655655

File tree

3 files changed

+47
-26
lines changed

3 files changed

+47
-26
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<div class="row scroll-table mt-5 ml-0">
2-
<table
3-
class="table table-striped mb-0"
4-
datatable
5-
[dtTrigger]="dtTrigger"
6-
[dtOptions]="dtOptions"
7-
*ngIf="(reportDataSource$ | async) as dataSource">
2+
<table class="table table-striped mb-0" datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions"
3+
*ngIf="reportDataSource$ | async as dataSource">
84
<thead class="thead-blue">
95
<tr class="d-flex">
106
<th class="hidden-col">ID</th>
@@ -25,7 +21,7 @@
2521
</thead>
2622
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
2723
<tbody *ngIf="!dataSource.isLoading">
28-
<tr class="d-flex" *ngFor="let entry of dataSource.data" _nghost-c0 = "" >
24+
<tr class="d-flex" *ngFor="let entry of dataSource.data" _nghost-c0="">
2925
<td class="hidden-col">{{ entry.id }}</td>
3026
<td class="col md-col">{{ entry.owner_email }}</td>
3127
<td class="col sm-col">
@@ -41,7 +37,13 @@
4137
<td class="col md-col">{{ entry.customer_name }}</td>
4238
<td class="hidden-col">{{ entry.customer_id }}</td>
4339
<td class="col md-col">{{ entry.activity_name }}</td>
44-
<td class="col lg-col"><a (click)="isLinkExternal(entry.uri)">{{ entry.uri }}</a></td>
40+
<td class="col lg-col">
41+
<ng-container *ngIf="entry.uri !== null">
42+
<a [class.is-url]="isValidUri(entry.uri)" (click)="isLinkExternal(entry.uri)">
43+
{{ entry.uri }}
44+
</a>
45+
</ng-container>
46+
</td>
4547
<td class="col lg-col">{{ entry.description }}</td>
4648
<td class="col lg-col">{{ entry.technologies }}</td>
4749
</tr>

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,25 @@
3232
width: 100%;
3333
display: grid;
3434
}
35+
36+
$base-color: #00BAEE;
37+
$hover-color: darken($base-color, 20);
38+
39+
.is-url {
40+
cursor: pointer;
41+
color: $base-color;
42+
text-decoration: underline;
43+
44+
&:visited {
45+
color: green;
46+
}
47+
48+
&:hover {
49+
color: $hover-color;
50+
}
51+
52+
&:active {
53+
color: $base-color;
54+
}
55+
}
56+

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

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getReportDataSource } from '../../../time-clock/store/entry.selectors';
1414
@Component({
1515
selector: 'app-time-entries-table',
1616
templateUrl: './time-entries-table.component.html',
17-
styleUrls: ['./time-entries-table.component.scss']
17+
styleUrls: ['./time-entries-table.component.scss'],
1818
})
1919
export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewInit {
2020
dtOptions: any = {
@@ -25,38 +25,33 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
2525
{
2626
extend: 'colvis',
2727
columns: ':not(.hidden-col)',
28-
2928
},
3029
'print',
3130
{
3231
extend: 'excel',
3332
exportOptions: {
3433
format: {
3534
body: (data, row, column, node) => {
36-
return column === 3 ?
37-
moment.duration(data).asHours().toFixed(4).slice(0, -1) :
38-
data;
39-
}
40-
}
35+
return column === 3 ? moment.duration(data).asHours().toFixed(4).slice(0, -1) : data;
36+
},
37+
},
4138
},
4239
text: 'Excel',
43-
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`
40+
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`,
4441
},
4542
{
4643
extend: 'csv',
4744
exportOptions: {
4845
format: {
4946
body: (data, row, column, node) => {
50-
return column === 3 ?
51-
moment.duration(data).asHours().toFixed(4).slice(0, -1) :
52-
data;
53-
}
54-
}
47+
return column === 3 ? moment.duration(data).asHours().toFixed(4).slice(0, -1) : data;
48+
},
49+
},
5550
},
5651
text: 'CSV',
57-
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`
58-
}
59-
]
52+
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`,
53+
},
54+
],
6055
};
6156
dtTrigger: Subject<any> = new Subject();
6257
@ViewChild(DataTableDirective, { static: false })
@@ -94,8 +89,10 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
9489
}
9590

9691
isLinkExternal(uri: string) {
97-
const isValidUri = uri.startsWith('http' || 'https');
98-
return isValidUri ? window.open(uri, '_blank') : '';
92+
return this.isValidUri(uri) ? window.open(uri, '_blank') : '';
9993
}
10094

95+
isValidUri(uri: string) {
96+
return uri.startsWith('http' || 'https');
97+
}
10198
}

0 commit comments

Comments
 (0)