Skip to content

Commit a3e3082

Browse files
committed
fixing secrets
1 parent 6506028 commit a3e3082

File tree

7 files changed

+50
-48
lines changed

7 files changed

+50
-48
lines changed

src/app/modules/activities-management/store/activity-management.selectors.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('ActivityManagement Selectors', () => {
4242
description: 'Some description'
4343
},
4444
];
45-
45+
4646
const activitiesOrdered = [
4747
{
4848
id: '002',

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ describe('Reports Page', () => {
142142
});
143143

144144
const params = [
145-
{url: 'http://example.com', expected_value: true},
146-
{url: 'https://example.com', expected_value: true},
147-
{url: 'no-url-example', expected_value: false}
145+
{ url: 'http://example.com', expected_value: true },
146+
{ url: 'https://example.com', expected_value: true },
147+
{ url: 'no-url-example', expected_value: false }
148148
];
149149
params.map((param) => {
150150
it(`Given the url ${param.url}, the method isURL should return ${param.expected_value}`, () => {
151151

152-
expect(component.isURL(param.url)).toEqual(param.expected_value);
152+
expect(component.isURL(param.url)).toEqual(param.expected_value);
153153
});
154154
});
155155

@@ -170,15 +170,15 @@ describe('Reports Page', () => {
170170
});
171171

172172
it('when the rerenderDataTable method is called and dtElement and dtInstance are defined, the destroy and next methods are called ',
173-
() => {
174-
spyOn(component.dtTrigger, 'next');
173+
() => {
174+
spyOn(component.dtTrigger, 'next');
175175

176-
component.ngAfterViewInit();
176+
component.ngAfterViewInit();
177177

178-
component.dtElement.dtInstance.then( (dtInstance) => {
179-
expect(component.dtTrigger.next).toHaveBeenCalled();
178+
component.dtElement.dtInstance.then((dtInstance) => {
179+
expect(component.dtTrigger.next).toHaveBeenCalled();
180+
});
180181
});
181-
});
182182

183183
it(`When the user method is called, the emit method is called`, () => {
184184
const userId = 'abc123';
@@ -203,8 +203,8 @@ describe('Reports Page', () => {
203203
});
204204

205205
it('The sum of the data dates is equal to {"hours": 3, "minutes":20,"seconds":0}', () => {
206-
let {hours,minutes,seconds}: TotalHours = component.sumDates(timeEntryList);
207-
expect({hours, minutes, seconds}).toEqual({hours:3,minutes:20,seconds:0});
206+
const { hours, minutes, seconds }: TotalHours = component.sumDates(timeEntryList);
207+
expect({ hours, minutes, seconds }).toEqual({ hours: 3, minutes: 20, seconds: 0 });
208208
});
209209

210210
afterEach(() => {

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
6060
filename: `time-entries-${formatDate(new Date(), 'MM_dd_yyyy-HH_mm', 'en')}`
6161
},
6262
],
63-
columnDefs: [{ type: 'date', targets: 2}],
64-
order: [[1,'asc'],[2,'desc'],[4,'desc']]
63+
columnDefs: [{ type: 'date', targets: 2 }],
64+
order: [[1, 'asc'], [2, 'desc'], [4, 'desc']]
6565
};
6666
dtTrigger: Subject<any> = new Subject();
6767
@ViewChild(DataTableDirective, { static: false })
@@ -72,7 +72,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
7272
resultSum: TotalHours;
7373
dateTimeOffset: ParseDateTimeOffset;
7474

75-
constructor(private store: Store<EntryState>, private actionsSubject$: ActionsSubject, private storeUser: Store<User> ) {
75+
constructor(private store: Store<EntryState>, private actionsSubject$: ActionsSubject, private storeUser: Store<User>) {
7676
this.reportDataSource$ = this.store.pipe(select(getReportDataSource));
7777
this.dateTimeOffset = new ParseDateTimeOffset();
7878
}
@@ -128,28 +128,28 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
128128
const durationColumnIndex = 3;
129129
return column === durationColumnIndex ? moment.duration(dataFormated).asHours().toFixed(2) : dataFormated;
130130
}
131-
132-
sumDates(arrayData: Entry[]): TotalHours{
131+
132+
sumDates(arrayData: Entry[]): TotalHours {
133133
this.resultSum = new TotalHours();
134-
let arrayDurations= new Array();
135-
arrayData.forEach(entry =>{
136-
let start = moment(entry.end_date).diff(moment(entry.start_date));
137-
arrayDurations.push(moment.utc(start).format("HH:mm:ss"));
134+
const arrayDurations = new Array();
135+
arrayData.forEach(entry => {
136+
const start = moment(entry.end_date).diff(moment(entry.start_date));
137+
arrayDurations.push(moment.utc(start).format('HH:mm:ss'));
138138
});
139-
140-
let totalDurations = arrayDurations.slice(1)
141-
.reduce((prev, cur) => {
142-
return prev.add(cur);
143-
},
144-
moment.duration(arrayDurations[0]));
145-
let daysInHours = totalDurations.days() * 24;
146-
this.resultSum.hours=totalDurations.hours() + daysInHours;
139+
140+
const totalDurations = arrayDurations.slice(1)
141+
.reduce((prev, cur) => {
142+
return prev.add(cur);
143+
},
144+
moment.duration(arrayDurations[0]));
145+
const daysInHours = totalDurations.days() * 24;
146+
this.resultSum.hours = totalDurations.hours() + daysInHours;
147147
this.resultSum.minutes = totalDurations.minutes();
148148
this.resultSum.seconds = totalDurations.seconds();
149149
return this.resultSum;
150150
}
151151

152-
user(userId: string){
152+
user(userId: string) {
153153
this.selectedUserId.emit(userId);
154154
}
155155

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export class TotalHours {
2-
2+
33
hours: number;
44
minutes: number;
55
seconds: number;
@@ -9,4 +9,4 @@ export class TotalHours {
99
this.minutes = 0;
1010
this.seconds = 0;
1111
}
12-
}
12+
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import * as moment from 'moment';
22

3-
export class ParseDateTimeOffset {
3+
export class ParseDateTimeOffset {
44

5-
parseDateTimeOffset(date:string, offset): string{
6-
if(date == null || date == undefined || date == '') return 'In progress';
7-
return moment.utc(date).utcOffset(-1*offset).format("HH:mm");
5+
parseDateTimeOffset(date: string, offset): string {
6+
if (date === null || date === undefined || date === '') {
7+
return 'In progress';
8+
}
9+
return moment.utc(date).utcOffset(-1 * offset).format('HH:mm');
810
}
911
}

src/app/modules/time-clock/components/entry-fields/entry-fields.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ describe('EntryFieldsComponent', () => {
379379
description: 'Some description'
380380
},
381381
];
382-
382+
383383
const activitiesOrdered = [
384384
{
385385
id: '005',
@@ -488,10 +488,10 @@ describe('EntryFieldsComponent', () => {
488488
});
489489

490490
it('when a activity is not register in DB should show activatefocus in select activity', () => {
491-
const activitiesMock = [{
491+
const activitiesMock = [{
492492
id: 'xyz',
493493
name: 'test',
494-
description : 'test1'
494+
description: 'test1'
495495
}];
496496
const data = {
497497
activity_id: 'xyz',

src/environments/environment.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import { EnvironmentType } from './enum';
55

66
export const environment = {
77
production: EnvironmentType.TT_DEV,
8-
timeTrackerApiUrl: process.env["API_URL"],
8+
timeTrackerApiUrl: process.env[`API_URL`],
99
stackexchangeApiUrl: 'https://api.stackexchange.com',
1010
};
1111

1212

1313

14-
export const AUTHORITY = process.env["AUTHORITY"];
15-
export const CLIENT_ID = process.env["CLIENT_ID"];
16-
export const CLIENT_URL = process.env["CLIENT_URL"];
17-
export const SCOPES = process.env["SCOPES"].split(",");
14+
export const AUTHORITY = process.env[`AUTHORITY`];
15+
export const CLIENT_ID = process.env[`CLIENT_ID`];
16+
export const CLIENT_URL = process.env[`CLIENT_URL`];
17+
export const SCOPES = process.env[`SCOPES`].split(`,`);
1818
export const ITEMS_PER_PAGE = 5;
19-
export const STACK_EXCHANGE_ID = process.env["STACK_EXCHANGE_ID"];
20-
export const STACK_EXCHANGE_ACCESS_TOKEN = process.env["STACK_EXCHANGE_ACCESS_TOKEN"];
21-
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = process.env["AZURE_APP_CONFIGURATION_CONNECTION_STRING"];
19+
export const STACK_EXCHANGE_ID = process.env[`STACK_EXCHANGE_ID`];
20+
export const STACK_EXCHANGE_ACCESS_TOKEN = process.env[`STACK_EXCHANGE_ACCESS_TOKEN`];
21+
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = process.env[`AZURE_APP_CONFIGURATION_CONNECTION_STRING`];
2222
export const DATE_FORMAT = 'yyyy-MM-dd';
2323
export const DATE_FORMAT_YEAR = 'YYYY-MM-DD';
2424
export const GROUPS = {

0 commit comments

Comments
 (0)