Skip to content

Commit 77ad971

Browse files
author
Juan Gabriel Guzman
committed
feat: ioet#204 Extracting inline css to scss file
1 parent 80f5d2c commit 77ad971

File tree

7 files changed

+34
-26
lines changed

7 files changed

+34
-26
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
<table class="table table-sm table-striped mb-0" datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions">
33
<thead class="thead-orange">
44
<tr class="d-flex">
5-
<th class="col" style="max-width: 8em">Date</th>
6-
<th class="col" style="max-width: 6.2em">Duration</th>
7-
<th class="col">Project</th>
8-
<th class="col">Ticket</th>
9-
<th class="col" style="min-width: 20em">Description</th>
10-
<th class="col" style="min-width: 20em">Technologies</th>
5+
<th class="col md-col">Date</th>
6+
<th class="col sm-col">Duration</th>
7+
<th class="col md-col">Project</th>
8+
<th class="col md-col">Ticket</th>
9+
<th class="col lg-col" >Description</th>
10+
<th class="col lg-col">Technologies</th>
1111
</tr>
1212
</thead>
1313
<tbody>
1414
<tr
1515
class="d-flex"
1616
*ngFor="let entry of data"
1717
>
18-
<td class="col" style="max-width: 8em"> {{ entry.start_date | date: 'dd/MM/yyyy' }} </td>
19-
<td class="col" style="max-width: 6.2em"> {{ entry.end_date | substractDate: entry.start_date }} </td>
20-
<td class="col"> {{ entry.project_name }} </td>
21-
<td class="col"> {{ entry.uri }} </td>
22-
<td class="col" style="min-width: 20em"> {{ entry.description }} </td>
23-
<td class="col" style="word-break: break-all; min-width: 20em"> {{ entry.technologies }} </td>
18+
<td class="col md-col"> {{ entry.start_date | date: 'dd/MM/yyyy' }} </td>
19+
<td class="col sm-col"> {{ entry.end_date | substractDate: entry.start_date }} </td>
20+
<td class="col md-col"> {{ entry.project_name }} </td>
21+
<td class="col md-col"> {{ entry.uri }} </td>
22+
<td class="col lg-col multiline-col"> {{ entry.description }} </td>
23+
<td class="col lg-col multiline-col"> {{ entry.technologies }} </td>
2424
</tr>
2525
</tbody>
2626
</table>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
.sm-col{
3+
max-width: 6.2em
4+
}
5+
.md-col{
6+
max-width: 8em
7+
}
8+
9+
.lg-col{
10+
min-width: 20em;
11+
}
12+
13+
.multiline-col{
14+
word-break: break-all;
15+
16+
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ describe('Reports Page', () => {
6161
expect(component.data).toEqual(state.entriesForReport);
6262
});
6363

64-
fit('after the component is initialized it should initialize the table', () => {
64+
it('after the component is initialized it should initialize the table', () => {
6565
spyOn(component.dtTrigger, 'next');
6666

6767
component.ngAfterViewInit();
68-
// fixture.detectChanges();
6968

7069
expect(component.dtTrigger.next).toHaveBeenCalled();
7170
});

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ import {DataTableDirective} from 'angular-datatables';
88
@Component({
99
selector: 'app-time-entries-table',
1010
templateUrl: './time-entries-table.component.html',
11+
styleUrls: ['./time-entries-table.component.scss']
1112
})
1213
export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewInit {
1314

1415
data = [];
1516
const;
1617
dtOptions: any = {
17-
scrollY: '790px',
18+
scrollY: '600px',
1819
paging: false,
1920
dom: 'Bfrtip',
2021
buttons: [
@@ -48,18 +49,12 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
4849
}
4950

5051
private rerenderDataTable(): void {
51-
console.log('1', this.dtElement);
52-
console.log('1', this.dtElement);
5352
if (this.dtElement && this.dtElement.dtInstance) {
54-
console.log('2');
5553
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
56-
console.log('3');
57-
5854
dtInstance.destroy();
5955
this.dtTrigger.next();
6056
});
6157
} else {
62-
console.log('4');
6358
this.dtTrigger.next();
6459
}
6560
}

src/app/modules/time-clock/store/entry.actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,4 @@ export type EntryActions =
200200
| DefaultEntry
201201
| LoadEntriesByTimeRange
202202
| LoadEntriesByTimeRangeSuccess
203-
| LoadEntriesByTimeRangeFail
203+
| LoadEntriesByTimeRangeFail;

src/app/modules/time-clock/store/entry.reducer.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import {TimeEntriesSummary, TimeDetails} from '../models/time.entry.summary';
2-
import {NewEntry, Entry} from './../../shared/models';
1+
import {TimeDetails, TimeEntriesSummary} from '../models/time.entry.summary';
2+
import {Entry, NewEntry} from './../../shared/models';
33
import * as actions from './entry.actions';
44
import {entryReducer, EntryState} from './entry.reducer';
5-
import {init} from 'protractor/built/launcher';
65

76
describe('entryReducer', () => {
87

src/styles/colors.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ General Datatable adjustment styles
7171
.dt-buttons {
7272
.dt-button {
7373
background-image: linear-gradient($info);
74-
color: white;
7574
}
7675
.dt-button:hover:not(.disabled){
7776
background-image: linear-gradient($info);

0 commit comments

Comments
 (0)