Skip to content

Commit 7c8ca50

Browse files
committed
format code indentation based in 2 spaces.
1 parent 01696cf commit 7c8ca50

File tree

13 files changed

+259
-240
lines changed

13 files changed

+259
-240
lines changed
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<div class="parent">
2-
<app-create-activity class="item">
3-
</app-create-activity>
4-
5-
<app-activity-list [activities]="activities" class="item">
6-
</app-activity-list>
2+
<app-create-activity class="item"></app-create-activity>
3+
<app-activity-list [activities]="activities" class="item"></app-activity-list>
74
</div>
Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
<div class="card-body">
2-
<div class="scroll">
3-
<div class="accordion" id="accordionActivities">
4-
<div *ngIf="activities?.length > 0; else notShow">
5-
<div class="card" *ngFor="let activity of activities; let rowIndex = index">
6-
<div class="card-header">
7-
<h2 class="mb-0">
8-
<a type="button" data-toggle="collapse" [attr.data-target]="'#row'+rowIndex">
9-
{{activity.name}}
10-
</a>
11-
<div class="btn-group float-right" role="group">
12-
<i class="far fa-edit btn btn-link"></i>
13-
<i class="far fa-trash-alt btn btn-link"></i>
14-
</div>
15-
</h2>
16-
</div>
17-
18-
<div [id]="'row'+rowIndex" class="collapse" data-parent="#accordionActivities">
19-
<div class="card-body">
20-
<h5>Description:</h5>
21-
<p>{{activity.description}}</p>
22-
</div>
23-
</div>
24-
25-
</div>
2+
<div class="scroll">
3+
<div class="accordion" id="accordionActivities">
4+
<div *ngIf="activities?.length > 0; else notShow">
5+
<div class="card" *ngFor="let activity of activities; let rowIndex = index">
6+
<div class="card-header">
7+
<h2 class="mb-0">
8+
<a type="button" data-toggle="collapse" [attr.data-target]="'#row'+rowIndex">
9+
{{activity.name}}
10+
</a>
11+
<div class="btn-group float-right" role="group">
12+
<i class="far fa-edit btn btn-link"></i>
13+
<i class="far fa-trash-alt btn btn-link"></i>
14+
</div>
15+
</h2>
16+
</div>
17+
<div [id]="'row'+rowIndex" class="collapse" data-parent="#accordionActivities">
18+
<div class="card-body">
19+
<h5>Description:</h5>
20+
<p>{{activity.description}}</p>
2621
</div>
27-
<ng-template #notShow>
28-
<div class="card">
29-
<div class="card-body">
30-
<h4 class="card-text">There are no activities.</h4>
31-
<h5 class="card-text">Please, create one.</h5>
32-
</div>
33-
</div>
34-
</ng-template>
22+
</div>
3523
</div>
24+
</div>
25+
<ng-template #notShow>
26+
<div class="card">
27+
<div class="card-body">
28+
<h4 class="card-text">There are no activities.</h4>
29+
<h5 class="card-text">Please, create one.</h5>
30+
</div>
31+
</div>
32+
</ng-template>
3633
</div>
34+
</div>
3735
</div>
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<div class="parent">
2-
<app-create-project class="item" [projectToEdit]="project" (savedProject)="updateProject($event)" (cancelForm)="cancelForm()">
3-
</app-create-project>
2+
<app-create-project class="item" [projectToEdit]="project" (savedProject)="updateProject($event)"
3+
(cancelForm)="cancelForm()">
4+
</app-create-project>
45

