Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication: Configure messaging code of conduct #7118

Merged
merged 17 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/de/tum/in/www1/artemis/domain/Course.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ public class Course extends DomainObject {
@JsonView(QuizView.Before.class)
private CourseInformationSharingConfiguration courseInformationSharingConfiguration = CourseInformationSharingConfiguration.COMMUNICATION_AND_MESSAGING; // default value

@Column(name = "info_sharing_messaging_code_of_conduct")
private String courseInformationSharingMessagingCodeOfConduct;

@Column(name = "max_complaints", nullable = false)
@JsonView(QuizView.Before.class)
private Integer maxComplaints = 3; // default value
Expand Down Expand Up @@ -1005,4 +1008,11 @@ public void setCourseInformationSharingConfiguration(CourseInformationSharingCon
this.courseInformationSharingConfiguration = courseInformationSharingConfiguration;
}

public String getCourseInformationSharingMessagingCodeOfConduct() {
return this.courseInformationSharingMessagingCodeOfConduct;
}

public void setCourseInformationSharingMessagingCodeOfConduct(String courseInformationSharingMessagingCodeOfConduct) {
this.courseInformationSharingMessagingCodeOfConduct = courseInformationSharingMessagingCodeOfConduct;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet author="zbil" id="20230907225501">
<addColumn tableName="course">
<column name="info_sharing_messaging_code_of_conduct" type="longtext"/>
</addColumn>
</changeSet>
</databaseChangeLog>
1 change: 1 addition & 0 deletions src/main/resources/config/liquibase/master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<include file="classpath:config/liquibase/changelog/20230622000000_changelog.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20230713113211_changelog.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20230907114600_changelog.xml" relativeToChangelogFile="false"/>
<include file="classpath:config/liquibase/changelog/20230907225501_changelog.xml" relativeToChangelogFile="false"/>
<!-- NOTE: please use the format "YYYYMMDDhhmmss_changelog.xml", i.e. year month day hour minutes seconds and not something else! -->
<!-- we should also stay in a chronological order! -->
<!-- you can use the command 'date '+%Y%m%d%H%M%S'' to get the current date and time in the correct format -->
Expand Down
12 changes: 12 additions & 0 deletions src/main/webapp/app/course/manage/course-update.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ <h5>
ngbTooltip="{{ 'artemisApp.course.courseCommunicationSetting.messagingEnabled.tooltip' | artemisTranslate }}"
></fa-icon>
</div>
<div class="form-group" *ngIf="messagingEnabled">
<label class="form-control-label" jhiTranslate="artemisApp.course.courseCommunicationSetting.messagingEnabled.codeOfConduct.label"
>Messaging Code of Conduct
</label>
<jhi-help-icon text="artemisApp.course.courseCommunicationSetting.messagingEnabled.codeOfConduct.tooltip"></jhi-help-icon>
<jhi-markdown-editor
class="markdown-editor"
[(markdown)]="course.courseInformationSharingMessagingCodeOfConduct"
(markdownChange)="updateCourseInformationSharingMessagingCodeOfConduct($event)"
>
</jhi-markdown-editor>
</div>
</div>
<div class="form-group" [jhiFeatureToggleHide]="FeatureToggle.LearningPaths">
<div class="form-check">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export class CourseUpdateComponent implements OnInit {
editorGroupName: new FormControl(this.course.editorGroupName),
instructorGroupName: new FormControl(this.course.instructorGroupName),
description: new FormControl(this.course.description),
courseInformationSharingMessagingCodeOfConduct: new FormControl(this.course.courseInformationSharingMessagingCodeOfConduct),
organizations: new FormControl(this.courseOrganizations),
startDate: new FormControl(this.course.startDate),
endDate: new FormControl(this.course.endDate),
Expand Down Expand Up @@ -520,6 +521,14 @@ export class CourseUpdateComponent implements OnInit {
this.courseForm.controls['registrationConfirmationMessage'].setValue(message);
}

/**
* Updates courseInformationSharingMessagingCodeOfConduct on markdown change
* @param message new courseInformationSharingMessagingCodeOfConduct
*/
updateCourseInformationSharingMessagingCodeOfConduct(message: string) {
this.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].setValue(message);
}

/**
* Auxiliary method checking if online course is currently true
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/app/entities/course.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class Course implements BaseEntity {
public tutorialGroups?: TutorialGroup[];
public onlineCourseConfiguration?: OnlineCourseConfiguration;
public courseInformationSharingConfiguration?: CourseInformationSharingConfiguration;
public courseInformationSharingMessagingCodeOfConduct?: string;

// helper attributes
public isAtLeastTutor?: boolean;
Expand Down
6 changes: 5 additions & 1 deletion src/main/webapp/i18n/de/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
},
"messagingEnabled": {
"label": "Nachrichten aktiviert",
"tooltip": "Ermöglicht den Nachrichtenaustausch zwischen Nutzer:innen in privaten oder öffentlichen Kanälen, Gruppenchats oder Direktnachrichten. Kanäle können nur von Lehrenden und Tutor:innen erstellt werden. Nutzer:innen können selbst öffentlichen Kanälen beitreten und müssen zu privaten Kanälen hinzugefügt werden. Alle Nutzer:innen können einen privaten Gruppenchat starten und andere Nutzer:innen hinzufügen. Ein Gruppenchat ist auf zehn Mitglieder:innen begrenzt. Alle Nutzer:innen können Direktnachrichten an andere Nutzer:innen senden. Die Chats finden im Nachrichtenbereich des Kurses statt."
"tooltip": "Ermöglicht den Nachrichtenaustausch zwischen Nutzer:innen in privaten oder öffentlichen Kanälen, Gruppenchats oder Direktnachrichten. Kanäle können nur von Lehrenden und Tutor:innen erstellt werden. Nutzer:innen können selbst öffentlichen Kanälen beitreten und müssen zu privaten Kanälen hinzugefügt werden. Alle Nutzer:innen können einen privaten Gruppenchat starten und andere Nutzer:innen hinzufügen. Ein Gruppenchat ist auf zehn Mitglieder:innen begrenzt. Alle Nutzer:innen können Direktnachrichten an andere Nutzer:innen senden. Die Chats finden im Nachrichtenbereich des Kurses statt.",
"codeOfConduct": {
"label": "Verhaltenskodex",
"tooltip": "Der Verhaltenskodex gibt Nutzer:innen an, wie sie miteinander kommunizieren sollen und welche Konsequenzen bei Fehlverhalten drohen können, sowie einen Kontakt zur Berichterstattung."
}
}
},
"registrationEnabled": {
Expand Down
6 changes: 5 additions & 1 deletion src/main/webapp/i18n/en/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
},
"messagingEnabled": {
"label": "Messaging Enabled",
"tooltip": "Enables messaging between course users in private or public channels, group chats or direct messages. Channels can only be created by instructors and tutors. Users can self-join public channels and must be invited to private channels. Every user can start a private group chat and add other users. A group chat is limited to 10 members. Every user can start a private one-to-one chat with another user. The chats happens in the messaging space of the course."
"tooltip": "Enables messaging between course users in private or public channels, group chats or direct messages. Channels can only be created by instructors and tutors. Users can self-join public channels and must be invited to private channels. Every user can start a private group chat and add other users. A group chat is limited to 10 members. Every user can start a private one-to-one chat with another user. The chats happens in the messaging space of the course.",
"codeOfConduct": {
"label": "Code of Conduct",
"tooltip": "The Code of Conduct describes to users how best to communicate and which consequences might be raised if there is misconduct, as well as, contact information for reporting."
}
}
},
"registrationEnabled": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { HasAnyAuthorityDirective } from 'app/shared/auth/has-any-authority.directive';
import { ColorSelectorComponent } from 'app/shared/color-selector/color-selector.component';
import { FormDateTimePickerComponent } from 'app/shared/date-time-picker/date-time-picker.component';
import { HelpIconComponent } from 'app/shared/components/help-icon.component';
import { SecuredImageComponent } from 'app/shared/image/secured-image.component';
import { ArtemisTranslatePipe } from 'app/shared/pipes/artemis-translate.pipe';
import { MockComponent, MockDirective, MockModule, MockPipe, MockProvider } from 'ng-mocks';
Expand Down Expand Up @@ -107,13 +108,14 @@ describe('Course Management Update Component', () => {
declarations: [
CourseUpdateComponent,
MarkdownEditorStubComponent,
MockPipe(ArtemisTranslatePipe),
MockComponent(SecuredImageComponent),
MockComponent(FormDateTimePickerComponent),
MockComponent(ColorSelectorComponent),
MockComponent(FormDateTimePickerComponent),
MockComponent(HelpIconComponent),
MockComponent(SecuredImageComponent),
MockDirective(FeatureToggleHideDirective),
MockDirective(HasAnyAuthorityDirective),
MockDirective(TranslateDirective),
MockDirective(FeatureToggleHideDirective),
MockPipe(ArtemisTranslatePipe),
MockPipe(RemoveKeysPipe),
],
})
Expand Down
Loading