From 7a1416767b9bf83be6c0a291ab49b1f4d0edae3d Mon Sep 17 00:00:00 2001 From: Tim Cremer <65229601+cremertim@users.noreply.github.com> Date: Sun, 20 Oct 2024 20:08:14 +0200 Subject: [PATCH] Communication: Always show favorite channels (#9510) --- .../course-conversations.component.html | 1 + .../course-conversations.component.ts | 18 +++++++++++++++--- .../course-exams/course-exams.component.html | 8 +++++++- .../course-exams/course-exams.component.ts | 6 ++++++ .../course-exercises.component.html | 9 ++++++++- .../course-exercises.component.ts | 14 ++++++++++++-- .../course-lectures.component.html | 8 +++++++- .../course-lectures.component.ts | 11 ++++++++++- .../course-tutorial-groups.component.html | 8 +++++++- .../course-tutorial-groups.component.ts | 9 ++++++++- .../sidebar-accordion.component.html | 2 +- .../sidebar-accordion.component.ts | 9 +++++---- .../app/shared/sidebar/sidebar.component.html | 1 + .../app/shared/sidebar/sidebar.component.ts | 3 ++- src/main/webapp/app/types/sidebar.ts | 3 +++ .../sidebar-accordion.component.spec.ts | 1 + 16 files changed, 94 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/app/overview/course-conversations/course-conversations.component.html b/src/main/webapp/app/overview/course-conversations/course-conversations.component.html index e4cd32cdbecb..fd62d2f7e57e 100644 --- a/src/main/webapp/app/overview/course-conversations/course-conversations.component.html +++ b/src/main/webapp/app/overview/course-conversations/course-conversations.component.html @@ -35,6 +35,7 @@ (onGroupChatPressed)="openCreateGroupChatDialog()" [showAddOption]="CHANNEL_TYPE_SHOW_ADD_OPTION" [channelTypeIcon]="CHANNEL_TYPE_ICON" + [sidebarItemAlwaysShow]="DEFAULT_SHOW_ALWAYS" [collapseState]="DEFAULT_COLLAPSE_STATE" [inCommunication]="true" /> diff --git a/src/main/webapp/app/overview/course-conversations/course-conversations.component.ts b/src/main/webapp/app/overview/course-conversations/course-conversations.component.ts index da7dd332f047..742999cf7aa7 100644 --- a/src/main/webapp/app/overview/course-conversations/course-conversations.component.ts +++ b/src/main/webapp/app/overview/course-conversations/course-conversations.component.ts @@ -13,7 +13,7 @@ import { PageType, SortDirection } from 'app/shared/metis/metis.util'; import { faBan, faComment, faComments, faFile, faFilter, faGraduationCap, faHeart, faList, faMessage, faPlus, faSearch, faTimes } from '@fortawesome/free-solid-svg-icons'; import { ButtonType } from 'app/shared/components/button.component'; import { CourseWideSearchComponent, CourseWideSearchConfig } from 'app/overview/course-conversations/course-wide-search/course-wide-search.component'; -import { AccordionGroups, ChannelAccordionShowAdd, ChannelTypeIcons, CollapseState, SidebarCardElement, SidebarData } from 'app/types/sidebar'; +import { AccordionGroups, ChannelAccordionShowAdd, ChannelTypeIcons, CollapseState, SidebarCardElement, SidebarData, SidebarItemShowAlways } from 'app/types/sidebar'; import { CourseOverviewService } from 'app/overview/course-overview.service'; import { GroupChatCreateDialogComponent } from 'app/overview/course-conversations/dialogs/group-chat-create-dialog/group-chat-create-dialog.component'; import { defaultFirstLayerDialogOptions, defaultSecondLayerDialogOptions } from 'app/overview/course-conversations/other/conversation.util'; @@ -55,16 +55,27 @@ const CHANNEL_TYPE_ICON: ChannelTypeIcons = { }; const DEFAULT_COLLAPSE_STATE: CollapseState = { - generalChannels: false, + generalChannels: true, exerciseChannels: true, examChannels: true, groupChats: true, directMessages: true, - favoriteChannels: true, + favoriteChannels: false, lectureChannels: true, hiddenChannels: true, }; +const DEFAULT_SHOW_ALWAYS: SidebarItemShowAlways = { + generalChannels: true, + exerciseChannels: false, + examChannels: false, + groupChats: true, + directMessages: true, + favoriteChannels: true, + lectureChannels: false, + hiddenChannels: false, +}; + @Component({ selector: 'jhi-course-conversations', templateUrl: './course-conversations.component.html', @@ -95,6 +106,7 @@ export class CourseConversationsComponent implements OnInit, OnDestroy { readonly CHANNEL_TYPE_SHOW_ADD_OPTION = CHANNEL_TYPE_SHOW_ADD_OPTION; readonly CHANNEL_TYPE_ICON = CHANNEL_TYPE_ICON; readonly DEFAULT_COLLAPSE_STATE = DEFAULT_COLLAPSE_STATE; + protected readonly DEFAULT_SHOW_ALWAYS = DEFAULT_SHOW_ALWAYS; // set undefined so nothing gets displayed until isCodeOfConductAccepted is loaded isCodeOfConductAccepted?: boolean; diff --git a/src/main/webapp/app/overview/course-exams/course-exams.component.html b/src/main/webapp/app/overview/course-exams/course-exams.component.html index 27b7f0a60a56..4eca637aab4c 100644 --- a/src/main/webapp/app/overview/course-exams/course-exams.component.html +++ b/src/main/webapp/app/overview/course-exams/course-exams.component.html @@ -1,7 +1,13 @@