diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 89617e1..c38ca0a 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,5 +1,5 @@ -import { TestBed, async } from '@angular/core/testing'; -import { AppComponent } from './app.component'; +import {async, TestBed} from '@angular/core/testing'; +import {AppComponent} from './app.component'; describe('AppComponent', () => { beforeEach(async(() => { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f332f7b..5e15e30 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit } from '@angular/core'; -import { User } from './models/user'; -import { DatasharingService } from './services/datasharing.service'; -import { SelfService } from './services/selfservice/self.service'; +import {Component, OnInit} from '@angular/core'; +import {DatasharingService} from './services/datasharing.service'; +import {SelfService} from './services/selfservice/self.service'; @Component({ selector: 'app-root', @@ -10,12 +9,13 @@ import { SelfService } from './services/selfservice/self.service'; }) export class AppComponent implements OnInit { - constructor(private data: DatasharingService, private selfservice: SelfService) { } + constructor(private data: DatasharingService, private selfservice: SelfService) { + } ngOnInit() { this.data.currentUserInfo.subscribe(user => { if (user.loggedIn !== true) { - this.selfservice.checkIfLoggedIn(); + this.selfservice.checkIfLoggedIn().subscribe(); } }); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e696687..6a32cee 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,43 +1,40 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { RouterModule, Routes } from '@angular/router'; -import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io'; -import { HttpModule } from '@angular/http'; +import {BrowserModule, DomSanitizer} from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; +import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +import {RouterModule, Routes} from '@angular/router'; +import {SocketIoConfig, SocketIoModule} from 'ngx-socket-io'; +import {HttpModule} from '@angular/http'; -import { AppComponent } from './app.component'; -import { DocumentListComponent } from './components/document-list/document-list.component'; -import { DocumentComponent } from './components/document/document.component'; -import { RegisterComponent } from './components/register/register.component'; -import { LoginComponent } from './components/login/login.component'; -import { ChatComponent } from './components/chat/chat.component'; -import { FriendsComponent } from './components/social/friends/friends.component'; -import { FeedComponent } from './components/feed/feed.component'; -import { HomeComponent } from './components/home/home.component'; -import { SocialComponent } from './components/social/social.component'; -import { GroupsComponent } from './components/social/groups/groups.component'; -import { DialogCreateGroupComponent } from './components/social/groups/groups.component'; -import { DialogCreateEventComponent } from './components/group/group.component'; -import { ChatmanagerComponent } from './components/chatmanager/chatmanager.component'; -import { ChatlistComponent } from './components/chatlist/chatlist.component'; -import { PostlistComponent } from './components/feed/postlist/postlist.component'; -import { GraphQLModule } from './graphql.module'; -import { HttpClientModule } from '@angular/common/http'; -import { ProfileComponent } from './components/profile/profile.component'; -import { GroupComponent } from './components/group/group.component'; -import { ImprintComponent } from './components/imprint/imprint.component'; -import { AboutComponent } from './components/about/about.component'; -import { ChatcontactsComponent } from './components/chatmanager/chatcontacts/chatcontacts.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import {AppComponent} from './app.component'; +import {DocumentListComponent} from './components/document-list/document-list.component'; +import {DocumentComponent} from './components/document/document.component'; +import {RegisterComponent} from './components/register/register.component'; +import {LoginComponent} from './components/login/login.component'; +import {ChatComponent} from './components/chat/chat.component'; +import {FriendsComponent} from './components/social/friends/friends.component'; +import {FeedComponent} from './components/feed/feed.component'; +import {HomeComponent} from './components/home/home.component'; +import {SocialComponent} from './components/social/social.component'; +import {DialogCreateGroupComponent, GroupsComponent} from './components/social/groups/groups.component'; +import {DialogCreateEventComponent, GroupComponent} from './components/group/group.component'; +import {ChatmanagerComponent} from './components/chatmanager/chatmanager.component'; +import {ChatlistComponent} from './components/chatlist/chatlist.component'; +import {PostlistComponent} from './components/feed/postlist/postlist.component'; +import {GraphQLModule} from './graphql.module'; +import {HttpClientModule} from '@angular/common/http'; +import {ProfileComponent} from './components/profile/profile.component'; +import {ImprintComponent} from './components/imprint/imprint.component'; +import {AboutComponent} from './components/about/about.component'; +import {ChatcontactsComponent} from './components/chatmanager/chatcontacts/chatcontacts.component'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {MatTableModule} from '@angular/material/table'; -import { InfiniteScrollModule } from 'ngx-infinite-scroll'; +import {InfiniteScrollModule} from 'ngx-infinite-scroll'; import {UserlistComponent} from './components/userlist/userlist.component'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatFormFieldModule } from '@angular/material/form-field'; +import {MatSliderModule} from '@angular/material/slider'; +import {MatFormFieldModule} from '@angular/material/form-field'; import {MatInputModule} from '@angular/material/input'; -import { ReactiveFormsModule} from '@angular/forms'; -import {MatIconModule} from '@angular/material/icon'; +import {MatIconModule, MatIconRegistry} from '@angular/material/icon'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatSidenavModule} from '@angular/material/sidenav'; import {MatTabsModule} from '@angular/material/tabs'; @@ -45,40 +42,39 @@ import {MatCardModule} from '@angular/material/card'; import {MatButtonToggleModule} from '@angular/material/button-toggle'; import {MatSelectModule} from '@angular/material/select'; import {MatCheckboxModule} from '@angular/material/checkbox'; -import { OverlayModule} from '@angular/cdk/overlay'; +import {OverlayModule} from '@angular/cdk/overlay'; import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatMenuModule} from '@angular/material/menu'; import {MatRippleModule} from '@angular/material/core'; import {MatBadgeModule} from '@angular/material/badge'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import { FlexLayoutModule } from '@angular/flex-layout'; -import { MainNavigationComponent } from './components/main-navigation/main-navigation.component'; -import { LayoutModule } from '@angular/cdk/layout'; -import { MatButtonModule } from '@angular/material/button'; -import { MatListModule } from '@angular/material/list'; +import {FlexLayoutModule} from '@angular/flex-layout'; +import {MainNavigationComponent} from './components/main-navigation/main-navigation.component'; +import {LayoutModule} from '@angular/cdk/layout'; +import {MatButtonModule} from '@angular/material/button'; +import {MatListModule} from '@angular/material/list'; import {MatSortModule} from '@angular/material/sort'; -import { SearchComponent } from './components/search/search.component'; -import {DomSanitizer} from '@angular/platform-browser'; -import {MatIconRegistry} from '@angular/material/icon'; +import {SearchComponent} from './components/search/search.component'; import {MatDialogModule} from '@angular/material/dialog'; import {MatTooltipModule} from '@angular/material/tooltip'; import {MatExpansionModule} from '@angular/material/expansion'; import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatNativeDateModule} from '@angular/material/'; +import {MatNativeDateModule, MatProgressBarModule} from '@angular/material/'; import {MatSnackBarModule} from '@angular/material/snack-bar'; +import {DialogFileUploadComponent} from './components/profile/fileUpload/fileUpload.component'; -const config: SocketIoConfig = { url: 'http://localhost:4444', options: {} }; +const config: SocketIoConfig = {url: 'http://localhost:4444', options: {}}; const appRoutes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'profile/:id', component: ProfileComponent }, - { path: 'group/:id', component: GroupComponent }, - { path: 'login', component: LoginComponent }, - { path: 'register', component: RegisterComponent }, - { path: 'about', component: AboutComponent }, - { path: 'imprint', component: ImprintComponent }, + {path: '', component: HomeComponent}, + {path: 'profile/:id', component: ProfileComponent}, + {path: 'group/:id', component: GroupComponent}, + {path: 'login', component: LoginComponent}, + {path: 'register', component: RegisterComponent}, + {path: 'about', component: AboutComponent}, + {path: 'imprint', component: ImprintComponent}, ]; @NgModule({ @@ -107,6 +103,7 @@ const appRoutes: Routes = [ GroupComponent, DialogCreateEventComponent, UserlistComponent, + DialogFileUploadComponent, ], imports: [ BrowserModule, @@ -124,7 +121,7 @@ const appRoutes: Routes = [ MatIconModule, BrowserAnimationsModule, MatSliderModule, - MatFormFieldModule , + MatFormFieldModule, MatInputModule, ReactiveFormsModule, MatToolbarModule, @@ -151,8 +148,13 @@ const appRoutes: Routes = [ MatExpansionModule, MatDatepickerModule, MatSnackBarModule, + MatProgressBarModule, + ], + entryComponents: [ + DialogCreateGroupComponent, + DialogCreateEventComponent, + DialogFileUploadComponent ], - entryComponents: [ DialogCreateGroupComponent, DialogCreateEventComponent ], providers: [], bootstrap: [AppComponent] }) @@ -163,4 +165,4 @@ export class AppModule { iconRegistry.addSvgIcon( 'logo_green', sanitizer.bypassSecurityTrustResourceUrl('assets/images/gv-logo-flat.svg')); } - } +} diff --git a/src/app/components/about/about.component.html b/src/app/components/about/about.component.html index 13f59fa..5bf352e 100644 --- a/src/app/components/about/about.component.html +++ b/src/app/components/about/about.component.html @@ -1,72 +1,74 @@
-
- -

