removed console.logs

master
Max 5 years ago
parent ccdf161a46
commit f78c535530

@ -34,7 +34,6 @@ export class FeedComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.data.currentUserInfo.subscribe(user => { this.data.currentUserInfo.subscribe(user => {
console.log('feed got new user');
this.user = user; this.user = user;
this.loggedIn = user.loggedIn; this.loggedIn = user.loggedIn;
if (this.loggedIn) { if (this.loggedIn) {
@ -44,7 +43,6 @@ export class FeedComponent implements OnInit {
this.feedNew = this.feedService.renderAllPosts(response.json()); this.feedNew = this.feedService.renderAllPosts(response.json());
this.parentSelectedPostList = this.feedNew; this.parentSelectedPostList = this.feedNew;
this.feedMostLiked = this.feedNew; this.feedMostLiked = this.feedNew;
console.log(this.feedNew);
}); });
} else { } else {
this.feedService.getAllPostsRaw().subscribe(response => { this.feedService.getAllPostsRaw().subscribe(response => {
@ -52,7 +50,6 @@ export class FeedComponent implements OnInit {
this.feedNew = this.feedService.renderAllPosts(response.json()); this.feedNew = this.feedService.renderAllPosts(response.json());
this.parentSelectedPostList = this.feedNew; this.parentSelectedPostList = this.feedNew;
this.feedMostLiked = this.feedNew; this.feedMostLiked = this.feedNew;
console.log(this.feedNew);
}); });
} }
}); });
@ -69,7 +66,6 @@ export class FeedComponent implements OnInit {
} }
showNew() { showNew() {
console.log('showNew()');
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
this.feedNew = this.feedService.renderAllPosts(response.json()); this.feedNew = this.feedService.renderAllPosts(response.json());
this.parentSelectedPostList = this.feedNew; }); this.parentSelectedPostList = this.feedNew; });
@ -78,7 +74,6 @@ export class FeedComponent implements OnInit {
} }
showMostLiked() { showMostLiked() {
console.log('showMostLiked()');
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
this.feedMostLiked = this.feedService.renderAllPosts(response.json()); this.feedMostLiked = this.feedService.renderAllPosts(response.json());
this.parentSelectedPostList = this.feedMostLiked; }); this.parentSelectedPostList = this.feedMostLiked; });
@ -90,7 +85,6 @@ export class FeedComponent implements OnInit {
refresh($event) { refresh($event) {
this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => { this.feedService.getAllPostsRawByUserId(this.userId).subscribe(response => {
this.parentSelectedPostList = this.feedService.renderAllPosts(response.json()); this.parentSelectedPostList = this.feedService.renderAllPosts(response.json());
console.log('Refresh');
}); });
} }

@ -26,19 +26,15 @@ export class LoginComponent implements OnInit {
} }
public loginError(error: any) { public loginError(error: any) {
console.log(error.errors[0].message);
this.errorOccurred = true; this.errorOccurred = true;
this.errorMessage = error.errors[0].message; this.errorMessage = error.errors[0].message;
} }
onClickSubmit(pEmail: string, pPasswordHash: string) { onClickSubmit(pEmail: string, pPasswordHash: string) {
console.log('try to login with mail adress:' + pEmail);
this.errorOccurred = false; this.errorOccurred = false;
this.errorMessage = ' '; this.errorMessage = ' ';
this.login.email = pEmail.trim().toLowerCase(); this.login.email = pEmail.trim().toLowerCase();
this.login.passwordHash = sha512.sha512(pPasswordHash); this.login.passwordHash = sha512.sha512(pPasswordHash);
console.log(this.login.email);
this.loginService.login(this.login, error => this.loginError(error.json())); this.loginService.login(this.login, error => this.loginError(error.json()));
} }

