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: Enable code of conduct when communication is enabled #8577

Merged
merged 3 commits into from
May 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h5>
ngbTooltip="{{ 'artemisApp.course.courseCommunicationSetting.messagingEnabled.tooltip' | artemisTranslate }}"
/>
</div>
@if (messagingEnabled) {
@if (messagingEnabled || communicationEnabled) {
<div class="form-group">
<label class="form-control-label" jhiTranslate="artemisApp.codeOfConduct.title"></label>
<jhi-help-icon text="artemisApp.codeOfConduct.tooltip" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ describe('Course Management Update Component', () => {
comp.updateCourseInformationSharingMessagingCodeOfConduct('# Code of Conduct');
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].value).toBe('# Code of Conduct');
});

it('should update course information sharing code of conduct when communication is enabled and messaging disabled', () => {
comp.communicationEnabled = true;
comp.messagingEnabled = false;
comp.course = new Course();
comp.courseForm = new FormGroup({
courseInformationSharingMessagingCodeOfConduct: new FormControl(),
});
comp.updateCourseInformationSharingMessagingCodeOfConduct('# Code of Conduct');
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].value).toBe('# Code of Conduct');
sarpsahinalp marked this conversation as resolved.
Show resolved Hide resolved
// Verify the form control is editable
expect(comp.courseForm.controls['courseInformationSharingMessagingCodeOfConduct'].enabled).toBeTrue();
});
});

describe('changeComplaintsEnabled', () => {
Expand Down
Loading