removed console.logs

master
Max 5 years ago
parent ccdf161a46
commit f78c535530

@ -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');
});
}

@ -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()));
}

@ -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();
}
}

@ -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';

@ -22,7 +22,6 @@ export class ChatService {
}
public getAllChats(): Array<Chat> {
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<Chat> {
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;

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

@ -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;
}

@ -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;

@ -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;

@ -110,7 +110,6 @@ export class ProfileService {
}
public renderProfile(response: any): User {
console.log(response);
const posts = new Array<Post>();
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;

@ -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;

Loading…
Cancel
Save