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
TT-39 fix: code coverage
  • Loading branch information
scastillo-jp authored and Guido Quezada committed Dec 28, 2020
commit e23f6e8d5e38433be99e74173e24aeeaa3ca8347
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export class EntryFieldsComponent implements OnInit {
newData;
lastEntry;
showTimeInbuttons = false;
month = new Date().getMonth();
year = new Date().getFullYear();

constructor(
private formBuilder: FormBuilder,
Expand All @@ -50,7 +52,7 @@ export class EntryFieldsComponent implements OnInit {

ngOnInit(): void {
this.store.dispatch(new LoadActivities());
this.store.dispatch(new entryActions.LoadEntries(12, 2020));
this.store.dispatch(new entryActions.LoadEntries(this.month, this.year));
this.actionsSubject$
.pipe(filter((action: any) => action.type === ActivityManagementActionTypes.LOAD_ACTIVITIES_SUCCESS))
.subscribe((action) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/time-clock/store/entry.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class EntryEffects {
ofType(actions.EntryActionTypes.UPDATE_CURRENT_OR_LAST_ENTRY),
map((action: actions.UpdateCurrentOrLastEntry) => action.payload),
switchMap((entry) =>
this.entryService.loadEntries(new Date().getMonth() + 1).pipe(
this.entryService.loadEntries(new Date().getMonth() + 1, new Date().getFullYear()).pipe(
map((entries) => {
const lastEntry = entries[1];
const isStartTimeInLastEntry = moment(entry.start_date).isBefore(lastEntry.end_date);
Expand Down