Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Trivernis 5 years ago committed by Gitea
commit 534d025790

@ -39,6 +39,7 @@ export class FeedComponent implements OnInit {
}
ngOnInit() {
console.log('init feedcomponent');
this.data.currentUserInfo.subscribe(user => {
this.user = user;
this.loggedIn = user.loggedIn;
@ -55,7 +56,6 @@ export class FeedComponent implements OnInit {
this.loadingNew = response;
});
this.feedService.topPostsAvailable.subscribe(response => {
console.log(response);
this.loadingMostLiked = response;
});
}
@ -83,7 +83,6 @@ export class FeedComponent implements OnInit {
}
onScroll() {
console.log('scrolled');
this.feedService.getNextPosts();
}

@ -1,4 +1,5 @@
<div id="content" fxShow="true" fxHide.lt-md="true">
<!--on big screen-->
<div id="content" *ngIf="media.isActive('md') || media.isActive('lg')">
<div id="chat">
<home-chatmanager [hidden]="!loggedIn"></home-chatmanager>
</div>
@ -12,14 +13,9 @@
<home-search></home-search>
</div>
</div>
<!--
<mat-tab-group headerPosition="below" position="0" id="bottom-menu" fxShow="true" fxHide.gt-sm="true">
<mat-tab label="First"> <home-chatmanager ></home-chatmanager></mat-tab>
<mat-tab label="Second"><home-feed id="feed"></home-feed></mat-tab>
<mat-tab label="Third"> <home-social ></home-social></mat-tab>
</mat-tab-group>
-->
<div class="bottom-menu" fxShow="true" fxHide.gt-sm="true">
<!--on small screen-->
<div class="bottom-menu" *ngIf="media.isActive('sm') || media.isActive('xs')">
<mat-tab-group id="tab-group" selectedIndex="1" mat-stretch-tabs headerPosition="below">
<mat-tab disabled>
<ng-template mat-tab-label>

@ -1,6 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {DatasharingService} from 'src/app/services/datasharing.service';
import {FeedService} from 'src/app/services/feed/feed.service';
import { MediaObserver } from '@angular/flex-layout';
@Component({
selector: 'app-home',
@ -11,7 +11,7 @@ export class HomeComponent implements OnInit {
loggedIn: boolean;
constructor(private data: DatasharingService, private feedService: FeedService) {
constructor(private data: DatasharingService, public media: MediaObserver) {
}
ngOnInit() {

@ -3,6 +3,12 @@
.dialogFormField
width: 100%
#error
margin-top: 1em
#progress-bar
margin-top: 1em
.confirmationButton
background-color: $primary-color

@ -1,5 +1,5 @@
<div id="file-upload-dialog">
<h1 mat-dialog-title align="center">Upload a new Profile Picture!</h1>
<h1 mat-dialog-title align="center">Upload a new profile picture!</h1>
<div class="uploadDialogContent" mat-dialog-content>
<input style="display: none" id="input-file" type="file" accept="image/*" (change)="onFileInputChange($event)" #name>
<label for="input-file" class="mat-button mat-raised-button mat-primary">Choose File</label>
@ -7,9 +7,9 @@
<h2 *ngIf="localFileUrl">Preview:</h2>
<img *ngIf="localFileUrl" id="inputPreview" [src]="localFileUrl"/>
</div>
<mat-progress-bar *ngIf="uploading" mode="indeterminate"></mat-progress-bar>
<mat-progress-bar id="progress-bar" *ngIf="uploading" mode="indeterminate"></mat-progress-bar>
</div>
<mat-error *ngIf="errorOccurred">{{getErrorMessage()}}</mat-error>
<mat-error id="error" *ngIf="errorOccurred">{{getErrorMessage()}}</mat-error>
<div mat-dialog-actions align="end">
<button mat-button (click)="onCancelClicked()">Cancel</button>
<button class="confirmationButton" mat-raised-button cdkFocusInitial (click)="onOkClicked()">Upload</button>

@ -41,11 +41,13 @@ export class User {
this.joinedAt = userDataResponse.joinedAt;
this.friendCount = userDataResponse.friendCount;
this.groupCount = userDataResponse.groupCount;
if (userDataResponse.settings) {
try {
this.darkmode = !!JSON.parse(userDataResponse.settings).darkmode;
} catch (err) {
console.error(err);
}
}
if (userDataResponse.friends) {
this.friends = userDataResponse.friends
.map(friend => new FriendInfo(

@ -151,6 +151,7 @@ export class FeedService {
}
public getPosts(sort: string) {
console.log('feedservice: getPosts()');
if ((sort === 'NEW' && this.newPosts.getValue().length === 0) ||
(sort === 'TOP' && this.mostLikedPosts.getValue().length === 0)) {
const headers = new Headers();

Loading…
Cancel
Save