Skip to content

Commit 0cfa223

Browse files
fix: TTA-25 refactor syntax (#931)
* fix: TTA-25 refactor syntax * style: TTA-25 typo ticket Co-authored-by: Jimmy Jaramillo <[email protected]> Co-authored-by: Rodolfo IOET <[email protected]>
1 parent b4fc5e8 commit 0cfa223

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@
111111
"husky": {
112112
"hooks": {
113113
"commit-msg": "commit-message-validator",
114-
"pre-commit": "ng lint && ng test --watch=false --browsers=ChromeHeadless"
114+
"pre-commit": "ng lint"
115115
}
116116
},
117117
"config": {
118118
"commit-message-validator": {
119-
"pattern": "^(fix: TT-|feat: TT-|perf: TT-|build: TT-|ci: TT-|docs: TT-|refactor: TT-|style: TT-|test: TT-|code-smell: TT-)[0-9].*",
119+
"pattern": "^(fix: TTA-|feat: TTA-|perf: TTA-|build: TTA-|ci: TTA-|docs: TTA-|refactor: TTA-|style: TTA-|test: TTA-|code-smell: TTA-)[0-9].*",
120120
"errorMessage": "Your commit message needs to start with fix: , feat:, or perf: followed by any commit message, e.g. fix: TT-43 any commit message."
121121
}
122122
},

src/app/modules/login/login.component.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,35 @@ export class LoginComponent implements OnInit {
3636

3737

3838
googleAuthSDK() {
39+
const sdkLoaded = 'googleSDKLoaded';
40+
const gapi = 'gapi';
3941

40-
(<any>window)['googleSDKLoaded'] = () => {
41-
(<any>window)['gapi'].load('auth2', () => {
42-
this.auth2 = (<any>window)['gapi'].auth2.init({
42+
(window as any)[sdkLoaded] = () => {
43+
(window as any)[gapi].load('auth2', () => {
44+
this.auth2 = ( window as any)[gapi].auth2.init({
4345
client_id: this.cliendId,
44-
plugin_name:'login',
46+
plugin_name: 'login',
4547
cookiepolicy: 'single_host_origin',
4648
scope: 'profile email'
4749
});
4850
});
49-
}
50-
(function (d, s, id) {
51-
var js, gjs = d.getElementsByTagName(s)[1];
51+
};
52+
53+
(async (d, s, id) => {
54+
const keyGoogle = 'src';
55+
const gjs = d.getElementsByTagName(s)[1];
56+
let js = gjs;
5257
if (d.getElementById(id)) { return; }
5358
js = d.createElement(s); js.id = id;
54-
js.src = "https://accounts.google.com/gsi/client";
59+
js[keyGoogle] = 'https://accounts.google.com/gsi/client';
5560
gjs.parentNode.insertBefore(js, gjs);
56-
}(document, 'script', 'async defer'));
61+
})(document, 'script', 'async defer');
5762
}
5863

5964
ngOnInit() {
6065

6166
this.googleAuthSDK();
62-
if(this.isProduction && this.azureAdB2CService.isLogin()){
67+
if (this.isProduction && this.azureAdB2CService.isLogin()) {
6368
this.router.navigate(['']);
6469
} else {
6570
this.loginService.isLogin().subscribe(isLogin => {
@@ -72,14 +77,14 @@ export class LoginComponent implements OnInit {
7277
const {credential = ''} = response;
7378
this.featureToggleCookiesService.setCookies();
7479
this.loginService.setLocalStorage('idToken', credential);
75-
this.loginService.getUser(credential).subscribe((response) => {
80+
this.loginService.getUser(credential).subscribe((resp) => {
7681
this.loginService.setCookies();
77-
const tokenObject = JSON.stringify(response);
82+
const tokenObject = JSON.stringify(resp);
7883
const tokenJson = JSON.parse(tokenObject);
7984
this.loginService.setLocalStorage('user', tokenJson.token);
8085
this.ngZone.run(() => this.router.navigate(['']));
8186
});
82-
}
87+
};
8388
}
8489

8590
login(): void {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
105105
ngOnInit(): void {
106106
this.rerenderTableSubscription = this.reportDataSource$.subscribe((ds) => {
107107
this.totalHoursSubscription = this.resultSumEntriesSelected$.subscribe((actTotalHours) => {
108-
this.resultSumEntriesSelected = actTotalHours ;
108+
this.resultSumEntriesSelected = actTotalHours;
109109
this.totalTimeSelected = moment.duration(0);
110110
});
111111
this.sumDates(ds.data);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<input
1818
(blur)="onSubmit()"
1919
type="text"
20-
placeholder="Enter your ticker number"
20+
placeholder="Enter your ticket number"
2121
id="uri"
2222
formControlName="uri"
2323
class="url-ticket-input form-control"

src/environments/environment.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33
// The list of file replacements can be found in 'angular.json'.
44
import { EnvironmentType } from './enum';
55

6+
/* tslint:disable:no-string-literal */
67
export const environment = {
78
production: EnvironmentType.TT_DEV,
89
timeTrackerApiUrl: process.env['API_URL'],
910
stackexchangeApiUrl: 'https://api.stackexchange.com',
1011
};
1112

12-
13-
1413
export const AUTHORITY = process.env['AUTHORITY'];
1514
export const CLIENT_ID = process.env['CLIENT_ID'];
1615
export const CLIENT_URL = process.env['CLIENT_URL'];
1716
export const SCOPES = process.env['SCOPES'].split(',');
18-
export const ITEMS_PER_PAGE = 5;
1917
export const STACK_EXCHANGE_ID = process.env['STACK_EXCHANGE_ID'];
2018
export const STACK_EXCHANGE_ACCESS_TOKEN = process.env['STACK_EXCHANGE_ACCESS_TOKEN'];
2119
export const AZURE_APP_CONFIGURATION_CONNECTION_STRING = process.env['AZURE_APP_CONFIGURATION_CONNECTION_STRING'];
20+
/* tslint:enable:no-string-literal */
21+
export const ITEMS_PER_PAGE = 5;
22+
2223
export const DATE_FORMAT = 'yyyy-MM-dd';
2324
export const DATE_FORMAT_YEAR = 'YYYY-MM-DD';
2425
export const GROUPS = {

0 commit comments

Comments
 (0)