Skip to content
Snippets Groups Projects
Commit 67c9631e authored by paf's avatar paf
Browse files

nicer fileValididationReport-Display

parent 482b6f8f
No related branches found
No related tags found
No related merge requests found
import { Component, Input, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'alert',
template: '<span [innerHTML]="transform(text)"></span>',
styles: ['.highlight {color: #003333}'],
encapsulation: ViewEncapsulation.None
})
export class AlertComponent {
@Input() text: string;
transform = (text: string): string => text.replace(
/\u0060([^\u0060]+)\u0060/g,
(match, match2) => `<span style='color:green' class='highlight'>${match2}</span>`
);
}
import { NgModule } from '@angular/core';
import { AlertComponent } from './alert.component';
@NgModule({
imports: [],
exports: [
AlertComponent
],
declarations: [AlertComponent]
})
export class AlertModule { }
......@@ -36,7 +36,7 @@
.report-error,
.checkerror {
color: brown;
color: #821324;
}
.report-warning,
......
......@@ -38,7 +38,7 @@
<div *ngFor="let message of element.report[level]">
<div class="vertical-align-middle">
<mat-icon class="report-{{level}}">{{level}}</mat-icon>
<span>{{message}}</span>
<alert text="{{message}}"></alert>
</div>
</div>
</ng-container>
......
......@@ -29,6 +29,7 @@ import { FilesComponent } from './files/files.component';
import { ResultsComponent } from './results/results.component';
import { SyscheckComponent } from './syscheck/syscheck.component';
import { IqbFilesModule } from './files/iqb-files';
import { AlertModule } from '../shared/alert/alert.module';
@NgModule({
imports: [
......@@ -55,7 +56,8 @@ import { IqbFilesModule } from './files/iqb-files';
IqbComponentsModule,
MatCardModule,
FlexLayoutModule,
IqbFilesModule
IqbFilesModule,
AlertModule
],
exports: [
WorkspaceComponent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment