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
Prev Previous commit
Next Next commit
feat: #204 Extracting inline css to scss file
  • Loading branch information
Juan Gabriel Guzman committed May 29, 2020
commit 77ad9716f0666addef7ff3da74bab72aadbb89a7
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
<table class="table table-sm table-striped mb-0" datatable [dtTrigger]="dtTrigger" [dtOptions]="dtOptions">
<thead class="thead-orange">
<tr class="d-flex">
<th class="col" style="max-width: 8em">Date</th>
<th class="col" style="max-width: 6.2em">Duration</th>
<th class="col">Project</th>
<th class="col">Ticket</th>
<th class="col" style="min-width: 20em">Description</th>
<th class="col" style="min-width: 20em">Technologies</th>
<th class="col md-col">Date</th>
<th class="col sm-col">Duration</th>
<th class="col md-col">Project</th>
<th class="col md-col">Ticket</th>
<th class="col lg-col" >Description</th>
<th class="col lg-col">Technologies</th>
</tr>
</thead>
<tbody>
<tr
class="d-flex"
*ngFor="let entry of data"
>
<td class="col" style="max-width: 8em"> {{ entry.start_date | date: 'dd/MM/yyyy' }} </td>
<td class="col" style="max-width: 6.2em"> {{ entry.end_date | substractDate: entry.start_date }} </td>
<td class="col"> {{ entry.project_name }} </td>
<td class="col"> {{ entry.uri }} </td>
<td class="col" style="min-width: 20em"> {{ entry.description }} </td>
<td class="col" style="word-break: break-all; min-width: 20em"> {{ entry.technologies }} </td>
<td class="col md-col"> {{ entry.start_date | date: 'dd/MM/yyyy' }} </td>
<td class="col sm-col"> {{ entry.end_date | substractDate: entry.start_date }} </td>
<td class="col md-col"> {{ entry.project_name }} </td>
<td class="col md-col"> {{ entry.uri }} </td>
<td class="col lg-col multiline-col"> {{ entry.description }} </td>
<td class="col lg-col multiline-col"> {{ entry.technologies }} </td>
</tr>
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

.sm-col{
max-width: 6.2em
}
.md-col{
max-width: 8em
}

.lg-col{
min-width: 20em;
}

.multiline-col{
word-break: break-all;

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ describe('Reports Page', () => {
expect(component.data).toEqual(state.entriesForReport);
});

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

component.ngAfterViewInit();
// fixture.detectChanges();

expect(component.dtTrigger.next).toHaveBeenCalled();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import {DataTableDirective} from 'angular-datatables';
@Component({
selector: 'app-time-entries-table',
templateUrl: './time-entries-table.component.html',
styleUrls: ['./time-entries-table.component.scss']
})
export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewInit {

data = [];
const;
dtOptions: any = {
scrollY: '790px',
scrollY: '600px',
paging: false,
dom: 'Bfrtip',
buttons: [
Expand Down Expand Up @@ -48,18 +49,12 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
}

private rerenderDataTable(): void {
console.log('1', this.dtElement);
console.log('1', this.dtElement);
if (this.dtElement && this.dtElement.dtInstance) {
console.log('2');
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
console.log('3');

dtInstance.destroy();
this.dtTrigger.next();
});
} else {
console.log('4');
this.dtTrigger.next();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/time-clock/store/entry.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ export type EntryActions =
| DefaultEntry
| LoadEntriesByTimeRange
| LoadEntriesByTimeRangeSuccess
| LoadEntriesByTimeRangeFail
| LoadEntriesByTimeRangeFail;
5 changes: 2 additions & 3 deletions src/app/modules/time-clock/store/entry.reducer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {TimeEntriesSummary, TimeDetails} from '../models/time.entry.summary';
import {NewEntry, Entry} from './../../shared/models';
import {TimeDetails, TimeEntriesSummary} from '../models/time.entry.summary';
import {Entry, NewEntry} from './../../shared/models';
import * as actions from './entry.actions';
import {entryReducer, EntryState} from './entry.reducer';
import {init} from 'protractor/built/launcher';

describe('entryReducer', () => {

Expand Down
1 change: 0 additions & 1 deletion src/styles/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ General Datatable adjustment styles
.dt-buttons {
.dt-button {
background-image: linear-gradient($info);
color: white;
}
.dt-button:hover:not(.disabled){
background-image: linear-gradient($info);
Expand Down