@@ -24,6 +24,7 @@ import WorkflowInvocationSteps from "../Workflow/Invocation/Graph/WorkflowInvoca
2424import InvocationReport from " ../Workflow/InvocationReport.vue" ;
2525import WorkflowAnnotation from " ../Workflow/WorkflowAnnotation.vue" ;
2626import WorkflowNavigationTitle from " ../Workflow/WorkflowNavigationTitle.vue" ;
27+ import TabsDisabledAlert from " ./TabsDisabledAlert.vue" ;
2728import WorkflowInvocationExportOptions from " ./WorkflowInvocationExportOptions.vue" ;
2829import WorkflowInvocationFeedback from " ./WorkflowInvocationFeedback.vue" ;
2930import WorkflowInvocationInputOutputTabs from " ./WorkflowInvocationInputOutputTabs.vue" ;
@@ -76,14 +77,19 @@ const tabsDisabled = computed(
7677const disabledTabTooltip = computed (() => {
7778 const state = invocationState .value ;
7879 if (state != " scheduled" ) {
79- return ` This workflow is not currently scheduled. The current state is ${state }. Once the workflow is fully scheduled and jobs have complete any disabled tabs will become available . ` ;
80+ return ` This workflow is not currently scheduled. The current state is ${state }. Disabled tabs are available if the workflow is fully scheduled and all jobs have completed . ` ;
8081 } else if (stateCounts .value && stateCounts .value .runningCount != 0 ) {
8182 return ` The workflow invocation still contains ${stateCounts .value .runningCount } running job(s). Once these jobs have completed any disabled tabs will become available. ` ;
8283 } else {
8384 return " Steps for this workflow are still running. Any disabled tabs will be available once complete." ;
8485 }
8586});
8687
88+ /** We are on the default "Overview" tab if the tab prop is not set or is not one of the expected tab values */
89+ const onOverviewTab = computed (() => {
90+ return ! props .tab || ! [" steps" , " inputs" , " outputs" , " report" , " export" , " metrics" , " debug" ].includes (props .tab );
91+ });
92+
8793const invocation = computed (() => {
8894 const storedInvocation = invocationStore .getInvocationById (props .invocationId );
8995 if (invocationLoaded .value && isWorkflowInvocationElementView (storedInvocation )) {
@@ -339,7 +345,7 @@ async function onCancel() {
339345 </WorkflowAnnotation >
340346
341347 <BNav v-if =" props.isFullPage" pills class =" mb-2 p-2 bg-light border-bottom" >
342- <BNavItem title =" Overview" :active =" !props.tab " :to =" `/workflows/invocations/${props.invocationId}`" >
348+ <BNavItem title =" Overview" :active =" onOverviewTab " :to =" `/workflows/invocations/${props.invocationId}`" >
343349 Overview
344350 </BNavItem >
345351 <BNavItem
@@ -361,17 +367,17 @@ async function onCancel() {
361367 Outputs
362368 </BNavItem >
363369 <BNavItem
364- title =" Report"
370+ : title =" !tabsDisabled ? ' Report' : disabledTabTooltip "
365371 class =" invocation-report-tab"
366- :active =" props.tab === 'report'"
372+ :active =" !tabsDisabled && props.tab === 'report'"
367373 :to =" `/workflows/invocations/${props.invocationId}/report`"
368374 :disabled =" tabsDisabled" >
369375 Report
370376 </BNavItem >
371377 <BNavItem
372- title =" Export"
378+ : title =" !tabsDisabled ? ' Export' : disabledTabTooltip "
373379 class =" invocation-export-tab"
374- :active =" props.tab === 'export'"
380+ :active =" !tabsDisabled && props.tab === 'export'"
375381 :to =" `/workflows/invocations/${props.invocationId}/export`"
376382 :disabled =" tabsDisabled" >
377383 Export
@@ -423,7 +429,7 @@ async function onCancel() {
423429 </BNav >
424430
425431 <div class =" mt-1 d-flex flex-column overflow-auto" >
426- <div v-if =" !props.tab " >
432+ <div v-if =" onOverviewTab " >
427433 <WorkflowInvocationOverview
428434 class =" invocation-overview"
429435 :invocation =" invocation"
@@ -451,15 +457,17 @@ async function onCancel() {
451457 <BAlert v-if =" isSubworkflow" variant =" info" show >
452458 <span v-localize >Report is not available for subworkflow.</span >
453459 </BAlert >
454- <BAlert v-else-if =" !invocationStateSuccess" variant =" info" show >
455- <span v-localize >{{ disabledTabTooltip }}</span >
456- </BAlert >
460+ <TabsDisabledAlert
461+ v-else-if =" tabsDisabled"
462+ :invocation-id =" props.invocationId"
463+ :tooltip =" disabledTabTooltip" />
457464 <InvocationReport v-else :invocation-id =" invocation.id" />
458465 </div >
459466 <div v-if =" props.tab === 'export'" >
460- <BAlert v-if =" !invocationAndJobTerminal" variant =" info" show >
461- <span v-localize >{{ disabledTabTooltip }}</span >
462- </BAlert >
467+ <TabsDisabledAlert
468+ v-if =" tabsDisabled"
469+ :invocation-id =" props.invocationId"
470+ :tooltip =" disabledTabTooltip" />
463471 <div v-else >
464472 <WorkflowInvocationExportOptions :invocation-id =" invocation.id" />
465473 </div >
0 commit comments