From 344fe918069cfbe9a0b13f4bd1cab3f7ae80aa74 Mon Sep 17 00:00:00 2001 From: Giuseppe Steduto Date: Mon, 11 Sep 2023 12:17:22 +0200 Subject: [PATCH] wf-details: always fill progress bar for finished workflows 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. --- CHANGES.rst | 1 + .../pages/workflowDetails/components/WorkflowProgress.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index c556cbca..854e4447 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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. diff --git a/reana-ui/src/pages/workflowDetails/components/WorkflowProgress.js b/reana-ui/src/pages/workflowDetails/components/WorkflowProgress.js index 8c4f8eef..ecd287aa 100644 --- a/reana-ui/src/pages/workflowDetails/components/WorkflowProgress.js +++ b/reana-ui/src/pages/workflowDetails/components/WorkflowProgress.js @@ -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 (