From 34d7c87a72180a65d2cdba3366e7f83445572051 Mon Sep 17 00:00:00 2001
From: paf <paf@titelfrei.de>
Date: Fri, 22 Jan 2021 09:41:08 +0100
Subject: [PATCH] design updates

---
 .../workspace-admin/files/files.component.css |  4 +--
 .../files/files.component.html                | 31 ++++++++--------
 .../workspace-admin/files/files.component.ts  |  7 +++-
 .../files/iqb-files/iqb-files.scss            | 14 +-------
 .../iqbFilesUpload.component.html             | 10 ++----
 .../iqbFilesUploadQueue.component.html        | 36 ++++++++++---------
 6 files changed, 47 insertions(+), 55 deletions(-)

diff --git a/src/app/workspace-admin/files/files.component.css b/src/app/workspace-admin/files/files.component.css
index 5f743c14..a418d995 100644
--- a/src/app/workspace-admin/files/files.component.css
+++ b/src/app/workspace-admin/files/files.component.css
@@ -12,8 +12,7 @@
 }
 
 mat-table {
-  margin-top: 1em;
-  margin-bottom: 2em;
+  margin-bottom: 3em;
 }
 
 .checkboxcell {
@@ -28,6 +27,7 @@ mat-table {
 .namecell .mat-subheading-1 {
   padding: 0 16px;
   margin-bottom: 0;
+  color: black;
 }
 
 .datecell {
diff --git a/src/app/workspace-admin/files/files.component.html b/src/app/workspace-admin/files/files.component.html
index d8d72a4a..6a33e2d1 100644
--- a/src/app/workspace-admin/files/files.component.html
+++ b/src/app/workspace-admin/files/files.component.html
@@ -1,5 +1,6 @@
 <div class="columnhost">
   <div class="filelist">
+
     <ng-container *ngFor="let type of fileTypes">
 
       <mat-table *ngIf="files && files[type]" [dataSource]="files[type]" matSort (matSortChange)="setTableSorting($event)">
@@ -14,10 +15,10 @@
 
         <ng-container matColumnDef="name">
           <mat-header-cell *matHeaderCellDef mat-sort-header class="namecell">
-            <div class="mat-subheading-1">{{files[type].data.length}} {{typeLabels[type]}}
-              <span *ngIf="type=='Testtakers'">({{fileStats.testtakers}} Teilnehmer)</span>
-            </div>
-            <alert level="error" *ngIf="fileStats.invalid[type]" text="`{{fileStats.invalid[type]}}` Fehlerhaft"></alert>
+            <div class="mat-subheading-1">{{typeLabels[type]}}</div>
+            <span>{{files[type].data.length}} Datei{{files[type].data.length === 1 ? '' : 'en'}}</span>
+            <span *ngIf="fileStats.invalid[type]">, davon {{fileStats.invalid[type]}} Fehlerhaft</span>
+            <span *ngIf="type=='Testtakers'">, {{fileStats.testtakers}} Teilnehmer</span>
           </mat-header-cell>
           <mat-cell *matCellDef="let element" class="namecell">
             <div class="file-report">
@@ -27,15 +28,10 @@
                   <mat-icon class="report-error">error</mat-icon>
                 </ng-container>
                 <ng-template #noError>
-                  <ng-container *ngIf="element.report.warning && element.report.warning.length; else: noWarning">
+                  <ng-container *ngIf="element.report.warning && element.report.warning.length">
                     <mat-icon class="report-warning">warning</mat-icon>
                   </ng-container>
                 </ng-template>
-                <ng-template #noWarning>
-                  <ng-container *ngIf="element.report.info && element.report.info.length">
-                    <mat-icon class="report-info">info</mat-icon>
-                  </ng-container>
-                </ng-template>
               </span>
               <mat-card class="full-file-report">
                 <mat-card-header *ngIf="element.info.label || element.id">
@@ -102,11 +98,14 @@
       (uploadCompleteEvent)="updateFileList()">
     </iqb-files-upload-queue>
 
-    <alert *ngIf="fileStats.invalid" level="error" text="{{fileStats.total.invalid}}
-      Datei{{fileStats.total.invalid == 1 ? '' : 'en'}} von {{fileStats.total.count}}
-      {{fileStats.total.invalid == 1 ? 'ist' : 'sind'}} nicht valide oder
-      {{fileStats.total.invalid == 1 ? 'hat' : 'haben'}} fehlende Abhängigkeiten
-      und {{fileStats.total.invalid == 1 ? 'wird' : 'werden'}} ignoriert!">
-    </alert>
+    <div *ngIf="!uploadQueue.files.length" class="workspace-report">
+      <alert *ngIf="fileStats.total.invalid" level="error" text="{{fileStats.total.invalid}}
+        Datei{{fileStats.total.invalid == 1 ? '' : 'en'}} von {{fileStats.total.count}}
+        {{fileStats.total.invalid == 1 ? 'ist' : 'sind'}} nicht valide oder
+        {{fileStats.total.invalid == 1 ? 'hat' : 'haben'}} fehlende Abhängigkeiten
+        und {{fileStats.total.invalid == 1 ? 'wird' : 'werden'}} ignoriert!">
+      </alert>
+    </div>
+
   </div>
 </div>
diff --git a/src/app/workspace-admin/files/files.component.ts b/src/app/workspace-admin/files/files.component.ts
index 8e338ac0..b35fee08 100644
--- a/src/app/workspace-admin/files/files.component.ts
+++ b/src/app/workspace-admin/files/files.component.ts
@@ -1,4 +1,6 @@
-import { Component, OnInit, Inject } from '@angular/core';
+import {
+  Component, OnInit, Inject, ViewChild
+} from '@angular/core';
 import { MatTableDataSource } from '@angular/material/table';
 import { MatSnackBar } from '@angular/material/snack-bar';
 import { MatDialog } from '@angular/material/dialog';
@@ -16,6 +18,7 @@ import {
 } from '../workspace.interfaces';
 import { BackendService, FileDeletionReport } from '../backend.service';
 import { MainDataService } from '../../maindata.service';
+import { IqbFilesUploadQueueComponent } from './iqb-files';
 
 interface FileStats {
   invalid: {
@@ -62,6 +65,8 @@ export class FilesComponent implements OnInit {
     testtakers: 0
   };
 
+  @ViewChild('fileUploadQueue', { static: true }) public uploadQueue: IqbFilesUploadQueueComponent;
+
   constructor(
     @Inject('SERVER_URL') private serverUrl: string,
     @Inject('VERONA_API_VERSION_SUPPORTED') private veronaApiVersionSupported: string,
diff --git a/src/app/workspace-admin/files/iqb-files/iqb-files.scss b/src/app/workspace-admin/files/iqb-files/iqb-files.scss
index b0e5284f..d64916d7 100644
--- a/src/app/workspace-admin/files/iqb-files/iqb-files.scss
+++ b/src/app/workspace-admin/files/iqb-files/iqb-files.scss
@@ -17,7 +17,7 @@
   display: flex;
   align-content: center;
   align-items: center;
-  height: 10px;
+  height: 25px;
 }
 
 .file-info {
@@ -29,16 +29,4 @@
   outline: none;
 }
 
-.report-headline {
-  display: flex;
-  align-content: center;
-  align-items: center;
-}
-
-.close-button {
-  color: #821324;
-  cursor: pointer;
-  outline: none;
-  right: 0px;
-}
 
diff --git a/src/app/workspace-admin/files/iqb-files/iqbFilesUpload/iqbFilesUpload.component.html b/src/app/workspace-admin/files/iqb-files/iqbFilesUpload/iqbFilesUpload.component.html
index 4438365b..6cdf1a05 100644
--- a/src/app/workspace-admin/files/iqb-files/iqbFilesUpload/iqbFilesUpload.component.html
+++ b/src/app/workspace-admin/files/iqb-files/iqbFilesUpload/iqbFilesUpload.component.html
@@ -7,16 +7,12 @@
 
   <ng-container *ngIf="status > 1">
     <ng-container *ngFor="let uploadedFile of uploadResponse | keyvalue">
-      <div class="subheading-2 {{uploadedFile.value.error ? 'error' : 'success'}}">{{uploadedFile.key || file.name}}</div>
-      <alert
-          level="{{uploadedFile.value.error ? 'error' : 'success'}}"
-          text="{{uploadedFile.value.error ? 'Abgelehnt' : 'Erfolgreich hochgeladen'}}"
-      ></alert>
+      <div class="subheading-2 {{uploadedFile.value.error ? 'error' : 'success'}}">
+        {{uploadedFile.key || file.name}} - {{uploadedFile.value.error ? 'Abgelehnt' : 'Erfolgreich hochgeladen'}}
+      </div>
       <ng-container *ngFor="let report of uploadedFile.value | keyvalue">
         <alert *ngFor="let reportEntry of report.value" [level]="report.key" [text]="reportEntry"></alert>
       </ng-container>
     </ng-container>
   </ng-container>
 </div>
-
-
diff --git a/src/app/workspace-admin/files/iqb-files/iqbFilesUploadQueue/iqbFilesUploadQueue.component.html b/src/app/workspace-admin/files/iqb-files/iqbFilesUploadQueue/iqbFilesUploadQueue.component.html
index 599a0dbe..36764c8c 100644
--- a/src/app/workspace-admin/files/iqb-files/iqbFilesUploadQueue/iqbFilesUploadQueue.component.html
+++ b/src/app/workspace-admin/files/iqb-files/iqbFilesUploadQueue/iqbFilesUploadQueue.component.html
@@ -1,18 +1,22 @@
-<div class="report-headline" *ngIf="files.length > 0">
-  <div class="subheading-1">Upload-Report</div>
-  <mat-icon class="close-button" *ngIf="!disableClearButton" (click)="removeAll()">cancel</mat-icon>
-</div>
+<mat-card *ngIf="files.length > 0">
+  <mat-card-header>
+    <mat-card-title>Upload-Report</mat-card-title>
+  </mat-card-header>
 
-<iqb-files-upload
-  *ngFor="let file of files; let i = index"
-  [file]="file"
-  [id]="i"
-  [httpUrl]="httpUrl"
-  [fileAlias]="fileAlias"
-  [folderName]="folderName"
-  [folder]="folder"
-  (removeFileRequestEvent)="removeFile($event)"
-  (statusChangedEvent)="analyseStatus()">
-</iqb-files-upload>
+  <iqb-files-upload
+    *ngFor="let file of files; let i = index"
+    [file]="file"
+    [id]="i"
+    [httpUrl]="httpUrl"
+    [fileAlias]="fileAlias"
+    [folderName]="folderName"
+    [folder]="folder"
+    (removeFileRequestEvent)="removeFile($event)"
+    (statusChangedEvent)="analyseStatus()">
+  </iqb-files-upload>
 
-<hr *ngIf="files.length > 0">
+
+  <mat-card-actions>
+    <button *ngIf="!disableClearButton" (click)="removeAll()" mat-raised-button color="primary">OK</button>
+  </mat-card-actions>
+</mat-card>
-- 
GitLab