Skip to content

Commit 861434a

Browse files
committed
Merge branch 'Time_Clock-Clock-In' of https://github.com/ioet/time-tracker-ui into Clock-Component
2 parents 8556927 + 2e0bc6b commit 861434a

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<div class="text-center mt-3">
2+
23
<div *ngIf="showAlertEnterTecnology" class="alert alert-danger" role="alert">
34
Field technology is requiered. Enter this field for clock out.
45
</div>
@@ -42,22 +43,10 @@ <h6 class="text-left"><strong>Projects</strong></h6>
4243
</form>
4344
<p class="text-left"><i class="fas fa-folder"></i><strong> Top</strong></p>
4445
<ul class="list-group">
45-
<li class="list-group-item d-flex justify-content-between align-items-center">
46-
Customer › ernst-and-young
47-
<button type="button" class="btn btn-success btn-sm">Clock In</button>
48-
</li>
49-
<li class="list-group-item d-flex justify-content-between align-items-center">
50-
Customer
51-
<i class="fas fa-chevron-right"></i>
52-
53-
</li>
54-
<li class="list-group-item d-flex justify-content-between align-items-center">
55-
Training
56-
<i class="fas fa-chevron-right"></i>
57-
</li>
46+
<app-project-list-hover [projects]="projects" (showFields)="setShowFields($event)"></app-project-list-hover>
5847
</ul>
5948
<br>
60-
<form *ngIf="!isClockIn">
49+
<form *ngIf="!isClockIn || showFields">
6150
<div class="form-group row">
6251
<label for="inputActivity" class="col-sm-2 col-form-label text-center"><strong>Activity</strong></label>
6352
<div class="col-sm-10">
@@ -93,3 +82,4 @@ <h6 class="text-left"><strong>Projects</strong></h6>
9382
</div>
9483
</div>
9584
</div>
85+
</div>

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import { Component, OnInit, OnDestroy } from '@angular/core';
1+
import { Component, OnInit } from '@angular/core';
22

33
@Component({
4-
selector: "app-time-clock",
5-
templateUrl: "./time-clock.component.html",
6-
styleUrls: ["./time-clock.component.css"]
4+
selector: 'app-time-clock',
5+
templateUrl: './time-clock.component.html',
6+
styleUrls: ['./time-clock.component.css']
77
})
8-
export class TimeClockComponent implements OnInit {
8+
9+
export class TimeClockComponent implements OnInit {
10+
911
projects = [
10-
{ id: "P1", name: "Project 1" },
11-
{ id: "P2", name: "Project 2" },
12-
{ id: "P3", name: "Project 3" },
13-
{ id: "P4", name: "Project 4" }
12+
{ id: 'P1', name: 'Project 1' },
13+
{ id: 'P2', name: 'Project 2' },
14+
{ id: 'P3', name: 'Project 3' },
15+
{ id: 'P4', name: 'Project 4' }
1416
];
1517

1618
username = 'Dario';
@@ -19,9 +21,11 @@ export class TimeClockComponent implements OnInit {
1921
isClockIn: boolean;
2022
isEnterTechnology: boolean;
2123
showAlertEnterTecnology: boolean;
24+
2225
hour: number;
2326
minute: number;
2427
seconds: number;
28+
2529
showFields: boolean;
2630

2731
constructor() {
@@ -55,12 +59,12 @@ export class TimeClockComponent implements OnInit {
5559
this.isEnterTechnology = false;
5660
}
5761
}
58-
59-
setShowFields(show: boolean) {
62+
63+
setShowFields(show: boolean) {
64+
this.isClockIn = false;
6065
this.showFields = show;
6166
}
6267

63-
ngOnInit(): void {
64-
}
65-
68+
ngOnInit(): void {}
69+
6670
}

0 commit comments

Comments
 (0)