Skip to content

Commit bcdc979

Browse files
authored
Merge 4fe8fd8 into ad6e04c
2 parents ad6e04c + 4fe8fd8 commit bcdc979

File tree

7 files changed

+49
-52
lines changed

7 files changed

+49
-52
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<div class="row scroll-table mt-5 ml-0">
22
<app-search-user [users]="users" (selectedUserId)="user($event)"></app-search-user>
3-
43
<table class="table table-striped mb-0" datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions" *ngIf="(reportDataSource$ | async) as dataSource">
54
<thead class="thead-blue">
65
<tr class="d-flex">
@@ -23,26 +22,26 @@
2322
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
2423
<tbody *ngIf="!dataSource.isLoading">
2524
<tr class="d-flex col-height" *ngFor="let entry of dataSource.data">
26-
<td class="hidden-col">{{ entry.id }}</td>
27-
<td class="col md-col">{{ entry.owner_email }}</td>
28-
<td class="col sm-col">
25+
<td class="hidden-col">{{ entry.id }}</td>
26+
<td class="col md-col">{{ entry.owner_email }}</td>
27+
<td class="col sm-col">
2928
{{ entry.start_date | date: 'MM/dd/yyyy' }}
30-
</td>
31-
<td class="col sm-col">
29+
</td>
30+
<td class="col sm-col">
3231
{{ entry.end_date | substractDate: entry.start_date }}
33-
</td>
34-
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }}</td>
35-
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.end_date , entry.timezone_offset) }}</td>
36-
<td class="col md-col">{{ entry.project_name }}</td>
37-
<td class="hidden-col">{{ entry.project_id }}</td>
38-
<td class="col md-col">{{ entry.customer_name }}</td>
39-
<td class="hidden-col">{{ entry.customer_id }}</td>
40-
<td class="col md-col">{{ entry.activity_name }}</td>
41-
<td class="col lg-col">
32+
</td>
33+
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.start_date,entry.timezone_offset) }}</td>
34+
<td class="col x-sm-col">{{ dateTimeOffset.parseDateTimeOffset(entry.end_date , entry.timezone_offset) }}</td>
35+
<td class="col md-col">{{ entry.project_name }}</td>
36+
<td class="hidden-col">{{ entry.project_id }}</td>
37+
<td class="col md-col">{{ entry.customer_name }}</td>
38+
<td class="hidden-col">{{ entry.customer_id }}</td>
39+
<td class="col md-col">{{ entry.activity_name }}</td>
40+
<td class="col lg-col">
4241
<ng-container *ngIf="entry.uri !== null">
4342
<a [class.is-url]="isURL(entry.uri)" (click)="openURLInNewTab(entry.uri)">
44-
{{ entry.uri }}
45-
</a>
43+
{{ entry.uri }}
44+
</a>
4645
</ng-container>
4746
</td>
4847
<td class="col lg-scroll">{{ entry.description }}</td>
@@ -55,6 +54,6 @@
5554
</td>
5655
</tr>
5756
</tbody>
58-
</table>
57+
</table>
5958
</div>
6059
<div class="alert alert-dark mt-3">Total: {{this.resultSum.hours}} hours, {{this.resultSum.minutes}} minutes</div>

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
2626
selectOptionNames = [15, 30, 50, 100, 'All'];
2727
users: User[] = [];
2828
dtOptions: any = {
29-
scrollY: '590px',
30-
dom: '<"d-flex justify-content-between"B<"d-flex"<"mr-5"l>f>>rtip',
29+
bScrollCollapse: true,
3130
pageLength: 30,
3231
lengthMenu: [this.selectOptionValues, this.selectOptionNames],
3332
buttons: [
3433
{
3534
text: 'Column Visibility' + ' ▼',
36-
extend: 'colvis',
37-
columns: ':not(.hidden-col)'
35+
extend: 'colvis'
3836
},
3937
{
40-
extend: 'print'
38+
extend: 'print',
39+
exportOptions: {
40+
columns: ':visible'
41+
}
4142
},
4243
{
4344
extend: 'excel',
@@ -88,7 +89,6 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
8889
ngOnInit(): void {
8990
this.rerenderTableSubscription = this.reportDataSource$.subscribe((ds) => {
9091
this.sumDates(ds.data);
91-
this.rerenderDataTable();
9292
});
9393
this.uploadUsers();
9494
}
@@ -102,14 +102,15 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
102102
this.dtTrigger.unsubscribe();
103103
}
104104

105-
private rerenderDataTable(): void {
105+
private rerenderDataTable(): any {
106106
if (this.dtElement && this.dtElement.dtInstance) {
107107
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
108108
dtInstance.destroy();
109109
this.dtTrigger.next();
110110
});
111111
} else {
112112
this.dtTrigger.next();
113+
return;
113114
}
114115
}
115116

@@ -151,6 +152,4 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
151152
user(userId: string){
152153
this.selectedUserId.emit(userId);
153154
}
154-
155-
}
156-
155+
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
required="true"
99
></app-input-date>
1010
</div>
11-
1211
<label class="col-12 col-md-2 col-form-label my-1">End date:</label>
1312
<div class="col-12 col-sm-6 col-md-3 my-1">
1413
<app-input-date
@@ -17,7 +16,6 @@
1716
required="true"
1817
></app-input-date>
1918
</div>
20-
2119
<div class="col-12 col-md-2 my-1">
2220
<button type="submit" class="btn btn-primary">Search</button>
2321
</div>
Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
<div>
22
<div>
33
<button type="button" (click)="newEntry()" data-toggle="modal" data-target="#editRecordsByDate" class="btn btn-primary">
4-
Add new entry
5-
</button>
6-
<button type="button" (click)="onDisplayModeChange()" class="btn btn-primary float-right" *ngIf="isFeatureToggleCalendarActive">
7-
<em class="fas fa-list" *ngIf="displayGridView"></em>
8-
<em class="fas fa-th" *ngIf="!displayGridView"></em>
9-
</button>
4+
Add new entry
5+
</button>
6+
<button type="button" (click)="onDisplayModeChange()" class="btn btn-primary float-right" *ngIf="isFeatureToggleCalendarActive">
7+
<em class="fas fa-list" *ngIf="displayGridView"></em>
8+
<em class="fas fa-th" *ngIf="!displayGridView"></em>
9+
</button>
1010
</div>
1111
<div style="height: 15px"></div>
1212
<app-month-picker [selectedDate]="selectedDate" (dateSelected)="dateSelected($event)"></app-month-picker>
1313
<div style="height: 15px"></div>
14-
15-
1614
<div id="gridView" [hidden]="!displayGridView">
1715
<div *ngIf="timeEntriesDataSource$ | async as dataSource">
1816
<app-loading-bar *ngIf="dataSource.isLoading"></app-loading-bar>
@@ -21,9 +19,8 @@
2119
</app-calendar>
2220
</div>
2321
</div>
24-
2522
<div id="listView" [hidden]="displayGridView">
26-
<table class="table table-sm table-striped mb-0" datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions" *ngIf="(timeEntriesDataSource$ | async) as dataSource">
23+
<table class="table table-sm table-striped mb-0 " datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions" *ngIf="(timeEntriesDataSource$ | async) as dataSource">
2724
<caption></caption>
2825
<thead class="thead-blue">
2926
<tr class="d-flex">
@@ -47,30 +44,29 @@
4744
<td class="col">{{ entry.activity_name }}</td>
4845
<td class="col">
4946
<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#editRecordsByDate" (click)="editEntry(entry.id)">
50-
<i class="fa fa-edit fa-xs"></i>
51-
</button>
47+
<i class="fa fa-edit fa-xs"></i>
48+
</button>
5249
<button class="btn btn-sm btn-danger ml-2" data-toggle="modal" data-target="#deleteModal" (click)="openModal(entry)">
53-
<i class="fa fa-trash fa-xs"></i>
54-
</button>
50+
<i class="fa fa-trash fa-xs"></i>
51+
</button>
5552
</td>
5653
</tr>
5754
</tbody>
58-
</table>
55+
</table>
5956
</div>
6057
</div>
61-
6258
<div class="modal fade" id="editRecordsByDate" tabindex="-1" role="dialog">
6359
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
6460
<div class="modal-content" cdkDrag (cdkDragEnded)="resetDraggablePosition($event)">
6561
<div class="modal-header">
6662
<h5 class="modal-title">{{ entryId ? 'Edit Entry' : 'New Entry' }}</h5>
6763
<div>
6864
<button class="btn shadow-none" data-bs-toggle="tooltip" title="Clean form values" (click)="detailsFields.cleanFieldsForm()">
69-
<em class="fa fa-eraser"> </em>
70-
</button>
65+
<em class="fa fa-eraser"> </em>
66+
</button>
7167
<button class="btn shadow-none" data-bs-toggle="tooltip" title="Drag modal" cdkDragHandle>
72-
<em class="fa fa-grip-vertical"></em>
73-
</button>
68+
<em class="fa fa-grip-vertical"></em>
69+
</button>
7470
</div>
7571
</div>
7672
<div class="modal-body">
@@ -80,6 +76,5 @@ <h5 class="modal-title">{{ entryId ? 'Edit Entry' : 'New Entry' }}</h5>
8076
</div>
8177
</div>
8278
</div>
83-
8479
<app-dialog *ngIf="showModal" class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-hidden="true" [body]="message" [title]="'Delete Entry'" (closeModalEvent)="removeEntry()">
8580
</app-dialog>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,4 @@ export class TimeEntriesComponent implements OnInit, OnDestroy, AfterViewInit {
255255
});
256256
}
257257
}
258-
}
258+
}

src/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ Overwritten calendar style
6868
border: 0.1px solid lighten($primary-text, 30%);
6969
}
7070

71+
.buttons-columnVisibility
72+
{
73+
background: $primary-disable !important;
74+
}
75+
7176
@media (max-width: 640px) {
7277
div.dt-buttons {
7378
text-align: start !important;

src/styles/colors.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ $font-size-base: 0.9rem;
22

33
$dark: #5c4e63;
44
$primary: #00baee;
5+
$primary-disable: #9ecedbe7;
56
$secondary: #555164;
67
$success: #00cc6c;
78
$warning: #ff5e0a;

0 commit comments

Comments
 (0)