From f78c535530fd3ea6244159de4bb9d7493d83c90c Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 10 Jan 2020 22:33:45 +0100 Subject: [PATCH] removed console.logs --- src/app/components/feed/feed.component.ts | 6 ------ src/app/components/login/login.component.ts | 4 ---- src/app/components/profile/profile.component.ts | 2 -- src/app/components/social/friends/friends.component.ts | 1 - src/app/services/chat/chat.service.ts | 5 ----- src/app/services/datasharing.service.ts | 1 - src/app/services/feed/feed.service.ts | 4 +--- src/app/services/group/group.service.ts | 3 --- src/app/services/login/login.service.ts | 3 --- src/app/services/profile/profile.service.ts | 2 -- src/app/services/selfservice/self.service.ts | 8 -------- 11 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 4395115..ef80553 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -34,7 +34,6 @@ export class FeedComponent implements OnInit { ngOnInit() { this.data.currentUserInfo.subscribe(user => { - console.log('feed got new user'); this.user = user; this.loggedIn = user.loggedIn; if (this.loggedIn) { @@ -44,7 +43,6 @@ export class FeedComponent implements OnInit { this.feedNew = this.feedService.renderAllPosts(response.json()); this.parentSelectedPostList = this.feedNew; this.feedMostLiked = this.feedNew; - console.log(this.feedNew); }); } else { this.feedService.getAllPostsRaw().subscribe(response => { @@ -52,7 +50,6 @@ export class FeedComponent implements OnInit { this.feedNew = this.feedService.renderAllPosts(response.json()); this.parentSelectedPostList = this.feedNew; this.feedMostLiked = this.feedNew; - console.log(this.feedNew); }); } }); @@ -69,7 +66,6 @@ export class FeedComponent implements OnInit { } showNew() { - console.log('showNew()'); this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedNew = this.feedService.renderAllPosts(response.json()); this.parentSelectedPostList = this.feedNew; }); @@ -78,7 +74,6 @@ export class FeedComponent implements OnInit { } showMostLiked() { - console.log('showMostLiked()'); this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedMostLiked = this.feedService.renderAllPosts(response.json()); this.parentSelectedPostList = this.feedMostLiked; }); @@ -90,7 +85,6 @@ export class FeedComponent implements OnInit { refresh($event) { this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.parentSelectedPostList = this.feedService.renderAllPosts(response.json()); - console.log('Refresh'); }); } diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index c3f9fc0..f7545d1 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -26,19 +26,15 @@ export class LoginComponent implements OnInit { } public loginError(error: any) { - console.log(error.errors[0].message); this.errorOccurred = true; this.errorMessage = error.errors[0].message; } onClickSubmit(pEmail: string, pPasswordHash: string) { - console.log('try to login with mail adress:' + pEmail); this.errorOccurred = false; this.errorMessage = ' '; this.login.email = pEmail.trim().toLowerCase(); this.login.passwordHash = sha512.sha512(pPasswordHash); - console.log(this.login.email); - this.loginService.login(this.login, error => this.loginError(error.json())); } diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 77dbab9..03fc377 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -8,7 +8,6 @@ import {MatTableDataSource} from '@angular/material/table'; import { RequestService } from 'src/app/services/request/request.service'; import { DatasharingService } from '../../services/datasharing.service'; import { ProfileService } from 'src/app/services/profile/profile.service'; -import { runInThisContext } from 'vm'; @Component({ selector: 'app-profile', @@ -43,7 +42,6 @@ export class ProfileComponent implements OnInit { const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); if (this.id !== possibleID && this.id && this.router.url.includes('profile/')) { // reload the user - console.log('search for user id: ' + this.router.url.substr(this.router.url.lastIndexOf('/') + 1)); this.ngOnInit(); } } diff --git a/src/app/components/social/friends/friends.component.ts b/src/app/components/social/friends/friends.component.ts index f0474af..cf2b0e4 100644 --- a/src/app/components/social/friends/friends.component.ts +++ b/src/app/components/social/friends/friends.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from '@angular/core'; import { DatasharingService } from 'src/app/services/datasharing.service'; -import { Http } from '@angular/http'; import { FriendInfo } from 'src/app/models/friendinfo'; import { Router } from '@angular/router'; import { User } from 'src/app/models/user'; diff --git a/src/app/services/chat/chat.service.ts b/src/app/services/chat/chat.service.ts index 315c532..c16ece1 100644 --- a/src/app/services/chat/chat.service.ts +++ b/src/app/services/chat/chat.service.ts @@ -22,7 +22,6 @@ export class ChatService { } public getAllChats(): Array { - console.log('Getting all chats ..'); const url = environment.graphQLUrl; const headers = new Headers(); @@ -36,7 +35,6 @@ export class ChatService { } public getAllChatsRaw(): any { - console.log('Getting all chats ..'); const url = 'https://greenvironment.net/graphql'; const headers = new Headers(); @@ -47,7 +45,6 @@ export class ChatService { public getChatsByID(pChatIDs: number[]): Array { this.chats = []; - console.log('Getting chats by ID..'); for (const chatId of pChatIDs) { const url = environment.graphQLUrl; @@ -64,7 +61,6 @@ export class ChatService { } public getChatsByIDRaw(pChatIDs: number[]): any { - console.log('Getting chats by ID..'); for (const chatId of pChatIDs) { const url = 'https://greenvironment.net/graphql'; @@ -140,7 +136,6 @@ export class ChatService { headers.set('Content-Type', 'application/json'); this.http.post(url, this.getBodyForGetMessagesInChat(pChatID)).subscribe(response => { - console.log('Downloading messages ...'); messages = this.renderMessages(response.json()); }); return messages; diff --git a/src/app/services/datasharing.service.ts b/src/app/services/datasharing.service.ts index 690b314..92cf5b8 100644 --- a/src/app/services/datasharing.service.ts +++ b/src/app/services/datasharing.service.ts @@ -15,7 +15,6 @@ export class DatasharingService { constructor() { } changeUserInfo(pUserInfo: User) { - console.log('DatasharingService: user info updated'); this.userInfoSource.next(pUserInfo); } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index c558f0a..f261df2 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -25,7 +25,7 @@ export class FeedService { }}; this.http.post(url, body).subscribe(response => { - console.log(response.text()); }); + }); } public upvote(pPostID: number): any { @@ -80,7 +80,6 @@ export class FeedService { this.http.post(url, this.getBodyForGetAllPosts()) .subscribe(response => { this.posts = this.renderAllPosts(response.json()); - console.log(response); }); return this.posts; } @@ -93,7 +92,6 @@ export class FeedService { this.http.post(url, this.getBodyForGetAllPostsByUserId(userId)) .subscribe(response => { this.posts = this.renderAllPosts(response.json()); - console.log(response); }); return this.posts; } diff --git a/src/app/services/group/group.service.ts b/src/app/services/group/group.service.ts index 78e7c27..6a0adea 100644 --- a/src/app/services/group/group.service.ts +++ b/src/app/services/group/group.service.ts @@ -43,8 +43,6 @@ export class GroupService { } public renderGroup(response: any): Group { - console.log(response); - console.log(response.data.getGroup.creator.id); const group = new Group(); const members: User[] = new Array(); const admins: User[] = new Array(); @@ -70,7 +68,6 @@ export class GroupService { admins.push(user); } group.admins = admins; - console.log(group); return group; } return null; diff --git a/src/app/services/login/login.service.ts b/src/app/services/login/login.service.ts index f11d13c..8cf7660 100644 --- a/src/app/services/login/login.service.ts +++ b/src/app/services/login/login.service.ts @@ -24,7 +24,6 @@ export class LoginService { return this.http.post(environment.graphQLUrl, this.buildJson(login)) .subscribe(response => { - console.log(response.text()); this.loginSuccess(); this.updateUserInfo(response.json()); }, errorCb @@ -32,7 +31,6 @@ export class LoginService { } public loginSuccess() { - console.log('alles supi dupi'); this.router.navigateByUrl(''); } @@ -50,7 +48,6 @@ export class LoginService { user.friends.push(new FriendInfo(friend.id, friend.name, friend.level)); } for (const group of response.data.login.groups) { - console.log(group.name); user.groups.push(new GroupInfo(group.id, group.name)); } user.chatIDs = response.data.login.chats; diff --git a/src/app/services/profile/profile.service.ts b/src/app/services/profile/profile.service.ts index ecd1986..f130b6f 100644 --- a/src/app/services/profile/profile.service.ts +++ b/src/app/services/profile/profile.service.ts @@ -110,7 +110,6 @@ export class ProfileService { } public renderProfile(response: any): User { - console.log(response); const posts = new Array(); const profile = new User(); if (response.data.getUser != null) { @@ -139,7 +138,6 @@ export class ProfileService { posts.push(new Post(id, content, htmlContent, upvotes, downvotes, userVote, deletable, pdate, author)); } profile.posts = posts; - console.log(profile); return profile; } return null; diff --git a/src/app/services/selfservice/self.service.ts b/src/app/services/selfservice/self.service.ts index f5fa47f..2d78d75 100644 --- a/src/app/services/selfservice/self.service.ts +++ b/src/app/services/selfservice/self.service.ts @@ -18,31 +18,24 @@ export class SelfService { constructor(private http: Http, private data: DatasharingService, private router: Router) { } public checkIfLoggedIn() { - console.log('check if logged in...'); - const url = environment.graphQLUrl; - const headers = new Headers(); headers.set('Content-Type', 'application/json'); return this.http.post(url, this.buildJson()) .subscribe(response => { - console.log(response.text()); this.stillLoggedIn(); this.updateUserInfo(response.json()); }, error => { this.notLoggedIn(); - console.log(error.text()); // this.fakeLogin(); } ); } public stillLoggedIn() { - console.log('user was logged in'); } public notLoggedIn() { - console.log('user was not logged in'); } public updateUserInfo(response: any) { @@ -59,7 +52,6 @@ export class SelfService { user.friends.push(new FriendInfo(friend.id, friend.name, friend.level)); } for (const group of response.data.getSelf.groups) { - console.log(group.name); user.groups.push(new GroupInfo(group.id, group.name)); } user.chatIDs = response.data.getSelf.chats;