From 6f83969aedf95618a22fddb22e83feae67eafdc7 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 10:12:13 +0100 Subject: [PATCH 1/8] Fix upload preview height --- src/app/components/feed/feed.component.sass | 6 ++---- src/app/models/post.ts | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass index 5f16e08..49b8a82 100644 --- a/src/app/components/feed/feed.component.sass +++ b/src/app/components/feed/feed.component.sass @@ -34,16 +34,14 @@ .mat-icon transform: scale(1.5) #inputPreview - max-width: 75% - max-height: 100% + max-width: 100% + max-height: 40vh width: auto border-radius: 4px mask-mode: luminance outline: none user-select: none ::ng-deep video - width: 100% - max-height: 40vh outline: none user-select: none #inputPreviewWrapper diff --git a/src/app/models/post.ts b/src/app/models/post.ts index 3143140..231acb7 100644 --- a/src/app/models/post.ts +++ b/src/app/models/post.ts @@ -1,5 +1,6 @@ import {Author} from './author'; import {Activity} from './activity'; +import { environment } from 'src/environments/environment'; export class Post { id: number; @@ -39,7 +40,7 @@ export class Post { this.author = author; this.activity = activity; if (media) { - this.mediaUrl = media.url; + this.mediaUrl = environment.greenvironmentUrl + media.url; this.mediaType = media.type; } } From e1c1d9de4484b63c3368f00a4f836bd9fd55241b Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 10:33:22 +0100 Subject: [PATCH 2/8] Change input to disabled while posting --- src/app/components/feed/feed.component.html | 12 +++++++----- src/app/components/feed/feed.component.sass | 2 ++ src/app/components/feed/feed.component.ts | 9 ++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index fca185c..308c0d3 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -14,22 +14,23 @@ -

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

What did you do? - + nothing ;) @@ -38,7 +39,8 @@ {{getErrorMessage()}} - diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass index 49b8a82..e3724a0 100644 --- a/src/app/components/feed/feed.component.sass +++ b/src/app/components/feed/feed.component.sass @@ -49,6 +49,8 @@ text-align: center max-height: 512px margin-bottom: 1em +#progress-bar + margin-top: 1em #action-chooser width: 100% diff --git a/src/app/components/feed/feed.component.ts b/src/app/components/feed/feed.component.ts index d226149..f32a8f4 100644 --- a/src/app/components/feed/feed.component.ts +++ b/src/app/components/feed/feed.component.ts @@ -22,6 +22,7 @@ export class FeedComponent implements OnInit { private file; fileType; public localFileUrl; + posting = false; checked = false; // if the "I protected the environment."-box is checked view = 'new'; @@ -70,7 +71,9 @@ export class FeedComponent implements OnInit { */ createPost(postElement, activityId: string) { if (postElement && activityId && this.checked) { + this.posting = true; this.feedService.createPostActivity(postElement.value, activityId, this.file).subscribe(() => { + this.posting = false; postElement.value = ''; this.textInputValue = ''; this.checked = false; @@ -81,11 +84,14 @@ export class FeedComponent implements OnInit { this.showNew(); } }, (error: IErrorResponse) => { + this.posting = false; this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; }); } else if (postElement) { + this.posting = true; this.feedService.createPost(postElement.value, this.file).subscribe(() => { + this.posting = false; postElement.value = ''; this.textInputValue = ''; this.checked = false; @@ -96,6 +102,7 @@ export class FeedComponent implements OnInit { this.showNew(); } }, (error: IErrorResponse) => { + this.posting = false; this.errorOccurred = true; this.errorMessage = error.error.errors[0].message; }); @@ -119,7 +126,7 @@ export class FeedComponent implements OnInit { } /** - * Fetches the next posts when scrolled + * Fetches the next posts when scrolled down */ onScroll() { this.feedService.getNextPosts(); From 2acce7625fee0d17f29dc7d77c6d97e0f1c2c14d Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 10:35:54 +0100 Subject: [PATCH 3/8] Add margin bottom to images and videos in the feed --- src/app/components/feed/postlist/postlist.component.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/components/feed/postlist/postlist.component.sass b/src/app/components/feed/postlist/postlist.component.sass index d27fcd9..3f2c0a4 100644 --- a/src/app/components/feed/postlist/postlist.component.sass +++ b/src/app/components/feed/postlist/postlist.component.sass @@ -60,16 +60,19 @@ $mat-card-header-size: 40px !default display: block margin-left: auto margin-right: auto + margin-bottom: 0.5em ::ng-deep video width: 100% max-height: 40vh outline: none user-select: none + margin-bottom: 0.5em ::ng-deep audio width: 100% max-height: 40vh outline: none user-select: none + margin-bottom: 0.5em .mat-button min-width: 32px !important From 88d68e6ae0656885fbf91ccf5259f017451c165a Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 10:37:20 +0100 Subject: [PATCH 4/8] Fix link of friends profile picture to profile page --- src/app/components/social/friends/friends.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/social/friends/friends.component.html b/src/app/components/social/friends/friends.component.html index c036f75..913d661 100644 --- a/src/app/components/social/friends/friends.component.html +++ b/src/app/components/social/friends/friends.component.html @@ -17,7 +17,7 @@ -
+
{{friend.name}} From 14b2c798d996b77623dcbd058312fa6cd26597fc Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 13:03:39 +0100 Subject: [PATCH 5/8] Change position of the add file button next to the check box --- src/app/components/feed/feed.component.html | 24 +++++++++++++-------- src/app/components/feed/feed.component.sass | 15 ++++++++++--- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 308c0d3..01fc5c6 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -13,21 +13,27 @@ Your browser does not support playing HTML5 video.
- + - - - -

