From d1df3e7824b29a8a004d019ee48950ca75161a2f Mon Sep 17 00:00:00 2001 From: Julian Gassner Date: Wed, 11 Dec 2024 15:18:04 +0100 Subject: [PATCH] Highlight solution answer in thread --- .../answer-post-header.component.html | 9 +++++++++ .../answer-post-header/answer-post-header.component.ts | 5 +++++ src/main/webapp/i18n/de/metis.json | 1 + src/main/webapp/i18n/en/metis.json | 1 + .../answer-post-header.component.spec.ts | 10 ++++++++++ 5 files changed, 26 insertions(+) diff --git a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.html b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.html index a03fb20cced3..5b129d3f7ff4 100644 --- a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.html +++ b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.html @@ -34,6 +34,15 @@ {{ postingIsOfToday ? (posting.creationDate | artemisDate: 'time') : (posting.creationDate | artemisDate: 'short-date') }} + @if (isResolvesPostSet()) { + + + + } @if (!!isCommunicationPage && (!lastReadDate || (lastReadDate && posting.creationDate && posting.creationDate.isAfter(lastReadDate))) && !isAuthorOfPosting) { } diff --git a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts index 45bd9775fd06..1d0a1c6126d8 100644 --- a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts +++ b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts @@ -28,4 +28,9 @@ export class AnswerPostHeaderComponent extends PostingHeaderDirective { let component: AnswerPostHeaderComponent; @@ -92,6 +93,15 @@ describe('AnswerPostHeaderComponent', () => { expect(getElement(debugElement, '#today-flag')).toBeNull(); }); + it('should display solution when answerPost resolves post', () => { + const isResolvesPostSetSpy = jest.spyOn(component, 'isResolvesPostSet'); + component.posting = metisResolvingAnswerPostUser1; + fixture.detectChanges(); + const solution = debugElement.query(By.css('.post-header-solution')); + expect(isResolvesPostSetSpy).toHaveReturnedWith(true); + expect(solution).not.toBeNull(); + }); + it('should initialize answer post not marked as resolved and not show the check to mark it as such', () => { // user, that is not author of original post, should not see the check to mark an answer post as resolving metisServiceUserIsAtLeastTutorMock.mockReturnValue(false);