Skip to content
3 changes: 2 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ import { ProjectEffects } from './modules/customer-management/components/project
import { TechnologyEffects } from './modules/shared/store/technology.effects';
import { ProjectTypeEffects } from './modules/customer-management/components/projects-type/store/project-type.effects';
import { reducers } from './reducers';
import { environment } from '../environments/environment';
import { CLIENT_URL, environment } from '../environments/environment';
import { EnvironmentType } from '../environments/enum';
import { CustomerComponent } from './modules/customer-management/pages/customer.component';
// tslint:disable-next-line: max-line-length
import { CustomerListComponent } from './modules/customer-management/components/customer-info/components/customer-list/customer-list.component';
Expand Down
3 changes: 2 additions & 1 deletion src/app/guards/login-guard/login.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Router, CanActivate } from '@angular/router';
import { AzureAdB2CService } from '../../modules/login/services/azure.ad.b2c.service';
import { LoginService } from '../../modules/login/services/login.service';
import { environment } from 'src/environments/environment';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { EnvironmentType } from 'src/environments/enum';


@Injectable({
providedIn: 'root',
Expand Down
1 change: 0 additions & 1 deletion src/app/modules/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { SocialAuthService, SocialUser } from 'angularx-social-login';
import { environment } from 'src/environments/environment';
import { EnvironmentType } from 'src/environments/enum';
import { LoginService } from './services/login.service';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Component({
selector: 'app-login',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,15 @@ describe('Reports Page', () => {
it('The sum of the data dates is equal to {"hours": 3, "minutes":20,"seconds":0}', () => {
const { hours, minutes, seconds }: TotalHours = component.sumDates(timeEntryList);
expect({ hours, minutes, seconds }).toEqual({ hours: 3, minutes: 20, seconds: 0 });

});

it('the sume of hours of entries selected is equal to {hours:0, minutes:0, seconds:0}', () => {
let checked = true;
let {hours, minutes, seconds}:TotalHours = component.sumHoursEntriesSelected(timeEntryList[0], checked);
checked = false;
({hours, minutes,seconds} = component.sumHoursEntriesSelected(timeEntryList[0], checked));
expect({hours, minutes, seconds}).toEqual({hours:0, minutes:0, seconds:0});
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`
},
],
columnDefs: [{ type: 'date', targets: 2}],
order: [[1, 'asc'], [2, 'desc'], [4, 'desc']]
columnDefs: [{ type: 'date', targets: 2}, {orderable: false, targets: [0]}],
order: [[1,'asc'],[2,'desc'],[4,'desc']]
};
dtTrigger: Subject<any> = new Subject();
@ViewChild(DataTableDirective, { static: false })
Expand Down Expand Up @@ -141,7 +141,8 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated;
}

sumDates(arrayData: Entry[]): TotalHours{

sumDates(arrayData: Entry[]): TotalHours {
this.resultSum = new TotalHours();
const arrayDurations = new Array();
arrayData.forEach(entry => {
Expand All @@ -150,10 +151,10 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
});

const totalDurations = arrayDurations.slice(1)
.reduce((prev, cur) => {
return prev.add(cur);
},
moment.duration(arrayDurations[0]));
.reduce((prev, cur) => {
return prev.add(cur);
},
moment.duration(arrayDurations[0]));
const daysInHours = totalDurations.days() * 24;
this.resultSum.hours = totalDurations.hours() + daysInHours;
this.resultSum.minutes = totalDurations.minutes();
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/user/services/user-info.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { JwtHelperService } from '@auth0/angular-jwt';
import { HttpClientTestingModule } from '@angular/common/http/testing';



describe('UserInfoService', () => {
let service: UserInfoService;
const userTest = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiVW5rbm93biBOYW1lIiwiZW1haWwiOiJleGFtcGxlQG1haWwuY29tIiwicm9sZXMiOltdLCJncm91cHMiOlsiZmFrZS1hZG1pbiIsImZha2UtdGVzdGVyIl0sImlkIjoiZHVtbXlfaWRfbG9hZCIsInRlbmFudF9pZCI6ImR1bW15X3RlbmFudF9pZF9sb2FkIiwiZGVsZXRlZCI6IiJ9.kTlan9Ea0uYVAPdVNmcJ11IQ1t8zRCOnEQckqpx2O9w';
Expand All @@ -27,6 +26,7 @@ describe('UserInfoService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],

providers: [{ provide : LoginService, useValue: mockLoginService}],
});
service = TestBed.inject(UserInfoService);
Expand Down
1 change: 0 additions & 1 deletion src/app/modules/user/services/user-info.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { JwtHelperService } from '@auth0/angular-jwt';
import { Observable, of } from 'rxjs';
import { GROUPS } from '../../../../environments/environment';

import { LoginService } from '../../login/services/login.service';
Expand Down