Skip to content
Closed
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
11 changes: 11 additions & 0 deletions core/gui/src/app/workspace/component/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
</a>
</div>
<div id="menu-content">
<div
class="report-generation-spinner"
*ngIf="isReportGenerating">
<div class="spinner-content">
<nz-spin
[nzSize]="'large'"
nzTip="Generating">
</nz-spin>
</div>
</div>

<div
id="menu-user"
*ngIf="userSystemEnabled">
Expand Down
27 changes: 27 additions & 0 deletions core/gui/src/app/workspace/component/menu/menu.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,30 @@ texera-user-icon {
texera-coeditor-user-icon {
margin-left: -10px;
}

report-generation-spinner {
position: fixed;
bottom: 0;
left: 50%;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}

.spinner-content {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
}

.ant-spin-text {
font-size: 18px;
color: #333;
margin-top: 10px;
}
10 changes: 9 additions & 1 deletion core/gui/src/app/workspace/component/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { ReportGenerationService } from "../../service/report-generation/report-
styleUrls: ["menu.component.scss"],
})
export class MenuComponent implements OnInit {
public isReportGenerating = false;
public executionState: ExecutionState; // set this to true when the workflow is started
public ExecutionState = ExecutionState; // make Angular HTML access enum definition
public isWorkflowValid: boolean = true; // this will check whether the workflow error or not
Expand Down Expand Up @@ -253,6 +254,8 @@ export class MenuComponent implements OnInit {
* get the html to export all results.
*/
public onClickGenerateReport(): void {
this.isReportGenerating = true;

// Get notification
this.notificationService.info("The report is being generated...");

Expand All @@ -278,13 +281,18 @@ export class MenuComponent implements OnInit {
);
// Generate the final report as HTML after all results are retrieved
this.reportGenerationService.generateReportAsHtml(workflowSnapshotURL, sortedResults, workflowName);
this.isReportGenerating = false;
},
error: (error: unknown) => {
this.notificationService.error("Error in retrieving operator results: " + (error as Error).message);
this.isReportGenerating = false;
},
});
},
error: (e: unknown) => this.notificationService.error((e as Error).message),
error: (e: unknown) => {
this.notificationService.error((e as Error).message);
this.isReportGenerating = false;
},
});
}

Expand Down