diff --git a/src/app/workspace-admin/files/files.component.css b/src/app/workspace-admin/files/files.component.css index 58d6fe8541b8a2b32ef209f2b4299205905da969..4f8eb5126d6c33254d53a4c3b2cd57e1a823075b 100644 --- a/src/app/workspace-admin/files/files.component.css +++ b/src/app/workspace-admin/files/files.component.css @@ -34,17 +34,45 @@ font-size: 0.8em; } +.report-error, .checkerror { color: brown; } + +.report-warning, .checkwarning { color: goldenrod; } + +.report-info, .checkinfo { - color: darkgreen; + color: blue; } .mat-raised-button { min-width: 100px; margin: 2px; -} \ No newline at end of file +} + +.file-report { + cursor: pointer +} + +.full-file-report { + display: none; +} + +.file-report:hover .full-file-report { + display: block; + position: absolute; + background: white; + padding: 4px; + border-radius: 5px; + box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12); +} + +.vertical-align-middle { + display: inline-flex; + vertical-align: middle; + align-items: center; +} diff --git a/src/app/workspace-admin/files/files.component.html b/src/app/workspace-admin/files/files.component.html index dc91133db8451b90ad7fbc0d8274dd22ffe90467..060a242c04025456cba734bc051ff95dc7322b07 100644 --- a/src/app/workspace-admin/files/files.component.html +++ b/src/app/workspace-admin/files/files.component.html @@ -18,7 +18,33 @@ <ng-container matColumnDef="filename"> <mat-header-cell *matHeaderCellDef mat-sort-header class="namecell"> Name </mat-header-cell> - <mat-cell *matCellDef="let element" class="namecell"><button mat-button (click)="download(element)">{{element.filename}}</button> </mat-cell> + <mat-cell *matCellDef="let element" class="namecell"> + <button mat-button (click)="download(element)">{{element.filename}}</button> + </mat-cell> + </ng-container> + + <ng-container matColumnDef="status"> + <mat-header-cell *matHeaderCellDef mat-sort-header class="namecell"></mat-header-cell> + <mat-cell *matCellDef="let element" class="namecell"> + <div class="file-report" > + <div *ngFor="let level of ['error', 'warning', 'info']" class="vertical-align-middle"> + <ng-container *ngIf="element.report[level] && element.report[level].length"> + <div>{{element.report[level].length}}</div> + <mat-icon class="report-{{level}}">{{level}}</mat-icon> + </ng-container> + </div> + <div class="full-file-report"> + <ng-container *ngFor="let level of ['error', 'warning', 'info']"> + <div *ngFor="let message of element.report[level]"> + <div class="vertical-align-middle"> + <mat-icon class="report-{{level}}">{{level}}</mat-icon> + <span>{{message}}</span> + </div> + </div> + </ng-container> + </div> + </div> + </mat-cell> </ng-container> <ng-container matColumnDef="filedatetime"> diff --git a/src/app/workspace-admin/files/files.component.ts b/src/app/workspace-admin/files/files.component.ts index fc6b33eeed58825373a8c52a2ab5de1cd52867ec..0d9298808f5364182337961a8fd1dcb9444a032f 100644 --- a/src/app/workspace-admin/files/files.component.ts +++ b/src/app/workspace-admin/files/files.component.ts @@ -22,7 +22,7 @@ import { MainDataService } from '../../maindata.service'; }) export class FilesComponent implements OnInit { public serverfiles: MatTableDataSource<GetFileResponseData>; - public displayedColumns = ['checked', 'filename', 'typelabel', 'filesize', 'filedatetime']; + public displayedColumns = ['checked', 'filename', 'status', 'typelabel', 'filesize', 'filedatetime']; // for fileupload public uploadUrl = ''; diff --git a/src/app/workspace-admin/workspace.interfaces.ts b/src/app/workspace-admin/workspace.interfaces.ts index 3aa5fdadac32e4c6a37ef5a93274c2fbc693298f..bc5f1ca717a48553630d92fc70649decfff72044 100644 --- a/src/app/workspace-admin/workspace.interfaces.ts +++ b/src/app/workspace-admin/workspace.interfaces.ts @@ -13,6 +13,11 @@ export interface GetFileResponseData { type: string; typelabel: string; isChecked: boolean; + report: { + error: string[]; + warning: string[]; + info: string[]; + } } export interface CheckWorkspaceResponseData {