Merge branch 'master' into julius-dev

master
trivernis 5 years ago
commit a87236cebe

@ -39,6 +39,7 @@ export class FeedComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log('init feedcomponent');
this.data.currentUserInfo.subscribe(user => { this.data.currentUserInfo.subscribe(user => {
this.user = user; this.user = user;
this.loggedIn = user.loggedIn; this.loggedIn = user.loggedIn;

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

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

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

@ -1,5 +1,5 @@
<div id="file-upload-dialog"> <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> <div class="uploadDialogContent" mat-dialog-content>
<input style="display: none" id="input-file" type="file" accept="image/*" (change)="onFileInputChange($event)" #name> <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> <label for="input-file" class="mat-button mat-raised-button mat-primary">Choose File</label>
@ -7,9 +7,9 @@
<h2 *ngIf="localFileUrl">Preview:</h2> <h2 *ngIf="localFileUrl">Preview:</h2>
<img *ngIf="localFileUrl" id="inputPreview" [src]="localFileUrl"/> <img *ngIf="localFileUrl" id="inputPreview" [src]="localFileUrl"/>
</div> </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> </div>
<mat-error *ngIf="errorOccurred">{{getErrorMessage()}}</mat-error> <mat-error id="error" *ngIf="errorOccurred">{{getErrorMessage()}}</mat-error>
<div mat-dialog-actions align="end"> <div mat-dialog-actions align="end">
<button mat-button (click)="onCancelClicked()">Cancel</button> <button mat-button (click)="onCancelClicked()">Cancel</button>
<button class="confirmationButton" mat-raised-button cdkFocusInitial (click)="onOkClicked()">Upload</button> <button class="confirmationButton" mat-raised-button cdkFocusInitial (click)="onOkClicked()">Upload</button>

@ -60,6 +60,7 @@ export class ProfileComponent implements OnInit {
this.userProfile = response; this.userProfile = response;
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
this.userProfile.allowedToSendRequest = this.requestService.isAllowedToSendRequest(this.userProfile.userID, this.self); this.userProfile.allowedToSendRequest = this.requestService.isAllowedToSendRequest(this.userProfile.userID, this.self);
console.log(this.userProfile.allowedToSendRequest);
this.ownProfile = this.userProfile.userID === this.self.userID; this.ownProfile = this.userProfile.userID === this.self.userID;
this.rankname = this.levellist.getLevelName(this.userProfile.level); this.rankname = this.levellist.getLevelName(this.userProfile.level);
} else { } else {

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

@ -19,6 +19,9 @@ export class RequestService {
if (!self.loggedIn) { if (!self.loggedIn) {
return false; return false;
} else { } else {
if (userID === self.userID) {
return false;
}
for (const receiverID of self.sentRequestUserIDs) { for (const receiverID of self.sentRequestUserIDs) {
if (userID === receiverID || if (userID === receiverID ||
userID === self.userID) { userID === self.userID) {

@ -1,5 +1,8 @@
@mixin gridPosition($rowStart, $rowEnd, $columnStart, $columnEnd) ::-webkit-scrollbar
grid-row-start: $rowStart width: 4px
grid-row-end: $rowEnd
grid-column-start: $columnStart ::-webkit-scrollbar-track
grid-column-end: $columnEnd background: #ddd
::-webkit-scrollbar-thumb
background: #666

Loading…
Cancel
Save