Commit 01638b0b by Leandro Nunes

Merge branch 'develop' into 'master'

Develop

Closes #148, #147, and #146

See merge request !48
parents a36c944f 82036989
Pipeline #13789275 passed with stages
in 4 minutes 11 seconds
......@@ -10,7 +10,7 @@
<h2>{{'conversations.subtitle' | translate}}</h2>
<div *ngFor="let local_conversations of groupConversations(); let i = index" class="card-deck">
<div *ngFor="let conversation of local_conversations; let e = index" class="card" [ngClass]="{ 'new' : !ratio(conversation) }">
<div *ngFor="let conversation of local_conversations; let e = index" class="card" [ngClass]="{ 'new' : conversation.is_new }">
<div class="card-cover" [ngStyle]="{'background-image' : 'url('+backgroundImage(conversation)+')' }">
<a routerLink="/conversations/participate/{{conversation.id}}">
......
......@@ -29,7 +29,7 @@ export class ConversationsComponent implements OnInit {
ngOnInit() {
this.conversationService.list().subscribe((conversations: Conversation[]) => {
this.conversations = conversations;
this.conversations = _.sortBy(conversations, ['position']);
});
if(_.isUndefined(this.profile.image)){
this.profile.image = '/assets/images/icons/profile_icon.svg';
......
......@@ -63,7 +63,6 @@ export class LoginComponent {
this.bsModalRef.hide();
this.bsRegistrationModalRef = this.modalService.show(RegistrationComponent, { class: 'modal-lg' });
this.bsRegistrationModalRef.content.loggedIn.subscribe(() => {
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk');
this.profile = this.profileService.getProfile();
this.loggedIn.emit();
this.profileService.profileChangeEvent.emit(this.profile);
......
......@@ -17,5 +17,7 @@ export class Conversation {
public polis_slug: string;
public id: number;
public author: any;
public position: number;
public is_new: boolean;
}
......@@ -36,18 +36,7 @@ export class RegistrationComponent {
this.profile.password1 = this.profile.password;
this.profile.password2 = this.profile.password_confirmation;
this.authService.signUp(this.profile).subscribe((response) => {
this.profileService.me().subscribe( profile => {
// console.log('eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', profile);
// this.profile = profile;
// console.log('ggggggggggggggggggggggggggggg', this.profile);
// this.profileService.setProfile(this.profile);
// this.loggedIn.emit();
// this.bsModalRef.hide();
// this.router.navigate(['conversations']);
this.handleloginSuccess();
});
this.handleloginSuccess();
}, error => this.handleError(error));
}
......@@ -88,11 +77,10 @@ export class RegistrationComponent {
handleloginSuccess(){
this.profileService.me().subscribe( profile => {
this.profileService.setProfile(this.profile);
this.profileService.setProfile(profile);
this.bsModalRef.hide();
this.loggedIn.emit();
this.notificationService.success({ title: "registration.success.title", message: "registration.success.message" });
// this.router.navigate(['conversations']);
});
}
......
......@@ -39,14 +39,6 @@ export class AuthService {
reset(profile: Profile) {
let fullEndpointUrl = `${environment.apiUrl}/rest-auth/password/reset/`;
return this.http.post(fullEndpointUrl, profile)
// .map(
// data => {
// console.log('sssssssssssssssss', data);
// },
// resp => {
// console.log('sssssssssssssssss', resp);
// );
}
signInFacebook(accessToken: string) {
......
......@@ -13,7 +13,6 @@ export class SessionService {
};
setProfile(profile: Profile): Profile {
console.log('SessionService', profile);
this.localStorageService.store('currentProfile', profile);
return this.localStorageService.retrieve('currentProfile');
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment