Skip to content
Snippets Groups Projects
Commit 74e031dd authored by paf's avatar paf
Browse files

remove validation endpoint wich is no longer needed

parent 45e524d0
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import {
GetFileResponseData, CheckWorkspaceResponseData, SysCheckStatistics,
GetFileResponseData, SysCheckStatistics,
ReviewData, LogData, UnitResponse, ResultData
} from './workspace.interfaces';
import { WorkspaceDataService } from './workspacedata.service';
......@@ -57,21 +57,6 @@ export class BackendService {
);
}
checkWorkspace(): Observable<CheckWorkspaceResponseData> {
return this.http
.get<CheckWorkspaceResponseData>(this.serverUrl + `workspace/${this.wds.wsId}/validation`, {})
.pipe(
catchError((err: ApiError) => {
console.warn(`checkWorkspace Api-Error: ${err.code} ${err.info} `);
return of(<CheckWorkspaceResponseData>{
errors: [`checkWorkspace Api-Error: ${err.code} ${err.info} `],
infos: [],
warnings: []
});
})
);
}
getResultData(): Observable<ResultData[]> {
return this.http
.get<ResultData[]>(this.serverUrl + `workspace/${this.wds.wsId}/results`, {})
......
......@@ -75,9 +75,6 @@
<button mat-raised-button (click)="hiddenfileinput.click()" matTooltip="Dateien hochladen/aktualisieren" matTooltipPosition="above" [disabled]="wds.wsRole !== 'RW'">
<mat-icon>cloud_upload</mat-icon>
</button>
<button mat-raised-button (click)="checkWorkspace()" matTooltip="Arbeitsbereich prüfen" matTooltipPosition="above">
<mat-icon>check</mat-icon>
</button>
</div>
<input #hiddenfileinput type="file" name="fileforvo" multiple [iqbFilesUploadInputFor]="fileUploadQueue" [hidden]="true"/>
......@@ -90,18 +87,6 @@
(uploadCompleteEvent)="updateFileList()">
</iqb-files-upload-queue>
<p *ngFor="let e of checkErrors" class="checkerror">
{{ e }}
</p>
<p *ngFor="let w of checkWarnings" class="checkwarning">
{{ w }}
</p>
<p *ngFor="let i of checkInfos" class="checkinfo">
{{ i }}
</p>
<ng-container *ngFor="let stat of fileStats.types | keyvalue">
<alert level="info" text="{{stat.value.valid}} valide Datei{{stat.value.valid == 1 ? '' : 'en'}} vom Typ
{{stat.key}} {{(stat.value.total > stat.value.valid) ? '(von insgesamt ' + stat.value.total + ')' : ''}}">
......
......@@ -12,7 +12,7 @@ import {
MessageDialogData, MessageType
} from 'iqb-components';
import { WorkspaceDataService } from '../workspacedata.service';
import { GetFileResponseData, CheckWorkspaceResponseData } from '../workspace.interfaces';
import { GetFileResponseData } from '../workspace.interfaces';
import { BackendService, FileDeletionReport } from '../backend.service';
import { MainDataService } from '../../maindata.service';
......@@ -40,11 +40,6 @@ export class FilesComponent implements OnInit {
public uploadUrl = '';
public fileNameAlias = 'fileforvo';
// for workspace-check
public checkErrors = [];
public checkWarnings = [];
public checkInfos = [];
public typeLabels = {
'Testtakers': 'Teilnehmerliste',
'Booklet': 'Testheft',
......@@ -79,18 +74,15 @@ export class FilesComponent implements OnInit {
});
}
checkAll(isChecked: boolean): void {
public checkAll(isChecked: boolean): void {
this.serverfiles.data.forEach(element => {
// eslint-disable-next-line no-param-reassign
element.isChecked = isChecked;
});
}
deleteFiles(): void {
public deleteFiles(): void {
if (this.wds.wsRole === 'RW') {
this.checkErrors = [];
this.checkWarnings = [];
this.checkInfos = [];
const filesToDelete = [];
this.serverfiles.data.forEach(element => {
......@@ -141,11 +133,7 @@ export class FilesComponent implements OnInit {
}
}
updateFileList(empty = false): void {
this.checkErrors = [];
this.checkWarnings = [];
this.checkInfos = [];
public updateFileList(empty = false): void {
if (empty) {
this.serverfiles = new MatTableDataSource([]);
this.mds.setSpinnerOff();
......@@ -186,7 +174,7 @@ export class FilesComponent implements OnInit {
return stats;
}
download(element: GetFileResponseData): void {
public download(element: GetFileResponseData): void {
this.mds.setSpinnerOn();
this.bs.downloadFile(element.type, element.name)
.subscribe(
......@@ -198,20 +186,4 @@ export class FilesComponent implements OnInit {
}
);
}
checkWorkspace(): void {
this.checkErrors = [];
this.checkWarnings = [];
this.checkInfos = [];
this.mds.setSpinnerOn();
this.bs.checkWorkspace().subscribe(
(checkResponse: CheckWorkspaceResponseData) => {
this.mds.setSpinnerOff();
this.checkErrors = checkResponse.errors;
this.checkWarnings = checkResponse.warnings;
this.checkInfos = checkResponse.infos;
}
);
}
}
......@@ -20,12 +20,6 @@ export interface GetFileResponseData {
}
}
export interface CheckWorkspaceResponseData {
errors: string[];
infos: string[];
warnings: string[];
}
export interface GroupResponse {
name: string;
testsTotal: number;
......
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