Skip to content

Commit

Permalink
Bugfix/Don't insert build output as html (#1004)
Browse files Browse the repository at this point in the history
Closes #993
  • Loading branch information
thilo-behnke authored and jpbernius committed Nov 1, 2019
1 parent f037cab commit acf76ce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3 class="card-title">
<div class="buildoutput d-flex flex-column">
<span *ngFor="let logEntry of rawBuildLogs" class="build-output__entry">
<span class="build-output__entry-date">{{ logEntry.time | date: 'yyyy-MM-dd HH:mm:ss' }}</span>
<span class="build-output__entry-text" [innerHtml]="logEntry.log | safeHtml"></span>
<span class="build-output__entry-text">{{ logEntry.log }}</span>
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h4 class="modal-title">Feedback</h4>
<p *ngIf="feedback.type === 'MANUAL' && feedback.positive">
<span class="code-success">Feedback &nbsp;{{ feedback.text }}:</span>
</p>
<pre *ngIf="feedback.detailText" [innerHtml]="feedback.detailText | safeHtml"></pre>
<pre *ngIf="feedback.detailText">{{ feedback.detailText }}</pre>
<pre *ngIf="!feedback.detailText">No feedback available</pre>
<hr *ngIf="!isLast" />
</div>
Expand All @@ -49,8 +49,9 @@ <h4 class="modal-title">Feedback</h4>
[class.font-weight-bold]="logEntry.type === BuildLogType.ERROR"
[class.text-warning]="logEntry.type === BuildLogType.WARNING"
[class.mb-3]="i + 1 < buildLogs.length && logEntry.time !== buildLogs[i + 1].time"
[innerHtml]="logEntry.log | safeHtml"
></dd>
>
{{ logEntry.log }}
</dd>
</ng-container>
</dl>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CodeEditorBuildLogService, CodeEditorBuildOutputComponent, CodeEditorSe
import { ArtemisTestModule } from '../../test.module';
import { Participation, ParticipationWebsocketService } from 'app/entities/participation';
import { MockCodeEditorBuildLogService, MockCodeEditorSessionService, MockCookieService, MockParticipationWebsocketService, MockResultService, MockSyncStorage } from '../../mocks';
import { SafeHtmlPipe } from 'app/shared';
import { ArtemisSharedModule, SafeHtmlPipe } from 'app/shared';
import { ResultService } from 'app/entities/result';
import { Feedback } from 'app/entities/feedback';
import { BuildLogEntryArray } from 'app/entities/build-log';
Expand All @@ -38,8 +38,8 @@ describe('CodeEditorBuildOutputComponent', () => {

beforeEach(async () => {
return TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), ArtemisTestModule, AceEditorModule],
declarations: [CodeEditorBuildOutputComponent, SafeHtmlPipe],
imports: [TranslateModule.forRoot(), ArtemisTestModule, AceEditorModule, ArtemisSharedModule],
declarations: [CodeEditorBuildOutputComponent],
providers: [
{ provide: ResultService, useClass: MockResultService },
{ provide: CodeEditorBuildLogService, useClass: MockCodeEditorBuildLogService },
Expand Down

0 comments on commit acf76ce

Please sign in to comment.