Skip to content

Commit b46f511

Browse files
fix: TT-653 Add conditions when an user is currently working on a task (#860)
1 parent f3805cc commit b46f511

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ describe('Reports Page', () => {
190190

191191
it('Should populate the users with the payload from the action executed', () => {
192192
const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
193-
const usersArray = []
193+
const usersArray = [];
194194
const action = {
195195
type: UserActionTypes.LOAD_USERS_SUCCESS,
196196
payload: usersArray
@@ -201,7 +201,7 @@ describe('Reports Page', () => {
201201

202202
expect(component.users).toEqual(usersArray);
203203
});
204-
204+
205205
it('The sum of the data dates is equal to {"hours": 3, "minutes":20,"seconds":0}', () => {
206206
let {hours,minutes,seconds}: TotalHours = component.sumDates(timeEntryList);
207207
expect({hours, minutes, seconds}).toEqual({hours:3,minutes:20,seconds:0});

src/app/modules/shared/components/details-fields/details-fields.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
361361

362362
const isStartDateInTheFuture = moment(startDateToSubmit).isAfter(moment());
363363
const isEndDateInTheFuture = moment(endDateToSubmit).isAfter(moment());
364-
const timeEntryIsInTheFuture = isStartDateInTheFuture || isEndDateInTheFuture;
364+
const timeEntryIsInTheFuture = isStartDateInTheFuture || (isEndDateInTheFuture && !this.goingToWorkOnThis);
365365

366366
if (timeEntryIsInTheFuture) {
367367
this.toastrService.error('You cannot start a time-entry in the future');

0 commit comments

Comments
 (0)