diff --git a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.css b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.css index e69de29bb..52f46bed6 100644 --- a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.css +++ b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.css @@ -0,0 +1,25 @@ +.current-elapsed-time-box{ + border-color: #FF5E0A; + border-width: 2px; + background-color: #FF5E0A; + color: white; + border-radius: .25rem; +} + +.clock-out{ + text-align: center; +} + +.bt-clock-out{ + background: #00baee; + color: #fff; + padding: 7px 20px; +} + +.bt-clock-out:hover{ + background: #10a5ce; + box-shadow: 0px 1px 5px 2px rgba(0,0,0,0.56); + -webkit-box-shadow: 0px 1px 5px 2px rgba(0,0,0,0.56); + -moz-box-shadow: 0px 1px 5px 2px rgba(0,0,0,0.56); + color: #fff; +} diff --git a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.html b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.html index dcca3ca07..97fb1c24e 100644 --- a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.html +++ b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.html @@ -1,22 +1,43 @@ +
+
+

+ You clocked in at + {{ activeTimeEntry?.start_date | date:'shortTime' }} +

+
+
+
+
Current
+

{{ currentWorkingTime }}

+
+
+
+ +
+
+
Summary

+
-
-
Current
-

{{ currentWorkingTime }}

-
-
+
Day

{{ timeEntriesSummary?.day | timeDetails }}

-
+
Week

{{ timeEntriesSummary?.week | timeDetails }}

-
+
Month

{{ timeEntriesSummary?.month | timeDetails }}

+
diff --git a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.spec.ts b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.spec.ts index 00b5c9fab..7ac3c117d 100644 --- a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.spec.ts +++ b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.spec.ts @@ -148,4 +148,11 @@ describe('TimeEntriesSummaryComponent', () => { discardPeriodicTasks(); })); + it('clockOut should emits event', () => { + spyOn(component.clockoutEvent, 'emit'); + component.clockOut(); + + expect(component.clockoutEvent.emit).toHaveBeenCalled(); + }); + }); diff --git a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.ts b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.ts index 9a225d605..b46c9b88a 100644 --- a/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.ts +++ b/src/app/modules/time-clock/components/time-entries-summary/time-entries-summary.component.ts @@ -5,9 +5,10 @@ import { Entry } from './../../../shared/models/entry.model'; import { TimeEntriesSummary } from '../../models/time.entry.summary'; import { LoadEntriesSummary, LoadActiveEntry, EntryActionTypes } from './../../store/entry.actions'; import { EntryState } from './../../store/entry.reducer'; -import { Store, ActionsSubject } from '@ngrx/store'; -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Store, ActionsSubject, select } from '@ngrx/store'; +import { Component, OnInit, OnDestroy, Output, EventEmitter, Input } from '@angular/core'; import * as moment from 'moment'; +import { getActiveTimeEntry } from '../../store/entry.selectors'; @Component({ selector: 'app-time-entries-summary', @@ -16,6 +17,10 @@ import * as moment from 'moment'; }) export class TimeEntriesSummaryComponent implements OnInit, OnDestroy { + @Input() activeTimeEntry: Entry; + @Input() areFieldsVisible = false; + @Output() clockoutEvent = new EventEmitter(); + timeEntriesSummary: TimeEntriesSummary; currentWorkingTime: string; destroyed$ = new Subject(); @@ -103,4 +108,9 @@ export class TimeEntriesSummaryComponent implements OnInit, OnDestroy { }); } } + + clockOut(): void { + this.clockoutEvent.emit(); + } + } diff --git a/src/app/modules/time-clock/pages/time-clock.component.html b/src/app/modules/time-clock/pages/time-clock.component.html index ed1a377f0..fdc2342de 100644 --- a/src/app/modules/time-clock/pages/time-clock.component.html +++ b/src/app/modules/time-clock/pages/time-clock.component.html @@ -1,13 +1,9 @@ - +
-

- You clocked in at - {{ activeTimeEntry?.start_date | date:'shortTime' }} -

Hi {{ username }}, please select a project to clock-in.

@@ -19,7 +15,4 @@
-
- -