Greenvironment

-




-

Keep it clean and green!

- -
-
-

What's Greenvironment?

-

We, the greenviroment team want to create a network for environmentalists who care for our nature and our planet as much as we do.

-
-

What does the level mean?

-

There are different levels you can reach through green behaviour. - Collect 100 points to level up! The levels are called: -

- - - - - - - - - - - -
level {{level.level}} level name {{level.name}}
-
-

How to level up?

-

There is an always growing list of things you can do, - to support your environment - and earn points to level up at the same time. - You can get a different amount of points - for differnet actions you can see in the list below: -

- - - - - - - - +
- - -
- - +

Greenvironment

+




+

Keep it clean and green!

+ + +
+

What's Greenvironment?

+

We, the greenviroment team want to create a network for environmentalists who care for our nature and our planet + as much as we do.

+
+

What does the level mean?

+

There are different levels you can reach through green behaviour. + Collect 100 points to level up! The levels are called: +

+
points {{action.points}} action {{action.name}}
+ + + + + + + + + + +
level {{level.level}} level name {{level.name}}
+
+

How to level up?

+

There is an always growing list of things you can do, + to support your environment + and earn points to level up at the same time. + You can get a different amount of points + for differnet actions you can see in the list below: +

+ + - - - - - + + + + + - - -
description {{action.description}} points {{action.points}}
-
-
-

We believe, that together we can do amazing things to protect our environment and keep it clean and green.

