diff --git a/pre-registration-ui/src/app/app.component.ts b/pre-registration-ui/src/app/app.component.ts index 93c40623..cb27c853 100644 --- a/pre-registration-ui/src/app/app.component.ts +++ b/pre-registration-ui/src/app/app.component.ts @@ -1,8 +1,6 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { HostListener } from '@angular/core'; -import { Event as NavigationEvent, Router } from '@angular/router'; +import { Component, OnInit, OnDestroy, HostListener } from '@angular/core'; +import { Event as NavigationEvent, Router, NavigationStart } from '@angular/router'; import { filter } from 'rxjs/operators'; -import { NavigationStart } from '@angular/router'; import { AutoLogoutService } from 'src/app/core/services/auto-logout.service'; import { ConfigService } from './core/services/config.service'; @@ -21,7 +19,9 @@ export class AppComponent implements OnInit, OnDestroy { constructor(private autoLogout: AutoLogoutService, private router: Router, private configService: ConfigService) {} ngOnInit() { - this.subscriptions.push(this.autoLogout.currentMessageAutoLogout.subscribe(() => {})); + this.subscriptions.push(this.autoLogout.currentMessageAutoLogout.subscribe(() => { + // This is intentional + })); this.autoLogout.changeMessage({ timerFired: false }); this.routerType(); } @@ -32,8 +32,7 @@ export class AppComponent implements OnInit, OnDestroy { .pipe(filter((event: NavigationEvent) => event instanceof NavigationStart)) .subscribe((event: NavigationStart) => { if (event.restoredState) { - // this.configService.navigationType = 'popstate'; - //this.preventBack(); + // This is intentional } }) ); diff --git a/pre-registration-ui/src/app/app.util.ts b/pre-registration-ui/src/app/app.util.ts index 9b4eb841..8f7c74b4 100644 --- a/pre-registration-ui/src/app/app.util.ts +++ b/pre-registration-ui/src/app/app.util.ts @@ -19,8 +19,7 @@ export default class Utils { urlSegments.pop(); } urlSegments.push(nextRoute); - const url = urlSegments.join("/"); - return url; + return urlSegments.join("/"); } } @@ -40,7 +39,6 @@ export default class Utils { language: string, ltrLangs: string[] ) { - //console.log(`language: ${language}`); let localeId = language.substring(0, 2); JSON.parse(localStorage.getItem(appConstants.LANGUAGE_CODE_VALUES)).forEach((element) => { if (language === element.code && element.locale) { @@ -50,12 +48,10 @@ export default class Utils { } } }); - //console.log(`getBookingDateTime: ${localeId}`); const localeData = localStorage.getItem(localeId); let proceed = false; if (localeData !== null) { registerLocaleData(JSON.parse(localeData)); - //console.log(`registered localeId: ${localeId}`); proceed = true; } else { registerLocaleData(localeEn, "en"); @@ -73,7 +69,6 @@ export default class Utils { } else { appointmentDateTime = date.join(" "); } - //console.log(appointmentDateTime); return appointmentDateTime; } else { return appointment_date; @@ -173,7 +168,7 @@ export default class Utils { return dataCaptureLanguagesLabels; }; - static getLangSelectionPopupAttributes(textDir: string,dataCaptureLabels: any, mandatoryLanguages: string[], minLanguage: Number, maxLanguage: Number, userPrefLanguage : string) { + static getLangSelectionPopupAttributes(textDir: string,dataCaptureLabels: any, mandatoryLanguages: string[], minLanguage: number, maxLanguage: number, userPrefLanguage : string) { //create string with mandatory Lang Names let mandatoryLang = ""; mandatoryLanguages.forEach((lang) => { @@ -242,7 +237,6 @@ export default class Utils { } else if (userRequest.langCode) { applicationLanguages = [userRequest.langCode]; } - //console.log(`applicationLanguages: ${applicationLanguages}`); return applicationLanguages; } diff --git a/pre-registration-ui/src/app/auth/auth-guard.service.spec.ts b/pre-registration-ui/src/app/auth/auth-guard.service.spec.ts index 9af8c22b..f7ffc4fd 100644 --- a/pre-registration-ui/src/app/auth/auth-guard.service.spec.ts +++ b/pre-registration-ui/src/app/auth/auth-guard.service.spec.ts @@ -1,7 +1,5 @@ import { TestBed } from '@angular/core/testing'; -import { ActivatedRouteSnapshot } from '@angular/router'; -import { RouterStateSnapshot } from '@angular/router'; -import { Router } from '@angular/router'; +import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { AuthService } from './auth.service'; import { AuthGuardService } from './auth-guard.service'; describe('AuthGuardService', () => { diff --git a/pre-registration-ui/src/app/auth/auth-guard.service.ts b/pre-registration-ui/src/app/auth/auth-guard.service.ts index 2bddca35..f788f733 100644 --- a/pre-registration-ui/src/app/auth/auth-guard.service.ts +++ b/pre-registration-ui/src/app/auth/auth-guard.service.ts @@ -1,6 +1,5 @@ -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; +import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; import { Injectable } from '@angular/core'; -import { Router } from '@angular/router'; import { AuthService } from './auth.service'; @Injectable({ diff --git a/pre-registration-ui/src/app/auth/auth.module.ts b/pre-registration-ui/src/app/auth/auth.module.ts index 8ef0404d..092cc24a 100644 --- a/pre-registration-ui/src/app/auth/auth.module.ts +++ b/pre-registration-ui/src/app/auth/auth.module.ts @@ -8,8 +8,7 @@ import { AppRoutingModule } from "../app-routing.module"; import { SharedModule } from "../shared/shared.module"; import { CoreModule } from "../core/core.module"; import { - RecaptchaModule, - RECAPTCHA_LANGUAGE, + RecaptchaModule } from "ng-recaptcha"; import { CaptchaComponent } from './captcha/captcha.component'; @NgModule({ diff --git a/pre-registration-ui/src/app/auth/login/login.component.css b/pre-registration-ui/src/app/auth/login/login.component.css index ca6f6ded..c7cc6b23 100644 --- a/pre-registration-ui/src/app/auth/login/login.component.css +++ b/pre-registration-ui/src/app/auth/login/login.component.css @@ -81,7 +81,7 @@ button { visibility: hidden; } ::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline { - color: lightgrey; + color: white !important; } ::ng-deep .mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick { @@ -93,9 +93,6 @@ button { /* ::ng-deep.mat-form-field-wrapper { padding-bottom: 0.5em !important; } */ -::ng-deep .mat-form-field-appearance-outline .mat-form-field-outline { - color: white !important; -} @media (max-width: 500px) { .form_fields_padding { diff --git a/pre-registration-ui/src/app/auth/login/login.component.html b/pre-registration-ui/src/app/auth/login/login.component.html index 8a622236..aca4539a 100644 --- a/pre-registration-ui/src/app/auth/login/login.component.html +++ b/pre-registration-ui/src/app/auth/login/login.component.html @@ -79,7 +79,6 @@ -
- -
{{ "login.otp_valid_label" | translate }} {{ minutes }} { - //response = stubConfig; this.configService.setConfig(response); this.appVersion = this.configService.getConfigByKey( "preregistration.ui.version" @@ -144,9 +139,7 @@ export class LoginComponent implements OnInit { console.log(`otp_sent_time: ${otp_sent_time}`); if (otp_sent_time && user_email_or_phone) { let otpSentTime = moment(otp_sent_time).toISOString(); - //console.log(`otpSentTime: ${otpSentTime}`); let currentTime = moment().toISOString(); - //console.log(`currentTime: ${currentTime}`); let otpExpiryIntervalInSeconds = Number( this.configService.getConfigByKey( appConstants.CONFIG_KEYS.mosip_kernel_otp_expiry_time @@ -155,15 +148,12 @@ export class LoginComponent implements OnInit { if (isNaN(otpExpiryIntervalInSeconds)) { otpExpiryIntervalInSeconds = 120; //2 mins by default } - //console.log(`otpExpiryIntervalInSeconds: ${otpExpiryIntervalInSeconds}`); var timeLapsedInSeconds = moment(currentTime).diff( moment(otpSentTime), "seconds" ); - //console.log(`timeLapsedInSeconds: ${timeLapsedInSeconds}`); if (timeLapsedInSeconds <= otpExpiryIntervalInSeconds) { console.log("otp interval not yet expired"); - //console.log(this.timer); let newOtpIntervalInSeconds = otpExpiryIntervalInSeconds - timeLapsedInSeconds; console.log(`newOtpIntervalInSeconds: ${newOtpIntervalInSeconds}`); @@ -174,7 +164,6 @@ export class LoginComponent implements OnInit { } this.errorMessage = ""; this.inputOTP = ""; - //this.showResend = false; this.showOTP = true; this.showSendOTP = false; this.showContactDetails = false; @@ -215,9 +204,7 @@ export class LoginComponent implements OnInit { ...this.mandatoryLanguages, ...this.optionalLanguages, ]; - this.maxLanguage == 1 - ? (this.showLanguageDropDown = false) - : (this.showLanguageDropDown = true); + this.showLanguageDropDown = this.maxLanguage == 1 ? false : true; localStorage.setItem( "availableLanguages", JSON.stringify(this.languageSelectionArray) @@ -354,15 +341,12 @@ export class LoginComponent implements OnInit { ) { this.errorMessage = ""; this.showVerify = true; - //this.showResend = false; } else { - //this.showResend = false; this.showVerify = false; } } verifyInput() { - //this.loginIdValidator(); this.errorMessage =""; } @@ -393,7 +377,6 @@ export class LoginComponent implements OnInit { // redirecting to initial phase on completion of timer this.showContactDetails = true; this.showSendOTP = true; - //this.showResend = true; this.showOTP = false; this.showVerify = false; this.enableSendOtp = true; @@ -417,10 +400,11 @@ export class LoginComponent implements OnInit { } if (document.getElementById("secondsSpan") && document.getElementById("secondsSpan").innerText) { + let newSecVal = --secValue; if (secValue === 10 || secValue < 10) { - document.getElementById("secondsSpan").innerText = "0" + --secValue; + document.getElementById("secondsSpan").innerText = "0" + newSecVal; } else { - document.getElementById("secondsSpan").innerText = --secValue + ""; + document.getElementById("secondsSpan").innerText = newSecVal + ""; } } }; @@ -452,7 +436,6 @@ export class LoginComponent implements OnInit { ); this.errorMessage = undefined; this.inputOTP = ""; - //this.showResend = false; this.showOTP = true; this.showSendOTP = false; this.showContactDetails = false; @@ -475,9 +458,7 @@ export class LoginComponent implements OnInit { }, (error) => { clearInterval(this.timer); - //console.log(error); if (this.enableCaptcha){ - //this.inputContactDetails = ""; this.resetCaptcha = true; this.captchaToken = null; this.enableSendOtp = false; @@ -506,7 +487,6 @@ export class LoginComponent implements OnInit { } }, (error) => { - //console.log(error); this.inputOTP = ""; this.disableVerify = false; this.showVerify = false; @@ -534,7 +514,6 @@ export class LoginComponent implements OnInit { localStorage.removeItem("otp_sent_time"); localStorage.removeItem("user_email_or_phone"); localStorage.removeItem("show_captcha"); - return; } } ); @@ -591,7 +570,6 @@ export class LoginComponent implements OnInit { showOtpMessage() { this.inputOTP = ""; let response = this.Languagelabels; - //console.log(response); let otpmessage = response["message"]["login"]["msg3"]; const message = { case: "MESSAGE", diff --git a/pre-registration-ui/src/app/core/about-us/about-us.component.ts b/pre-registration-ui/src/app/core/about-us/about-us.component.ts index eafe3b8a..243f5424 100644 --- a/pre-registration-ui/src/app/core/about-us/about-us.component.ts +++ b/pre-registration-ui/src/app/core/about-us/about-us.component.ts @@ -10,8 +10,6 @@ export class AboutUsComponent implements OnInit { langCode = ''; panelOpenState = -1; - constructor() { } - ngOnInit() { this.langCode = localStorage.getItem('langCode'); } diff --git a/pre-registration-ui/src/app/core/contact/contact.component.ts b/pre-registration-ui/src/app/core/contact/contact.component.ts index 2126220a..b6b3f580 100644 --- a/pre-registration-ui/src/app/core/contact/contact.component.ts +++ b/pre-registration-ui/src/app/core/contact/contact.component.ts @@ -7,9 +7,8 @@ import { Component, OnInit } from '@angular/core'; }) export class ContactComponent implements OnInit { - constructor() { } - ngOnInit() { + //Empty function } } diff --git a/pre-registration-ui/src/app/core/footer/footer.component.ts b/pre-registration-ui/src/app/core/footer/footer.component.ts index 90dc92ca..4825d22e 100644 --- a/pre-registration-ui/src/app/core/footer/footer.component.ts +++ b/pre-registration-ui/src/app/core/footer/footer.component.ts @@ -6,8 +6,8 @@ import { Component, Input, OnInit } from "@angular/core"; }) export class FooterComponent implements OnInit { @Input() appVersion: string; - constructor() {} ngOnInit() { - } + //Empty function + } } diff --git a/pre-registration-ui/src/app/core/header/header.component.html b/pre-registration-ui/src/app/core/header/header.component.html index ee997441..630b3a93 100644 --- a/pre-registration-ui/src/app/core/header/header.component.html +++ b/pre-registration-ui/src/app/core/header/header.component.html @@ -24,7 +24,6 @@ - {{ 'header.link_about' | translate }} {{ 'header.link_faq' | translate }} @@ -45,7 +44,6 @@
-
diff --git a/pre-registration-ui/src/app/core/header/header.component.spec.ts b/pre-registration-ui/src/app/core/header/header.component.spec.ts index d5c1fa05..d4388e1c 100644 --- a/pre-registration-ui/src/app/core/header/header.component.spec.ts +++ b/pre-registration-ui/src/app/core/header/header.component.spec.ts @@ -63,12 +63,4 @@ describe('HeaderComponent', () => { expect(routerStub.navigate).toHaveBeenCalled(); }); }); - // describe('doLogout', () => { - // it('makes expected calls', () => { - // const authServiceStub: AuthService = fixture.debugElement.injector.get(AuthService); - // spyOn(authServiceStub, 'onLogout'); - // component.doLogout(); - // expect(authServiceStub.onLogout).toHaveBeenCalled(); - // }); - // }); }); diff --git a/pre-registration-ui/src/app/core/header/header.component.ts b/pre-registration-ui/src/app/core/header/header.component.ts index a1eb87ad..9a2a6b59 100644 --- a/pre-registration-ui/src/app/core/header/header.component.ts +++ b/pre-registration-ui/src/app/core/header/header.component.ts @@ -50,8 +50,8 @@ export class HeaderComponent implements OnInit, OnDestroy { ]); } - async doLogout() { - await this.showMessage(); + doLogout() { + this.showMessage(); } showMessage() { @@ -73,8 +73,8 @@ export class HeaderComponent implements OnInit, OnDestroy { data: data, }) .afterClosed() - .subscribe((response) => { - if (response === true) { + .subscribe((res) => { + if (res === true) { localStorage.removeItem("loggedOutLang"); localStorage.removeItem("loggedOut"); this.authService.onLogout(); diff --git a/pre-registration-ui/src/app/core/services/auto-logout.service.spec.ts b/pre-registration-ui/src/app/core/services/auto-logout.service.spec.ts index e1e46976..ef9bb646 100644 --- a/pre-registration-ui/src/app/core/services/auto-logout.service.spec.ts +++ b/pre-registration-ui/src/app/core/services/auto-logout.service.spec.ts @@ -1,4 +1,4 @@ -import { TestBed, ComponentFixture } from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; import { UserIdleService } from 'angular-user-idle'; import { MatDialog } from '@angular/material'; import { AutoLogoutService } from './auto-logout.service'; diff --git a/pre-registration-ui/src/app/core/services/auto-logout.service.ts b/pre-registration-ui/src/app/core/services/auto-logout.service.ts index ff097669..ffbda638 100644 --- a/pre-registration-ui/src/app/core/services/auto-logout.service.ts +++ b/pre-registration-ui/src/app/core/services/auto-logout.service.ts @@ -49,17 +49,10 @@ export class AutoLogoutService { * @memberof AutoLogoutService */ getValues(langCode) { - (this.idle = Number( - this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_idle) - )), - (this.timeout = Number( - this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_timeout) - )), - (this.ping = Number( - this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_ping) - )); - - this.dataStorageService + this.idle = Number(this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_idle)) + this.timeout = Number(this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_timeout)) + this.ping = Number(this.configservice.getConfigByKey(appConstants.CONFIG_KEYS.mosip_preregistration_auto_logout_ping)) + this.dataStorageService .getI18NLanguageFiles(langCode) .subscribe((response) => { this.languagelabels = response['autologout']; @@ -114,8 +107,12 @@ export class AutoLogoutService { } } }, - () => {}, - () => {} + () => { + // This is intentional + }, + () => { + // This is intentional + } ); this.userIdle.onTimeout().subscribe(() => { diff --git a/pre-registration-ui/src/app/core/services/data-storage.service.ts b/pre-registration-ui/src/app/core/services/data-storage.service.ts index 4b04709f..d31cc9fb 100644 --- a/pre-registration-ui/src/app/core/services/data-storage.service.ts +++ b/pre-registration-ui/src/app/core/services/data-storage.service.ts @@ -66,7 +66,6 @@ export class DataStorageService { appConstants.APPEND_URL.applicants + appConstants.APPENDER + preRegId; - //console.log("url>>>>" + url); return this.httpClient.get(url); } @@ -257,7 +256,6 @@ export class DataStorageService { "&pageSize=" + pageSize + "&orderBy=desc&sortBy=createdDateTime"; - //console.log(url); return this.httpClient.get(url); } @@ -282,7 +280,6 @@ export class DataStorageService { locCode + "/" + langCode; - //console.log(url); return this.httpClient.get(url); } @@ -379,8 +376,6 @@ export class DataStorageService { appConstants.PARAMS_KEYS.POA + "&sourcePreId=" + sourceId; - // const params = new URLSearchParams().set(appConstants.PARAMS_KEYS.catCode, appConstants.PARAMS_KEYS.POA); - // params.set(appConstants.PARAMS_KEYS.sourcePrId, sourceId); return this.httpClient.put(url, { observe: "body", @@ -443,7 +438,6 @@ export class DataStorageService { locationHierarchyCode: number, data: string[] ) { - //console.log(data); let url = this.BASE_URL + this.PRE_REG_URL + @@ -463,7 +457,6 @@ export class DataStorageService { if (url.charAt(url.length - 1) === "&") { url = url.substring(0, url.length - 1); } - //console.log(url); return this.httpClient.get(url); } @@ -513,7 +506,6 @@ export class DataStorageService { appConstants.APPEND_URL.validDocument + applicantCode + "/languages"; - //console.log(APPLICANT_VALID_DOCUMENTS_URL); return this.httpClient.get(APPLICANT_VALID_DOCUMENTS_URL, { params: new HttpParams().append( appConstants.PARAMS_KEYS.getDocumentCategories, @@ -528,8 +520,7 @@ export class DataStorageService { appConstants.APPEND_URL.location + appConstants.APPEND_URL.validDocument + applicantCode + - "/languages"; - //console.log(APPLICANT_VALID_DOCUMENTS_URL); + "/languages"; return this.httpClient.get(APPLICANT_VALID_DOCUMENTS_URL, { params: new HttpParams().append( appConstants.PARAMS_KEYS.getDocumentCategories, @@ -539,7 +530,6 @@ export class DataStorageService { } getConfig() { - // return this.httpClient.get('./assets/configs.json'); const url = this.BASE_URL + this.PRE_REG_URL + @@ -636,15 +626,12 @@ export class DataStorageService { } verifyGCaptcha(captcha) { - //console.log(captcha); - const headers = new HttpHeaders({ "Content-Type": "application/json" }); const url = this.BASE_URL + this.PRE_REG_URL + appConstants.APPEND_URL.captcha; return this.httpClient.post(url, captcha); } getIdentityJson() { - //const url = this.BASE_URL + this.PRE_REG_URL+ 'applications/config'; let url = this.BASE_URL + this.PRE_REG_URL + `uispec/latest`; return this.httpClient.get(url); } @@ -679,7 +666,6 @@ export class DataStorageService { "proxy" + appConstants.APPEND_URL.master_data + `dynamicfields?langCode=${langCode}`; - ////console.log(url); return this.httpClient.get(url); } @@ -690,7 +676,6 @@ export class DataStorageService { "proxy" + appConstants.APPEND_URL.master_data + `dynamicfields?pageNumber=${pageNumber}&pageSize=10`; - ////console.log(url); return this.httpClient.get(url); } @@ -709,7 +694,7 @@ export class DataStorageService { return this.httpClient.post(url, request); } - updateApplicationStatus(prid: String, statusCode: string) { + updateApplicationStatus(prid: string, statusCode: string) { const requesturl = this.BASE_URL + this.PRE_REG_URL + @@ -717,7 +702,7 @@ export class DataStorageService { return this.httpClient.put(requesturl, {}); } - getApplicationStatus(prid: String) { + getApplicationStatus(prid: string) { const requesturl = this.BASE_URL + this.PRE_REG_URL + `applications/prereg/status/${prid}`; return this.httpClient.get(requesturl); diff --git a/pre-registration-ui/src/app/core/services/registration.service.spec.ts b/pre-registration-ui/src/app/core/services/registration.service.spec.ts index 4ffb782e..8244447f 100644 --- a/pre-registration-ui/src/app/core/services/registration.service.spec.ts +++ b/pre-registration-ui/src/app/core/services/registration.service.spec.ts @@ -63,15 +63,6 @@ describe('RegistrationService', () => { expect(service.getUsers().length).toBe(0); })); - // it('gets the list of files of the user', inject([RegistrationService], (service: RegistrationService) => { - // const x = { - // files: ['hello.txt'] - // }; - // // service.addUser(x); - // const files = service.getUserFiles(0); - // expect(files).toBe(x.files); - // })); - it('sets and gets registration center ID', inject([RegistrationService], (service: RegistrationService) => { const x = '12345'; service.setRegCenterId(x); diff --git a/pre-registration-ui/src/app/feature/booking/booking.service.spec.ts b/pre-registration-ui/src/app/feature/booking/booking.service.spec.ts index c7766553..a67cd5ea 100644 --- a/pre-registration-ui/src/app/feature/booking/booking.service.spec.ts +++ b/pre-registration-ui/src/app/feature/booking/booking.service.spec.ts @@ -44,23 +44,6 @@ describe('BookingService', () => { expect(service.getNameList()[0]).toBe(x); })); - // it('adds and gets applicants', inject([BookingService], (service: BookingService) => { - // const user: NameList = { - // fullName: 'Agnitra', - // preRegId: '1234' - // }; - // const x = { - // response: [ - // { - // ...user - // } - // ] - // }; - // service.addApplicants(x); - // const c = service.getAllApplicants(); - // expect(c[0]).toBe(x.response[0]); - // })); - it('should reset the namelist', inject([BookingService], (service: BookingService) => { const x: NameList = { fullName: 'Agnitra', diff --git a/pre-registration-ui/src/app/feature/booking/booking.service.ts b/pre-registration-ui/src/app/feature/booking/booking.service.ts index f6ba8fd3..a0f44c36 100644 --- a/pre-registration-ui/src/app/feature/booking/booking.service.ts +++ b/pre-registration-ui/src/app/feature/booking/booking.service.ts @@ -14,7 +14,6 @@ export class BookingService { private registrationCenterCoordinatesList = new BehaviorSubject(Array); coordinatesList = this.registrationCenterCoordinatesList.asObservable(); - constructor() {} changeCoordinates(coordinates) { this.coordinatesSource.next(coordinates); diff --git a/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.css b/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.css index 3f9740b3..69164410 100644 --- a/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.css +++ b/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.css @@ -130,15 +130,6 @@ input[type="radio"] { display: flex; margin-bottom: 60px; } -.center-selection__button-container { - width: 100%; - position: fixed; - bottom: 0; - left: 0; - padding: 2px 2vw; - display: flex; - z-index: 22; -} .center_selection-intial-recommendation-container { display: flex; align-items: center; diff --git a/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.ts b/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.ts index d9b6cb33..503c6605 100644 --- a/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.ts +++ b/pre-registration-ui/src/app/feature/booking/center-selection/center-selection.component.ts @@ -12,8 +12,7 @@ import Utils from "src/app/app.util"; import { ConfigService } from "src/app/core/services/config.service"; import * as appConstants from "./../../../app.constants"; import { BookingDeactivateGuardService } from "src/app/shared/can-deactivate-guard/booking-guard/booking-deactivate-guard.service"; -import { Subscription } from "rxjs";; -import identityStubJson from "../../../../assets/identity-spec1.json"; +import { Subscription } from "rxjs"; @Component({ selector: "app-center-selection", @@ -142,7 +141,7 @@ export class CenterSelectionComponent ) ); }, - (error) => { + (err) => { this.dataService.getApplicationDetails(prid.toString()).subscribe((response) => { resolve( new UserModel( @@ -173,8 +172,6 @@ export class CenterSelectionComponent return new Promise((resolve, reject) => { this.dataService.getIdentityJson().subscribe( async (response) => { - //response = identityStubJson; - //console.log(identityStubJson); let identityJsonSpec = response[appConstants.RESPONSE]["jsonSpec"]["identity"]; this.identityData = identityJsonSpec["identity"]; @@ -188,7 +185,6 @@ export class CenterSelectionComponent } async getRecommendedCenters() { - //console.log("getRecommendedCenters"); this.totalItems = 0; this.nearbyClicked = false; let uiFieldName = null; @@ -196,7 +192,7 @@ export class CenterSelectionComponent if ( obj.inputRequired === true && obj.controlType !== null && - !(obj.controlType === "fileupload") + (obj.controlType !== "fileupload") ) { if (obj.locationHierarchyLevel && this.recommendedCenterLocCode == obj.locationHierarchyLevel) { uiFieldName = obj.id; @@ -210,12 +206,10 @@ export class CenterSelectionComponent this.users.forEach((user) => { console.log(user); if (user.request && user.request.demographicDetails && user.request.demographicDetails.identity) { - //console.log(typeof user.request.demographicDetails.identity[uiFieldName]); if ( typeof user.request.demographicDetails.identity[uiFieldName] === "object" ) { - //console.log(user.request.demographicDetails.identity[uiFieldName][0].value); this.locationCodes.push( user.request.demographicDetails.identity[uiFieldName][0].value ); @@ -223,7 +217,6 @@ export class CenterSelectionComponent typeof user.request.demographicDetails.identity[uiFieldName] === "string" ) { - //console.log(user.request.demographicDetails.identity[uiFieldName]); this.locationCodes.push( user.request.demographicDetails.identity[uiFieldName] ); @@ -242,7 +235,6 @@ export class CenterSelectionComponent resolve(true); } this.locationCodes.forEach(async (pins,index) => { - //console.log(pins); await this.getLocationNames(pins); if(index===this.locationCodes.length-1){ resolve(true); @@ -329,7 +321,6 @@ export class CenterSelectionComponent this.pageSize = pageEvent.pageSize; this.pageIndex = pageEvent.pageIndex; } - //console.log(this.locationType); const subs = this.dataService .getRegistrationCentersByNamePageWise( this.locationType.hierarchyLevel, @@ -353,7 +344,6 @@ export class CenterSelectionComponent this.showMessage = true; this.totalItems = 0; this.selectedCentre = null; - //this.showErrorMessage(error); }); this.subscriptions.push(subs); } else { @@ -364,11 +354,9 @@ export class CenterSelectionComponent } onChangeLocationType() { - //console.log('onChangeLocationType'); this.showMessage = false; this.totalItems = 0; this.searchText = ""; - //this.REGISTRATION_CENTRES = []; this.selectedCentre = null; } @@ -392,25 +380,20 @@ export class CenterSelectionComponent getLocation() { this.REGISTRATION_CENTRES = []; this.nearbyClicked = true; - //console.log(navigator.geolocation); if ("geolocation" in navigator) { this.showMap = false; this.positions = navigator.geolocation; this.positions.geolocation.getCurrentPosition((position) => { console.log(position.coords); - //this.searchClick = true; const subs = this.dataService .getNearbyRegistrationCenters(position.coords) .subscribe( (response) => { - //console.log(response[appConstants.RESPONSE]["registrationCenters"].length); if ( response[appConstants.RESPONSE]["registrationCenters"].length !== 0 ) { - //this.searchClick = false; this.displayResults(response[appConstants.RESPONSE]); } else { - //this.searchClick = false; this.showMessage = true; this.selectedCentre = null; } @@ -418,15 +401,13 @@ export class CenterSelectionComponent (error) => { this.showMessage = true; this.selectedCentre = null; - //this.showErrorMessage(error); }); this.subscriptions.push(subs); }); - } else { } } - changeTimeFormat(time: string): string | Number { + changeTimeFormat(time: string): string | number { let inputTime = time.split(":"); let formattedTime: any; if (Number(inputTime[0]) < 12 && Number(inputTime[0]) > 0) { @@ -445,7 +426,7 @@ export class CenterSelectionComponent return formattedTime; } - showTime(startTime: string, endTime: string): string | Number { + showTime(startTime: string, endTime: string): string | number { let formattedStartTime = this.changeTimeFormat(startTime); let formattedEndTime = this.changeTimeFormat(endTime); let formattedTime = formattedStartTime + ' - ' + formattedEndTime; diff --git a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.css b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.css index d1784625..b708155f 100644 --- a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.css +++ b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.css @@ -212,9 +212,7 @@ font-weight: 500; color: white; } -.circleBase { - border-radius: 10%; -} + .sizing { height: 130px; display: inline-block; @@ -312,6 +310,7 @@ .time-selection__name-list-header { min-height: 50px; padding: 5px; + width: 100%; } .time-selection__name-list-item { @@ -334,11 +333,6 @@ margin-top: 24px; } - .time-selection__name-list-header { - height: 70px; - width: 100%; - } - .user-back-btn, .user-book_later-btn, .user-continue-btn { diff --git a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.spec.ts b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.spec.ts index a0c637c5..ae9d7135 100644 --- a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.spec.ts +++ b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.spec.ts @@ -144,7 +144,6 @@ describe('TimeSelectionComponent', () => { component.names = name; component.dateSelected(0); fixture.detectChanges(); - // expect(component.enableBookButton).toBeTruthy(); }); it('should check enable bucket tabs', () => { diff --git a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.ts b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.ts index 12a110de..0efdb93a 100644 --- a/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.ts +++ b/pre-registration-ui/src/app/feature/booking/time-selection/time-selection.component.ts @@ -36,7 +36,7 @@ export class TimeSelectionComponent @ViewChild("widgetsContent", { read: ElementRef }) public widgetsContent; @ViewChild("cardsContent", { read: ElementRef }) public cardsContent; textDir = localStorage.getItem("dir"); - registrationCenter: String; + registrationCenter: string; selectedCard: number; selectedTile = 0; showNote = false; @@ -147,8 +147,7 @@ export class TimeSelectionComponent ) ); }, - (error) => { - //this.showErrorMessage(error); + (err) => { this.dataService.getApplicationDetails(prid.toString()).subscribe((response) => { resolve( new UserModel( @@ -270,8 +269,6 @@ export class TimeSelectionComponent dateSelected(index: number) { this.selectedTile = index; - // this.placeNamesInSlots(); - // this.cardSelected(0); } cardSelected(index: number): void { diff --git a/pre-registration-ui/src/app/feature/dashboard/dashboard/dashboard.component.ts b/pre-registration-ui/src/app/feature/dashboard/dashboard/dashboard.component.ts index 42081ea6..122df99f 100644 --- a/pre-registration-ui/src/app/feature/dashboard/dashboard/dashboard.component.ts +++ b/pre-registration-ui/src/app/feature/dashboard/dashboard/dashboard.component.ts @@ -66,8 +66,8 @@ export class DashBoardComponent implements OnInit, OnDestroy { locationHeirarchies: any[]; mandatoryLanguages: string[]; optionalLanguages: string[]; - minLanguage: Number; - maxLanguage: Number; + minLanguage: number; + maxLanguage: number; isNavigateToDemographic = false; appStatusCodes = appConstants.APPLICATION_STATUS_CODES; newPreRegApplication = appConstants.NEW_PREREGISTRATION; diff --git a/pre-registration-ui/src/app/feature/demographic/demographic/demographic.component.ts b/pre-registration-ui/src/app/feature/demographic/demographic/demographic.component.ts index 635051eb..147afce8 100644 --- a/pre-registration-ui/src/app/feature/demographic/demographic/demographic.component.ts +++ b/pre-registration-ui/src/app/feature/demographic/demographic/demographic.component.ts @@ -2158,7 +2158,7 @@ export class DemographicComponent } } - openLangSelectionPopup(mandatoryLanguages: string[], minLanguage: Number, maxLanguage: Number) { + openLangSelectionPopup(mandatoryLanguages: string[], minLanguage: number, maxLanguage: number) { return new Promise((resolve) => { const popupAttributes = Utils.getLangSelectionPopupAttributes(this.userPrefLanguageDir, this.dataCaptureLabels, mandatoryLanguages, minLanguage, maxLanguage, this.userPrefLanguage); diff --git a/pre-registration-ui/src/app/feature/summary/preview/preview.component.ts b/pre-registration-ui/src/app/feature/summary/preview/preview.component.ts index 3757c3c5..1b5ea84e 100644 --- a/pre-registration-ui/src/app/feature/summary/preview/preview.component.ts +++ b/pre-registration-ui/src/app/feature/summary/preview/preview.component.ts @@ -609,7 +609,7 @@ export class PreviewComponent implements OnInit { } } - openLangSelectionPopup(mandatoryLanguages: string[], minLanguage: Number, maxLanguage: Number) { + openLangSelectionPopup(mandatoryLanguages: string[], minLanguage: number, maxLanguage: number) { return new Promise((resolve) => { const popupAttributes = Utils.getLangSelectionPopupAttributes(this.dataCaptureLangsDir[0], this.dataCaptureLabels, mandatoryLanguages, minLanguage, maxLanguage, this.userPrefLanguage);