- I protected the environment. - -

+ + What did you do? diff --git a/src/app/components/feed/feed.component.sass b/src/app/components/feed/feed.component.sass index e3724a0..9997dd5 100644 --- a/src/app/components/feed/feed.component.sass +++ b/src/app/components/feed/feed.component.sass @@ -27,12 +27,17 @@ #feedlist width: 100% -#input +.input width: 100% padding-left: 0.5em padding-right: 0.5em - .mat-icon - transform: scale(1.5) +.left, .right + display: inline-block + width: 50% +.left + text-align: left +.right + text-align: right #inputPreview max-width: 100% max-height: 40vh @@ -60,6 +65,10 @@ #check margin: 0 padding-left: 0.5em + display: contents +#button-box + text-align: right + margin-left: auto #post-button width: 100% From 63b2e3cfc2666824dc04841102ae22d88fbafe4f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 15:23:55 +0100 Subject: [PATCH 6/8] Fix position of camera icon on group page --- src/app/components/group/group.component.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/group/group.component.sass b/src/app/components/group/group.component.sass index 6312e7b..6046785 100644 --- a/src/app/components/group/group.component.sass +++ b/src/app/components/group/group.component.sass @@ -54,7 +54,7 @@ $mat-card-header-size: 100px !default #icon display: none position: absolute - z-index: 11 + z-index: 100 color: white $mat-card-header-size: 100px !default From cf8b53bb3833089ff8da50224921b3c356049681 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Jan 2020 16:21:16 +0100 Subject: [PATCH 7/8] Add discard button for selected files --- src/app/components/feed/feed.component.html | 20 ++++++++++++++------ src/app/components/feed/feed.component.sass | 11 +++++++++++ src/app/components/feed/feed.component.ts | 10 +++++++++- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/app/components/feed/feed.component.html b/src/app/components/feed/feed.component.html index 01fc5c6..111dfbd 100644 --- a/src/app/components/feed/feed.component.html +++ b/src/app/components/feed/feed.component.html @@ -6,12 +6,20 @@
-
-

Preview:

- - +
+

Preview:

+
+ + + +