-

You aren't part of greenvironment yet? - join us now!

- Register -
- Login + + + action + {{action.name}} + + + + + description + {{action.description}} + + + + + +
+
+

We believe, that together we can do amazing things to protect our environment and keep it + clean and green.

+

You aren't part of greenvironment yet? - join us now!

+ Register +
+ Login +
- \ No newline at end of file diff --git a/src/app/components/about/about.component.sass b/src/app/components/about/about.component.sass index d8cea49..699ab55 100644 --- a/src/app/components/about/about.component.sass +++ b/src/app/components/about/about.component.sass @@ -16,7 +16,7 @@ padding: 2em min-height: 50% max-width: 100% - + .big-icon //color: white transform: scale(2) @@ -31,5 +31,6 @@ max-width: 690px margin: 0 auto text-align: left + .mat-header-cell padding-right: 0.5em diff --git a/src/app/components/about/about.component.spec.ts b/src/app/components/about/about.component.spec.ts index 6b77344..3035231 100644 --- a/src/app/components/about/about.component.spec.ts +++ b/src/app/components/about/about.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { AboutComponent } from './about.component'; +import {AboutComponent} from './about.component'; describe('AboutComponent', () => { let component: AboutComponent; @@ -8,9 +8,9 @@ describe('AboutComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AboutComponent ] + declarations: [AboutComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/about/about.component.ts b/src/app/components/about/about.component.ts index c891813..3983dc3 100644 --- a/src/app/components/about/about.component.ts +++ b/src/app/components/about/about.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { Activitylist } from 'src/app/models/activity'; -import { Levellist } from 'src/app/models/levellist'; +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 {ActivityService} from 'src/app/services/activity/activity.service'; @Component({ selector: 'app-about', @@ -19,9 +19,11 @@ export class AboutComponent implements OnInit { displayedLevelColumns = ['level', 'name']; levelSource = this.levellist.levels; - constructor(private activityService: ActivityService) { } + constructor(private activityService: ActivityService) { + } @ViewChild(MatSort, {static: true}) sort: MatSort; + ngOnInit() { this.activityService.getActivities(); this.activityService.activitylist.subscribe(response => { diff --git a/src/app/components/chat/chat.component.spec.ts b/src/app/components/chat/chat.component.spec.ts index 1f642f2..bfbbddf 100644 --- a/src/app/components/chat/chat.component.spec.ts +++ b/src/app/components/chat/chat.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { ChatComponent } from './chat.component'; +import {ChatComponent} from './chat.component'; describe('ChatComponent', () => { let component: ChatComponent; @@ -8,9 +8,9 @@ describe('ChatComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChatComponent ] + declarations: [ChatComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/chat/chat.component.ts b/src/app/components/chat/chat.component.ts index 7727629..e39259d 100644 --- a/src/app/components/chat/chat.component.ts +++ b/src/app/components/chat/chat.component.ts @@ -1,8 +1,7 @@ -import { Component, OnInit, EventEmitter, Output, Input } from '@angular/core'; -import { Chatmessage } from 'src/app/models/chatmessage'; -import { Chatinfo } from 'src/app/models/chatinfo'; -import { ChatService } from 'src/app/services/chat/chat.service'; -import { Chat } from 'src/app/models/chat'; +import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; +import {Chatmessage} from 'src/app/models/chatmessage'; +import {ChatService} from 'src/app/services/chat/chat.service'; +import {Chat} from 'src/app/models/chat'; @Component({ selector: 'chatmanager-chat', @@ -16,7 +15,8 @@ export class ChatComponent implements OnInit { @Output() goBackEvent = new EventEmitter(); @Input() childChat: Chat; - constructor(private chatService: ChatService) { } + constructor(private chatService: ChatService) { + } ngOnInit() { this.refresh(); @@ -28,16 +28,16 @@ export class ChatComponent implements OnInit { sendMessage(pElement) { this.chatService.sendMessage(this.childChat.id, pElement.value) - .subscribe(response => { - console.log('Message sent'); - pElement.value = ''; - this.refresh(); - }); + .subscribe(response => { + console.log('Message sent'); + pElement.value = ''; + this.refresh(); + }); } refresh() { this.chatService.getMessagesRaw(this.childChat.id) - .subscribe(response => { + .subscribe(response => { console.log('Downloading messages ...'); this.messages = this.chatService.renderMessages(response.json()); }); diff --git a/src/app/components/chatlist/chatlist.component.html b/src/app/components/chatlist/chatlist.component.html index 793c220..eab8653 100644 --- a/src/app/components/chatlist/chatlist.component.html +++ b/src/app/components/chatlist/chatlist.component.html @@ -5,11 +5,11 @@ --> Chat
-
+
Pic
{{chat.memberName}}
- +
diff --git a/src/app/components/chatlist/chatlist.component.spec.ts b/src/app/components/chatlist/chatlist.component.spec.ts index 19e8849..ff3de58 100644 --- a/src/app/components/chatlist/chatlist.component.spec.ts +++ b/src/app/components/chatlist/chatlist.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { ChatlistComponent } from './chatlist.component'; +import {ChatlistComponent} from './chatlist.component'; describe('ChatlistComponent', () => { let component: ChatlistComponent; @@ -8,9 +8,9 @@ describe('ChatlistComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChatlistComponent ] + declarations: [ChatlistComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/chatlist/chatlist.component.ts b/src/app/components/chatlist/chatlist.component.ts index f648e12..138346f 100644 --- a/src/app/components/chatlist/chatlist.component.ts +++ b/src/app/components/chatlist/chatlist.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; -import { Chatinfo } from 'src/app/models/chatinfo'; -import { Chat } from 'src/app/models/chat'; -import { ChatService } from 'src/app/services/chat/chat.service'; +import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; +import {Chat} from 'src/app/models/chat'; +import {ChatService} from 'src/app/services/chat/chat.service'; @Component({ selector: 'chatmanager-chatlist', @@ -15,7 +14,8 @@ export class ChatlistComponent implements OnInit { @Output() showCreateChatEvent = new EventEmitter(); selectedChat: Chat; - constructor(private chatService: ChatService) { } + constructor(private chatService: ChatService) { + } ngOnInit() { diff --git a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.html b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.html index a55f166..2fb7dc5 100644 --- a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.html +++ b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.html @@ -1,15 +1,16 @@
- -
-
-
-
-
Pic
-
{{contact.name}}
-
+ +
+
+
+
+
Pic
+
{{contact.name}}
+
diff --git a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.spec.ts b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.spec.ts index f94d884..a7a9415 100644 --- a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.spec.ts +++ b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { ChatcontactsComponent } from './chatcontacts.component'; +import {ChatcontactsComponent} from './chatcontacts.component'; describe('ChatcontactsComponent', () => { let component: ChatcontactsComponent; @@ -8,9 +8,9 @@ describe('ChatcontactsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChatcontactsComponent ] + declarations: [ChatcontactsComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.ts b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.ts index 2ccfa3b..006a5b6 100644 --- a/src/app/components/chatmanager/chatcontacts/chatcontacts.component.ts +++ b/src/app/components/chatmanager/chatcontacts/chatcontacts.component.ts @@ -1,6 +1,6 @@ -import { Component, OnInit, Output, EventEmitter } from '@angular/core'; -import { FriendInfo } from 'src/app/models/friendinfo'; -import { ChatService } from 'src/app/services/chat/chat.service'; +import {Component, EventEmitter, OnInit, Output} from '@angular/core'; +import {FriendInfo} from 'src/app/models/friendinfo'; +import {ChatService} from 'src/app/services/chat/chat.service'; @Component({ selector: 'chatmanager-chatcontacts', @@ -12,7 +12,8 @@ export class ChatcontactsComponent implements OnInit { @Output() goBackEvent = new EventEmitter(); selectedContact: FriendInfo; - constructor(private chatService: ChatService) { } + constructor(private chatService: ChatService) { + } ngOnInit() { } diff --git a/src/app/components/chatmanager/chatmanager.component.sass b/src/app/components/chatmanager/chatmanager.component.sass index f74a631..6694562 100644 --- a/src/app/components/chatmanager/chatmanager.component.sass +++ b/src/app/components/chatmanager/chatmanager.component.sass @@ -1,6 +1,6 @@ @import '../../../styles/mixins.sass' @import '../../../styles/vars.sass' -div - width: 100% - height: 100% \ No newline at end of file +div + width: 100% + height: 100% diff --git a/src/app/components/chatmanager/chatmanager.component.spec.ts b/src/app/components/chatmanager/chatmanager.component.spec.ts index d222640..4518c76 100644 --- a/src/app/components/chatmanager/chatmanager.component.spec.ts +++ b/src/app/components/chatmanager/chatmanager.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { ChatmanagerComponent } from './chatmanager.component'; +import {ChatmanagerComponent} from './chatmanager.component'; describe('ChatmanagerComponent', () => { let component: ChatmanagerComponent; @@ -8,9 +8,9 @@ describe('ChatmanagerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChatmanagerComponent ] + declarations: [ChatmanagerComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/chatmanager/chatmanager.component.ts b/src/app/components/chatmanager/chatmanager.component.ts index db1550a..45216f2 100644 --- a/src/app/components/chatmanager/chatmanager.component.ts +++ b/src/app/components/chatmanager/chatmanager.component.ts @@ -1,9 +1,7 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { ChatService } from '../../services/chat/chat.service'; -import { ChatComponent } from '../chat/chat.component'; -import { Chatinfo } from 'src/app/models/chatinfo'; -import { DatasharingService } from 'src/app/services/datasharing.service'; -import { Chat } from 'src/app/models/chat'; +import {Component, OnInit} from '@angular/core'; +import {ChatService} from '../../services/chat/chat.service'; +import {DatasharingService} from 'src/app/services/datasharing.service'; +import {Chat} from 'src/app/models/chat'; @Component({ selector: 'home-chatmanager', @@ -19,7 +17,8 @@ export class ChatmanagerComponent implements OnInit { parentSelectedChat: Chat; parentChats: Array; - constructor(private data: DatasharingService, private chatService: ChatService) { } + constructor(private data: DatasharingService, private chatService: ChatService) { + } ngOnInit() { /*this.data.currentChatIDs.subscribe(chatIDs => { @@ -51,7 +50,7 @@ export class ChatmanagerComponent implements OnInit { refresh() { this.chatService.getAllChatsRaw() - .subscribe(response => { + .subscribe(response => { console.log(response); this.parentChats = this.chatService.renderAllChats(response.json()); }); diff --git a/src/app/components/document-list/document-list.component.html b/src/app/components/document-list/document-list.component.html index 6a57b17..d99fd52 100644 --- a/src/app/components/document-list/document-list.component.html +++ b/src/app/components/document-list/document-list.component.html @@ -1,4 +1,5 @@
New Document - {{ docId }} + {{ docId }}
diff --git a/src/app/components/document-list/document-list.component.scss b/src/app/components/document-list/document-list.component.scss index 506aa38..10001b7 100644 --- a/src/app/components/document-list/document-list.component.scss +++ b/src/app/components/document-list/document-list.component.scss @@ -1,24 +1,28 @@ .sidenav { - position: fixed; - height: 100%; - width: 220px; - top: 0; - left: 0; - background-color: #111111; - overflow-x: hidden; - padding-top: 20px; + position: fixed; + height: 100%; + width: 220px; + top: 0; + left: 0; + background-color: #111111; + overflow-x: hidden; + padding-top: 20px; - span { - padding: 6px 8px 6px 16px; - text-decoration: none; - font-size: 25px; - font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif; - color: #818181; - display: block; - }.selected { - color: #e1e1e1; - }:hover { - color: #f1f1f1; - cursor: pointer; - } + span { + padding: 6px 8px 6px 16px; + text-decoration: none; + font-size: 25px; + font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif; + color: #818181; + display: block; + } + + .selected { + color: #e1e1e1; + } + + :hover { + color: #f1f1f1; + cursor: pointer; + } } diff --git a/src/app/components/document-list/document-list.component.spec.ts b/src/app/components/document-list/document-list.component.spec.ts index f8c7635..2ba5f52 100644 --- a/src/app/components/document-list/document-list.component.spec.ts +++ b/src/app/components/document-list/document-list.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { DocumentListComponent } from './document-list.component'; +import {DocumentListComponent} from './document-list.component'; describe('DocumentListComponent', () => { let component: DocumentListComponent; @@ -8,9 +8,9 @@ describe('DocumentListComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DocumentListComponent ] + declarations: [DocumentListComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/document-list/document-list.component.ts b/src/app/components/document-list/document-list.component.ts index 10faac9..6a68c2f 100644 --- a/src/app/components/document-list/document-list.component.ts +++ b/src/app/components/document-list/document-list.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { Observable, Subscription } from 'rxjs'; +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {Observable, Subscription} from 'rxjs'; -import { DocumentService } from 'src/app/services/document.service'; +import {DocumentService} from 'src/app/services/document.service'; @Component({ selector: 'app-document-list', @@ -13,7 +13,8 @@ export class DocumentListComponent implements OnInit, OnDestroy { currentDoc: string; private _docSub: Subscription; - constructor(private documentService: DocumentService) { } + constructor(private documentService: DocumentService) { + } ngOnInit() { this.documents = this.documentService.documents; diff --git a/src/app/components/document/document.component.scss b/src/app/components/document/document.component.scss index 67d5275..f97544b 100644 --- a/src/app/components/document/document.component.scss +++ b/src/app/components/document/document.component.scss @@ -1,12 +1,12 @@ textarea { - position: fixed; - width: calc(100% - 235px); - height: 100%; - right: 0; - top: 0; - font-size: 18pt; - padding-top: 20px; - resize: none; - border: none; - padding: 20px 0px 20px 15px; + position: fixed; + width: calc(100% - 235px); + height: 100%; + right: 0; + top: 0; + font-size: 18pt; + padding-top: 20px; + resize: none; + border: none; + padding: 20px 0px 20px 15px; } diff --git a/src/app/components/document/document.component.spec.ts b/src/app/components/document/document.component.spec.ts index 6780d19..5f113c4 100644 --- a/src/app/components/document/document.component.spec.ts +++ b/src/app/components/document/document.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { DocumentComponent } from './document.component'; +import {DocumentComponent} from './document.component'; describe('DocumentComponent', () => { let component: DocumentComponent; @@ -8,9 +8,9 @@ describe('DocumentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DocumentComponent ] + declarations: [DocumentComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/document/document.component.ts b/src/app/components/document/document.component.ts index a5c4c04..8bb37ba 100644 --- a/src/app/components/document/document.component.ts +++ b/src/app/components/document/document.component.ts @@ -1,8 +1,8 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { DocumentService } from 'src/app/services/document.service'; -import { Subscription } from 'rxjs'; -import { Document } from 'src/app/models/document'; -import { startWith } from 'rxjs/operators'; +import {Component, OnDestroy, OnInit} from '@angular/core'; +import {DocumentService} from 'src/app/services/document.service'; +import {Subscription} from 'rxjs'; +import {Document} from 'src/app/models/document'; +import {startWith} from 'rxjs/operators'; @Component({ selector: 'app-document', @@ -12,11 +12,13 @@ import { startWith } from 'rxjs/operators'; export class DocumentComponent implements OnInit, OnDestroy { document: Document; private _docSub: Subscription; - constructor(private documentService: DocumentService) { } + + constructor(private documentService: DocumentService) { + } ngOnInit() { this._docSub = this.documentService.currentDocument.pipe( - startWith({ id: '', doc: 'Select an existing document or create a new one to get started'}) + startWith({id: '', doc: 'Select an existing document or create a new one to get started'}) ).subscribe(document => this.document = document); } diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index dac9442..3f7bb97 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -1,31 +1,35 @@
+ infinite-scroll + [infiniteScrollDistance]="0.5" + [scrollWindow]="false" + (scrolled)="onScroll()">
- + - +

- I protected the environment. + I protected the environment. +

What did you do? nothing ;) - + {{action.name}} ({{action.description}}) {{getErrorMessage()}} -
@@ -34,26 +38,27 @@ infinite-scroll
- + You need to login to post something.
-
+
- New - Most Liked - -
-
-
- -
- + New + Most Liked + +
+
+
+ +
+ +
-
diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass index c3d660c..40e1094 100644 --- a/src/app/components/feed/feed.component.sass +++ b/src/app/components/feed/feed.component.sass @@ -3,43 +3,44 @@ .primary-color - color: $primary-color + color: $primary-color -#home - width: 100% - height: 100% - overflow-y: scroll +#home + width: 100% + height: 100% + overflow-y: scroll #complete-feed - box-sizing: border-box - display: flex - width: 100% - padding: 0.5em + box-sizing: border-box + display: flex + width: 100% + padding: 0.5em + #info - ::ng-deep .mat-card-header-text - margin: 0px + ::ng-deep .mat-card-header-text + margin: 0px #feedlist - width: 100% + width: 100% #input - width: 100% - padding-left: 0.5em - padding-right: 0.5em + width: 100% + padding-left: 0.5em + padding-right: 0.5em #action-chooser - width: 100% - padding-left: 0.5em - padding-right: 0.5em + width: 100% + padding-left: 0.5em + padding-right: 0.5em #check - margin: 0 - padding-left: 0.5em + margin: 0 + padding-left: 0.5em #post-button - width: 100% - padding-left: 0.5em - padding-right: 0.5em - margin-top: 0.5em + width: 100% + padding-left: 0.5em + padding-right: 0.5em + margin-top: 0.5em diff --git a/src/app/components/feed/feed.component.spec.ts b/src/app/components/feed/feed.component.spec.ts index 4101160..322f1ef 100644 --- a/src/app/components/feed/feed.component.spec.ts +++ b/src/app/components/feed/feed.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { FeedComponent } from './feed.component'; +import {FeedComponent} from './feed.component'; describe('FeedComponent', () => { let component: FeedComponent; @@ -8,9 +8,9 @@ describe('FeedComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FeedComponent ] + declarations: [FeedComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index ff21e52..baf1aa8 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -49,9 +49,6 @@ export class FeedComponent implements OnInit { }); this.feedService.getPosts('NEW'); this.feedService.posts.subscribe(response => { - if (response.length > 0) { - // this.loading = false; - } this.parentSelectedPostList = response; }); this.feedService.newPostsAvailable.subscribe(response => { @@ -104,4 +101,14 @@ export class FeedComponent implements OnInit { getErrorMessage() { return this.errorMessage; } + + /** + * Executed when the text in the input field changes. + */ + onTextInputChange() { + if (this.errorOccurred) { + this.errorOccurred = false; + this.errorMessage = ''; + } + } } diff --git a/src/app/components/feed/postlist/postlist.component.html b/src/app/components/feed/postlist/postlist.component.html index 6b0db0d..fcf28eb 100644 --- a/src/app/components/feed/postlist/postlist.component.html +++ b/src/app/components/feed/postlist/postlist.component.html @@ -19,10 +19,10 @@
--> - +
- +
- + {{post.author.name}} @@ -46,7 +46,7 @@
-

+

+ +
+ + +
+ created by {{groupProfile.creator.username}} + @{{groupProfile.creator.handle}} +
+
+ +
+ {{groupProfile.members.length}} member(s) +
+
+ + + + +
+ {{groupProfile.name}} + created by {{groupProfile.creator.username}} + @{{groupProfile.creator.handle}} +
+ + +
+
+ +
+ {{groupProfile.members.length}} member(s) +
+
+
+
+ + + + + Events + + +
+ + + {{event.name}} + {{event.date}}
- - + +
- - -
- created by {{groupProfile.creator.username}} @{{groupProfile.creator.handle}} -
-
- -
- {{groupProfile.members.length}} member(s) -
-
- - - - -
- {{groupProfile.name}} - created by {{groupProfile.creator.username}} @{{groupProfile.creator.handle}} -
- - -
-
- -
- {{groupProfile.members.length}} member(s) -
-
-
-
- - - - - Events - - -
- - - {{event.name}} - {{event.date}} -
- - -
-
-
-
-
- - - - Members - - -
- -
-
-
+ +
+ + + + + Members + + +
+ +
+
+
-
-

Group not found :(

-
- +
+
+

Group not found :(

+
+
- \ No newline at end of file diff --git a/src/app/components/group/group.component.sass b/src/app/components/group/group.component.sass index 0de5d38..d153814 100644 --- a/src/app/components/group/group.component.sass +++ b/src/app/components/group/group.component.sass @@ -26,22 +26,30 @@ $mat-card-header-size: 100px !default .button-box text-align: right margin-left: auto + .request-button margin: auto 0 + #toolbar margin-top: 32px + .mat-toolbar-row max-height: 40px + .info-box font-size: 14px margin-left: calc(100px + 0.5em) + .info margin-right: 3em + #username margin: 0 0.5em overflow: auto + #handle font-size: 14px + .profile-picture background-image: url(https://material.angular.io/assets/img/examples/shiba1.jpg) height: $mat-card-header-size @@ -49,6 +57,7 @@ $mat-card-header-size: 100px !default border-radius: 50% flex-shrink: 0 background-size: cover + &:hover height: 200 // Makes `` tags behave like `background-size: cover`. Not supported @@ -61,27 +70,35 @@ $mat-card-header-size: 100px !default margin-top: 0.5em outline: none user-select: none + ::ng-deep .mat-card-header-text margin: 0 margin-left: 16px + .mat-card-subtitle margin: 0 word-break: break-all + .mat-card-title margin: 0 word-break: break-all + .request-button margin-top: 0.5em margin-bottom: 0.5em + .profile-picture background-image: url(https://material.angular.io/assets/img/examples/shiba1.jpg) background-size: cover + .profile-picture:hover cursor: pointer + .pointer cursor: pointer ::ng-deep .mat-expansion-panel background: #e6e6e6 + ::ng-deep.dark-theme .mat-expansion-panel background: #121212 diff --git a/src/app/components/group/group.component.spec.ts b/src/app/components/group/group.component.spec.ts index 50601d0..8d9ff1d 100644 --- a/src/app/components/group/group.component.spec.ts +++ b/src/app/components/group/group.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { GroupComponent } from './group.component'; +import {GroupComponent} from './group.component'; describe('GroupComponent', () => { let component: GroupComponent; @@ -8,9 +8,9 @@ describe('GroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupComponent ] + declarations: [GroupComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/group/group.component.ts b/src/app/components/group/group.component.ts index 6e5af39..de4ad53 100644 --- a/src/app/components/group/group.component.ts +++ b/src/app/components/group/group.component.ts @@ -1,12 +1,12 @@ -import { Component, OnInit, ViewChild} from '@angular/core'; -import {Router, NavigationEnd} from '@angular/router'; -import { User } from 'src/app/models/user'; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {NavigationEnd, Router} from '@angular/router'; +import {User} from 'src/app/models/user'; import {MatSort} from '@angular/material/sort'; -import { RequestService } from 'src/app/services/request/request.service'; -import { DatasharingService } from '../../services/datasharing.service'; -import { GroupService } from 'src/app/services/group/group.service'; -import { Group } from 'src/app/models/group'; -import { Event } from 'src/app/models/event'; +import {RequestService} from 'src/app/services/request/request.service'; +import {DatasharingService} from '../../services/datasharing.service'; +import {GroupService} from 'src/app/services/group/group.service'; +import {Group} from 'src/app/models/group'; +import {Event} from 'src/app/models/event'; import {MatDialog, MatDialogRef} from '@angular/material/dialog'; // DIALOG COMPONENT to create events @@ -21,8 +21,8 @@ export class DialogCreateEventComponent { public dialogRef: MatDialogRef, private group: GroupService, private router: Router) { - this.groupId = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); - } + this.groupId = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); + } onNoClick(): void { this.dialogRef.close(); @@ -63,20 +63,21 @@ export class GroupComponent implements OnInit { private requestService: RequestService, private data: DatasharingService, private groupService: GroupService) { - router.events.forEach((event) => { - // check if url changes - if (event instanceof NavigationEnd) { - const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); - if (this.id !== possibleID && this.id && this.router.url.includes('group/')) { - // reload the group - console.log('search for group id: ' + this.router.url.substr(this.router.url.lastIndexOf('/') + 1)); - this.ngOnInit(); - } + router.events.forEach((event) => { + // check if url changes + if (event instanceof NavigationEnd) { + const possibleID = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); + if (this.id !== possibleID && this.id && this.router.url.includes('group/')) { + // reload the group + console.log('search for group id: ' + this.router.url.substr(this.router.url.lastIndexOf('/') + 1)); + this.ngOnInit(); } - }); + } + }); } @ViewChild(MatSort, {static: true}) sort: MatSort; + ngOnInit() { this.loading = true; this.id = this.router.url.substr(this.router.url.lastIndexOf('/') + 1); @@ -98,7 +99,9 @@ export class GroupComponent implements OnInit { for (const member of this.groupProfile.members) { member.allowedToSendRequest = this.requestService.isAllowedToSendRequest(member.userID, this.self); } - } else { this.groupNotFound = true; } + } else { + this.groupNotFound = true; + } this.loading = false; }); } diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index e274fc6..cee7549 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1,8 +1,16 @@
-
-
- - +
+ +
+
+ +
+ +
-
- - - - chat - - - - - - home - - - - - - people - - - - - - search - - - - +
+ + + + chat + + + + + + home + + + + + + people + + + + + + search + + + +
diff --git a/src/app/components/home/home.component.spec.ts b/src/app/components/home/home.component.spec.ts index 490e81b..482c23c 100644 --- a/src/app/components/home/home.component.spec.ts +++ b/src/app/components/home/home.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { HomeComponent } from './home.component'; +import {HomeComponent} from './home.component'; describe('HomeComponent', () => { let component: HomeComponent; @@ -8,9 +8,9 @@ describe('HomeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ HomeComponent ] + declarations: [HomeComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index 22abaab..7df509d 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -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 {Component, OnInit} from '@angular/core'; +import {DatasharingService} from 'src/app/services/datasharing.service'; +import {FeedService} from 'src/app/services/feed/feed.service'; @Component({ selector: 'app-home', @@ -11,7 +11,8 @@ export class HomeComponent implements OnInit { loggedIn: boolean; - constructor(private data: DatasharingService, private feedService: FeedService) { } + constructor(private data: DatasharingService, private feedService: FeedService) { + } ngOnInit() { this.data.currentUserInfo.subscribe(user => { diff --git a/src/app/components/imprint/imprint.component.sass b/src/app/components/imprint/imprint.component.sass index 6d771cc..571666b 100644 --- a/src/app/components/imprint/imprint.component.sass +++ b/src/app/components/imprint/imprint.component.sass @@ -8,8 +8,8 @@ margin: 0 auto h1.mat-display-1 - margin: 0 + margin: 0 + - diff --git a/src/app/components/imprint/imprint.component.spec.ts b/src/app/components/imprint/imprint.component.spec.ts index 49b68ae..79721d0 100644 --- a/src/app/components/imprint/imprint.component.spec.ts +++ b/src/app/components/imprint/imprint.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { ImprintComponent } from './imprint.component'; +import {ImprintComponent} from './imprint.component'; describe('ImprintComponent', () => { let component: ImprintComponent; @@ -8,9 +8,9 @@ describe('ImprintComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ImprintComponent ] + declarations: [ImprintComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/imprint/imprint.component.ts b/src/app/components/imprint/imprint.component.ts index ba755c1..aa45e45 100644 --- a/src/app/components/imprint/imprint.component.ts +++ b/src/app/components/imprint/imprint.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; @Component({ selector: 'app-imprint', @@ -7,7 +7,8 @@ import { Component, OnInit } from '@angular/core'; }) export class ImprintComponent implements OnInit { - constructor() { } + constructor() { + } ngOnInit() { } diff --git a/src/app/components/login/login.component.html b/src/app/components/login/login.component.html index 0d2f145..d0de276 100644 --- a/src/app/components/login/login.component.html +++ b/src/app/components/login/login.component.html @@ -1,24 +1,25 @@
- - - Login - - -
- {{getErrorMessage()}} - - - - - - - -
- -

You aren't part of greenvironment yet?

- Register -
-
+ + + Login + + +
+ {{getErrorMessage()}} + + + + + + + +
+ +

You aren't part of greenvironment yet?

+ Register +
+
diff --git a/src/app/components/login/login.component.sass b/src/app/components/login/login.component.sass index 131accc..d4f5c5c 100644 --- a/src/app/components/login/login.component.sass +++ b/src/app/components/login/login.component.sass @@ -6,21 +6,21 @@ max-width: 35em margin: 0 auto -.example-container +.example-container display: flex flex-direction: column -.example-container > * +.example-container > * width: 100% -.example-right-align +.example-right-align text-align: right input.example-right-align::-webkit-outer-spin-button, -input.example-right-align::-webkit-inner-spin-button +input.example-right-align::-webkit-inner-spin-button display: none -input.example-right-align +input.example-right-align -moz-appearance: textfield .mat-error @@ -35,7 +35,7 @@ input.example-right-align .mat-stroked-button width: 100% - + diff --git a/src/app/components/login/login.component.spec.ts b/src/app/components/login/login.component.spec.ts index d6d85a8..28a5704 100644 --- a/src/app/components/login/login.component.spec.ts +++ b/src/app/components/login/login.component.spec.ts @@ -1,6 +1,6 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import { LoginComponent } from './login.component'; +import {LoginComponent} from './login.component'; describe('LoginComponent', () => { let component: LoginComponent; @@ -8,9 +8,9 @@ describe('LoginComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoginComponent ] + declarations: [LoginComponent] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { diff --git a/src/app/components/login/login.component.ts b/src/app/components/login/login.component.ts index 6c26301..bb6313d 100644 --- a/src/app/components/login/login.component.ts +++ b/src/app/components/login/login.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; import {FormControl, Validators} from '@angular/forms'; -import { Login } from 'src/app/models/login'; -import { LoginService } from 'src/app/services/login/login.service'; +import {Login} from 'src/app/models/login'; +import {LoginService} from 'src/app/services/login/login.service'; import {Router} from '@angular/router'; import * as sha512 from 'js-sha512'; import {IErrorResponse} from '../../models/interfaces/IErrorResponse'; @@ -16,6 +16,7 @@ export class LoginComponent implements OnInit { constructor(private loginService: LoginService, private router: Router) { this.login = {passwordHash: null, email: null}; } + login: Login; hide = true; errorOccurred = false; @@ -43,7 +44,7 @@ export class LoginComponent implements OnInit { this.errorMessage = ' '; this.login.email = pEmail.trim().toLowerCase(); this.login.passwordHash = sha512.sha512(pPasswordHash); - this.loginService.login(this.login).subscribe( () => { + this.loginService.login(this.login).subscribe(() => { this.router.navigateByUrl('').catch((error) => { this.errorMessage = error.message; this.errorOccurred = true; @@ -55,6 +56,7 @@ export class LoginComponent implements OnInit { }); } - ngOnInit() {} + ngOnInit() { + } } diff --git a/src/app/components/main-navigation/main-navigation.component.html b/src/app/components/main-navigation/main-navigation.component.html index 80caa1f..acc8103 100644 --- a/src/app/components/main-navigation/main-navigation.component.html +++ b/src/app/components/main-navigation/main-navigation.component.html @@ -1,20 +1,22 @@ - - + + - + Menu -
- -
-
- Hello, {{user.username}} -
+
+ +
+
+ Hello, {{user.username}} +
Home @@ -24,8 +26,10 @@
@@ -46,26 +50,27 @@ Greenvironment -