From 67c4664fe58d6062979b16df4ba5b72e2dabe32c Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 16 Jan 2020 15:29:10 +0100 Subject: [PATCH 01/13] Fix typos & stuff --- src/app/components/about/about.component.ts | 2 +- src/app/components/feed/feed.component.ts | 2 +- src/app/services/activity/activity.service.ts | 2 +- src/app/services/feed/feed.service.ts | 28 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/app/components/about/about.component.ts b/src/app/components/about/about.component.ts index d2907cd..c891813 100644 --- a/src/app/components/about/about.component.ts +++ b/src/app/components/about/about.component.ts @@ -23,7 +23,7 @@ export class AboutComponent implements OnInit { @ViewChild(MatSort, {static: true}) sort: MatSort; ngOnInit() { - this.activityService.getActivitys(); + this.activityService.getActivities(); this.activityService.activitylist.subscribe(response => { this.actionlist = response; this.dataSource = new MatTableDataSource(this.actionlist.Actions); diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 64efd5d..491b80d 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -38,7 +38,7 @@ export class FeedComponent implements OnInit { this.user = user; this.loggedIn = user.loggedIn; }); - this.activityService.getActivitys(); + this.activityService.getActivities(); this.activityService.activitylist.subscribe(response => { this.actionlist = response; }); diff --git a/src/app/services/activity/activity.service.ts b/src/app/services/activity/activity.service.ts index 4e4f43f..526bfd0 100644 --- a/src/app/services/activity/activity.service.ts +++ b/src/app/services/activity/activity.service.ts @@ -18,7 +18,7 @@ export class ActivityService { this.activitylist.next(pActivitylist); } - public getActivitys() { + public getActivities() { if (this.activitylist.getValue().Actions.length < 1) { const headers = new Headers(); headers.set('Content-Type', 'application/json'); diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 1f39cdc..9f990b9 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -14,9 +14,9 @@ export class FeedService { public newPostsAvailable = new BehaviorSubject(true); public topPostsAvailable = new BehaviorSubject(true); - public posts: BehaviorSubject = new BehaviorSubject(new Array()); - public newPosts: BehaviorSubject = new BehaviorSubject(new Array()); - public mostLikedPosts: BehaviorSubject = new BehaviorSubject(new Array()); + public posts: BehaviorSubject = new BehaviorSubject([]); + public newPosts: BehaviorSubject = new BehaviorSubject([]); + public mostLikedPosts: BehaviorSubject = new BehaviorSubject([]); private activePostList = 'NEW'; private mostLikedOffset = 0; private newOffset = 0; @@ -52,9 +52,9 @@ export class FeedService { content: pContent }}; return this.http.post(environment.graphQLUrl, body).subscribe(response => { - const updatedposts = this.newPosts.getValue(); - updatedposts.unshift(this.renderPost(response.json())); - this.newPosts.next(updatedposts); + const updatedPosts = this.newPosts.getValue(); + updatedPosts.unshift(this.renderPost(response.json())); + this.newPosts.next(updatedPosts); this.setPost('NEW'); }); } @@ -89,14 +89,14 @@ export class FeedService { id: activityId }}; return this.http.post(environment.graphQLUrl, body).subscribe(response => { - const updatedposts = this.newPosts.getValue(); - updatedposts.unshift(this.renderPost(response.json())); - this.newPosts.next(updatedposts); + const updatedPosts = this.newPosts.getValue(); + updatedPosts.unshift(this.renderPost(response.json())); + this.newPosts.next(updatedPosts); this.setPost('NEW'); }); } - public upvote(pPostID: number): any { + public upvote(postId: number): any { const headers = new Headers(); headers.set('Content-Type', 'application/json'); @@ -105,7 +105,7 @@ export class FeedService { post{userVote upvotes downvotes} } }`, variables: { - postId: pPostID + postId }}; return this.http.post(environment.graphQLUrl, body); @@ -163,12 +163,12 @@ export class FeedService { headers.set('Content-Type', 'application/json'); this.http.post(environment.graphQLUrl, this.buildJson(this.activePostList, this.newOffset)) .subscribe(response => { - let updatedposts = this.newPosts.getValue(); - updatedposts = updatedposts.concat(this.renderAllPosts(response.json())); + let updatedPosts = this.newPosts.getValue(); + updatedPosts = updatedPosts.concat(this.renderAllPosts(response.json())); if (this.renderAllPosts(response.json()).length < 1) { this.newPostsAvailable.next(false); } - this.newPosts.next(updatedposts); + this.newPosts.next(updatedPosts); this.setPost('NEW'); }); } else if (this.activePostList === 'TOP' && this.topPostsAvailable) { From 279c7cec323ec09db738a8a21b9df9fd70dcb983 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 16 Jan 2020 15:29:10 +0100 Subject: [PATCH 02/13] Fix typos & stuff --- src/app/components/about/about.component.ts | 2 +- src/app/components/feed/feed.component.ts | 2 +- src/app/services/activity/activity.service.ts | 2 +- src/app/services/feed/feed.service.ts | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/components/about/about.component.ts b/src/app/components/about/about.component.ts index d2907cd..c891813 100644 --- a/src/app/components/about/about.component.ts +++ b/src/app/components/about/about.component.ts @@ -23,7 +23,7 @@ export class AboutComponent implements OnInit { @ViewChild(MatSort, {static: true}) sort: MatSort; ngOnInit() { - this.activityService.getActivitys(); + this.activityService.getActivities(); this.activityService.activitylist.subscribe(response => { this.actionlist = response; this.dataSource = new MatTableDataSource(this.actionlist.Actions); diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 64efd5d..491b80d 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -38,7 +38,7 @@ export class FeedComponent implements OnInit { this.user = user; this.loggedIn = user.loggedIn; }); - this.activityService.getActivitys(); + this.activityService.getActivities(); this.activityService.activitylist.subscribe(response => { this.actionlist = response; }); diff --git a/src/app/services/activity/activity.service.ts b/src/app/services/activity/activity.service.ts index 4e4f43f..526bfd0 100644 --- a/src/app/services/activity/activity.service.ts +++ b/src/app/services/activity/activity.service.ts @@ -18,7 +18,7 @@ export class ActivityService { this.activitylist.next(pActivitylist); } - public getActivitys() { + public getActivities() { if (this.activitylist.getValue().Actions.length < 1) { const headers = new Headers(); headers.set('Content-Type', 'application/json'); diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index a516eb3..955cf2d 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -14,9 +14,9 @@ export class FeedService { public newPostsAvailable = new BehaviorSubject(true); public topPostsAvailable = new BehaviorSubject(true); - public posts: BehaviorSubject = new BehaviorSubject(new Array()); - public newPosts: BehaviorSubject = new BehaviorSubject(new Array()); - public mostLikedPosts: BehaviorSubject = new BehaviorSubject(new Array()); + public posts: BehaviorSubject = new BehaviorSubject([]); + public newPosts: BehaviorSubject = new BehaviorSubject([]); + public mostLikedPosts: BehaviorSubject = new BehaviorSubject([]); private activePostList = 'NEW'; private mostLikedOffset = 0; private newOffset = 0; @@ -96,7 +96,7 @@ export class FeedService { }); } - public upvote(pPostID: number): any { + public upvote(postId: number): any { const headers = new Headers(); headers.set('Content-Type', 'application/json'); @@ -105,7 +105,7 @@ export class FeedService { post{userVote upvotes downvotes} } }`, variables: { - postId: pPostID + postId }}; return this.http.post(environment.graphQLUrl, body); @@ -168,7 +168,7 @@ export class FeedService { if (this.renderAllPosts(response).length < 1) { this.newPostsAvailable.next(false); } - this.newPosts.next(updatedposts); + this.newPosts.next(updatedPosts); this.setPost('NEW'); }); } else if (this.activePostList === 'TOP' && this.topPostsAvailable) { From b15dc8e16b542c45c91676089118276c44f27484 Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 16 Jan 2020 23:20:14 +0100 Subject: [PATCH 03/13] Revert "Merge remote-tracking branch 'origin/julius-dev' into julius-dev" This reverts commit da971a1f135d6baefa33eb759c3c8f2102f2e64a. --- src/app/services/feed/feed.service.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index bf0952b..955cf2d 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -52,15 +52,9 @@ export class FeedService { content: pContent }}; return this.http.post(environment.graphQLUrl, body).subscribe(response => { -<<<<<<< HEAD const updatedposts = this.newPosts.getValue(); updatedposts.unshift(this.renderPost(response)); this.newPosts.next(updatedposts); -======= - const updatedPosts = this.newPosts.getValue(); - updatedPosts.unshift(this.renderPost(response.json())); - this.newPosts.next(updatedPosts); ->>>>>>> julius-dev this.setPost('NEW'); }); } @@ -95,15 +89,9 @@ export class FeedService { id: activityId }}; return this.http.post(environment.graphQLUrl, body).subscribe(response => { -<<<<<<< HEAD const updatedposts = this.newPosts.getValue(); updatedposts.unshift(this.renderPost(response)); this.newPosts.next(updatedposts); -======= - const updatedPosts = this.newPosts.getValue(); - updatedPosts.unshift(this.renderPost(response.json())); - this.newPosts.next(updatedPosts); ->>>>>>> julius-dev this.setPost('NEW'); }); } @@ -175,15 +163,9 @@ export class FeedService { headers.set('Content-Type', 'application/json'); this.http.post(environment.graphQLUrl, this.buildJson(this.activePostList, this.newOffset)) .subscribe(response => { -<<<<<<< HEAD let updatedposts = this.newPosts.getValue(); updatedposts = updatedposts.concat(this.renderAllPosts(response)); if (this.renderAllPosts(response).length < 1) { -======= - let updatedPosts = this.newPosts.getValue(); - updatedPosts = updatedPosts.concat(this.renderAllPosts(response.json())); - if (this.renderAllPosts(response.json()).length < 1) { ->>>>>>> julius-dev this.newPostsAvailable.next(false); } this.newPosts.next(updatedPosts); From 59994f369746e6e37ababbceb6819bd654eac9ce Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 16 Jan 2020 23:28:57 +0100 Subject: [PATCH 04/13] Fix votes not getting refreshed --- .../components/feed/postlist/postlist.component.ts | 12 ++++++------ src/app/services/feed/feed.service.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/components/feed/postlist/postlist.component.ts b/src/app/components/feed/postlist/postlist.component.ts index ec2e5f1..b16794d 100644 --- a/src/app/components/feed/postlist/postlist.component.ts +++ b/src/app/components/feed/postlist/postlist.component.ts @@ -22,18 +22,18 @@ export class PostlistComponent implements OnInit { voteUp(pPost: Post) { this.feedService.upvote(pPost.id).subscribe(response => { // this.voteEvent.emit(true); - pPost.userVote = response.json().data.vote.post.userVote; - pPost.upvotes = response.json().data.vote.post.upvotes; - pPost.downvotes = response.json().data.vote.post.downvotes; + pPost.userVote = response.data.vote.post.userVote; + pPost.upvotes = response.data.vote.post.upvotes; + pPost.downvotes = response.data.vote.post.downvotes; }); } voteDown(pPost: Post) { this.feedService.downvote(pPost.id).subscribe(response => { // this.voteEvent.emit(true); - pPost.userVote = response.json().data.vote.post.userVote; - pPost.upvotes = response.json().data.vote.post.upvotes; - pPost.downvotes = response.json().data.vote.post.downvotes; + pPost.userVote = response.data.vote.post.userVote; + pPost.upvotes = response.data.vote.post.upvotes; + pPost.downvotes = response.data.vote.post.downvotes; }); } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 955cf2d..99217fe 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -168,7 +168,7 @@ export class FeedService { if (this.renderAllPosts(response).length < 1) { this.newPostsAvailable.next(false); } - this.newPosts.next(updatedPosts); + this.newPosts.next(updatedposts); this.setPost('NEW'); }); } else if (this.activePostList === 'TOP' && this.topPostsAvailable) { From b6d578fdb6a450fb06742edfa5d1471bc5a99022 Mon Sep 17 00:00:00 2001 From: trivernis Date: Fri, 17 Jan 2020 13:32:37 +0100 Subject: [PATCH 05/13] Add the correct favicon --- src/favicon.ico | Bin 5430 -> 27088 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/favicon.ico diff --git a/src/favicon.ico b/src/favicon.ico old mode 100644 new mode 100755 index 8081c7ceaf2be08bf59010158c586170d9d2d517..279b7a9a0e7c0ad03aeb0e032b142888f1b57708 GIT binary patch literal 27088 zcmeFY^;cWn6E7Ts2X`ngMGJ(sxH~Py-L=p{v7!Nj7BAXT(&A7ocyagA(%|kCXb3LB z_2&8Bb$@*SgZE@*t+SG|=Iq%s^BLU$02b!+--QKW1GK&c0BAAyak|>-B%nti%q__a z4HbRNzo-9w3Ggt#{Fzye2Vfq4p`vIQkhQlA$+9q7mOmQ3SaST*IEnivKkAE;MQPZP z!XM)`X9~wuRRw&-@AbS1L_?&4M-oGvGDD<5&@W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vEw0Ul ze(ha!e&qANbTL1ZneNl45t=#Ot??C0MHjjgY8%*mGisN|S6%g3;Hlx#fMNcL<87MW zZ>6moo1YD?P!fJ#Jb(4)_cc50X5n0KoDYfdPoL^iV`k&o{LPyaoqMqk92wVM#_O0l z09$(A-D+gVIlq4TA&{1T@BsUH`Bm=r#l$Z51J-U&F32+hfUP-iLo=jg7Xmy+WLq6_tWv&`wDlz#`&)Jp~iQf zZP)tu>}pIIJKuw+$&t}GQuqMd%Z>0?t%&BM&Wo^4P^Y z)c6h^f2R>X8*}q|bblAF?@;%?2>$y+cMQbN{X$)^R>vtNq_5AB|0N5U*d^T?X9{xQnJYeU{ zoZL#obI;~Pp95f1`%X3D$Mh*4^?O?IT~7HqlWguezmg?Ybq|7>qQ(@pPHbE9V?f|( z+0xo!#m@Np9PljsyxBY-UA*{U*la#8Wz2sO|48_-5t8%_!n?S$zlGe+NA%?vmxjS- zHE5O3ZarU=X}$7>;Okp(UWXJxI%G_J-@IH;%5#Rt$(WUX?6*Ux!IRd$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- Date: Sat, 18 Jan 2020 11:53:57 +0100 Subject: [PATCH 06/13] Change icons - Change default profile picture - Change dark mode icon to flat one that matches the color schmee - Move icons to assets/images --- src/app/app.module.ts | 12 +- src/app/models/user.ts | 2 +- src/app/services/feed/feed.service.ts | 4 +- src/app/services/profile/profile.service.ts | 4 +- src/assets/images/account_circle-24px.svg | 81 ------- src/assets/images/default-profilepic.svg | 200 ++++++++++++++++++ .../images/gv-logo-flat.svg} | 83 +------- .../images/gv-logo-white.svg} | 0 8 files changed, 218 insertions(+), 168 deletions(-) delete mode 100644 src/assets/images/account_circle-24px.svg create mode 100755 src/assets/images/default-profilepic.svg rename src/{app/gv-new-logo.svg => assets/images/gv-logo-flat.svg} (52%) mode change 100644 => 100755 rename src/{app/gv-new-logo-white.svg => assets/images/gv-logo-white.svg} (100%) mode change 100644 => 100755 diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 99d543d..e696687 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -68,10 +68,6 @@ import {MatDatepickerModule} from '@angular/material/datepicker'; import {MatNativeDateModule} from '@angular/material/'; import {MatSnackBarModule} from '@angular/material/snack-bar'; -// import logo from 'src/assets/gv-new-logo.svg'; -import logo from '!!raw-loader!./gv-new-logo-white.svg'; -import logo_green from '!!raw-loader!./gv-new-logo.svg'; - const config: SocketIoConfig = { url: 'http://localhost:4444', options: {} }; @@ -162,9 +158,9 @@ const appRoutes: Routes = [ }) export class AppModule { constructor(iconRegistry: MatIconRegistry, sanitizer: DomSanitizer) { - iconRegistry.addSvgIconLiteral( - 'logo', sanitizer.bypassSecurityTrustHtml(logo)); - iconRegistry.addSvgIconLiteral( - 'logo_green', sanitizer.bypassSecurityTrustHtml(logo_green)); + iconRegistry.addSvgIcon( + 'logo', sanitizer.bypassSecurityTrustResourceUrl('assets/images/gv-logo-white.svg')); + iconRegistry.addSvgIcon( + 'logo_green', sanitizer.bypassSecurityTrustResourceUrl('assets/images/gv-logo-flat.svg')); } } diff --git a/src/app/models/user.ts b/src/app/models/user.ts index 2c26c05..25c1773 100644 --- a/src/app/models/user.ts +++ b/src/app/models/user.ts @@ -65,7 +65,7 @@ export class User { if (path) { return environment.greenvironmentUrl + path; } else { - return 'assets/images/account_circle-24px.svg'; + return 'assets/images/default-profilepic.svg'; } } } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index 99217fe..f912f11 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -239,7 +239,7 @@ export class FeedService { if (post.author.profilePicture) { profilePicture = environment.greenvironmentUrl + post.author.profilePicture; } else { - profilePicture = 'assets/images/account_circle-24px.svg'; + profilePicture = 'assets/images/default-profilepic.svg'; } const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture); const temp = new Date(Number(post.createdAt)); @@ -271,7 +271,7 @@ export class FeedService { if (post.author.profilePicture) { profilePicture = environment.greenvironmentUrl + post.author.profilePicture; } else { - profilePicture = 'assets/images/account_circle-24px.svg'; + profilePicture = 'assets/images/default-profilepic.svg'; } const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture); const temp = new Date(Number(post.createdAt)); diff --git a/src/app/services/profile/profile.service.ts b/src/app/services/profile/profile.service.ts index 1a28185..1eecb07 100644 --- a/src/app/services/profile/profile.service.ts +++ b/src/app/services/profile/profile.service.ts @@ -85,7 +85,7 @@ export class ProfileService { if (response.data.getUser.profilePicture) { profile.profilePicture = environment.greenvironmentUrl + response.data.getUser.profilePicture; } else { - profile.profilePicture = 'assets/images/account_circle-24px.svg'; + profile.profilePicture = 'assets/images/default-profilepic.svg'; } const temp = new Date(Number(response.data.getUser.joinedAt)); const date = temp.toLocaleString('en-GB'); @@ -102,7 +102,7 @@ export class ProfileService { if (post.author.profilePicture) { profilePicture = environment.greenvironmentUrl + post.author.profilePicture; } else { - profilePicture = 'assets/images/account_circle-24px.svg'; + profilePicture = 'assets/images/default-profilepic.svg'; } const author = new Author(post.author.id, post.author.name, post.author.handle, profilePicture); const ptemp = new Date(Number(post.createdAt)); diff --git a/src/assets/images/account_circle-24px.svg b/src/assets/images/account_circle-24px.svg deleted file mode 100644 index 6b911ac..0000000 --- a/src/assets/images/account_circle-24px.svg +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/src/assets/images/default-profilepic.svg b/src/assets/images/default-profilepic.svg new file mode 100755 index 0000000..fa37d4d --- /dev/null +++ b/src/assets/images/default-profilepic.svg @@ -0,0 +1,200 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/src/app/gv-new-logo.svg b/src/assets/images/gv-logo-flat.svg old mode 100644 new mode 100755 similarity index 52% rename from src/app/gv-new-logo.svg rename to src/assets/images/gv-logo-flat.svg index b1cb0cb..b23d0b4 --- a/src/app/gv-new-logo.svg +++ b/src/assets/images/gv-logo-flat.svg @@ -7,7 +7,6 @@ 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" @@ -16,73 +15,9 @@ version="1.1" id="SVGRoot" inkscape:version="0.92.4 5da689c313, 2019-01-14" - sodipodi:docname="gv-new-logo.svg"> + sodipodi:docname="gv-flat-logo.svg"> - - - - - - - - - - - - - - - - + id="defs3412" /> image/svg+xml - + @@ -120,19 +55,19 @@ inkscape:label="Layer 2" style="display:inline"> Date: Sat, 18 Jan 2020 17:12:12 +0100 Subject: [PATCH 07/13] Add error messages when posting failed --- src/app/components/feed/feed.component.html | 11 ++-- src/app/components/feed/feed.component.ts | 58 ++++++++++++++------- src/app/services/feed/feed.service.ts | 10 ++-- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 8dd1575..dac9442 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -4,10 +4,10 @@ infinite-scroll [scrollWindow]="false" (scrolled)="onScroll()">
- + - + @@ -24,14 +24,15 @@ infinite-scroll -
- + You need to login to post something. @@ -55,4 +56,4 @@ infinite-scroll
- \ No newline at end of file + diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 491b80d..ff21e52 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -1,10 +1,11 @@ -import { Component, OnInit } from '@angular/core'; -import { Post } from 'src/app/models/post'; -import { FeedService } from 'src/app/services/feed/feed.service'; -import { Activitylist } from 'src/app/models/activity'; -import { DatasharingService } from '../../services/datasharing.service'; -import { ActivityService } from 'src/app/services/activity/activity.service'; -import { User } from 'src/app/models/user'; +import {Component, OnInit} from '@angular/core'; +import {Post} from 'src/app/models/post'; +import {FeedService} from 'src/app/services/feed/feed.service'; +import {Activitylist} from 'src/app/models/activity'; +import {DatasharingService} from '../../services/datasharing.service'; +import {ActivityService} from 'src/app/services/activity/activity.service'; +import {User} from 'src/app/models/user'; +import {IErrorResponse} from '../../models/interfaces/IErrorResponse'; @Component({ selector: 'home-feed', @@ -17,21 +18,25 @@ export class FeedComponent implements OnInit { checked = false; // if the "I protected the environment."-box is checked view = 'new'; - empty: any; - // id of the green activity + textInputValue: string; + // id of the green activity value: any; - parentSelectedPostList: Array; + parentSelectedPostList: Post[]; actionlist: Activitylist = new Activitylist(); loggedIn = false; user: User; + errorOccurred: boolean; + + private errorMessage: string; constructor( private feedService: FeedService, private data: DatasharingService, private activityService: ActivityService - ) { } + ) { + } ngOnInit() { this.data.currentUserInfo.subscribe(user => { @@ -60,15 +65,23 @@ export class FeedComponent implements OnInit { createPost(pElement, activityId: string) { if (pElement && activityId && this.checked) { - this.feedService.createPostActivity(pElement.value, activityId); - pElement.value = ''; - this.empty = ''; - this.view = 'new'; + this.feedService.createPostActivity(pElement.value, activityId).subscribe(() => { + pElement.value = ''; + this.textInputValue = ''; + this.view = 'new'; + }, (error: IErrorResponse) => { + this.errorOccurred = true; + this.errorMessage = error.error.errors[0].message; + }); } else if (pElement) { - this.feedService.createPost(pElement.value); - pElement.value = ''; - this.empty = ''; - this.view = 'new'; + this.feedService.createPost(pElement.value).subscribe(() => { + pElement.value = ''; + this.textInputValue = ''; + this.view = 'new'; + }, (error: IErrorResponse) => { + this.errorOccurred = true; + this.errorMessage = error.error.errors[0].message; + }); } } @@ -84,4 +97,11 @@ export class FeedComponent implements OnInit { showMostLiked() { this.feedService.getPosts('TOP'); } + + /** + * Returns the error message if one exists + */ + getErrorMessage() { + return this.errorMessage; + } } diff --git a/src/app/services/feed/feed.service.ts b/src/app/services/feed/feed.service.ts index f912f11..dc10fd5 100644 --- a/src/app/services/feed/feed.service.ts +++ b/src/app/services/feed/feed.service.ts @@ -5,7 +5,7 @@ import { Author } from 'src/app/models/author'; import { environment } from 'src/environments/environment'; import { Activity } from 'src/app/models/activity'; import { BehaviorSubject } from 'rxjs'; -import { User } from 'src/app/models/user'; +import {tap} from 'rxjs/operators'; @Injectable({ providedIn: 'root' @@ -51,12 +51,12 @@ export class FeedService { }`, variables: { content: pContent }}; - return this.http.post(environment.graphQLUrl, body).subscribe(response => { + return this.http.post(environment.graphQLUrl, body).pipe(tap(response => { const updatedposts = this.newPosts.getValue(); updatedposts.unshift(this.renderPost(response)); this.newPosts.next(updatedposts); this.setPost('NEW'); - }); + })); } public createPostActivity(pContent: String, activityId: String) { @@ -88,12 +88,12 @@ export class FeedService { content: pContent, id: activityId }}; - return this.http.post(environment.graphQLUrl, body).subscribe(response => { + return this.http.post(environment.graphQLUrl, body).pipe(tap(response => { const updatedposts = this.newPosts.getValue(); updatedposts.unshift(this.renderPost(response)); this.newPosts.next(updatedposts); this.setPost('NEW'); - }); + })); } public upvote(postId: number): any { From f9ef6c2669916448ab86bad7b245b880b8b51e36 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 18:19:26 +0100 Subject: [PATCH 08/13] Refactor profile and self service --- src/app/app.component.ts | 2 +- .../components/profile/profile.component.ts | 4 +- src/app/models/user.ts | 36 +++-- src/app/services/profile/profile.service.ts | 149 +++++++++--------- src/app/services/selfservice/self.service.ts | 110 +++++++------ 5 files changed, 164 insertions(+), 137 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f332f7b..df671f7 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,7 +15,7 @@ export class AppComponent implements OnInit { ngOnInit() { this.data.currentUserInfo.subscribe(user => { if (user.loggedIn !== true) { - this.selfservice.checkIfLoggedIn(); + this.selfservice.checkIfLoggedIn().subscribe(); } }); } diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index b1a9aba..948e830 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -58,9 +58,7 @@ export class ProfileComponent implements OnInit { this.userProfile = response; // tslint:disable-next-line:max-line-length this.userProfile.allowedToSendRequest = this.requestService.isAllowedToSendRequest(this.userProfile.userID, this.self); - if (this.userProfile.userID === this.self.userID) { - this.ownProfile = true; - } else {this.ownProfile = false; } + this.ownProfile = this.userProfile.userID === this.self.userID; this.rankname = this.levellist.getLevelName(this.userProfile.level); } else { this.profileNotFound = true; } this.loading = false; diff --git a/src/app/models/user.ts b/src/app/models/user.ts index 25c1773..c4658ca 100644 --- a/src/app/models/user.ts +++ b/src/app/models/user.ts @@ -46,19 +46,29 @@ export class User { } catch (err) { console.error(err); } - this.friends = userDataResponse.friends - .map(friend => new FriendInfo( - friend.id, friend.name, - friend.level, - this.buildProfilePictureUrl(friend.profilePicture) - )); - this.groups = userDataResponse.groups - .map(group => new GroupInfo(group.id, group.name)); - this.chatIDs = userDataResponse.chats.map(chat => chat.id); - this.sentRequestUserIDs = userDataResponse.sentRequests - .map(request => request.receiver.id); - this.receivedRequests = userDataResponse.receivedRequests - .map(request => new FriendRequest(request.id, request.sender.id, request.sender.handle, request.sender.name)); + if (userDataResponse.friends) { + this.friends = userDataResponse.friends + .map(friend => new FriendInfo( + friend.id, friend.name, + friend.level, + this.buildProfilePictureUrl(friend.profilePicture) + )); + } + if (userDataResponse.groups) { + this.groups = userDataResponse.groups + .map(group => new GroupInfo(group.id, group.name)); + } + if (userDataResponse.chats) { + this.chatIDs = userDataResponse.chats.map(chat => chat.id); + } + if (userDataResponse.sentRequests) { + this.sentRequestUserIDs = userDataResponse.sentRequests + .map(request => request.receiver.id); + } + if (userDataResponse.receivedRequests) { + this.receivedRequests = userDataResponse.receivedRequests + .map(request => new FriendRequest(request.id, request.sender.id, request.sender.handle, request.sender.name)); + } } buildProfilePictureUrl(path: string): string { diff --git a/src/app/services/profile/profile.service.ts b/src/app/services/profile/profile.service.ts index 1eecb07..b1df34f 100644 --- a/src/app/services/profile/profile.service.ts +++ b/src/app/services/profile/profile.service.ts @@ -1,92 +1,97 @@ -import { Injectable } from '@angular/core'; -import { Http } from '@angular/http'; -import { Post } from 'src/app/models/post'; -import { Author } from 'src/app/models/author'; -import { environment } from 'src/environments/environment'; -import { User } from 'src/app/models/user'; -import { Observable, Subject } from 'rxjs'; -import { Activity } from 'src/app/models/activity'; +import {Injectable} from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {Post} from 'src/app/models/post'; +import {Author} from 'src/app/models/author'; +import {environment} from 'src/environments/environment'; +import {User} from 'src/app/models/user'; +import {Subject} from 'rxjs'; +import {Activity} from 'src/app/models/activity'; +import {BaseService} from '../base.service'; + +const graphqlGetProfileQuery = `query($userId: ID) { + getUser(userId:$userId){ + id + handle + name + profilePicture + points + level + friendCount + groupCount + joinedAt + friends{ + id + } + posts{ + id, + content, + htmlContent, + upvotes, + downvotes, + userVote, + deletable, + activity{ + id + name + description + points + }, + author{ + name, + handle, + profilePicture + id}, + createdAt + } + } +}`; @Injectable({ providedIn: 'root' }) -export class ProfileService { +export class ProfileService extends BaseService { + + constructor(private http: HttpClient) { + super(); + } public proflile: Subject = new Subject(); - constructor(private http: Http) { } + /** + * Builds the request body of a getProfile request + * @param id + */ + private static buildGetProfileBody(id: string): any { + return { + query: graphqlGetProfileQuery, + variables: { + userId: id, + } + }; + } + /** + * Returns the data for the specified user. + * @param userId + */ public getUserData(userId: string) { const headers = new Headers(); headers.set('Content-Type', 'application/json'); - // return this.renderProfile(this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId))); - this.http.post(environment.graphQLUrl, this.buildGetProfileJson(userId)).subscribe(result => { - // push onto subject - this.proflile.next(this.renderProfile(result.json())); + this.http.post(environment.graphQLUrl, ProfileService.buildGetProfileBody(userId)).subscribe(result => { + this.proflile.next(this.getProfileData(result)); return this.proflile; }); } - public buildGetProfileJson(id: string): any { - const body = {query: `query($userId: ID) { - getUser(userId:$userId){ - id - handle - name - profilePicture - points - level - friendCount - groupCount - joinedAt - friends{ - id - } - posts{ - id, - content, - htmlContent, - upvotes, - downvotes, - userVote, - deletable, - activity{ - id - name - description - points - }, - author{ - name, - handle, - profilePicture - id}, - createdAt - } - } - }`, variables: { - userId: id, - }}; - return body; - } - - public renderProfile(response: any): User { + /** + * Returns a userinstance filled with profile data + * @param response + */ + public getProfileData(response: any): User { const posts = new Array(); const profile = new User(); - if (response.data.getUser != null) { - - profile.userID = response.data.getUser.id; - profile.username = response.data.getUser.name; - profile.handle = response.data.getUser.handle; - profile.points = response.data.getUser.points; - profile.level = response.data.getUser.level; - profile.friendCount = response.data.getUser.friendCount; - profile.groupCount = response.data.getUser.groupCount; - if (response.data.getUser.profilePicture) { - profile.profilePicture = environment.greenvironmentUrl + response.data.getUser.profilePicture; - } else { - profile.profilePicture = 'assets/images/default-profilepic.svg'; - } + if (response.data.getUser) { + profile.assignFromResponse(response.data.getUser); const temp = new Date(Number(response.data.getUser.joinedAt)); const date = temp.toLocaleString('en-GB'); profile.joinedAt = date; diff --git a/src/app/services/selfservice/self.service.ts b/src/app/services/selfservice/self.service.ts index efb8fb6..133f8ad 100644 --- a/src/app/services/selfservice/self.service.ts +++ b/src/app/services/selfservice/self.service.ts @@ -1,41 +1,87 @@ -import { Injectable, EventEmitter, Output } from '@angular/core'; -import {Http, URLSearchParams, Headers} from '@angular/http'; -import { User } from 'src/app/models/user'; -import { DatasharingService } from '../datasharing.service'; +import {Injectable} from '@angular/core'; +import {User} from 'src/app/models/user'; +import {DatasharingService} from '../datasharing.service'; import {Router} from '@angular/router'; -import { environment } from 'src/environments/environment'; -import { FriendRequest } from 'src/app/models/friendRequest'; -import { FriendInfo } from 'src/app/models/friendinfo'; -import { GroupInfo } from 'src/app/models/groupinfo'; +import {environment} from 'src/environments/environment'; +import {FriendRequest} from 'src/app/models/friendRequest'; +import {FriendInfo} from 'src/app/models/friendinfo'; +import {HttpClient} from '@angular/common/http'; +import {tap} from 'rxjs/operators'; +import {BaseService} from '../base.service'; + +const getSelfGraphqlQuery = `{ + getSelf{ + id, + name, + email, + handle, + points, + level, + profilePicture, + receivedRequests{id, sender{name, handle, id}}, + sentRequests{receiver{id}}, + friends { + id, + name, + level, + profilePicture, + }, + groups { + id, + name + }, + chats{ + id + }, + settings + } +}`; @Injectable({ providedIn: 'root' }) -export class SelfService { +export class SelfService extends BaseService { + + constructor(private http: HttpClient, private data: DatasharingService) { + super(); + } - constructor(private http: Http, private data: DatasharingService, private router: Router) { } + /** + * Builds the getself request body + */ + private static buildGetSelfBody(): any { + return { + query: getSelfGraphqlQuery, variables: {} + }; + } + /** + * Checks if the user is still logged in + */ public checkIfLoggedIn() { const url = environment.graphQLUrl; const headers = new Headers(); headers.set('Content-Type', 'application/json'); - return this.http.post(url, this.buildJson()) - .subscribe(response => { + return this.http.post(url, SelfService.buildGetSelfBody(), {headers: this.headers}) + .pipe(tap(response => { this.stillLoggedIn(); - this.updateUserInfo(response.json()); + this.updateUserInfo(response); }, error => { this.notLoggedIn(); - // this.fakeLogin(); - } - ); + })); } + public stillLoggedIn() { } public notLoggedIn() { } + /** + * Updates the info on a user + * @param response + */ public updateUserInfo(response: any) { const user = new User(); user.assignFromResponse(response.data.getSelf); @@ -63,36 +109,4 @@ export class SelfService { this.data.changeUserInfo(user); } - - public buildJson(): any { - const body = {query: `{ - getSelf{ - id, - name, - email, - handle, - points, - level, - profilePicture, - receivedRequests{id, sender{name, handle, id}}, - sentRequests{receiver{id}}, - friends { - id, - name, - level, - profilePicture, - }, - groups { - id, - name - }, - chats{ - id - }, - settings - } - }`, variables: { - }}; - return body; - } } From 454917efdd46265bfec13a98a7a2b560ee7d403b Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 18:28:54 +0100 Subject: [PATCH 09/13] Change error clearing to occur on input change --- src/app/components/feed/feed.component.html | 2 +- src/app/components/feed/feed.component.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index dac9442..c8339e5 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -7,7 +7,7 @@ infinite-scroll - + diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index ff21e52..599c45e 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. + */ + private onTextInputChange() { + if (this.errorOccurred) { + this.errorOccurred = false; + this.errorMessage = ''; + } + } } From f4a456ace47c041b3559399f163df6555a002b3e Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 18:33:11 +0100 Subject: [PATCH 10/13] Fix event callback being private --- src/app/components/feed/feed.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index 599c45e..baf1aa8 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -105,7 +105,7 @@ export class FeedComponent implements OnInit { /** * Executed when the text in the input field changes. */ - private onTextInputChange() { + onTextInputChange() { if (this.errorOccurred) { this.errorOccurred = false; this.errorMessage = ''; From 168c737665539d4f53d186c4213c6cdb7cf02f4a Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 19:38:01 +0100 Subject: [PATCH 11/13] Move file upload handling to self service --- .../components/profile/profile.component.ts | 18 ++++----- .../models/interfaces/IFileUploadResult.ts | 5 +++ src/app/services/selfservice/self.service.ts | 38 +++++-------------- 3 files changed, 21 insertions(+), 40 deletions(-) create mode 100644 src/app/models/interfaces/IFileUploadResult.ts diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index 948e830..e73df0b 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -8,7 +8,7 @@ import { ProfileService } from 'src/app/services/profile/profile.service'; import { HttpClient } from '@angular/common/http'; import { environment } from 'src/environments/environment'; import {MatSnackBar} from '@angular/material/snack-bar'; -import { reduce } from 'rxjs/operators'; +import {SelfService} from '../../services/selfservice/self.service'; @Component({ selector: 'app-profile', @@ -33,7 +33,8 @@ export class ProfileComponent implements OnInit { private router: Router, private requestService: RequestService, private data: DatasharingService, - private profileService: ProfileService) { + private profileService: ProfileService, + private selfService: SelfService) { router.events.forEach((event) => { // check if the user is on the profile page (of userY) and routes to the page of userY (e.g. his own page) if (event instanceof NavigationEnd) { @@ -69,18 +70,13 @@ export class ProfileComponent implements OnInit { user.allowedToSendRequest = false; this.requestService.sendFriendRequest(user); } - onFileInput(event) { - console.log(event.target.files[0]); - const formData: any = new FormData(); - formData.append('profilePicture', event.target.files[0]); - this.http.post(environment.greenvironmentUrl + '/upload', formData).subscribe( - (response: any) => { + onFileInput(event) { + this.selfService.changeProfilePicture(event.target.files[0]).subscribe((response) => { this.userProfile.profilePicture = environment.greenvironmentUrl + response.fileName; - }, - (error) => { + }, (error) => { this._snackBar.open('failed to upload picture', 'okay', { - duration: 3000 + duration: 3000 }); }); } diff --git a/src/app/models/interfaces/IFileUploadResult.ts b/src/app/models/interfaces/IFileUploadResult.ts new file mode 100644 index 0000000..fe564c6 --- /dev/null +++ b/src/app/models/interfaces/IFileUploadResult.ts @@ -0,0 +1,5 @@ +export interface IFileUploadResult { + success: boolean; + fileName?: string; + error?: string; +} diff --git a/src/app/services/selfservice/self.service.ts b/src/app/services/selfservice/self.service.ts index 133f8ad..d2c4a22 100644 --- a/src/app/services/selfservice/self.service.ts +++ b/src/app/services/selfservice/self.service.ts @@ -8,6 +8,7 @@ import {FriendInfo} from 'src/app/models/friendinfo'; import {HttpClient} from '@angular/common/http'; import {tap} from 'rxjs/operators'; import {BaseService} from '../base.service'; +import {IFileUploadResult} from '../../models/interfaces/IFileUploadResult'; const getSelfGraphqlQuery = `{ getSelf{ @@ -65,17 +66,18 @@ export class SelfService extends BaseService { return this.http.post(url, SelfService.buildGetSelfBody(), {headers: this.headers}) .pipe(tap(response => { - this.stillLoggedIn(); this.updateUserInfo(response); - }, error => { - this.notLoggedIn(); })); } - public stillLoggedIn() { - } - - public notLoggedIn() { + /** + * Uploads a file as a profile picture + * @param file + */ + public changeProfilePicture(file: any) { + const formData: any = new FormData(); + formData.append('profilePicture', file); + return this.http.post(environment.greenvironmentUrl + '/upload', formData); } /** @@ -87,26 +89,4 @@ export class SelfService extends BaseService { user.assignFromResponse(response.data.getSelf); this.data.changeUserInfo(user); } - - public fakeLogin() { - const user: User = new User(); - let friendRequest: FriendRequest = new FriendRequest(); - user.loggedIn = true; - user.userID = 1; - user.username = 'Rapier'; - user.handle = 'rapier123'; - user.email = 'r@r.com'; - user.points = 100; - user.level = 3; - user.friends.push(new FriendInfo(1, 'Freund77', 4, 'lalala')); - - friendRequest = new FriendRequest(); - friendRequest.id = 10; - friendRequest.senderUserID = 99; - friendRequest.senderUsername = 'Löwe'; - friendRequest.senderHandle = 'loewe123'; - user.receivedRequests.push(friendRequest); - - this.data.changeUserInfo(user); - } } From d99310c9b64499600fa64b37327a3097b3a5159a Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 22:11:02 +0100 Subject: [PATCH 12/13] Add File upload dialog --- src/app/app.module.ts | 13 ++- .../fileUpload/fileUpload.component.sass | 23 ++++++ .../fileUpload/fileUpload.component.ts | 79 +++++++++++++++++++ .../fileUploadDialog.component.html | 16 ++++ .../components/profile/profile.component.html | 44 ++++------- .../components/profile/profile.component.sass | 10 +-- .../components/profile/profile.component.ts | 24 +++--- 7 files changed, 162 insertions(+), 47 deletions(-) create mode 100644 src/app/components/profile/fileUpload/fileUpload.component.sass create mode 100644 src/app/components/profile/fileUpload/fileUpload.component.ts create mode 100644 src/app/components/profile/fileUpload/fileUploadDialog.component.html diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e696687..33487a8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -65,8 +65,9 @@ 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: {} }; @@ -107,6 +108,7 @@ const appRoutes: Routes = [ GroupComponent, DialogCreateEventComponent, UserlistComponent, + DialogFileUploadComponent, ], imports: [ BrowserModule, @@ -124,7 +126,7 @@ const appRoutes: Routes = [ MatIconModule, BrowserAnimationsModule, MatSliderModule, - MatFormFieldModule , + MatFormFieldModule, MatInputModule, ReactiveFormsModule, MatToolbarModule, @@ -151,8 +153,13 @@ const appRoutes: Routes = [ MatExpansionModule, MatDatepickerModule, MatSnackBarModule, + MatProgressBarModule, + ], + entryComponents: [ + DialogCreateGroupComponent, + DialogCreateEventComponent, + DialogFileUploadComponent ], - entryComponents: [ DialogCreateGroupComponent, DialogCreateEventComponent ], providers: [], bootstrap: [AppComponent] }) diff --git a/src/app/components/profile/fileUpload/fileUpload.component.sass b/src/app/components/profile/fileUpload/fileUpload.component.sass new file mode 100644 index 0000000..a515920 --- /dev/null +++ b/src/app/components/profile/fileUpload/fileUpload.component.sass @@ -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 diff --git a/src/app/components/profile/fileUpload/fileUpload.component.ts b/src/app/components/profile/fileUpload/fileUpload.component.ts new file mode 100644 index 0000000..fe24bb1 --- /dev/null +++ b/src/app/components/profile/fileUpload/fileUpload.component.ts @@ -0,0 +1,79 @@ +import {Component, EventEmitter} 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; + private file; + public localFileUrl; + + constructor(public dialogRef: MatDialogRef, private selfService: SelfService) { + this.profilePictureUrl = new BehaviorSubject(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); + } +} diff --git a/src/app/components/profile/fileUpload/fileUploadDialog.component.html b/src/app/components/profile/fileUpload/fileUploadDialog.component.html new file mode 100644 index 0000000..7edfd5c --- /dev/null +++ b/src/app/components/profile/fileUpload/fileUploadDialog.component.html @@ -0,0 +1,16 @@ +
+

Upload a new Profile picture!

+
+ +
+

Preview:

+ +
+ +
+ {{getErrorMessage()}} +
+ + +
+
diff --git a/src/app/components/profile/profile.component.html b/src/app/components/profile/profile.component.html index cc5263c..75bbfb7 100644 --- a/src/app/components/profile/profile.component.html +++ b/src/app/components/profile/profile.component.html @@ -3,27 +3,26 @@ -
- +
+ camera_alt -
- + {{userProfile.username}} - - -
+ +
@{{userProfile.handle}} -
+
@@ -45,19 +44,18 @@ -
- +
+ camera_alt -
{{userProfile.username}} @{{userProfile.handle}} - @@ -72,20 +70,9 @@
- +
- -
@@ -94,4 +81,3 @@
- \ No newline at end of file diff --git a/src/app/components/profile/profile.component.sass b/src/app/components/profile/profile.component.sass index c6f8e7e..91a0d65 100644 --- a/src/app/components/profile/profile.component.sass +++ b/src/app/components/profile/profile.component.sass @@ -8,7 +8,7 @@ overflow: scroll overflow-x: hidden -#profile +#profile padding: 2em max-width: 1200px margin: 0 auto @@ -32,14 +32,14 @@ font-size: 14px margin-left: calc(100px + 0.5em) .info - margin-right: 1em + margin-right: 1em font-size: 14px #username margin: 0 0.5em #handle font-size: 14px -#icon +#icon display: none position: absolute z-index: 11 @@ -71,9 +71,7 @@ $mat-card-header-size: 100px !default z-index: 10 object-fit: cover - - #postlist margin: 0.5em auto padding: 0 - max-width: 690px \ No newline at end of file + max-width: 690px diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index e73df0b..17a7a62 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -9,13 +9,14 @@ import { HttpClient } from '@angular/common/http'; import { environment } from 'src/environments/environment'; import {MatSnackBar} from '@angular/material/snack-bar'; import {SelfService} from '../../services/selfservice/self.service'; +import {MatDialog} from '@angular/material'; +import {DialogFileUploadComponent} from './fileUpload/fileUpload.component'; @Component({ selector: 'app-profile', templateUrl: './profile.component.html', styleUrls: ['./profile.component.sass'] }) - export class ProfileComponent implements OnInit { levellist: Levellist = new Levellist(); ownProfile = false; @@ -34,7 +35,8 @@ export class ProfileComponent implements OnInit { private requestService: RequestService, private data: DatasharingService, private profileService: ProfileService, - private selfService: SelfService) { + private selfService: SelfService, + public dialog: MatDialog) { router.events.forEach((event) => { // check if the user is on the profile page (of userY) and routes to the page of userY (e.g. his own page) if (event instanceof NavigationEnd) { @@ -71,13 +73,17 @@ export class ProfileComponent implements OnInit { this.requestService.sendFriendRequest(user); } - onFileInput(event) { - this.selfService.changeProfilePicture(event.target.files[0]).subscribe((response) => { - this.userProfile.profilePicture = environment.greenvironmentUrl + response.fileName; - }, (error) => { - this._snackBar.open('failed to upload picture', 'okay', { - duration: 3000 - }); + /** + * Opens the file upload dialog + */ + openFileUploadDialog() { + const dialogRef = this.dialog.open(DialogFileUploadComponent, { + width: '400px' + }); + dialogRef.componentInstance.profilePictureUrl.subscribe((profilePictureUrl) => { + if (profilePictureUrl) { + this.userProfile.profilePicture = profilePictureUrl; + } }); } } From 5a19cc0dc4dafc7ac3de0e1ba85c61a1ef223aad Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 18 Jan 2020 22:14:56 +0100 Subject: [PATCH 13/13] Cleanup code --- src/app/app.component.spec.ts | 4 +- src/app/app.component.ts | 10 +- src/app/app.module.ts | 101 ++++---- src/app/components/about/about.component.html | 136 +++++------ src/app/components/about/about.component.sass | 3 +- .../components/about/about.component.spec.ts | 8 +- src/app/components/about/about.component.ts | 12 +- .../components/chat/chat.component.spec.ts | 8 +- src/app/components/chat/chat.component.ts | 24 +- .../chatlist/chatlist.component.html | 6 +- .../chatlist/chatlist.component.spec.ts | 8 +- .../components/chatlist/chatlist.component.ts | 10 +- .../chatcontacts/chatcontacts.component.html | 25 +- .../chatcontacts.component.spec.ts | 8 +- .../chatcontacts/chatcontacts.component.ts | 9 +- .../chatmanager/chatmanager.component.sass | 6 +- .../chatmanager/chatmanager.component.spec.ts | 8 +- .../chatmanager/chatmanager.component.ts | 15 +- .../document-list.component.html | 3 +- .../document-list.component.scss | 46 ++-- .../document-list.component.spec.ts | 8 +- .../document-list/document-list.component.ts | 9 +- .../document/document.component.scss | 20 +- .../document/document.component.spec.ts | 8 +- .../components/document/document.component.ts | 16 +- src/app/components/feed/feed.component.html | 47 ++-- src/app/components/feed/feed.component.sass | 49 ++-- .../components/feed/feed.component.spec.ts | 8 +- .../feed/postlist/postlist.component.html | 8 +- .../feed/postlist/postlist.component.sass | 77 +++--- .../feed/postlist/postlist.component.spec.ts | 8 +- .../feed/postlist/postlist.component.ts | 11 +- src/app/components/group/group.component.html | 225 +++++++++--------- src/app/components/group/group.component.sass | 17 ++ .../components/group/group.component.spec.ts | 8 +- src/app/components/group/group.component.ts | 45 ++-- src/app/components/home/home.component.html | 70 +++--- .../components/home/home.component.spec.ts | 8 +- src/app/components/home/home.component.ts | 9 +- .../components/imprint/imprint.component.sass | 4 +- .../imprint/imprint.component.spec.ts | 8 +- .../components/imprint/imprint.component.ts | 5 +- src/app/components/login/login.component.html | 45 ++-- src/app/components/login/login.component.sass | 12 +- .../components/login/login.component.spec.ts | 8 +- src/app/components/login/login.component.ts | 12 +- .../main-navigation.component.html | 77 +++--- .../main-navigation.component.sass | 11 +- .../main-navigation.component.spec.ts | 18 +- .../main-navigation.component.ts | 85 ++++--- .../fileUpload/fileUpload.component.ts | 6 +- .../components/profile/profile.component.html | 144 +++++------ .../components/profile/profile.component.sass | 30 ++- .../profile/profile.component.spec.ts | 8 +- .../components/profile/profile.component.ts | 55 ++--- .../register/register.component.html | 33 +-- .../register/register.component.sass | 14 +- .../register/register.component.spec.ts | 8 +- .../components/register/register.component.ts | 10 +- .../components/search/search.component.html | 27 ++- .../components/search/search.component.sass | 6 + .../search/search.component.spec.ts | 8 +- src/app/components/search/search.component.ts | 20 +- .../social/friends/friends.component.html | 24 +- .../social/friends/friends.component.sass | 22 +- .../social/friends/friends.component.spec.ts | 8 +- .../social/friends/friends.component.ts | 17 +- .../social/groups/groups.component.html | 19 +- .../social/groups/groups.component.sass | 3 +- .../social/groups/groups.component.spec.ts | 8 +- .../social/groups/groups.component.ts | 2 - .../components/social/social.component.html | 38 +-- .../social/social.component.spec.ts | 8 +- src/app/components/social/social.component.ts | 5 +- .../userlist/userlist.component.html | 27 ++- .../userlist/userlist.component.sass | 20 +- .../userlist/userlist.component.spec.ts | 8 +- .../components/userlist/userlist.component.ts | 11 +- src/app/graphql.module.ts | 8 +- src/app/models/activity.ts | 3 +- src/app/models/author.ts | 20 +- src/app/models/chat.ts | 22 +- src/app/models/chatinfo.ts | 12 +- src/app/models/chatmessage.ts | 16 +- src/app/models/document.ts | 4 +- src/app/models/event.ts | 20 +- src/app/models/friendRequest.ts | 22 +- src/app/models/friendinfo.ts | 24 +- src/app/models/group.ts | 10 +- src/app/models/groupinfo.ts | 14 +- src/app/models/interfaces/IGraphqlError.ts | 2 +- src/app/models/interfaces/IUser.ts | 1 - src/app/models/levellist.ts | 18 +- src/app/models/login.ts | 8 +- src/app/models/post.ts | 72 +++--- src/app/models/registration.ts | 8 +- src/app/models/user.ts | 10 +- .../activity/activity.service.spec.ts | 4 +- src/app/services/activity/activity.service.ts | 21 +- src/app/services/chat/chat.service.spec.ts | 4 +- src/app/services/chat/chat.service.ts | 105 ++++---- src/app/services/datasharing.service.spec.ts | 4 +- src/app/services/datasharing.service.ts | 9 +- src/app/services/document.service.spec.ts | 4 +- src/app/services/document.service.ts | 11 +- src/app/services/feed/feed.service.spec.ts | 4 +- src/app/services/feed/feed.service.ts | 176 ++++++++------ src/app/services/group/group.service.spec.ts | 4 +- src/app/services/group/group.service.ts | 48 ++-- src/app/services/login/login.service.spec.ts | 4 +- .../services/profile/profile.service.spec.ts | 4 +- src/app/services/profile/profile.service.ts | 12 +- .../register/register.service.spec.ts | 4 +- src/app/services/register/register.service.ts | 33 +-- .../services/request/request.service.spec.ts | 4 +- src/app/services/request/request.service.ts | 8 +- .../services/search/search.service.spec.ts | 4 +- src/app/services/search/search.service.ts | 35 ++- .../services/selfservice/self.service.spec.ts | 4 +- src/app/services/selfservice/self.service.ts | 3 - .../settings/settings.service.spec.ts | 4 +- src/app/services/settings/settings.service.ts | 10 +- .../services/social/social.service.spec.ts | 4 +- src/app/services/social/social.service.ts | 2 +- src/assets/images/default-profilepic.svg | 127 +++++----- src/assets/images/gv-logo-flat.svg | 109 +++++---- src/assets/images/gv-logo-white.svg | 111 +++++---- src/index.html | 2 +- src/main.ts | 8 +- src/polyfills.ts | 16 +- src/styles/greenvironment-material-theme.scss | 76 +++--- src/test.ts | 7 +- src/tslint.json | 32 +-- src/typings.d.ts | 5 +- 134 files changed, 1723 insertions(+), 1568 deletions(-) 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 df671f7..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,7 +9,8 @@ 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 => { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 33487a8..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,22 +42,20 @@ 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'; @@ -70,16 +65,16 @@ 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({ @@ -170,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 c8339e5..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/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 -