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

wf-details: always fill progress bar for finished workflows #348

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
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
Loading