Skip to content

Commit

Permalink
wf-details: always fill progress bar for finished workflows
Browse files Browse the repository at this point in the history
Changes the workflow progress bar to always show 100% for workflows that
are in status "finished", so that even when some steps are restored from
cache, the progress bar stays consistent with the status of the
workflow.

Closes reanahub/reana-workflow-engine-snakemake#62.
  • Loading branch information
giuseppe-steduto committed Sep 20, 2023
1 parent 71cb0ea commit 344fe91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Version 0.9.1 (UNRELEASED)
- Adds support for previewing PDF files in the workspace details page.
- Adds an extra button for login with custom third-party Keycloak SSO authentication services.
- Adds a new menu item to the workflow actions popup to allow stopping running workflows.
- Changes the workflow progress bar to always display it as full for finished workflows.
- Changes the interactive session notification by adding a message stating that the session will be closed after a specified number of days inactivity.
- Changes the workflow-details page to make it possible to scroll through the list of workflow steps in the job logs section.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ import { Progress } from "semantic-ui-react";
import { statusMapping } from "~/util";

export default function WorkflowProgress({ workflow }) {
function handlePercentage(completedSteps, totalSteps) {
function handlePercentage(completedSteps, totalSteps, status) {
if (status === "finished") return 100;
return Math.floor((completedSteps * 100) / totalSteps);
}

return (
<Progress
size="small"
percent={handlePercentage(workflow.completed, workflow.total)}
percent={handlePercentage(
workflow.completed,
workflow.total,
workflow.status
)}
color={statusMapping[workflow.status].color}
active={workflow.status === "running"}
/>
Expand Down

0 comments on commit 344fe91

Please sign in to comment.