Skip to content

Commit 65aaa88

Browse files
committed
Only display current wf operation if wf running
The workflow tab in the event details displays the current workflow operation. This is now only displayed if the workflow is still running, because for finished workflows this is a waste of screen space.
1 parent 4fe3fdb commit 65aaa88

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowDetails.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ const EventDetailsWorkflowDetails = ({
239239
{/* 'Workflow Operation table */}
240240
<div className="obj tbl-container more-info-actions">
241241
<header>
242-
{t("EVENTS.EVENTS.DETAILS.WORKFLOW_DETAILS.LATEST_OPERATION")}
242+
{t("EVENTS.EVENTS.DETAILS.WORKFLOW_DETAILS.OPERATIONS")}
243243
</header>
244244

245245
<table className="main-tbl">
@@ -322,6 +322,14 @@ const OperationsPreview = ({
322322

323323
const workflowId = useAppSelector(state => getModalWorkflowId(state));
324324
const operationsEntry = useAppSelector(state => getLatestWorkflowOperation(state));
325+
const workflow = useAppSelector(state => getWorkflow(state));
326+
327+
// Parse translation key to state
328+
let workflowDone = false;
329+
if ("status" in workflow) {
330+
const workflowStatus = workflow.status.split(".").pop();
331+
workflowDone = !(workflowStatus === "SUCCEEDED" || workflowStatus === "FAILED" || workflowStatus === "STOPPED");
332+
}
325333

326334
const loadWorkflowOperations = async () => {
327335
// Fetching workflow operations from server
@@ -351,9 +359,13 @@ const OperationsPreview = ({
351359
return (
352360
<div className="obj tbl-container more-info-actions">
353361
<header>
354-
{t("EVENTS.EVENTS.DETAILS.WORKFLOW_DETAILS.LATEST_OPERATION")}
362+
{ workflowDone
363+
? t("EVENTS.EVENTS.DETAILS.WORKFLOW_DETAILS.CURRENT_OPERATION")
364+
: t("EVENTS.EVENTS.DETAILS.WORKFLOW_DETAILS.OPERATIONS")
365+
}
355366
</header>
356367

368+
{ workflowDone && <>
357369
<table className="main-tbl">
358370
<thead>
359371
<tr>
@@ -380,6 +392,7 @@ const OperationsPreview = ({
380392
</tbody>
381393
</table>
382394
<hr style={{ height: "1px", border: 0, borderTop: "1px solid #ccc", margin: "0", padding: "0"}} />
395+
</>}
383396

384397
{/* links to 'Operations' or 'Errors & Warnings' sub-Tabs */}
385398
<div className="obj-container">

src/i18n/org/opencastproject/adminui/languages/lang-en_US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@
10311031
"WORKFLOW_DETAILS": {
10321032
"TITLE": "Workflow details",
10331033
"CONFIGURATION": "Workflow configuration",
1034-
"LATEST_OPERATION": "Latest workflow operation"
1034+
"OPERATIONS": "Operations",
1035+
"CURRENT_OPERATION": "Current workflow operation"
10351036
},
10361037
"WORKFLOW_OPERATIONS": {
10371038
"TITLE": "Workflow operations",

0 commit comments

Comments
 (0)