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

master
Max_ES 5 years ago
commit 0313201d06

1292
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -30,12 +30,12 @@
"apollo-client": "^2.6.8",
"apollo-link": "^1.2.11",
"core-js": "^2.6.11",
"graphql": "^14.3.1",
"graphql-tag": "^2.10.0",
"graphql": "^14.6.0",
"graphql-tag": "^2.10.3",
"hammerjs": "^2.0.8",
"js-sha512": "^0.8.0",
"ngx-infinite-scroll": "^8.0.1",
"ngx-lightbox": "^2.1.1",
"ngx-lightbox": "^2.1.2",
"ngx-socket-io": "^2.1.1",
"node-sass": "^4.13.1",
"rxjs": "~6.5.4",
@ -43,8 +43,8 @@
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.23",
"@angular/cli": "^8.3.23",
"@angular-devkit/build-angular": "^0.803.25",
"@angular/cli": "^8.3.25",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "^7.2.16",
"@types/jasmine": "^2.8.16",
@ -58,7 +58,7 @@
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.2",
"protractor": "^5.4.3",
"ts-node": "~7.0.0",
"tslint": "^5.20.1",
"typescript": "<3.6.0"

@ -4,7 +4,7 @@
<h1>Greenvironment</h1>
<br> <br> <br> <br> <br>
<h1 class="mat-display-3">Keep it clean and green!</h1>
<button mat-icon-button>
<button mat-icon-button disabled>
<mat-icon class="big-icon" color="primary">keyboard_arrow_down</mat-icon>
</button>
</div>
@ -66,9 +66,11 @@
<div id="text2" style="text-align: center;">
<p class="mat-display-1">We believe, that together we can do amazing things to protect our environment and keep it
clean and green.</p>
<p class="mat-display-1">You aren't part of greenvironment yet? - join us now!</p>
<a mat-stroked-button color="primary" class="link-button" routerLink="/register">Register</a>
<br>
<a mat-stroked-button color="primary" class="link-button" routerLink="/login">Login</a>
<div *ngIf="!loggedIn">
<p class="mat-display-1">You aren't part of greenvironment yet? - join us now!</p>
<a mat-stroked-button color="primary" class="link-button" routerLink="/register">Register</a>
<br>
<a mat-stroked-button color="primary" class="link-button" routerLink="/login">Login</a>
</div>
</div>
</div>

@ -1,9 +1,10 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {Activitylist} from 'src/app/models/activity';
import {LevelList} from 'src/app/models/levellist';
import {MatSort} from '@angular/material/sort';
import {MatTableDataSource} from '@angular/material/table';
import {ActivityService} from 'src/app/services/activity/activity.service';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Activitylist } from 'src/app/models/activity';
import { LevelList } from 'src/app/models/levellist';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ActivityService } from 'src/app/services/activity/activity.service';
import { DatasharingService } from '../../services/datasharing.service';
@Component({
selector: 'app-about',
@ -11,6 +12,7 @@ import {ActivityService} from 'src/app/services/activity/activity.service';
styleUrls: ['./about.component.sass']
})
export class AboutComponent implements OnInit {
loggedIn = false;
actionlist: Activitylist = new Activitylist();
levellist: LevelList = new LevelList();
@ -19,12 +21,15 @@ export class AboutComponent implements OnInit {
displayedLevelColumns = ['level', 'name'];
levelSource = new MatTableDataSource(this.levellist.levels);
constructor(private activityService: ActivityService) {
constructor(private activityService: ActivityService, private data: DatasharingService) {
}
@ViewChild(MatSort, {static: true}) sort: MatSort;
@ViewChild(MatSort, { static: true }) sort: MatSort;
ngOnInit() {
this.data.currentUser.subscribe(user => {
this.loggedIn = user.loggedIn;
});
this.activityService.getActivities();
this.activityService.activitylist.subscribe(response => {
this.actionlist = response;

@ -1,6 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {RegisterService} from '../../services/register/register.service';
import {Registration} from '../../models/registration';
import { Component, OnInit } from '@angular/core';
import { RegisterService } from '../../services/register/register.service';
import { Registration } from '../../models/registration';
import * as sha512 from 'js-sha512';
@Component({
@ -18,7 +18,7 @@ export class RegisterComponent implements OnInit {
imprintCheck = false;
constructor(private registerService: RegisterService) {
this.registration = {username: null, passwordHash: null, email: null};
this.registration = { username: null, passwordHash: null, email: null };
}
public registerError(error: any) {
@ -39,6 +39,11 @@ export class RegisterComponent implements OnInit {
}
passwordSame(pwd: string, pwd2: string) {
if (!pwd) {
this.errorOccurred = true;
this.errorMessage = 'please enter a password';
return false;
}
if (pwd === pwd2) {
return true;
} else {

Loading…
Cancel
Save