Skip to content

Commit e735f5e

Browse files
jr-98scastillo-jp
andauthored
fix: TT-144 Responsive all tables (#635)
* fix: TT-144 Responsive all tables * fix: TT-144 responsive tables scroll Co-authored-by: Sandro Castillo <[email protected]>
1 parent d5773d7 commit e735f5e

File tree

6 files changed

+68
-71
lines changed

6 files changed

+68
-71
lines changed

src/app/modules/activities-management/components/activity-list/activity-list.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<table class="table table-sm table-bordered table-striped">
33
<thead class="thead-blue">
44
<tr class="d-flex">
5-
<th class="col-4">Activity ID</th>
6-
<th class="col-5">Activity</th>
5+
<th class="col-4 text-center">Activity ID</th>
6+
<th class="col-5 text-center">Activity</th>
77
<th class="col-3 text-center">Options</th>
88
</tr>
99
</thead>
1010
<app-loading-bar *ngIf="(isLoading$ | async)"></app-loading-bar>
1111
<tbody *ngIf="(isLoading$ | async) === false">
1212
<tr class="d-flex" *ngFor="let activity of activities">
13-
<td class="col-sm-4">{{ activity.id }}</td>
14-
<td class="col-sm-5">{{ activity.name }}</td>
15-
<td class="col-sm-3 text-center">
13+
<td class="col-4 text-break">{{ activity.id }}</td>
14+
<td class="col-5 ">{{ activity.name }}</td>
15+
<td class="col-3 text-center">
1616
<button
1717
type="button"
1818
class="btn btn-sm btn-primary"
Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,50 @@
1-
<div class="row mt-5">
2-
<div class="col">
3-
<table
4-
class="table table-sm table-striped"
5-
datatable
6-
[dtTrigger]="dtTrigger"
7-
[dtOptions]="dtOptions"
8-
*ngIf="(reportDataSource$ | async) as dataSource"
9-
>
10-
<thead class="thead-blue">
11-
<tr class="d-flex">
12-
<th class="hidden-col" >ID</th>
13-
<th class="col md-col">User email</th>
14-
<th class="col sm-col">Date</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>
18-
<th class="col md-col">Project</th>
19-
<th class="hidden-col">Project ID</th>
20-
<th class="col md-col">Customer</th>
21-
<th class="hidden-col">Customer ID</th>
22-
<th class="col md-col">Activity</th>
23-
<th class="col lg-col">Ticket</th>
24-
<th class="col lg-col">Description</th>
25-
<th class="col lg-col">Technologies</th>
26-
</tr>
27-
</thead>
28-
<app-loading-bar
29-
*ngIf="dataSource.isLoading"
30-
></app-loading-bar>
31-
<tbody *ngIf="!dataSource.isLoading">
32-
<tr
33-
class="d-flex"
34-
*ngFor="let entry of dataSource.data"
35-
>
36-
<td class="hidden-col">{{ entry.id }}</td>
37-
<td class="col md-col">{{ entry.owner_email }}</td>
38-
<td class="col sm-col">
39-
{{ entry.start_date | date: 'MM/dd/yyyy' }}
40-
</td>
41-
<td class="col x-sm-col">
42-
{{ entry.end_date | substractDate: entry.start_date }}
43-
</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>
46-
<td class="col md-col">{{ entry.project_name }}</td>
47-
<td class="hidden-col">{{ entry.project_id }}</td>
48-
<td class="col md-col">{{ entry.customer_name }}</td>
49-
<td class="hidden-col">{{ entry.customer_id }}</td>
50-
<td class="col md-col">{{ entry.activity_name }}</td>
51-
<td class="col lg-col">{{ entry.uri }}</td>
52-
<td class="col lg-col">{{ entry.description }}</td>
53-
<td class="col lg-col">{{ entry.technologies }}</td>
54-
</tr>
55-
</tbody>
56-
</table>
57-
</div>
1+
<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">
8+
<thead class="thead-blue">
9+
<tr class="d-flex">
10+
<th class="hidden-col">ID</th>
11+
<th class="col md-col">User email</th>
12+
<th class="col sm-col">Date</th>
13+
<th class="col x-sm-col" title="Duration (hours)">Duration (hours)</th>
14+
<th class="col x-sm-col" title="Time in">Time in</th>
15+
<th class="col x-sm-col" title="Time out">Time out</th>
16+
<th class="col md-col">Project</th>
17+
<th class="hidden-col">Project ID</th>
18+
<th class="col md-col">Customer</th>
19+
<th class="hidden-col">Customer ID</th>
20+
<th class="col md-col">Activity</th>
21+
<th class="col lg-col">Ticket</th>
22+
<th class="col lg-col">Description</th>
23+
<th class="col lg-col">Technologies</th>
24+
</tr>
25+
</thead>
26+
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
27+
<tbody *ngIf="!dataSource.isLoading">
28+
<tr class="d-flex" *ngFor="let entry of dataSource.data">
29+
<td class="hidden-col">{{ entry.id }}</td>
30+
<td class="col md-col">{{ entry.owner_email }}</td>
31+
<td class="col sm-col">
32+
{{ entry.start_date | date: 'MM/dd/yyyy' }}
33+
</td>
34+
<td class="col x-sm-col">
35+
{{ entry.end_date | substractDate: entry.start_date }}
36+
</td>
37+
<td class="col x-sm-col">{{ entry.start_date | date: 'HH:mm' }}</td>
38+
<td class="col x-sm-col">{{ entry.end_date | date: 'HH:mm' }}</td>
39+
<td class="col md-col">{{ entry.project_name }}</td>
40+
<td class="hidden-col">{{ entry.project_id }}</td>
41+
<td class="col md-col">{{ entry.customer_name }}</td>
42+
<td class="hidden-col">{{ entry.customer_id }}</td>
43+
<td class="col md-col">{{ entry.activity_name }}</td>
44+
<td class="col lg-col">{{ entry.uri }}</td>
45+
<td class="col lg-col">{{ entry.description }}</td>
46+
<td class="col lg-col">{{ entry.technologies }}</td>
47+
</tr>
48+
</tbody>
49+
</table>
5850
</div>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@
2626
.hidden-col{
2727
display: none;
2828
}
29+
30+
.scroll-table {
31+
overflow-x: scroll;
32+
width: 100%;
33+
display: grid;
34+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { getReportDataSource } from '../../../time-clock/store/entry.selectors';
1717
})
1818
export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewInit {
1919
dtOptions: any = {
20-
scrollY: '600px',
20+
scrollY: '590px',
2121
paging: false,
2222
dom: 'Bfrtip',
2323
buttons: [

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<form [formGroup]="reportForm" (ngSubmit)="onSubmit()">
2-
32
<div class="form-group row">
43
<label class="col-12 col-md-2 col-form-label my-1">Start date:</label>
54
<div class="col-12 col-sm-6 col-md-3 my-1">

src/app/modules/time-entries/pages/time-entries.component.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ export class TimeEntriesComponent implements OnInit, OnDestroy {
128128
if (dataToUse && this.isNewEntry()) {
129129
const startDate = new Date(new Date().setHours(0, 0, 0, 0));
130130
const entry = {
131-
description : dataToUse.description ? dataToUse.description : '',
132-
technologies : dataToUse.technologies ? dataToUse.technologies : [],
133-
uri : dataToUse.uri ? dataToUse.uri : '',
134-
activity_id : dataToUse.activity_id,
135-
project_id : dataToUse.project_id,
136-
start_date : startDate,
137-
end_date : startDate
131+
description: dataToUse.description ? dataToUse.description : '',
132+
technologies: dataToUse.technologies ? dataToUse.technologies : [],
133+
uri: dataToUse.uri ? dataToUse.uri : '',
134+
activity_id: dataToUse.activity_id,
135+
project_id: dataToUse.project_id,
136+
start_date: startDate,
137+
end_date: startDate
138138
};
139139
this.entry = entry;
140140
}

0 commit comments

Comments
 (0)