From cec38668e1a0e332f86462461475d9932f3c4d9f Mon Sep 17 00:00:00 2001 From: Asli Aykan <56061820+asliayk@users.noreply.github.com> Date: Sun, 10 Nov 2024 17:22:51 +0100 Subject: [PATCH] Communication: Add profile picture to sidebar element and conversation header (#9719) --- .../conversation/one-to-one-chat.model.ts | 7 +++ .../course-conversations.module.ts | 2 - .../conversation-detail-dialog.component.html | 4 +- .../conversation-detail-dialog.component.ts | 2 + .../conversation-header.component.html | 19 +++++++- .../conversation-header.component.ts | 15 +++++- .../group-chat-icon.component.html | 1 - .../group-chat-icon.component.ts | 11 ----- .../sidebar-card-item.component.html | 15 +++++- .../sidebar-card-item.component.ts | 18 +++++++ .../app/shared/sidebar/sidebar.component.html | 2 +- .../app/shared/sidebar/sidebar.component.ts | 4 +- .../app/shared/sidebar/sidebar.module.ts | 2 + ...rsation-add-users-dialog.component.spec.ts | 9 +--- ...nversation-detail-dialog.component.spec.ts | 4 +- .../conversation-header.component.spec.ts | 17 ++++++- .../group-chat-icon.component.spec.ts | 23 --------- .../sidebar-card-item.component.spec.ts | 47 ++++++++++++++----- 18 files changed, 132 insertions(+), 70 deletions(-) delete mode 100644 src/main/webapp/app/overview/course-conversations/other/group-chat-icon/group-chat-icon.component.html delete mode 100644 src/main/webapp/app/overview/course-conversations/other/group-chat-icon/group-chat-icon.component.ts delete mode 100644 src/test/javascript/spec/component/overview/course-conversations/other/group-chat-icon/group-chat-icon.component.spec.ts diff --git a/src/main/webapp/app/entities/metis/conversation/one-to-one-chat.model.ts b/src/main/webapp/app/entities/metis/conversation/one-to-one-chat.model.ts index 76f59620f516..d6c8d128596d 100644 --- a/src/main/webapp/app/entities/metis/conversation/one-to-one-chat.model.ts +++ b/src/main/webapp/app/entities/metis/conversation/one-to-one-chat.model.ts @@ -15,3 +15,10 @@ export class OneToOneChatDTO extends ConversationDTO { export function isOneToOneChatDTO(conversation: ConversationDTO): conversation is OneToOneChatDTO { return conversation.type === ConversationType.ONE_TO_ONE; } + +export function getAsOneToOneChatDTO(conversation: ConversationDTO | undefined): OneToOneChatDTO | undefined { + if (!conversation) { + return undefined; + } + return isOneToOneChatDTO(conversation) ? conversation : undefined; +} diff --git a/src/main/webapp/app/overview/course-conversations/course-conversations.module.ts b/src/main/webapp/app/overview/course-conversations/course-conversations.module.ts index 2f6e01364f58..0646118f577f 100644 --- a/src/main/webapp/app/overview/course-conversations/course-conversations.module.ts +++ b/src/main/webapp/app/overview/course-conversations/course-conversations.module.ts @@ -26,7 +26,6 @@ import { GenericConfirmationDialogComponent } from './dialogs/generic-confirmati import { ConversationSettingsComponent } from './dialogs/conversation-detail-dialog/tabs/conversation-settings/conversation-settings.component'; import { OneToOneChatCreateDialogComponent } from './dialogs/one-to-one-chat-create-dialog/one-to-one-chat-create-dialog.component'; import { GroupChatCreateDialogComponent } from './dialogs/group-chat-create-dialog/group-chat-create-dialog.component'; -import { GroupChatIconComponent } from './other/group-chat-icon/group-chat-icon.component'; import { ArtemisMarkdownModule } from 'app/shared/markdown.module'; import { CourseConversationsCodeOfConductComponent } from 'app/overview/course-conversations/code-of-conduct/course-conversations-code-of-conduct.component'; import { CourseWideSearchComponent } from 'app/overview/course-conversations/course-wide-search/course-wide-search.component'; @@ -79,7 +78,6 @@ const routes: Routes = [ ConversationSettingsComponent, OneToOneChatCreateDialogComponent, GroupChatCreateDialogComponent, - GroupChatIconComponent, CourseWideSearchComponent, ], }) diff --git a/src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html b/src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html index bd18770a088c..193b823d77b3 100644 --- a/src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html +++ b/src/main/webapp/app/overview/course-conversations/dialogs/conversation-detail-dialog/conversation-detail-dialog.component.html @@ -6,8 +6,8 @@