Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed the rerun report so that it now works with updated API #433

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/app/report/edit-display/edit-display.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ export class EditDisplayComponent {

rerunReport(): void {
let reportId: string = this.report.storageId;
this.httpService.runDisplayReport(reportId, this.currentView.storageName).subscribe((response) => {
this.rerunSuccess = this.report == response;
});
// TODO: Fix the run report for debug tab after PR 433 of frontend project
// this.httpService.runDisplayReport(reportId, this.currentView.storageName).subscribe((response) => {
// this.rerunSuccess = this.report == response;
// });
}

closeReport(removeReportFromTree: boolean): void {
Expand Down
9 changes: 3 additions & 6 deletions src/app/shared/services/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TestListItem } from '../interfaces/test-list-item';
import { CloneReport } from '../interfaces/clone-report';
import { UploadParams } from '../interfaces/upload-params';
import { UpdatePathSettings } from '../interfaces/update-path-settings';
import { TestResult } from '../interfaces/test-result';

@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -202,13 +203,9 @@ export class HttpService {
return this.http.get<OptionsSettings>('api/testtool/reset').pipe(catchError(this.handleError()));
}

reset(): Observable<void> {
return this.http.post<void>('api/runner/reset', {}).pipe(catchError(this.handleError()));
}

runReport(storage: string, targetStorage: string, reportId: string): Observable<void> {
runReport(storage: string, reportId: string): Observable<TestResult> {
return this.http
.post<void>('api/runner/run/' + storage + '/' + targetStorage + '/' + reportId, {
.post<void>(`api/runner/run/${storage}/${reportId}`, {
headers: this.headers,
observe: 'response',
})
Expand Down
9 changes: 3 additions & 6 deletions src/app/test/test.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,14 @@ export class TestComponent implements OnInit, AfterViewInit {
}

resetRunner(): void {
this.httpService.reset().subscribe();
this.reranReports = [];
}

run(reportId: string): void {
if (this.generatorStatus === 'Enabled') {
this.httpService
.runReport(this.currentView.storageName, this.currentView.targetStorage, reportId)
.subscribe((response: any) => {
this.showResult(response);
});
this.httpService.runReport(this.currentView.targetStorage, reportId).subscribe((response: TestResult): void => {
this.showResult(response);
});
} else {
this.toastService.showWarning('Generator is disabled!');
}
Expand Down
Loading