diff --git a/infrastructure/main.tf b/infrastructure/main.tf index d7b433273..649f224bf 100644 --- a/infrastructure/main.tf +++ b/infrastructure/main.tf @@ -42,7 +42,7 @@ locals { } module "ui" { - source = "git@github.com:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.5" + source = "git@github.com:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.11" app_service_name = local.service_name create_app_service_plan = local.create_app_service_plan docker_image_name = "${local.image_name}:${var.image_tag}" diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts index 559a13b93..d07d85d1f 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.spec.ts @@ -190,7 +190,7 @@ describe('Reports Page', () => { it('Should populate the users with the payload from the action executed', () => { const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject; - const usersArray = [] + const usersArray = []; const action = { type: UserActionTypes.LOAD_USERS_SUCCESS, payload: usersArray @@ -203,8 +203,8 @@ describe('Reports Page', () => { }); it('The sum of the data dates is equal to {"hours": 3, "minutes":20,"seconds":0}', () => { - let {hours,minutes,seconds}: TotalHours = component.sumDates(timeEntryList); - expect({hours, minutes, seconds}).toEqual({hours:3,minutes:20,seconds:0}); + let { hours, minutes, seconds }: TotalHours = component.sumDates(timeEntryList); + expect({ hours, minutes, seconds }).toEqual({ hours: 3, minutes: 20, seconds: 0 }); }); afterEach(() => { diff --git a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts index cfa6f98ee..765a01e5e 100644 --- a/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts +++ b/src/app/modules/reports/components/time-entries-table/time-entries-table.component.ts @@ -127,13 +127,13 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn const durationColumnIndex = 3; return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated; } - + sumDates(arrayData: Entry[]): TotalHours{ this.resultSum = new TotalHours(); - let arrayDurations= new Array(); - arrayData.forEach(entry =>{ - let start = moment(entry.end_date).diff(moment(entry.start_date)); - arrayDurations.push(moment.utc(start).format("HH:mm:ss")); + let arrayDurations = new Array(); + arrayData.forEach(entry => { + const start = moment(entry.end_date).diff(moment(entry.start_date)); + arrayDurations.push(moment.utc(start).format('HH:mm:ss')); }); let totalDurations = arrayDurations.slice(1) @@ -142,7 +142,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn }, moment.duration(arrayDurations[0])); let daysInHours = totalDurations.days() * 24; - this.resultSum.hours=totalDurations.hours() + daysInHours; + this.resultSum.hours = totalDurations.hours() + daysInHours; this.resultSum.minutes = totalDurations.minutes(); this.resultSum.seconds = totalDurations.seconds(); return this.resultSum; diff --git a/src/app/modules/reports/models/total-hours-report.ts b/src/app/modules/reports/models/total-hours-report.ts index 0dc49b541..e925db92b 100644 --- a/src/app/modules/reports/models/total-hours-report.ts +++ b/src/app/modules/reports/models/total-hours-report.ts @@ -9,4 +9,4 @@ export class TotalHours { this.minutes = 0; this.seconds = 0; } -} \ No newline at end of file +} diff --git a/src/app/modules/shared/formatters/parse-date-time-offset/parse-date-time-offset.ts b/src/app/modules/shared/formatters/parse-date-time-offset/parse-date-time-offset.ts index 7dd05aba1..11f38aa94 100644 --- a/src/app/modules/shared/formatters/parse-date-time-offset/parse-date-time-offset.ts +++ b/src/app/modules/shared/formatters/parse-date-time-offset/parse-date-time-offset.ts @@ -2,8 +2,12 @@ import * as moment from 'moment'; export class ParseDateTimeOffset { - parseDateTimeOffset(date:string, offset): string{ - if(date == null || date == undefined || date == '') return 'In progress'; - return moment.utc(date).utcOffset(-1*offset).format("HH:mm"); + parseDateTimeOffset(date: string, offset: any): string { + if (date === null || date === undefined || date === '') return 'In progress'; + + return moment + .utc(date) + .utcOffset(-1 * offset) + .format('HH:mm'); } }