5-
<app-project-list class="item" [projects]="projects" (editProject)="editProject($event)" (deleteProject)="deleteProject($event)">
6-
</app-project-list>
6+
<app-project-list class="item" [projects]="projects" (editProject)="editProject($event)"
7+
(deleteProject)="deleteProject($event)">
8+
</app-project-list>
79
</div>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<div class="text-center mt-5">
2-
3-
<p>reports works!</p>
4-
2+
<p>reports works!</p>
53
</div>
Lines changed: 84 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,90 @@
11
<div class="text-center mt-5">
2-
<div class="card">
3-
<div class="card-header">
4-
<div class="row">
5-
<div class="col-2 text-left">
6-
<strong>Time clock</strong>
7-
</div>
8-
<div class="col-10 text-right">
9-
<i class="far fa-question-circle"></i>
10-
</div>
11-
</div>
2+
<div class="card">
3+
<div class="card-header">
4+
<div class="row">
5+
<div class="col-2 text-left">
6+
<strong>Time clock</strong>
127
</div>
13-
14-
<div class="card-body">
15-
<p *ngIf="!isClockIn" class="card-title text-left"><strong>{{ username }}</strong> clocked <strong class="text-success">in</strong> at <strong>{{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}</strong></p>
16-
<p *ngIf="isClockIn" class="card-title text-left"><strong>{{ username }}</strong> clocked <strong class="text-danger">out</strong> at <strong>{{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}</strong></p>
17-
<h6 class="text-left"><strong>Totals</strong></h6>
18-
<hr>
19-
<div class="row">
20-
<div class="col-4">
21-
<h6>Current</h6>
22-
<h3>{{ hourCounterRealTime | number: '2.0-2' }}:{{ minuteCounterRealTime | number: '2.0-2' }}:{{ secondsCounterRealTime | number: '2.0-2' }}</h3>
23-
</div>
24-
<div class="col-4">
25-
<h6>Day</h6>
26-
<h3>00:00</h3>
27-
</div>
28-
<div class="col-4">
29-
<h6>Week</h6>
30-
<h3>00:00</h3>
31-
</div>
32-
</div>
33-
<h6 class="text-left"><strong>Projects</strong></h6>
34-
<p class="text-left"><i class="fas fa-folder"></i><strong> Top</strong></p>
35-
<ul class="list-group">
36-
<app-project-list-hover [projects]="projects" (showFields)="setShowFields($event)"></app-project-list-hover>
37-
</ul>
38-
<br>
39-
<form *ngIf="(!isClockIn || showFields) && !isHidenForm">
40-
<div class="form-group row">
41-
<label for="inputActivity" class="col-sm-2 col-form-label text-center"><strong>Activity</strong></label>
42-
<div class="col-sm-10">
43-
<input type="text" class="form-control">
44-
</div>
45-
</div>
46-
<div class="form-group row">
47-
<label for="inputJiraTicket" class="col-sm-2 col-form-label text-center"><strong>Jira Ticket</strong></label>
48-
<div class="col-sm-10">
49-
<input type="text" class="form-control">
50-
</div>
51-
</div>
52-
<div class="form-group row">
53-
<label for="inputTechnology" class="col-sm-2 col-form-label text-center"><strong>Technology</strong></label>
54-
<div class="col-sm-10">
55-
<input *ngIf="!showAlertEnterTecnology" #data type="text" (keyup)="enterTechnology(data.value)" class="form-control">
56-
<input *ngIf="showAlertEnterTecnology" #data type="text" (keyup)="enterTechnology(data.value)" class="form-control border-danger">
57-
<div>
58-
<h6 *ngIf="showAlertEnterTecnology" class="text-danger text-left">Technology field is required. Enter this field to clock out.</h6>
59-
</div>
60-
</div>
61-
</div>
62-
</form>
63-
<hr>
64-
<div class="container">
65-
<div class="row">
66-
<div class="col text-left" id="optionsContainer">
67-
<button class="btn btn-light btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
68-
Options
69-
</button>
70-
</div>
71-
<div class="col text-right" id="clockInOutContainer">
72-
<button *ngIf="isClockIn" class="btn btn-success btn-sm" type="button" (click)="employeClockIn()">Clock In</button>
73-
<button *ngIf="!isClockIn" class="btn btn-danger btn-sm" type="button" (click)="employeClockOut()">Clock Out</button>
74-
</div>
75-
</div>
8+
<div class="col-10 text-right">
9+
<i class="far fa-question-circle"></i>
10+
</div>
11+
</div>
12+
</div>
13+
<div class="card-body">
14+
<p *ngIf="!isClockIn" class="card-title text-left"><strong>{{ username }}</strong> clocked <strong
15+
class="text-success">in</strong> at
16+
<strong>{{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}</strong></p>
17+
<p *ngIf="isClockIn" class="card-title text-left"><strong>{{ username }}</strong> clocked <strong
18+
class="text-danger">out</strong> at
19+
<strong>{{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}</strong></p>
20+
<h6 class="text-left"><strong>Totals</strong></h6>
21+
<hr>
22+
<div class="row">
23+
<div class="col-4">
24+
<h6>Current</h6>
25+
<h3>
26+
{{ hourCounterRealTime | number: '2.0-2' }}:{{ minuteCounterRealTime | number: '2.0-2' }}:{{ secondsCounterRealTime | number: '2.0-2' }}
27+
</h3>
28+
</div>
29+
<div class="col-4">
30+
<h6>Day</h6>
31+
<h3>00:00</h3>
32+
</div>
33+
<div class="col-4">
34+
<h6>Week</h6>
35+
<h3>00:00</h3>
36+
</div>
37+
</div>
38+
<h6 class="text-left"><strong>Projects</strong></h6>
39+
<p class="text-left"><i class="fas fa-folder"></i><strong> Top</strong></p>
40+
<ul class="list-group">
41+
<app-project-list-hover [projects]="projects" (showFields)="setShowFields($event)"></app-project-list-hover>
42+
</ul>
43+
<br>
44+
<form *ngIf="(!isClockIn || showFields) && !isHidenForm">
45+
<div class="form-group row">
46+
<label for="inputActivity" class="col-sm-2 col-form-label text-center"><strong>Activity</strong></label>
47+
<div class="col-sm-10">
48+
<input type="text" class="form-control">
49+
</div>
50+
</div>
51+
<div class="form-group row">
52+
<label for="inputJiraTicket" class="col-sm-2 col-form-label text-center"><strong>Jira Ticket</strong></label>
53+
<div class="col-sm-10">
54+
<input type="text" class="form-control">
55+
</div>
56+
</div>
57+
<div class="form-group row">
58+
<label for="inputTechnology" class="col-sm-2 col-form-label text-center"><strong>Technology</strong></label>
59+
<div class="col-sm-10">
60+
<input *ngIf="!showAlertEnterTecnology" #data type="text" (keyup)="enterTechnology(data.value)"
61+
class="form-control">
62+
<input *ngIf="showAlertEnterTecnology" #data type="text" (keyup)="enterTechnology(data.value)"
63+
class="form-control border-danger">
64+
<div>
65+
<h6 *ngIf="showAlertEnterTecnology" class="text-danger text-left">Technology field is required. Enter this
66+
field to clock out.</h6>
7667
</div>
68+
</div>
69+
</div>
70+
</form>
71+
<hr>
72+
<div class="container">
73+
<div class="row">
74+
<div class="col text-left" id="optionsContainer">
75+
<button class="btn btn-light btn-sm dropdown-toggle" type="button" data-toggle="dropdown"
76+
aria-haspopup="true" aria-expanded="false">
77+
Options
78+
</button>
79+
</div>
80+
<div class="col text-right" id="clockInOutContainer">
81+
<button *ngIf="isClockIn" class="btn btn-success btn-sm" type="button" (click)="employeClockIn()">Clock
82+
In</button>
83+
<button *ngIf="!isClockIn" class="btn btn-danger btn-sm" type="button" (click)="employeClockOut()">Clock
84+
Out</button>
85+
</div>
7786
</div>
87+
</div>
7888
</div>
89+
</div>
7990
</div>

src/app/components/options-sidebar/time-clock/time-clock.component.ts

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Component, OnInit } from '@angular/core';
66
styleUrls: ['./time-clock.component.scss']
77
})
88

9-
export class TimeClockComponent implements OnInit {
9+
export class TimeClockComponent implements OnInit {
1010

1111
projects = [
1212
{ id: 'P1', name: 'Project 1' },
@@ -43,74 +43,73 @@ export class TimeClockComponent implements OnInit {
4343
this.hour = 0;
4444
this.minute = 0;
4545
this.seconds = 0;
46-
}
47-
48-
employeClockIn(): boolean {
49-
this.isClockInEnable = true;
50-
this.isClockIn = !this.isClockIn;
51-
this.isHidenForm = false;
52-
this.startTimer();
53-
this.setArrivalAndDepartureTimes();
54-
return this.isClockIn;
55-
}
56-
57-
employeClockOut() {
58-
if ( this.isEnterTechnology === false ) {
59-
this.isClockIn = false;
60-
this.showAlertEnterTecnology = true;
61-
} else {
62-
this.setDefaultValuesToFields();
63-
this.pauseTimer();
64-
this.setArrivalAndDepartureTimes();
65-
}
66-
}
67-
68-
enterTechnology(data: string) {
69-
if ( data.length > 0 ) {
46+
}
47+
48+
employeClockIn(): boolean {
49+
this.isClockInEnable = true;
50+
this.isClockIn = !this.isClockIn;
51+
this.isHidenForm = false;
52+
this.startTimer();
53+
this.setArrivalAndDepartureTimes();
54+
return this.isClockIn;
55+
}
56+
57+
employeClockOut() {
58+
if (this.isEnterTechnology === false) {
59+
this.isClockIn = false;
60+
this.showAlertEnterTecnology = true;
61+
} else {
62+
this.setDefaultValuesToFields();
63+
this.pauseTimer();
64+
this.setArrivalAndDepartureTimes();
65+
}
66+
}
67+
68+
enterTechnology(data: string) {
69+
if (data.length > 0) {
7070
this.isEnterTechnology = true;
71-
} else {
72-
this.isEnterTechnology = false;
73-
}
74-
}
75-
76-
setShowFields(show: boolean) {
77-
this.isHidenForm = false;
78-
if ( this.isClockInEnable !== true ) {
71+
} else {
72+
this.isEnterTechnology = false;
73+
}
74+
}
75+
76+
setShowFields(show: boolean) {
77+
this.isHidenForm = false;
78+
if (this.isClockInEnable !== true) {
7979
this.isClockIn = false;
8080
this.showFields = show;
81-
if ( !this.execOnlyOneTimeCounter ) {
81+
if (!this.execOnlyOneTimeCounter) {
8282
this.startTimer();
8383
this.execOnlyOneTimeCounter = true;
8484
}
8585
this.setArrivalAndDepartureTimes();
86-
}
86+
}
8787
}
8888

8989
startTimer() {
9090
this.interval = setInterval(() => {
91-
this.timer();
92-
}, 1000 );
93-
}
91+
this.timer();
92+
}, 1000);
93+
}
9494

95-
pauseTimer() {
96-
clearInterval(this.interval);
97-
}
95+
pauseTimer() {
96+
clearInterval(this.interval);
97+
}
9898

99-
timer() {
99+
timer() {
100100
this.secondsCounterRealTime += 1;
101-
if ( this.secondsCounterRealTime === 59 ) {
102-
console.log('entroooo');
103-
this.minuteCounterRealTime += 1; //1
104-
this.secondsCounterRealTime = 0; //0
105-
if ( this.minuteCounterRealTime === 59 ) {
101+
if (this.secondsCounterRealTime === 59) {
102+
this.minuteCounterRealTime += 1;
103+
this.secondsCounterRealTime = 0;
104+
if (this.minuteCounterRealTime === 59) {
106105
this.hourCounterRealTime += 1;
107106
this.minuteCounterRealTime = 0;
108107
}
109108
}
110109
}
111110

112111
setArrivalAndDepartureTimes() {
113-
if ( !this.execOnlyOneTimeClockIn ) {
112+
if (!this.execOnlyOneTimeClockIn) {
114113
this.currentDate = new Date();
115114
this.hour = this.currentDate.getHours();
116115
this.minute = this.currentDate.getMinutes();

0 commit comments

Comments
 (0)