diff --git a/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue index eb3ccc1b2..2cb244b52 100644 --- a/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue +++ b/packages/frontend-2/components/automate/viewer/panel/FunctionRunRow.vue @@ -35,20 +35,8 @@
Status
-
- Function is {{ functionRun.status.toLowerCase() }}. -
-
- {{ functionRun.statusMessage || 'No status message' }} +
+ {{ statusMessage }}
@@ -168,4 +156,16 @@ const hasValidContextView = computed(() => { const currentPath = route.fullPath return !doesRouteFitTarget(ctxView, currentPath) }) + +const statusMessage = computed(() => { + const isFinished = ![ + AutomateRunStatus.Initializing, + AutomateRunStatus.Running, + AutomateRunStatus.Pending + ].includes(props.functionRun.status) + + return isFinished + ? props.functionRun.statusMessage ?? 'No status message' + : `Function is ${props.functionRun.status.toLowerCase()}.` +})