Skip to content

Commit

Permalink
remove eslint error in all component pages (#73)
Browse files Browse the repository at this point in the history
* remove eslint error in all component pages

* fixed prettier issue
  • Loading branch information
NamrataSweya authored May 27, 2024
1 parent de51c61 commit 02d0976
Show file tree
Hide file tree
Showing 66 changed files with 324 additions and 901 deletions.
1 change: 0 additions & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { AddReservationComponent } from './view/add-reservation/add-reservation.
import { ForgetPasswordComponent } from './view/forget-password/forget-password.component';
import { ResetPasswordComponent } from './view/reset-password/reset-password.component';
import { UserProfileComponent } from './view/user-profile/user-profile.component';
import { UserInvitationComponent } from './view/organization/user-invitation/user-invitation.component';
import { UserAcceptInvitationComponent } from './view/user-accept-invitation/user-accept-invitation.component';
('./view/UserAcceptInvitationComponent');
const routes: Routes = [
Expand Down
6 changes: 1 addition & 5 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { FormBuilder } from '@angular/forms';
import { SelectionModel } from '@angular/cdk/collections';
import { MediaMatcher } from '@angular/cdk/layout';
import { ChangeDetectorRef, Component, OnDestroy } from '@angular/core';
import { MatTableDataSource } from '@angular/material/table';
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
Expand Down
11 changes: 4 additions & 7 deletions src/app/auth/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
HttpInterceptor,
HttpResponse,
} from '@angular/common/http';
import { catchError, Observable, of, tap, throwError } from 'rxjs';
import { catchError, Observable, tap, throwError } from 'rxjs';
import { Router } from '@angular/router';

@Injectable()
Expand All @@ -16,7 +16,7 @@ export class AuthInterceptor implements HttpInterceptor {
request: HttpRequest<unknown>,
next: HttpHandler,
): Observable<HttpEvent<unknown>> {
let authorizationToken = sessionStorage.getItem('access-token');
const authorizationToken = sessionStorage.getItem('access-token');
if (authorizationToken) {
request = request.clone({
setHeaders: {
Expand All @@ -33,13 +33,10 @@ export class AuthInterceptor implements HttpInterceptor {
}
}
}),
catchError((err: string, caught: Observable<any>) =>
this.handleHttpClientError(err, caught),
),
catchError((err: string) => this.handleHttpClientError(err)),
);
}
handleHttpClientError(error: any, caught: Observable<any>) {
//this.sharedService.stopLoader();
handleHttpClientError(error: any) {
if (error.status == 401) {
// this.tokenHandlingService.removeTokenFromStorage();
// this.sharedService.showToastMessages('info', 'Your session has been timed out, you have been logged out');
Expand Down
8 changes: 2 additions & 6 deletions src/app/auth/authbase.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Injectable } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpErrorResponse,
} from '@angular/common/http';
import { HttpClient } from '@angular/common/http';
//import {environment} from '../../environments/environment.dev';
import { environment } from '../../environments/environment';
import { Observable } from 'rxjs';
Expand All @@ -12,7 +8,7 @@ import { Observable } from 'rxjs';
providedIn: 'root',
})
export class AuthbaseService {
url: String = environment.API_URL;
url: string = environment.API_URL;
constructor(private httpClient: HttpClient) {}

login(routePath: string, data: any) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/auth/services/ACL_User_permission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../environments/environment';
import { YieldConfig } from '../../models/yieldvalue.model';
import { getapiuser_header } from '../../utils/apiuser_clientinfo';
@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -46,7 +45,7 @@ export class ACLModulePermisionService {
);
}
public PutUserpermission(id: any, data: any): Observable<any> {
let headers = new HttpHeaders(this.headersData);
const headers = new HttpHeaders(this.headersData);
return this.httpClient.put<any>(
environment.API_URL + 'permission/update/' + id,
data,
Expand Down
29 changes: 12 additions & 17 deletions src/app/auth/services/admin.service.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { Injectable } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpErrorResponse,
} from '@angular/common/http';
//import {environment} from '../../../environments/environment.dev';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from '../../../environments/environment';
import { Observable } from 'rxjs';
import { getapiuser_header } from '../../utils/apiuser_clientinfo';
@Injectable({
providedIn: 'root',
})
export class AdminService {
url: String = environment.API_URL;
url: string = environment.API_URL;
headersData = getapiuser_header();
constructor(private httpClient: HttpClient) {}

Expand All @@ -23,14 +18,14 @@ export class AdminService {
): Observable<any> {
let searchUrl = `${this.url}admin/organizations`;
if (pagenumber != undefined && limit != undefined) {
if (!(typeof pagenumber === undefined || pagenumber === null)) {
if (!(pagenumber === undefined || pagenumber === null)) {
searchUrl += `?pageNumber=${pagenumber}&limit=${limit}`;
}
}
if (searchData != undefined) {
if (
!(
typeof searchData.organizationName === undefined ||
searchData.organizationName === undefined ||
searchData.organizationName === '' ||
searchData.organizationName === null
)
Expand All @@ -49,17 +44,17 @@ export class AdminService {
limit?: number,
searchData?: any,
): Observable<any> {
let headers = new HttpHeaders(this.headersData);
const headers = new HttpHeaders(this.headersData);
let searchUrl = `${this.url}admin/users`;
if (pagenumber != undefined && limit != undefined) {
if (!(typeof pagenumber === undefined || pagenumber === null)) {
if (!(pagenumber === undefined || pagenumber === null)) {
searchUrl += `?pageNumber=${pagenumber}&limit=${limit}`;
}
}
if (searchData != undefined) {
if (
!(
typeof searchData.organizationName === undefined ||
searchData.organizationName === undefined ||
searchData.organizationName === '' ||
searchData.organizationName === null
)
Expand All @@ -74,10 +69,10 @@ export class AdminService {
pagenumber?: number,
limit?: number,
): Observable<any> {
let headers = new HttpHeaders(this.headersData);
const headers = new HttpHeaders(this.headersData);
let searchUrl = `${this.url}admin/organizations/user/${organizationsId}`;
if (pagenumber != undefined && limit != undefined) {
if (!(typeof pagenumber === undefined || pagenumber === null)) {
if (!(pagenumber === undefined || pagenumber === null)) {
searchUrl += `?pageNumber=${pagenumber}&limit=${limit}`;
}
}
Expand All @@ -93,7 +88,7 @@ export class AdminService {
searchInput: StaticRange,
orgId: number,
): Observable<any> {
let searchUrl =
const searchUrl =
`${this.url}admin/devices/autocomplete?externalId=` +
searchInput +
`&organizationId=` +
Expand All @@ -114,15 +109,15 @@ export class AdminService {
): Observable<any> {
let searchUrl = `${this.url}admin/apiusers`;
if (pagenumber != undefined && limit != undefined) {
if (!(typeof pagenumber === undefined || pagenumber === null)) {
if (!(pagenumber === undefined || pagenumber === null)) {
searchUrl += `?pageNumber=${pagenumber}&limit=${limit}`;
}
}

if (searchData != undefined) {
if (
!(
typeof searchData.organizationName === undefined ||
searchData.organizationName === undefined ||
searchData.organizationName === '' ||
searchData.organizationName === null
)
Expand Down
1 change: 0 additions & 1 deletion src/app/auth/services/blockchain-drec.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../environments/environment';
import { OrganizationInformation } from '../../models/organization.model';
import { BlockchainProperties } from '../../models/blockchain-properties.model';

@Injectable({
Expand Down
30 changes: 13 additions & 17 deletions src/app/auth/services/certificate.service.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { Injectable } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpErrorResponse,
} from '@angular/common/http';
//import {environment} from '../../environments/environment.dev';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from '../../../environments/environment';
import { Observable } from 'rxjs';
import { getapiuser_header } from '../../utils/apiuser_clientinfo';
@Injectable({
providedIn: 'root',
})
export class CertificateService {
url: String = environment.API_URL;
url: string = environment.API_URL;
headersData = getapiuser_header();
constructor(private httpClient: HttpClient) {}
GetRedemptionMethod(): Observable<any> {
Expand All @@ -29,7 +24,7 @@ export class CertificateService {
if (searchData != undefined) {
if (
!(
typeof searchData.organizationId === undefined ||
searchData.organizationId === undefined ||
searchData.organizationId === '' ||
searchData.organizationId === null ||
searchData.organizationId === undefined
Expand All @@ -39,7 +34,7 @@ export class CertificateService {
}
if (
!(
typeof searchData.countryCode === undefined ||
searchData.countryCode === undefined ||
searchData.countryCode === '' ||
searchData.countryCode === null
)
Expand All @@ -49,7 +44,7 @@ export class CertificateService {

if (
!(
typeof searchData.fuelCode === undefined ||
searchData.fuelCode === undefined ||
searchData.fuelCode === '' ||
searchData.fuelCode === null
)
Expand All @@ -59,7 +54,7 @@ export class CertificateService {

if (
!(
typeof searchData.capacity === undefined ||
searchData.capacity === undefined ||
searchData.capacity === '' ||
searchData.capacity === null
)
Expand All @@ -68,7 +63,7 @@ export class CertificateService {
}
if (
!(
typeof searchData.offTaker === undefined ||
searchData.offTaker === undefined ||
searchData.offTaker === '' ||
searchData.offTaker === null
)
Expand All @@ -77,7 +72,7 @@ export class CertificateService {
}
if (
!(
typeof searchData.SDGBenefits === undefined ||
searchData.SDGBenefits === undefined ||
searchData.SDGBenefits === '' ||
searchData.SDGBenefits === null
)
Expand Down Expand Up @@ -123,27 +118,28 @@ export class CertificateService {
searchUrl += `&toAmountread=${searchData.toAmountread}`;
}
}
let headers = new HttpHeaders(this.headersData);
const headers = new HttpHeaders(this.headersData);

return this.httpClient.get(searchUrl, { headers });
}
getcertifiedlogByGooupUid(
group_uid: string,
pagenumber: number,
): Observable<any> {
let searchUrl =
const searchUrl =
this.url +
'certificate-log/issuer/certified/new/' +
group_uid +
'?pageNumber=' +
pagenumber;
let headers = new HttpHeaders(this.headersData);
const headers = new HttpHeaders(this.headersData);

return this.httpClient.get(searchUrl, { headers });
}

getcertifiedlogPerDevice(group_uid: string): Observable<any> {
let searchUrl = this.url + 'certificate-log/expoert_perdevice/' + group_uid;
const searchUrl =
this.url + 'certificate-log/expoert_perdevice/' + group_uid;

return this.httpClient.get(searchUrl, { responseType: 'blob' });
}
Expand Down
Loading

0 comments on commit 02d0976

Please sign in to comment.