Skip to content

Commit

Permalink
Updated playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
egekurt123 committed Jun 19, 2024
1 parent 8519109 commit d37e3a6
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 898 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,7 @@ import { UserPublicInfoDTO } from 'app/core/user/user.model';
import { OneToOneChatCreateDialogComponent } from 'app/overview/course-conversations/dialogs/one-to-one-chat-create-dialog/one-to-one-chat-create-dialog.component';
import { ChannelsOverviewDialogComponent } from 'app/overview/course-conversations/dialogs/channels-overview-dialog/channels-overview-dialog.component';

const CHANNEL_GROUPS_MESSAGING_ENABLED: AccordionGroups = {
favoriteChannels: { entityData: [] },
generalChannels: { entityData: [] },
exerciseChannels: { entityData: [] },
lectureChannels: { entityData: [] },
examChannels: { entityData: [] },
groupChats: { entityData: [] },
directMessages: { entityData: [] },
hiddenChannels: { entityData: [] },
};

const CHANNEL_GROUPS_MESSAGING_DISABLED: AccordionGroups = {
const DEFAULT_CHANNEL_GROUPS: AccordionGroups = {
favoriteChannels: { entityData: [] },
generalChannels: { entityData: [] },
exerciseChannels: { entityData: [] },
Expand Down Expand Up @@ -245,7 +234,9 @@ export class CourseConversationsComponent implements OnInit, OnDestroy {

initializeSidebarAccordions() {
this.messagingEnabled = isMessagingEnabled(this.course);
this.accordionConversationGroups = this.messagingEnabled ? CHANNEL_GROUPS_MESSAGING_ENABLED : CHANNEL_GROUPS_MESSAGING_DISABLED;
this.accordionConversationGroups = this.messagingEnabled
? { ...DEFAULT_CHANNEL_GROUPS, groupChats: { entityData: [] }, directMessages: { entityData: [] } }
: DEFAULT_CHANNEL_GROUPS;
}

onSearch() {
Expand Down
15 changes: 2 additions & 13 deletions src/main/webapp/app/overview/course-overview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,15 @@ const DEFAULT_UNIT_GROUPS: AccordionGroups = {
noDate: { entityData: [] },
};

const CHANNEL_GROUPS_MESSAGING_ENABLED: AccordionGroups = {
const DEFAULT_CHANNEL_GROUPS: AccordionGroups = {
favoriteChannels: { entityData: [] },
generalChannels: { entityData: [] },
exerciseChannels: { entityData: [] },
lectureChannels: { entityData: [] },
examChannels: { entityData: [] },
groupChats: { entityData: [] },
directMessages: { entityData: [] },
hiddenChannels: { entityData: [] },
};

const CHANNEL_GROUPS_MESSAGING_DISABLED: AccordionGroups = {
favoriteChannels: { entityData: [] },
generalChannels: { entityData: [] },
exerciseChannels: { entityData: [] },
lectureChannels: { entityData: [] },
examChannels: { entityData: [] },
groupChats: { entityData: [] },
};

@Injectable({
providedIn: 'root',
})
Expand Down Expand Up @@ -167,7 +156,7 @@ export class CourseOverviewService {
}

groupConversationsByChannelType(conversations: ConversationDTO[], messagingEnabled: boolean): AccordionGroups {
const channelGroups = messagingEnabled ? CHANNEL_GROUPS_MESSAGING_ENABLED : CHANNEL_GROUPS_MESSAGING_DISABLED;
const channelGroups = messagingEnabled ? { ...DEFAULT_CHANNEL_GROUPS, groupChats: { entityData: [] }, directMessages: { entityData: [] } } : DEFAULT_CHANNEL_GROUPS;
const groupedConversationGroups = cloneDeep(channelGroups) as AccordionGroups;

for (const conversation of conversations) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/i18n/de/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"tooltip": "Ermöglicht die Kommunikation zwischen Nutzer:innen in privaten oder öffentlichen Kanälen, die nur von Lehrenden und Tutor:innen erstellt werden können. Die Studierenden können mit anderen Studierenden interagieren und Fragen stellen, während Moderator:innen Kursinformationen bereitstellen und inhaltliche Fragen beantworten können. Die Kommunikation kann direkt auf der Seite der jeweiligen Übung oder Vorlesung oder im speziellen Kommunikationsbereich des Kurses erfolgen."
},
"messagingEnabled": {
"label": "Nachrichten aktiviert",
"label": "Direktnachrichten / Gruppen-Chats aktiviert",
"tooltip": "Ermöglicht den Nachrichtenaustausch in Gruppenchats oder Direktnachrichten. Alle Nutzer:innen können Direktnachrichten oder einen privaten Gruppenchat starten und andere Nutzer:innen hinzufügen. Ein Gruppenchat ist auf zehn Mitglieder:innen begrenzt. Die Chats finden im Kommunikationbereich des Kurses statt.",
"codeOfConduct": "Nachrichten: Code of Conduct"
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/i18n/en/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"tooltip": "Enables communication between course users in private or public channels which can only be created by instructors and tutors. Students can interact with peers and ask questions while moderators can provide course information and answer content-related questions. The communication can happen directly on the page of the respective exercise or lecture or in the dedicated communication space of the course."
},
"messagingEnabled": {
"label": "Messaging Enabled",
"label": "Direct Messages / Group Chats Enabled",
"tooltip": "Enables messaging between course users in group chats or direct messages. Every user can start a direct message, private group chat and add other users. A group chat is limited to 10 members. The chats happens in the communication space of the course.",
"codeOfConduct": "Messaging Code of Conduct"
}
Expand Down
Loading

0 comments on commit d37e3a6

Please sign in to comment.