From 74860f036ff3f9a935e34c1a7ed1a7c53c75072b Mon Sep 17 00:00:00 2001 From: mutugiii Date: Wed, 1 Nov 2023 15:40:20 +0300 Subject: [PATCH 1/7] Remove the configuration toolbar --- src/app/community/community.component.html | 7 ++----- src/app/community/community.scss | 20 +++----------------- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index 352f88b5f6..e161c58b9d 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -1,8 +1,5 @@
- - {{configuration?.name}} -
@@ -58,11 +55,11 @@

- +

- +
diff --git a/src/app/community/community.scss b/src/app/community/community.scss index a15de78ab0..0d8339059d 100644 --- a/src/app/community/community.scss +++ b/src/app/community/community.scss @@ -8,17 +8,12 @@ display: grid; grid-template-columns: 2fr 1fr; - grid-template-rows: 64px calc(100% - 64px - 0.5rem); - grid-template-areas: - "links calendar" - "news calendar"; + grid-template-areas: "news calendar"; gap: 0.5rem; - @media only screen and (max-width: #{$screen-sm}) { + @media only screen and (max-width: #{$screen-md}) { grid-template-columns: 1fr; - grid-template-areas: - "links" - "news"; + grid-template-areas: "news"; } } @@ -28,26 +23,17 @@ align-items: center; } -.view-container mat-toolbar { - grid-area: links; - overflow: hidden; -} - .community-news { - grid-area: news; overflow-y: auto; h3 { - margin: 0; *:not(:last-child) { margin-right: 0.25rem; } - } - } planet-calendar { From 7ffedd354bad5f30dcac58afc42b2265e7703651 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Wed, 1 Nov 2023 22:18:22 +0300 Subject: [PATCH 2/7] alignment of the card actions --- src/app/news/news-list-item.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/news/news-list-item.component.html b/src/app/news/news-list-item.component.html index 5ac80b09ad..9a46d83a97 100644 --- a/src/app/news/news-list-item.component.html +++ b/src/app/news/news-list-item.component.html @@ -10,7 +10,7 @@

Member of Planet {{item.doc.createdOn}}

- wrote on {{item.doc.time | date: 'medium' }} + posted on {{item.doc.time | date: 'medium' }} | edited on {{item.doc.updatedDate | date: 'medium'}} | shared on {{item.sharedDate | date: 'medium'}} @@ -32,6 +32,7 @@ + From 732af54b434aa5819bcde42a93a5b1a61e409297 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Fri, 3 Nov 2023 16:47:25 +0300 Subject: [PATCH 3/7] Add spacing between the news items && add an mat-icon-button to toggle the edited and shared dates --- src/app/news/news-list-item.component.html | 9 +++++++-- src/app/news/news-list-item.component.ts | 5 +++++ src/app/news/news-list-item.scss | 8 ++++++++ src/app/news/news-list.component.ts | 3 +++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/app/news/news-list-item.component.html b/src/app/news/news-list-item.component.html index 9a46d83a97..380a7b22c2 100644 --- a/src/app/news/news-list-item.component.html +++ b/src/app/news/news-list-item.component.html @@ -1,6 +1,9 @@ + {{item.doc.user.firstName ? @@ -11,8 +14,10 @@

Member of Planet {{item.doc.createdOn}}

posted on {{item.doc.time | date: 'medium' }} - | edited on {{item.doc.updatedDate | date: 'medium'}} - | shared on {{item.sharedDate | date: 'medium'}} + + | edited on {{item.doc.updatedDate | date: 'medium'}} + | shared on {{item.sharedDate | date: 'medium'}} + diff --git a/src/app/news/news-list-item.component.ts b/src/app/news/news-list-item.component.ts index e92478c3bb..5e023d283d 100644 --- a/src/app/news/news-list-item.component.ts +++ b/src/app/news/news-list-item.component.ts @@ -32,6 +32,7 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked { showExpand = false; showLess = true; showShare = false; + showDatesInfo = false; planetCode = this.stateService.configuration.code; targetLocalPlanet = true; labels = { listed: [], all: [ 'help', 'offer', 'advice' ] }; @@ -144,4 +145,8 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked { maxHeight: '90vh' }); } + + toggleDatesInfo() { + this.showDatesInfo = !this.showDatesInfo; + } } diff --git a/src/app/news/news-list-item.scss b/src/app/news/news-list-item.scss index b0cc8eedd8..d48cca3254 100644 --- a/src/app/news/news-list-item.scss +++ b/src/app/news/news-list-item.scss @@ -2,6 +2,7 @@ mat-card { margin: 0.25rem; + border-radius: 15px; } :host(.main-message) { @@ -18,3 +19,10 @@ mat-card { mat-card-content { margin-bottom: 0; } + +.info-button { + position: absolute; + top: 0; + right: 0; + margin: 8px; +} diff --git a/src/app/news/news-list.component.ts b/src/app/news/news-list.component.ts index 4f01e30643..75f700ba28 100644 --- a/src/app/news/news-list.component.ts +++ b/src/app/news/news-list.component.ts @@ -17,6 +17,9 @@ import { dedupeShelfReduce } from '../shared/utils'; mat-divider { margin: 1rem 0; } + planet-news-list-item { + margin: 0.1rem; + } ` ] }) export class NewsListComponent implements OnChanges { From 9c899209f8fc4f0fd5c993615b1f38728226bea0 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Fri, 3 Nov 2023 18:08:52 +0300 Subject: [PATCH 4/7] Update message height when contracted && remove border radius --- src/app/news/news-list-item.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/news/news-list-item.scss b/src/app/news/news-list-item.scss index d48cca3254..bd405505f0 100644 --- a/src/app/news/news-list-item.scss +++ b/src/app/news/news-list-item.scss @@ -2,7 +2,6 @@ mat-card { margin: 0.25rem; - border-radius: 15px; } :host(.main-message) { @@ -12,7 +11,7 @@ mat-card { } .show-less { - max-height: 6rem; + max-height: 8rem; overflow-y: hidden; } From 9e9eabcb3d558bd19f46009e480a35fa9940b2d3 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Mon, 6 Nov 2023 12:33:40 +0300 Subject: [PATCH 5/7] Replace the news tab && New Voices button alignment --- src/app/community/community.component.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index e161c58b9d..fbea8eed6d 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -2,9 +2,8 @@
- -

- Your Voices + +

From 3adaa040481705334c7370e906ca1eca579cd743 Mon Sep 17 00:00:00 2001 From: mutugiii Date: Thu, 16 Nov 2023 20:19:42 +0300 Subject: [PATCH 6/7] Ensure that the latest news item is always expanded --- src/app/news/news-list-item.component.html | 2 +- src/app/news/news-list-item.component.ts | 9 ++++++++- src/app/news/news-list.component.ts | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/news/news-list-item.component.html b/src/app/news/news-list-item.component.html index 380a7b22c2..b85e8b5347 100644 --- a/src/app/news/news-list-item.component.html +++ b/src/app/news/news-list-item.component.html @@ -30,7 +30,7 @@
- {{ showLess ? 'Show More' : 'Show Less' }} + {{ showLess ? 'Show More' : 'Show Less' }} diff --git a/src/app/news/news-list-item.component.ts b/src/app/news/news-list-item.component.ts index 5e023d283d..b781e1dc81 100644 --- a/src/app/news/news-list-item.component.ts +++ b/src/app/news/news-list-item.component.ts @@ -14,7 +14,7 @@ import { UserProfileDialogComponent } from '../users/users-profile/users-profile templateUrl: 'news-list-item.component.html', styleUrls: [ './news-list-item.scss' ] }) -export class NewsListItemComponent implements OnChanges, AfterViewChecked { +export class NewsListItemComponent implements OnInit, OnChanges, AfterViewChecked { @Input() item; @Input() replyObject; @@ -48,6 +48,13 @@ export class NewsListItemComponent implements OnChanges, AfterViewChecked { private dialog: MatDialog ) {} + ngOnInit() { + if (this.item.latestMessage) { + this.showExpand = true; + this.showLess = false; + } + } + ngOnChanges() { this.targetLocalPlanet = this.shareTarget === this.stateService.configuration.planetType; this.showShare = this.shouldShowShare(); diff --git a/src/app/news/news-list.component.ts b/src/app/news/news-list.component.ts index 75f700ba28..ae4b040721 100644 --- a/src/app/news/news-list.component.ts +++ b/src/app/news/news-list.component.ts @@ -48,9 +48,15 @@ export class NewsListComponent implements OnChanges { ) {} ngOnChanges() { + let isNotReply = true; this.replyObject = {}; this.items.forEach(item => { this.replyObject[item.doc.replyTo || 'root'] = [ ...(this.replyObject[item.doc.replyTo || 'root'] || []), item ]; + + if (!item.doc.replyTo && isNotReply) { + item.latestMessage = true; + isNotReply = false; + } }); this.displayedItems = this.replyObject[this.replyViewing._id]; if (this.replyViewing._id !== 'root') { From d9dbf544e2daf5e5a3ebb05f16d790f690c064eb Mon Sep 17 00:00:00 2001 From: mutugiii Date: Thu, 16 Nov 2023 20:20:04 +0300 Subject: [PATCH 7/7] Remove unused import --- src/app/news/news-list-item.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/news/news-list-item.component.ts b/src/app/news/news-list-item.component.ts index b781e1dc81..c2282a48f0 100644 --- a/src/app/news/news-list-item.component.ts +++ b/src/app/news/news-list-item.component.ts @@ -4,7 +4,6 @@ import { UserService } from '../shared/user.service'; import { CouchService } from '../shared/couchdb.service'; import { NotificationsService } from '../notifications/notifications.service'; import { StateService } from '../shared/state.service'; -import { planetAndParentId } from '../manager-dashboard/reports/reports.utils'; import { NewsService } from './news.service'; import { MatDialog } from '@angular/material/dialog'; import { UserProfileDialogComponent } from '../users/users-profile/users-profile-dialog.component';