Skip to content

Commit 24569ec

Browse files
author
Juan Gabriel Guzman
committed
feat: #418 Improve reports table
* Reducing font size * Removing some columns from UI * Moving search button so that it can be displayed on low resolution screens
1 parent ce748d7 commit 24569ec

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
>
1010
<thead class="thead-blue">
1111
<tr class="d-flex">
12-
<th class="col md-col">ID</th>
12+
<th class="hidden-col" >ID</th>
1313
<th class="col md-col">User email</th>
1414
<th class="col sm-col">Date</th>
15-
<th class="col sm-col">Duration (hours)</th>
16-
<th class="col sm-col">Time in</th>
17-
<th class="col sm-col">Time out</th>
15+
<th class="col x-sm-col" title="Duration (hours)">Duration (hours)</th>
16+
<th class="col x-sm-col" title="Time in">Time in</th>
17+
<th class="col x-sm-col" title="Time out">Time out</th>
1818
<th class="col md-col">Project</th>
19-
<th class="col lg-col">Project ID</th>
19+
<th class="hidden-col">Project ID</th>
2020
<th class="col md-col">Customer</th>
21-
<th class="col lg-col">Customer ID</th>
21+
<th class="hidden-col">Customer ID</th>
2222
<th class="col md-col">Activity</th>
2323
<th class="col lg-col">Ticket</th>
2424
<th class="col lg-col">Description</th>
@@ -33,24 +33,24 @@
3333
class="d-flex"
3434
*ngFor="let entry of dataSource.data"
3535
>
36-
<td class="col md-col multiline-col">{{ entry.id }}</td>
37-
<td class="col md-col multiline-col">{{ entry.owner_email }}</td>
36+
<td class="hidden-col">{{ entry.id }}</td>
37+
<td class="col md-col">{{ entry.owner_email }}</td>
3838
<td class="col sm-col">
3939
{{ entry.start_date | date: 'MM/dd/yyyy' }}
4040
</td>
41-
<td class="col sm-col">
41+
<td class="col x-sm-col">
4242
{{ entry.end_date | substractDate: entry.start_date }}
4343
</td>
44-
<td class="col sm-col">{{ entry.start_date | date: 'HH:mm' }}</td>
45-
<td class="col sm-col">{{ entry.end_date | date: 'HH:mm' }}</td>
44+
<td class="col x-sm-col">{{ entry.start_date | date: 'HH:mm' }}</td>
45+
<td class="col x-sm-col">{{ entry.end_date | date: 'HH:mm' }}</td>
4646
<td class="col md-col">{{ entry.project_name }}</td>
47-
<td class="col md-col">{{ entry.project_id }}</td>
47+
<td class="hidden-col">{{ entry.project_id }}</td>
4848
<td class="col md-col">{{ entry.customer_name }}</td>
49-
<td class="col md-col">{{ entry.customer_id }}</td>
49+
<td class="hidden-col">{{ entry.customer_id }}</td>
5050
<td class="col md-col">{{ entry.activity_name }}</td>
5151
<td class="col lg-col">{{ entry.uri }}</td>
52-
<td class="col lg-col multiline-col">{{ entry.description }}</td>
53-
<td class="col lg-col multiline-col">{{ entry.technologies }}</td>
52+
<td class="col lg-col">{{ entry.description }}</td>
53+
<td class="col lg-col">{{ entry.technologies }}</td>
5454
</tr>
5555
</tbody>
5656
</table>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
white-space: nowrap;
33
overflow: hidden;
44
text-overflow: ellipsis;
5+
font-size: small;
6+
}
7+
.x-sm-col{
8+
width: 5em;
9+
max-width: 7em;
510
}
611

712
.sm-col{
813
width: 6em;
914
max-width: 8em;
1015
}
16+
1117
.md-col{
1218
width: 9em;
1319
}
@@ -17,3 +23,6 @@
1723
overflow: hidden;
1824
white-space: normal;
1925
}
26+
.hidden-col{
27+
display: none;
28+
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as moment from 'moment';
66
import { Observable, Subject } from 'rxjs';
77
import { Entry } from 'src/app/modules/shared/models';
88
import { DataSource } from 'src/app/modules/shared/models/data-source.model';
9+
910
import { EntryState } from '../../../time-clock/store/entry.reducer';
1011
import { getReportDataSource } from '../../../time-clock/store/entry.selectors';
1112

@@ -20,7 +21,11 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
2021
paging: false,
2122
dom: 'Bfrtip',
2223
buttons: [
23-
'colvis',
24+
{
25+
extend: 'colvis',
26+
columns: ':not(.hidden-col)',
27+
28+
},
2429
'print',
2530
{
2631
extend: 'excel',

src/app/modules/reports/components/time-range-form/time-range-form.component.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
<form [formGroup]="reportForm" (ngSubmit)="onSubmit()">
22
<div class="row">
3-
<div class="col">
3+
<div class="col col-md-3">
44
<div class="input-group">
55
<app-input-label text="Start Date"></app-input-label>
6-
<app-input-date formControlName="startDate" id="startDate" required="true"></app-input-date>
6+
<app-input-date
7+
formControlName="startDate"
8+
id="startDate"
9+
required="true"
10+
></app-input-date>
711
</div>
812
</div>
9-
<div class="col">
13+
<div class="col col-md-3">
1014
<div class="input-group">
1115
<app-input-label text="End Date"></app-input-label>
12-
<app-input-date formControlName="endDate" id="endDate" required="true"></app-input-date>
16+
<app-input-date
17+
formControlName="endDate"
18+
id="endDate"
19+
required="true"
20+
></app-input-date>
1321
</div>
1422
</div>
15-
<div class="col">
16-
<button type="submit" class="btn btn-primary float-right">Search</button>
23+
</div>
24+
<div class="row pt-4">
25+
<div class="col-md-3 offset-md-6">
26+
<button type="submit" class="btn btn-primary">Search</button>
1727
</div>
1828
</div>
1929
</form>
20-
21-

0 commit comments

Comments
 (0)