Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: TT-144 Responsive all tables
  • Loading branch information
jr-98 authored and scastillo-jp committed Feb 18, 2021
commit 390b6a9a1c55334c4f010403d810eea514bda80d
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<table class="table table-sm table-bordered table-striped">
<thead class="thead-blue">
<tr class="d-flex">
<th class="col-4">Activity ID</th>
<th class="col-5">Activity</th>
<th class="col-4 text-center">Activity ID</th>
<th class="col-5 text-center">Activity</th>
<th class="col-3 text-center">Options</th>
</tr>
</thead>
<app-loading-bar *ngIf="(isLoading$ | async)"></app-loading-bar>
<tbody *ngIf="(isLoading$ | async) === false">
<tr class="d-flex" *ngFor="let activity of activities">
<td class="col-sm-4">{{ activity.id }}</td>
<td class="col-sm-5">{{ activity.name }}</td>
<td class="col-sm-3 text-center">
<td class="col-4 text-break">{{ activity.id }}</td>
<td class="col-5 ">{{ activity.name }}</td>
<td class="col-3 text-center">
<button
type="button"
class="btn btn-sm btn-primary"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,58 +1,54 @@
<div class="row mt-5">
<div class="col">
<table
class="table table-sm table-striped"
datatable
[dtTrigger]="dtTrigger"
[dtOptions]="dtOptions"
*ngIf="(reportDataSource$ | async) as dataSource"
>
<thead class="thead-blue">
<tr class="d-flex">
<th class="hidden-col" >ID</th>
<th class="col md-col">User email</th>
<th class="col sm-col">Date</th>
<th class="col x-sm-col" title="Duration (hours)">Duration (hours)</th>
<th class="col x-sm-col" title="Time in">Time in</th>
<th class="col x-sm-col" title="Time out">Time out</th>
<th class="col md-col">Project</th>
<th class="hidden-col">Project ID</th>
<th class="col md-col">Customer</th>
<th class="hidden-col">Customer ID</th>
<th class="col md-col">Activity</th>
<th class="col lg-col">Ticket</th>
<th class="col lg-col">Description</th>
<th class="col lg-col">Technologies</th>
</tr>
</thead>
<app-loading-bar
*ngIf="dataSource.isLoading"
></app-loading-bar>
<tbody *ngIf="!dataSource.isLoading">
<tr
class="d-flex"
*ngFor="let entry of dataSource.data"
>
<td class="hidden-col">{{ entry.id }}</td>
<td class="col md-col">{{ entry.owner_email }}</td>
<td class="col sm-col">
{{ entry.start_date | date: 'MM/dd/yyyy' }}
</td>
<td class="col x-sm-col">
{{ entry.end_date | substractDate: entry.start_date }}
</td>
<td class="col x-sm-col">{{ entry.start_date | date: 'HH:mm' }}</td>
<td class="col x-sm-col">{{ entry.end_date | date: 'HH:mm' }}</td>
<td class="col md-col">{{ entry.project_name }}</td>
<td class="hidden-col">{{ entry.project_id }}</td>
<td class="col md-col">{{ entry.customer_name }}</td>
<td class="hidden-col">{{ entry.customer_id }}</td>
<td class="col md-col">{{ entry.activity_name }}</td>
<td class="col lg-col">{{ entry.uri }}</td>
<td class="col lg-col">{{ entry.description }}</td>
<td class="col lg-col">{{ entry.technologies }}</td>
</tr>
</tbody>
</table>
<div>
<div class="table-responsive">
<table
class="table table-sm table-striped mb-0"
datatable
[dtTrigger]="dtTrigger"
[dtOptions]="dtOptions"
*ngIf="(reportDataSource$ | async) as dataSource">
<thead class="thead-blue">
<tr class="d-flex">
<th class="hidden-col">ID</th>
<th class="col md-col">User email</th>
<th class="col sm-col">Date</th>
<th class="col x-sm-col" title="Duration (hours)">Duration (hours)</th>
<th class="col x-sm-col" title="Time in">Time in</th>
<th class="col x-sm-col" title="Time out">Time out</th>
<th class="col md-col">Project</th>
<th class="hidden-col">Project ID</th>
<th class="col md-col">Customer</th>
<th class="hidden-col">Customer ID</th>
<th class="col md-col">Activity</th>
<th class="col lg-col">Ticket</th>
<th class="col lg-col">Description</th>
<th class="col lg-col">Technologies</th>
</tr>
</thead>
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
<tbody *ngIf="!dataSource.isLoading">
<tr class="d-flex" *ngFor="let entry of dataSource.data">
<td class="hidden-col">{{ entry.id }}</td>
<td class="col md-col">{{ entry.owner_email }}</td>
<td class="col sm-col">
{{ entry.start_date | date: 'MM/dd/yyyy' }}
</td>
<td class="col x-sm-col">
{{ entry.end_date | substractDate: entry.start_date }}
</td>
<td class="col x-sm-col">{{ entry.start_date | date: 'HH:mm' }}</td>
<td class="col x-sm-col">{{ entry.end_date | date: 'HH:mm' }}</td>
<td class="col md-col">{{ entry.project_name }}</td>
<td class="hidden-col">{{ entry.project_id }}</td>
<td class="col md-col">{{ entry.customer_name }}</td>
<td class="hidden-col">{{ entry.customer_id }}</td>
<td class="col md-col">{{ entry.activity_name }}</td>
<td class="col lg-col">{{ entry.uri }}</td>
<td class="col lg-col">{{ entry.description }}</td>
<td class="col lg-col">{{ entry.technologies }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
.hidden-col{
display: none;
}
.table {
overflow-x: auto;
}
.row{
width: 100%;
display: grid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getReportDataSource } from '../../../time-clock/store/entry.selectors';
})
export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewInit {
dtOptions: any = {
scrollY: '600px',
scrollY: '590px',
paging: false,
dom: 'Bfrtip',
buttons: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<form [formGroup]="reportForm" (ngSubmit)="onSubmit()">

<div class="form-group row">
<label class="col-12 col-md-2 col-form-label my-1">Start date:</label>
<div class="col-12 col-sm-6 col-md-3 my-1">
Expand Down
14 changes: 7 additions & 7 deletions src/app/modules/time-entries/pages/time-entries.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ export class TimeEntriesComponent implements OnInit, OnDestroy {
if (dataToUse && this.isNewEntry()) {
const startDate = new Date(new Date().setHours(0, 0, 0, 0));
const entry = {
description : dataToUse.description ? dataToUse.description : '',
technologies : dataToUse.technologies ? dataToUse.technologies : [],
uri : dataToUse.uri ? dataToUse.uri : '',
activity_id : dataToUse.activity_id,
project_id : dataToUse.project_id,
start_date : startDate,
end_date : startDate
description: dataToUse.description ? dataToUse.description : '',
technologies: dataToUse.technologies ? dataToUse.technologies : [],
uri: dataToUse.uri ? dataToUse.uri : '',
activity_id: dataToUse.activity_id,
project_id: dataToUse.project_id,
start_date: startDate,
end_date: startDate
};
this.entry = entry;
}
Expand Down