diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 991a4490..14dcce95 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -72,10 +72,6 @@ export class AppComponent implements OnInit { this.refreshApi.stopInterval(); let info = ev.value as LoginInfo; - console.log('STARTING INTERVAL') - console.log(info.expire) - console.log(((info.expire - moment().unix()) - 4)) - this.refreshApi.startInterval(((info.expire - moment().unix())-4)*1000, ev); initFlowbite(); //this.refreshApi.startInterval(3000, ev.value); @@ -90,8 +86,6 @@ export class AppComponent implements OnInit { else if (((aux.expire - moment().unix())-4) > 0) { this.refreshApi.stopInterval(); this.refreshApi.startInterval(((aux.expire - moment().unix())-4)*1000, aux); - console.log('token') - console.log(aux.token) initFlowbite(); } this.router.events.subscribe(event => { diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index e21c1483..5240e6e9 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -92,15 +92,8 @@ export class DashboardComponent implements OnInit, OnDestroy { this.startTagTransition(); }) this.isFilterPanelShown = JSON.parse(this.localStorage.getItem('is_filter_panel_shown') as string); - //this.route.snapshot.paramMap.get('id'); - console.log('--- route data') - console.log(this.route.queryParams) - console.log(this.route.snapshot.queryParamMap.get('token')) if(this.route.snapshot.queryParamMap.get('token') != null){ this.loginService.getLogin(this.route.snapshot.queryParamMap.get('token')).then(data => { - console.log('---- loginangular response ----') - console.log(data) - console.log(data.username) let info = { "id": data.id, "user": data.username, @@ -120,30 +113,20 @@ export class DashboardComponent implements OnInit, OnDestroy { this.localStorage.addLoginInfo(info); this.eventMessage.emitLogin(info); initFlowbite(); - console.log('----') //this.refreshApi.stopInterval(); //this.refreshApi.startInterval(((data.expire - moment().unix())-4)*1000, data); //this.refreshApi.startInterval(3000, data); }) this.router.navigate(['/dashboard']) } else { - console.log('sin token') //this.localStorage.clear() let aux = this.localStorage.getObject('login_items') as LoginInfo; - if (JSON.stringify(aux) != '{}') { - console.log(aux) - console.log('moment') - console.log(aux['expire']) - console.log(moment().unix()) - console.log(aux['expire'] - moment().unix()) - console.log(aux['expire'] - moment().unix() <= 5) - } + // keep stored session data if present } this.showContact = true; this.cdr.detectChanges(); - console.log('----') } ngOnDestroy(): void { diff --git a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts index 3854f869..cc5c9374 100644 --- a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts +++ b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts @@ -178,8 +178,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { getProfile(){ this.contactmediums=[]; this.accountService.getOrgInfo(this.partyId).then(data=> { - console.log('--org info--') - console.log(data) this.profile=data; this.loadProfileData(this.profile) this.loading=false; @@ -217,7 +215,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { }) } for(let i=0; i { this.profileForm.reset(); @@ -272,7 +267,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { error: error => { console.error('There was an error while updating!', error); if(error.error.error){ - console.log(error) this.errorMessage='Error: '+error.error.error; } else { this.errorMessage='There was an error while updating profile!'; @@ -349,7 +343,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { const phoneNumber = parsePhoneNumber(this.phonePrefix.code + this.mediumForm.value.telephoneNumber); if (phoneNumber) { if (!phoneNumber.isValid()) { - console.log('NUMERO INVALIDO') this.mediumForm.controls['telephoneNumber'].setErrors({'invalidPhoneNumber': true}); this.toastVisibility = true; setTimeout(() => { @@ -415,7 +408,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } } this.mediumForm.reset(); - console.log(this.contactmediums) } removeMedium(medium:any){ @@ -477,7 +469,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { const phoneNumber = parsePhoneNumber(this.phonePrefix.code + this.mediumForm.value.telephoneNumber); if (phoneNumber) { if (!phoneNumber.isValid()) { - console.log('NUMERO INVALIDO') this.mediumForm.controls['telephoneNumber'].setErrors({'invalidPhoneNumber': true}); this.toastVisibility = true; setTimeout(() => { @@ -541,7 +532,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } selectPrefix(pref:any) { - console.log(pref) this.prefixCheck = false; this.phonePrefix = pref; } @@ -614,32 +604,22 @@ export class OrgInfoComponent implements OnInit, OnDestroy { this.mediumForm.get('telephoneNumber')?.setValue(''); this.cdr.detectChanges(); } - console.log(this.mediumForm) - console.log(this.printAllActiveValidators()); } showMedium(){ - console.log('--- SHOW MEDIUM') - console.log(this.mediumForm) - console.log(this.printAllActiveValidators()); - console.log('--value') - console.log(this.mediumForm.get('email')?.value) } printActiveValidators(controlName: string) { const control = this.mediumForm.get(controlName); if (!control || !control.validator) { - console.log(`No active validators for ${controlName}`); return; } const validatorFn = control.validator({} as AbstractControl); if (!validatorFn) { - console.log(`No active validators for ${controlName}`); return; } - console.log(`Active validators for ${controlName}:`, Object.keys(validatorFn)); } printAllActiveValidators() { @@ -658,14 +638,11 @@ export class OrgInfoComponent implements OnInit, OnDestroy { if (droppedFile.fileEntry.isFile) { const fileEntry = droppedFile.fileEntry as FileSystemFileEntry; fileEntry.file((file: File) => { - console.log('dropped') if (file) { const reader = new FileReader(); reader.onload = (e: any) => { const base64String: string = e.target.result.split(',')[1]; - console.log('BASE 64....') - console.log(base64String); // You can use this base64 string as needed let fileBody = { content: { name: 'orglogo'+file.name, @@ -695,7 +672,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } this.attachmentService.uploadFile(fileBody).subscribe({ next: data => { - console.log(data) if(sel=='img'){ if(file.type.startsWith("image")){ this.showImgPreview=true; @@ -709,12 +685,10 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } } this.cdr.detectChanges(); - console.log('uploaded') }, error: error => { console.error('There was an error while uploading!', error); if(error.error.error){ - console.log(error) this.errorMessage='Error: '+error.error.error; } else { this.errorMessage='There was an error while uploading the file!'; @@ -736,7 +710,6 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } else { // It was a directory (empty directories are added, otherwise only files) const fileEntry = droppedFile.fileEntry as FileSystemDirectoryEntry; - console.log(droppedFile.relativePath, fileEntry); } } } @@ -746,12 +719,9 @@ export class OrgInfoComponent implements OnInit, OnDestroy { } public fileOver(event: any){ - console.log(event); } public fileLeave(event: any){ - console.log('leave') - console.log(event); } saveImgFromURL(){ diff --git a/src/app/pages/user-profile/profile-sections/user-info/user-info.component.ts b/src/app/pages/user-profile/profile-sections/user-info/user-info.component.ts index cc3c6544..00ef803f 100644 --- a/src/app/pages/user-profile/profile-sections/user-info/user-info.component.ts +++ b/src/app/pages/user-profile/profile-sections/user-info/user-info.component.ts @@ -82,10 +82,7 @@ export class UserInfoComponent implements OnInit, OnDestroy { } else { let loggedOrg = aux.organizations.find((element: { id: any; }) => element.id == aux.logged_as) this.partyId = loggedOrg.partyId - console.log(aux.organizations) this.accountService.getOrgInfo(this.partyId).then(data=> { - console.log('org') - console.log(data) }) } this.token=aux.token; @@ -98,7 +95,6 @@ export class UserInfoComponent implements OnInit, OnDestroy { getProfile(){ this.accountService.getUserInfo(this.partyId).then(data=> { - console.log(data) this.profile=data; this.loadProfileData(this.profile) this.loading=false; @@ -122,8 +118,7 @@ export class UserInfoComponent implements OnInit, OnDestroy { "placeOfBirth": this.userProfileForm.value.city, "title": this.userProfileForm.value.treatment, "birthDate": this.userProfileForm.value.birthdate - } - console.log(profile) + } this.accountService.updateUserInfo(this.partyId,profile).subscribe({ next: data => { this.userProfileForm.reset(); diff --git a/src/app/pages/user-profile/user-profile.component.ts b/src/app/pages/user-profile/user-profile.component.ts index 475f0028..e6d63a94 100644 --- a/src/app/pages/user-profile/user-profile.component.ts +++ b/src/app/pages/user-profile/user-profile.component.ts @@ -213,8 +213,6 @@ export class UserProfileComponent implements OnInit, OnDestroy { if(elem != null){ if(elem.className.match(cls)){ this.removeClass(elem,cls) - } else { - console.log('already unselected') } } } @@ -222,7 +220,6 @@ export class UserProfileComponent implements OnInit, OnDestroy { selectMenu(elem:HTMLElement| null,cls:string){ if(elem != null){ if(elem.className.match(cls)){ - console.log('already selected') } else { this.addClass(elem,cls) } diff --git a/src/app/services/event-message.service.ts b/src/app/services/event-message.service.ts index fb82fa60..984cf264 100644 --- a/src/app/services/event-message.service.ts +++ b/src/app/services/event-message.service.ts @@ -126,14 +126,10 @@ export class EventMessageService { } emitCategoryAdded(cat:Category){ - console.log('event emitter category') - console.log(cat) this.eventMessageSubject.next({ type: 'CategoryAdded', value: cat }); } emitChangedSession(session:any){ - console.log('event eChangedSession') - console.log(session) this.eventMessageSubject.next({ type: 'ChangedSession', value: session }); } diff --git a/src/app/services/refresh-login-service.service.ts b/src/app/services/refresh-login-service.service.ts index 85d39514..c1fe5a15 100644 --- a/src/app/services/refresh-login-service.service.ts +++ b/src/app/services/refresh-login-service.service.ts @@ -25,20 +25,8 @@ export class RefreshLoginServiceService { startInterval(intervalDuration: number, data:any): void { this.intervalObservable = interval(intervalDuration); - console.log('start interval') - console.log(intervalDuration) - this.intervalSubscription = this.intervalObservable.subscribe(() => { - console.log('login subscription') - console.log(data.expire - moment().unix()) - console.log(data.expire - moment().unix() <= 5) - console.log((data.expire - moment().unix()) - 5) - let aux = this.localStorage.getObject('login_items') as LoginInfo; - - console.log('usuario antes') - console.log(aux) - this.api.getLogin(aux['token']).then(refreshed => { this.stopInterval() @@ -54,9 +42,6 @@ export class RefreshLoginServiceService { "logged_as": aux['logged_as'] }); - console.log('usuario despues') - console.log(this.localStorage.getObject('login_items') as LoginInfo) - // Start the interval only if the token has been really refreshed // Otherwise close the session if (refreshed.expire > moment().unix() + 4) { @@ -65,16 +50,11 @@ export class RefreshLoginServiceService { this.stopInterval(); this.localStorage.setObject('login_items',{}); this.api.logout().catch((err) => { - console.log('Something happened') - console.log(err) }) this.router.navigate(['/dashboard']).then(() => { - console.log('LOGOUT MADE') window.location.reload() }).catch((err) => { - console.log('Something happened router') - console.log(err) }) } }) @@ -83,7 +63,6 @@ export class RefreshLoginServiceService { stopInterval(): void { if (this.intervalSubscription) { - console.log('stop interval') this.intervalSubscription.unsubscribe(); } } diff --git a/src/app/shared/header/header.component.ts b/src/app/shared/header/header.component.ts index 3f8286fa..56b1c9ab 100644 --- a/src/app/shared/header/header.component.ts +++ b/src/app/shared/header/header.component.ts @@ -185,13 +185,10 @@ export class HeaderComponent implements OnInit, AfterViewInit, DoCheck, OnDestro let aux = this.localStorage.getObject('login_items') as LoginInfo; - console.log('aux: ' + aux) if(JSON.stringify(aux) != '{}' && (((aux.expire - moment().unix())-4) > 0)) { this.loginInfo=aux; this.is_logged=true; this.orgs=aux.organizations; - console.log('--roles') - console.log(aux.roles) for(let i=0; i < aux.roles.length; i++){ if(aux.roles[i].name == environment.ADMIN_ROLE){ this.isAdmin=true; @@ -205,11 +202,8 @@ export class HeaderComponent implements OnInit, AfterViewInit, DoCheck, OnDestro for(let i=0;i element.id == aux.logged_as) - console.log('loggedOrg') - console.log(loggedOrg) this.loggedAsOrg=true; this.username=loggedOrg.name; this.usercharacters=(loggedOrg.name.slice(0, 2)).toUpperCase(); @@ -217,7 +211,6 @@ export class HeaderComponent implements OnInit, AfterViewInit, DoCheck, OnDestro for(let i=0;i element.id == aux.logged_as) - console.log('loggedOrg') - console.log(loggedOrg) this.loggedAsOrg=true; this.username=loggedOrg.name; this.usercharacters=(loggedOrg.name.slice(0, 2)).toUpperCase(); @@ -328,7 +319,6 @@ export class HeaderComponent implements OnInit, AfterViewInit, DoCheck, OnDestro } async toggleLogin(){ - console.log('login') this.showLogin=true; //this.api.getLogin() //await (window.location.href='http://localhost:8004/login'); @@ -437,7 +427,6 @@ export class HeaderComponent implements OnInit, AfterViewInit, DoCheck, OnDestro // Get the final URL string let finalUrl = newUrl.toString(); - console.group(finalUrl) verifierUrl = `${verifierUrl}&client_callback=${finalUrl}` this.qrWindow = this.qrVerifier.launchPopup(verifierUrl, 'Scan QR code', 500, 500);