@ -8,7 +8,6 @@ import {MatTableDataSource} from '@angular/material/table';
import { RequestService } from 'src/app/services/request/request.service'; import { RequestService } from 'src/app/services/request/request.service';
import { DatasharingService } from '../../services/datasharing.service'; import { DatasharingService } from '../../services/datasharing.service';
import { ProfileService } from 'src/app/services/profile/profile.service'; import { ProfileService } from 'src/app/services/profile/profile.service';
import { runInThisContext } from 'vm';
@Component({ @Component({
selector: 'app-profile', selector: 'app-profile',
@ -43,7 +42,6 @@ export class ProfileComponent implements OnInit {
const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1);
if (this.id !== possibleID && this.id && this.router.url.includes('profile/')) { if (this.id !== possibleID && this.id && this.router.url.includes('profile/')) {
// reload the user // reload the user
console.log('search for user id: ' + this.router.url.substr(this.router.url.lastIndexOf('/') + 1));
this.ngOnInit(); this.ngOnInit();
} }
} }

@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { DatasharingService } from 'src/app/services/datasharing.service'; import { DatasharingService } from 'src/app/services/datasharing.service';
import { Http } from '@angular/http';
import { FriendInfo } from 'src/app/models/friendinfo'; import { FriendInfo } from 'src/app/models/friendinfo';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { User } from 'src/app/models/user'; import { User } from 'src/app/models/user';

@ -22,7 +22,6 @@ export class ChatService {
} }
public getAllChats(): Array<Chat> { public getAllChats(): Array<Chat> {
console.log('Getting all chats ..');
const url = environment.graphQLUrl; const url = environment.graphQLUrl;
const headers = new Headers(); const headers = new Headers();
@ -36,7 +35,6 @@ export class ChatService {
} }
public getAllChatsRaw(): any { public getAllChatsRaw(): any {
console.log('Getting all chats ..');
const url = 'https://greenvironment.net/graphql'; const url = 'https://greenvironment.net/graphql';
const headers = new Headers(); const headers = new Headers();
@ -47,7 +45,6 @@ export class ChatService {
public getChatsByID(pChatIDs: number[]): Array<Chat> { public getChatsByID(pChatIDs: number[]): Array<Chat> {
this.chats = []; this.chats = [];
console.log('Getting chats by ID..');
for (const chatId of pChatIDs) { for (const chatId of pChatIDs) {
const url = environment.graphQLUrl; const url = environment.graphQLUrl;
@ -64,7 +61,6 @@ export class ChatService {
} }
public getChatsByIDRaw(pChatIDs: number[]): any { public getChatsByIDRaw(pChatIDs: number[]): any {
console.log('Getting chats by ID..');
for (const chatId of pChatIDs) { for (const chatId of pChatIDs) {
const url = 'https://greenvironment.net/graphql'; const url = 'https://greenvironment.net/graphql';
@ -140,7 +136,6 @@ export class ChatService {
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
this.http.post(url, this.getBodyForGetMessagesInChat(pChatID)).subscribe(response => { this.http.post(url, this.getBodyForGetMessagesInChat(pChatID)).subscribe(response => {
console.log('Downloading messages ...');
messages = this.renderMessages(response.json()); messages = this.renderMessages(response.json());
}); });
return messages; return messages;

@ -15,7 +15,6 @@ export class DatasharingService {
constructor() { } constructor() { }
changeUserInfo(pUserInfo: User) { changeUserInfo(pUserInfo: User) {
console.log('DatasharingService: user info updated');
this.userInfoSource.next(pUserInfo); this.userInfoSource.next(pUserInfo);
} }

@ -25,7 +25,7 @@ export class FeedService {
}}; }};
this.http.post(url, body).subscribe(response => { this.http.post(url, body).subscribe(response => {
console.log(response.text()); }); });
} }
public upvote(pPostID: number): any { public upvote(pPostID: number): any {
@ -80,7 +80,6 @@ export class FeedService {
this.http.post(url, this.getBodyForGetAllPosts()) this.http.post(url, this.getBodyForGetAllPosts())
.subscribe(response => { .subscribe(response => {
this.posts = this.renderAllPosts(response.json()); this.posts = this.renderAllPosts(response.json());
console.log(response);
}); });
return this.posts; return this.posts;
} }
@ -93,7 +92,6 @@ export class FeedService {
this.http.post(url, this.getBodyForGetAllPostsByUserId(userId)) this.http.post(url, this.getBodyForGetAllPostsByUserId(userId))
.subscribe(response => { .subscribe(response => {
this.posts = this.renderAllPosts(response.json()); this.posts = this.renderAllPosts(response.json());
console.log(response);
}); });
return this.posts; return this.posts;
} }

@ -43,8 +43,6 @@ export class GroupService {
} }
public renderGroup(response: any): Group { public renderGroup(response: any): Group {
console.log(response);
console.log(response.data.getGroup.creator.id);
const group = new Group(); const group = new Group();
const members: User[] = new Array(); const members: User[] = new Array();
const admins: User[] = new Array(); const admins: User[] = new Array();
@ -70,7 +68,6 @@ export class GroupService {
admins.push(user); admins.push(user);
} }
group.admins = admins; group.admins = admins;
console.log(group);
return group; return group;
} }
return null; return null;

@ -24,7 +24,6 @@ export class LoginService {
return this.http.post(environment.graphQLUrl, this.buildJson(login)) return this.http.post(environment.graphQLUrl, this.buildJson(login))
.subscribe(response => { .subscribe(response => {
console.log(response.text());
this.loginSuccess(); this.loginSuccess();
this.updateUserInfo(response.json()); this.updateUserInfo(response.json());
}, errorCb }, errorCb
@ -32,7 +31,6 @@ export class LoginService {
} }
public loginSuccess() { public loginSuccess() {
console.log('alles supi dupi');
this.router.navigateByUrl(''); this.router.navigateByUrl('');
} }
@ -50,7 +48,6 @@ export class LoginService {
user.friends.push(new FriendInfo(friend.id, friend.name, friend.level)); user.friends.push(new FriendInfo(friend.id, friend.name, friend.level));
} }
for (const group of response.data.login.groups) { for (const group of response.data.login.groups) {
console.log(group.name);
user.groups.push(new GroupInfo(group.id, group.name)); user.groups.push(new GroupInfo(group.id, group.name));
} }
user.chatIDs = response.data.login.chats; user.chatIDs = response.data.login.chats;

@ -110,7 +110,6 @@ export class ProfileService {
} }
public renderProfile(response: any): User { public renderProfile(response: any): User {
console.log(response);
const posts = new Array<Post>(); const posts = new Array<Post>();
const profile = new User(); const profile = new User();
if (response.data.getUser != null) { 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)); posts.push(new Post(id, content, htmlContent, upvotes, downvotes, userVote, deletable, pdate, author));
} }
profile.posts = posts; profile.posts = posts;
console.log(profile);
return profile; return profile;
} }
return null; return null;

@ -18,31 +18,24 @@ export class SelfService {
constructor(private http: Http, private data: DatasharingService, private router: Router) { } constructor(private http: Http, private data: DatasharingService, private router: Router) { }
public checkIfLoggedIn() { public checkIfLoggedIn() {
console.log('check if logged in...');
const url = environment.graphQLUrl; const url = environment.graphQLUrl;
const headers = new Headers(); const headers = new Headers();
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
return this.http.post(url, this.buildJson()) return this.http.post(url, this.buildJson())
.subscribe(response => { .subscribe(response => {
console.log(response.text());
this.stillLoggedIn(); this.stillLoggedIn();
this.updateUserInfo(response.json()); this.updateUserInfo(response.json());
}, error => { }, error => {
this.notLoggedIn(); this.notLoggedIn();
console.log(error.text());
// this.fakeLogin(); // this.fakeLogin();
} }
); );
} }
public stillLoggedIn() { public stillLoggedIn() {
console.log('user was logged in');
} }
public notLoggedIn() { public notLoggedIn() {
console.log('user was not logged in');
} }
public updateUserInfo(response: any) { public updateUserInfo(response: any) {
@ -59,7 +52,6 @@ export class SelfService {
user.friends.push(new FriendInfo(friend.id, friend.name, friend.level)); user.friends.push(new FriendInfo(friend.id, friend.name, friend.level));
} }
for (const group of response.data.getSelf.groups) { for (const group of response.data.getSelf.groups) {
console.log(group.name);
user.groups.push(new GroupInfo(group.id, group.name)); user.groups.push(new GroupInfo(group.id, group.name));
} }
user.chatIDs = response.data.getSelf.chats; user.chatIDs = response.data.getSelf.chats;

Loading…
Cancel
Save