Merge branch 'master' of Software_Engineering_I/greenvironment-frontend into max_dev
commit
39cdcbd96a
@ -1,4 +1,5 @@
|
||||
<div class='sidenav'>
|
||||
<span (click)='newDoc()'>New Document</span>
|
||||
<span [class.selected]='docId === currentDoc' (click)='loadDoc(docId)' *ngFor='let docId of documents | async'>{{ docId }}</span>
|
||||
<span [class.selected]='docId === currentDoc' (click)='loadDoc(docId)'
|
||||
*ngFor='let docId of documents | async'>{{ docId }}</span>
|
||||
</div>
|
||||
|
@ -0,0 +1,23 @@
|
||||
@import '../../../../styles/greenvironment-material-theme'
|
||||
|
||||
.dialogFormField
|
||||
width: 100%
|
||||
|
||||
.confirmationButton
|
||||
background-color: $primary-color
|
||||
|
||||
.uploadDialogContent
|
||||
overflow: hidden
|
||||
text-align: center
|
||||
|
||||
#inputPreview
|
||||
max-width: 75%
|
||||
max-height: 100%
|
||||
width: auto
|
||||
clip-path: circle()
|
||||
mask-mode: luminance
|
||||
|
||||
#inputPreviewWrapper
|
||||
margin: auto
|
||||
text-align: center
|
||||
max-height: 512px
|
@ -0,0 +1,79 @@
|
||||
import {Component} from '@angular/core';
|
||||
import {MatDialogRef} from '@angular/material/dialog';
|
||||
import {SelfService} from '../../../services/selfservice/self.service';
|
||||
import {environment} from '../../../../environments/environment';
|
||||
import {BehaviorSubject} from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'file-upload-dialog',
|
||||
templateUrl: 'fileUploadDialog.component.html',
|
||||
styleUrls: ['./fileUpload.component.sass'],
|
||||
})
|
||||
export class DialogFileUploadComponent {
|
||||
public errorOccurred = false;
|
||||
public uploading = false;
|
||||
private errorMessage: string;
|
||||
public profilePictureUrl: BehaviorSubject<string | null>;
|
||||
private file;
|
||||
public localFileUrl;
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<DialogFileUploadComponent>, private selfService: SelfService) {
|
||||
this.profilePictureUrl = new BehaviorSubject<string | null>(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for the error message
|
||||
*/
|
||||
getErrorMessage() {
|
||||
return this.errorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when the cancel button of the dialog is pressed
|
||||
*/
|
||||
onCancelClicked() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when the ok button was pressed
|
||||
*/
|
||||
onOkClicked() {
|
||||
this.errorOccurred = false;
|
||||
this.uploading = true;
|
||||
this.selfService.changeProfilePicture(this.file).subscribe((response) => {
|
||||
this.uploading = false;
|
||||
if (response.success) {
|
||||
this.profilePictureUrl.next(environment.greenvironmentUrl + response.fileName);
|
||||
this.dialogRef.close();
|
||||
} else {
|
||||
this.errorMessage = response.error;
|
||||
this.errorOccurred = true;
|
||||
}
|
||||
}, (error) => {
|
||||
this.uploading = false;
|
||||
this.errorOccurred = true;
|
||||
console.log(error);
|
||||
if (error.error) {
|
||||
this.errorMessage = error.error.error;
|
||||
} else {
|
||||
this.errorMessage = 'Failed to upload the profile picture.';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when the input of the file select changes.
|
||||
* @param event
|
||||
*/
|
||||
onFileInputChange(event) {
|
||||
this.errorOccurred = false;
|
||||
this.errorMessage = '';
|
||||
this.file = event.target.files[0];
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e: any) => {
|
||||
this.localFileUrl = e.target.result;
|
||||
};
|
||||
reader.readAsDataURL(this.file);
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<div id="file-upload-dialog">
|
||||
<h1 mat-dialog-title align="center">Upload a new Profile picture!</h1>
|
||||
<div class="uploadDialogContent" mat-dialog-content>
|
||||
<input type="file" accept="image/*" (change)="onFileInputChange($event)" #name>
|
||||
<div id="inputPreviewWrapper">
|
||||
<h2 *ngIf="localFileUrl">Preview:</h2>
|
||||
<img *ngIf="localFileUrl" id="inputPreview" [src]="localFileUrl"/>
|
||||
</div>
|
||||
<mat-progress-bar *ngIf="uploading" mode="indeterminate"></mat-progress-bar>
|
||||
</div>
|
||||
<mat-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>
|
||||
</div>
|
||||
</div>
|
@ -1,33 +1,38 @@
|
||||
<div id="register">
|
||||
<mat-card style="text-align: center;" >
|
||||
<mat-card style="text-align: center;">
|
||||
<mat-card-title>
|
||||
Register
|
||||
</mat-card-title>
|
||||
<mat-card-content>
|
||||
<div class="example-container" (keyup.enter)="onClickSubmit(username.value,email.value,password.value, repeatpassword.value)">
|
||||
<div class="example-container"
|
||||
(keyup.enter)="onClickSubmit(username.value,email.value,password.value, repeatpassword.value)">
|
||||
<mat-error *ngIf="errorOccurred">{{errorMessage}}</mat-error>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Enter your email" #email >
|
||||
<input matInput placeholder="Enter your email" #email>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Enter your username" #username >
|
||||
<input matInput placeholder="Enter your username" #username>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Enter your password" [type]="hide1 ? 'password' : 'text'" #password>
|
||||
<button mat-icon-button matSuffix (click)="hide1 = !hide1" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide1">
|
||||
<button mat-icon-button matSuffix (click)="hide1 = !hide1" [attr.aria-label]="'Hide password'"
|
||||
[attr.aria-pressed]="hide1">
|
||||
<mat-icon>{{hide1 ? 'visibility_off' : 'visibility'}}</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Repeat your password" [type]="hide2 ? 'password' : 'text'" #repeatpassword>
|
||||
<button mat-icon-button matSuffix (click)="hide2 = !hide2" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide2">
|
||||
<button mat-icon-button matSuffix (click)="hide2 = !hide2" [attr.aria-label]="'Hide password'"
|
||||
[attr.aria-pressed]="hide2">
|
||||
<mat-icon>{{hide2 ? 'visibility_off' : 'visibility'}}</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<button mat-raised-button color="primary" (click)="onClickSubmit(username.value,email.value,password.value, repeatpassword.value)">Register</button>
|
||||
<button mat-raised-button color="primary"
|
||||
(click)="onClickSubmit(username.value,email.value,password.value, repeatpassword.value)">Register
|
||||
</button>
|
||||
<p>You are already part of greenvironment?</p>
|
||||
<a mat-stroked-button color="primary" routerLink="/login">Login</a>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
id="SVGRoot"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="gv-new-logo-white.svg">
|
||||
<defs
|
||||
id="defs3412" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="5.656854"
|
||||
inkscape:cx="-16.580479"
|
||||
inkscape:cy="40.712852"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1003"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:grid-bbox="true" />
|
||||
<metadata
|
||||
id="metadata3415">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2"
|
||||
style="display:inline">
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 59.638425,10.982918 c -2.598034,1.65974 -5.164767,1.536797 -6.79245,1.598268 -1.627684,0.06147 -7.89147,-0.248912 -10.548644,-0.307359 -2.031158,-0.04467 -10.408921,-0.634292 -18.029729,3.227272 -6.189793,3.136452 -10.030686,7.78418 -11.299883,11.09567 -1.095556,2.858442 -1.721588,5.317315 -1.095556,9.896969 0.334798,2.449172 0.916715,4.631314 0.829032,5.615672 -0.07744,0.869314 0.04741,1.638006 -2.331509,4.035408 -2.3789231,2.397403 -7.5630585,6.702992 -7.5630585,6.702992"
|
||||
id="path3986"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssssc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:2.81999993;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 17.040936,45.75125 c 0,0 5.71124,1.10058 9.863991,0.923511 4.152753,-0.177069 10.503177,-1.963537 14.640251,-4.074381 2.654809,-1.354554 8.010685,-4.452479 10.623857,-9.671077 1.545586,-3.086589 2.392221,-6.933871 2.615983,-8.836099 0.374688,-3.185266 0.215574,-5.492636 0.858958,-6.968217"
|
||||
id="path3988"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssssc" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 16.515165,41.68934 c 0,0 3.942744,-4.483925 8.75,-9 3.732038,-3.505984 5.757466,-5.519577 10.967068,-8.580806 3.85598,-2.265823 12.426015,-6.277728 15.87316,-7.736136"
|
||||
id="path3990"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssc" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 3.4 KiB |
@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
id="SVGRoot"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="gv-new-logo.svg">
|
||||
<defs
|
||||
id="defs3412">
|
||||
<linearGradient
|
||||
id="linearGradient4054"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop4050"
|
||||
offset="0"
|
||||
style="stop-color:#00c088;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4052"
|
||||
offset="1"
|
||||
style="stop-color:#08ff21;stop-opacity:0.97468352" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient4048"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop4044"
|
||||
offset="0"
|
||||
style="stop-color:#00c088;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop4046"
|
||||
offset="1"
|
||||
style="stop-color:#08ff21;stop-opacity:0.97468352" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4005">
|
||||
<stop
|
||||
style="stop-color:#00c088;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4001" />
|
||||
<stop
|
||||
style="stop-color:#08ff21;stop-opacity:0.95358652"
|
||||
offset="1"
|
||||
id="stop4003" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4054"
|
||||
id="linearGradient4007"
|
||||
x1="13.48775"
|
||||
y1="12.73616"
|
||||
x2="52.052452"
|
||||
y2="47.384392"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4048"
|
||||
id="linearGradient4017"
|
||||
x1="14.551315"
|
||||
y1="10.077048"
|
||||
x2="51.051678"
|
||||
y2="51.531181"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4005"
|
||||
id="linearGradient4025"
|
||||
x1="13.637479"
|
||||
y1="15.156103"
|
||||
x2="52.776852"
|
||||
y2="46.975906"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="-4.045925"
|
||||
inkscape:cy="41.653992"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1003"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:grid-bbox="true" />
|
||||
<metadata
|
||||
id="metadata3415">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Layer 2"
|
||||
style="display:inline">
|
||||
<path
|
||||
style="fill:none;stroke:url(#linearGradient4007);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 59.638425,10.982918 c -2.598034,1.65974 -5.164767,1.536797 -6.79245,1.598268 -1.627684,0.06147 -7.89147,-0.248912 -10.548644,-0.307359 -2.031158,-0.04467 -10.408921,-0.634292 -18.029729,3.227272 -6.189793,3.136452 -10.030686,7.78418 -11.299883,11.09567 -1.095556,2.858442 -1.721588,5.317315 -1.095556,9.896969 0.334798,2.449172 0.916715,4.631314 0.829032,5.615672 -0.07744,0.869314 0.04741,1.638006 -2.331509,4.035408 -2.3789231,2.397403 -7.5630585,6.702992 -7.5630585,6.702992"
|
||||
id="path3986"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssssc" />
|
||||
<path
|
||||
style="fill:none;stroke:url(#linearGradient4017);stroke-width:2.81999993;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 17.040936,45.75125 c 0,0 5.71124,1.10058 9.863991,0.923511 4.152753,-0.177069 10.503177,-1.963537 14.640251,-4.074381 2.654809,-1.354554 8.010685,-4.452479 10.623857,-9.671077 1.545586,-3.086589 2.392221,-6.933871 2.615983,-8.836099 0.374688,-3.185266 0.215574,-5.492636 0.858958,-6.968217"
|
||||
id="path3988"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssssc" />
|
||||
<path
|
||||
style="fill:none;stroke:url(#linearGradient4025);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 16.515165,41.68934 c 0,0 3.942744,-4.483925 8.75,-9 3.732038,-3.505984 5.757466,-5.519577 10.967068,-8.580806 3.85598,-2.265823 12.426015,-6.277728 15.87316,-7.736136"
|
||||
id="path3990"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssc" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 5.2 KiB |
@ -1,14 +1,14 @@
|
||||
import { User } from 'src/app/models/user';
|
||||
import { Event } from 'src/app/models/event';
|
||||
import {User} from 'src/app/models/user';
|
||||
import {Event} from 'src/app/models/event';
|
||||
|
||||
export class Group {
|
||||
id: number;
|
||||
name: string;
|
||||
handle: string;
|
||||
creator: User = new User();
|
||||
members: User[] = new Array();
|
||||
admins: User[] = new Array();
|
||||
events: Event[] = new Array();
|
||||
members: User[] = [];
|
||||
admins: User[] = [];
|
||||
events: Event[] = [];
|
||||
joined: boolean;
|
||||
allowedToJoinGroup = false;
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
export interface IFileUploadResult {
|
||||
success: boolean;
|
||||
fileName?: string;
|
||||
error?: string;
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
import { Hash } from 'crypto';
|
||||
|
||||
export interface Login {
|
||||
email: string;
|
||||
passwordHash: string;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue