Skip to content

Commit

Permalink
Merge branch 'develop' into feature/programming-exercises/ts-template
Browse files Browse the repository at this point in the history
  • Loading branch information
magaupp authored Oct 17, 2024
2 parents 06eb80a + 98d6d06 commit c53db92
Show file tree
Hide file tree
Showing 38 changed files with 467 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tone_instructions: ''
early_access: true
enable_free_tier: true
reviews:
profile: assertive
profile: chill
request_changes_workflow: true
high_level_summary: true
high_level_summary_placeholder: '@coderabbitai summary'
Expand Down Expand Up @@ -192,7 +192,7 @@ reviews:
- TYPOGRAPHY
- CASING
enabled_only: false
level: picky
level: default
enabled_rules: []
enabled_categories: []
biome:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Refer to [Using JHipster in production](http://www.jhipster.tech/production) for
The following command can automate the deployment to a server. The example shows the deployment to the main Artemis test server (which runs a virtual machine):

```shell
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.6.0.war
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.6.1.war
```

## Architecture
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
}

group = "de.tum.cit.aet.artemis"
version = "7.6.0"
version = "7.6.1"
description = "Interactive Learning with Individual Feedback"

java {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artemis",
"version": "7.6.0",
"version": "7.6.1",
"description": "Interactive Learning with Individual Feedback",
"private": true,
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ public void setJudgementOfLearning(long competencyId, long userId, short jolValu
irisCourseChatSessionService.ifPresent(service -> {
// Inform Iris so it can send a message to the user
try {
if (userId % 3 > 0) { // HD3-GROUPS: Iris groups are 1 & 2
service.onJudgementOfLearningSet(jol);
}
service.onJudgementOfLearningSet(jol);
}
catch (Exception e) {
log.warn("Something went wrong while sending the judgement of learning to Iris", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import jakarta.validation.constraints.NotNull;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.http.CacheControl;
Expand All @@ -32,6 +33,9 @@ public PublicResourcesConfiguration(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}

@Value("${artemis.file-upload-path}")
private String fileUploadPath;

@Override
public void addResourceHandlers(@NotNull ResourceHandlerRegistry registry) {
// Enable static resource serving in general from "/public" from both classpath and hosts filesystem
Expand All @@ -46,6 +50,16 @@ public void addResourceHandlers(@NotNull ResourceHandlerRegistry registry) {

addResourceHandlerForPath(registry, "images", "about").setCacheControl(defaultCacheControl);
addResourceHandlerForPath(registry, "emoji").setCacheControl(defaultCacheControl);

// Add caching for course icons, user profile pictures, and drag and drop quiz pictures
// Add resource handlers for dynamic image paths based on fileUploadPath
// TODO: those paths have to be the same as in FilePathService, ideally we reuse the constants and define them only once
registry.addResourceHandler("/images/course/icons/**").addResourceLocations("file:" + fileUploadPath + "/images/course/icons/").setCacheControl(defaultCacheControl);

registry.addResourceHandler("/images/user/profile-pictures/**").addResourceLocations("file:" + fileUploadPath + "/images/user/profile-pictures/")
.setCacheControl(defaultCacheControl);

registry.addResourceHandler("/images/drag-and-drop/**").addResourceLocations("file:" + fileUploadPath + "/images/drag-and-drop/").setCacheControl(defaultCacheControl);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -646,7 +647,8 @@ private ResponseEntity<byte[]> responseEntityForFilePath(Path filePath) {
if (file == null) {
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(file);
return ResponseEntity.ok().cacheControl(CacheControl.maxAge(30, TimeUnit.DAYS)) // Cache for 30 days;
.contentType(getMediaTypeFromFilename(filePath.getFileName().toString())).body(file);
}
catch (IOException e) {
log.error("Failed to return requested file with path {}", filePath, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</span>
}
@if (!isInSidebarCard) {
<span [ngbTooltip]="result!.completionDate | artemisDate"> ({{ result!.completionDate | artemisTimeAgo }} ) </span>
<span [ngbTooltip]="result!.completionDate | artemisDate"> ({{ result!.completionDate | artemisTimeAgo }}) </span>
}
</span>
@if (hasBuildArtifact() && participation.type === ParticipationType.PROGRAMMING) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export class CourseConversationsComponent implements OnInit, OnDestroy {
this.subscribeToIsCodeOfConductAccepted();
this.subscribeToIsCodeOfConductPresented();
this.subscribeToConversationsOfUser();
this.subscribeToLoading();
this.updateQueryParameters();
this.prepareSidebarData();
this.metisConversationService.checkIsCodeOfConductAccepted(this.course!);
this.isServiceSetUp = true;
this.isLoading = false;
}
});

Expand Down Expand Up @@ -224,12 +224,6 @@ export class CourseConversationsComponent implements OnInit, OnDestroy {
});
}

private subscribeToLoading() {
this.metisConversationService.isLoading$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((isLoading: boolean) => {
this.isLoading = isLoading;
});
}

acceptCodeOfConduct() {
if (this.course) {
this.metisConversationService.acceptCodeOfConduct(this.course);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@
<div
id="scrollableDiv"
#container
[ngClass]="{ 'posting-infinite-scroll-container': posts.length !== 0, 'content-height-dev': contentHeightDev }"
[ngClass]="{ 'posting-infinite-scroll-container': posts.length !== 0, 'content-height-dev': contentHeightDev, 'is-fetching-posts': isFetchingPosts }"
infinite-scroll
class="conversation-messages-message-list"
[scrollWindow]="false"
(scrolledUp)="fetchNextPage()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@
padding-top: 100px;
padding-bottom: 100px;
}

.conversation-messages-message-list.is-fetching-posts {
display: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD
this.createEmptyPost();
}
}

private subscribeToMetis() {
this.metisService.posts.pipe(takeUntil(this.ngUnsubscribe)).subscribe((posts: Post[]) => {
this.setPosts(posts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,13 @@ export class CourseDashboardComponent implements OnInit, OnDestroy {
this.paramSubscription = this.route.parent?.parent?.params.subscribe((params) => {
this.courseId = parseInt(params['courseId'], 10);

// HD3-GROUPS: Experiment groups for IRIS are 1 & 2. Disable for group 0
if (this.accountService.userIdentity && this.accountService.userIdentity!.id! % 3 > 0) {
this.profileService.getProfileInfo().subscribe((profileInfo) => {
if (profileInfo?.activeProfiles.includes(PROFILE_IRIS)) {
this.irisSettingsService.getCombinedCourseSettings(this.courseId).subscribe((settings) => {
this.irisEnabled = !!settings?.irisChatSettings?.enabled;
});
}
});
}
this.profileService.getProfileInfo().subscribe((profileInfo) => {
if (profileInfo?.activeProfiles.includes(PROFILE_IRIS)) {
this.irisSettingsService.getCombinedCourseSettings(this.courseId).subscribe((settings) => {
this.irisEnabled = !!settings?.irisChatSettings?.enabled;
});
}
});
});
this.setCourse(this.courseStorageService.getCourse(this.courseId));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@
</div>
</div>
<hr class="" />
@if (faqs.length === 0) {
<h2 class="markdown-preview" jhiTranslate="artemisApp.faq.noExisting"></h2>
}
<div>
@for (faq of this.filteredFaqs; track faq) {
<jhi-course-faq-accordion [faq]="faq"></jhi-course-faq-accordion>
}
</div>
@if (filteredFaqs.length === 0 && faqs.length > 0) {
<h2 class="markdown-preview" jhiTranslate="artemisApp.faq.noMatching"></h2>
}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import { loadCourseFaqCategories } from 'app/faq/faq.utils';
import { CustomExerciseCategoryBadgeComponent } from 'app/shared/exercise-categories/custom-exercise-category-badge/custom-exercise-category-badge.component';
import { onError } from 'app/shared/util/global.utils';
import { SearchFilterComponent } from 'app/shared/search-filter/search-filter.component';
import { ArtemisMarkdownModule } from 'app/shared/markdown.module';

@Component({
selector: 'jhi-course-faq',
templateUrl: './course-faq.component.html',
styleUrls: ['../course-overview.scss', 'course-faq.component.scss'],
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [ArtemisSharedComponentModule, ArtemisSharedModule, CourseFaqAccordionComponent, CustomExerciseCategoryBadgeComponent, SearchFilterComponent],
imports: [ArtemisSharedComponentModule, ArtemisSharedModule, CourseFaqAccordionComponent, CustomExerciseCategoryBadgeComponent, SearchFilterComponent, ArtemisMarkdownModule],
})
export class CourseFaqComponent implements OnInit, OnDestroy {
private ngUnsubscribe = new Subject<void>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if (!isExamExercise) {
@if (!isExamExercise && requestFeedbackEnabled) {
@if (athenaEnabled) {
@if (exercise().type === ExerciseType.TEXT) {
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ParticipationService } from 'app/exercises/shared/participation/partici
export class RequestFeedbackButtonComponent implements OnInit {
faPenSquare = faPenSquare;
athenaEnabled = false;
requestFeedbackEnabled = false;
isExamExercise: boolean;
participation?: StudentParticipation;

Expand All @@ -34,7 +35,6 @@ export class RequestFeedbackButtonComponent implements OnInit {
exercise = input.required<Exercise>();
generatingFeedback = output<void>();

private feedbackSent = false;
private profileService = inject(ProfileService);
private alertService = inject(AlertService);
private courseExerciseService = inject(CourseExerciseService);
Expand All @@ -52,6 +52,7 @@ export class RequestFeedbackButtonComponent implements OnInit {
if (this.isExamExercise || !this.exercise().id) {
return;
}
this.requestFeedbackEnabled = this.exercise().allowFeedbackRequests ?? false;
this.updateParticipation();
}

Expand All @@ -77,7 +78,6 @@ export class RequestFeedbackButtonComponent implements OnInit {
next: (participation: StudentParticipation) => {
if (participation) {
this.generatingFeedback.emit();
this.feedbackSent = true;
this.alertService.success('artemisApp.exercise.feedbackRequestSent');
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class MetisConversationService implements OnDestroy {

public setActiveConversation(conversationIdentifier: ConversationDTO | number | undefined) {
this.updateLastReadDateAndNumberOfUnreadMessages();
let cachedConversation = undefined;
let cachedConversation: ConversationDTO | undefined = undefined;
if (conversationIdentifier) {
const parameterJustId = typeof conversationIdentifier === 'number';
cachedConversation = this.conversationsOfUser.find(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Interface for the colors of the editor.
* See https://code.visualstudio.com/api/references/theme-color
* All colors must be in the format '#RRGGBB' or '#RRGGBBAA'.
*/
export interface EditorColors {
/**
* The background color of the editor.
*/
backgroundColor?: string;
/**
* The default color of all text in the editor, not including syntax highlighting.
*/
foregroundColor?: string;
/**
* Colors for line numbers in the editor.
*/
lineNumbers?: {
/**
* The color of the line numbers.
*/
foregroundColor?: string;
/**
* The color of the line number of the line that the cursor is on.
*/
activeForegroundColor?: string;
/**
* The color of the line numbers for dimmed lines. This is used for the final newline of the code.
*/
dimmedForegroundColor?: string;
};
/**
* Colors for the active line highlight in the editor.
*/
lineHighlight?: {
/**
* The color used as the background color for the cursor's current line.
*/
backgroundColor?: string;
/**
* The color used for the border of the cursor's current line.
*/
borderColor?: string;
};
/**
* Colors for the diff editor.
*/
diff?: {
/**
* The background color for inserted lines in the diff editor.
*/
insertedLineBackgroundColor?: string;
/**
* The background color for inserted text in the diff editor.
* This will overlap with the `insertedLineBackgroundColor`.
*/
insertedTextBackgroundColor?: string;
/**
* The background color for removed lines in the diff editor.
*/
removedTextBackgroundColor?: string;
/**
* The background color for removed text in the diff editor.
* This will overlap with the `removedLineBackgroundColor`.
*/
removedLineBackgroundColor?: string;
/**
* The color used for the diagonal fill in the diff editor.
* This is used when the diff editor pads the length of the files to align the lines of the original and modified files.
*/
diagonalFillColor?: string;
/**
* Colors for the diff editor gutter. This is the area to the left of the editor that shows the line numbers.
*/
gutter?: {
/**
* The background color for inserted lines in the diff editor gutter.
*/
insertedLineBackgroundColor?: string;
/**
* The background color for removed lines in the diff editor gutter.
*/
removedLineBackgroundColor?: string;
};
};
}
Loading

0 comments on commit c53db92

Please sign in to comment.