Skip to content

Commit

Permalink
adding conditional rendering for report and pdf generation, based on …
Browse files Browse the repository at this point in the history
…success of invocation and steps
  • Loading branch information
assuntad23 committed Dec 8, 2023
1 parent f053242 commit e298855
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
<div class="mb-3 workflow-invocation-state-component">
<div v-if="invocationAndJobTerminal">
<span>
<b-button v-b-tooltip.hover size="sm" class="invocation-report-link" :href="invocationLink">
<b-button
v-if="invocationStateSuccess"
v-b-tooltip.hover
size="sm"
class="invocation-report-link"
:href="invocationLink">
View Report
</b-button>
<b-button
v-if="invocationStateSuccess"
v-b-tooltip.hover
size="sm"
class="invocation-pdf-link"
Expand Down Expand Up @@ -126,6 +132,15 @@ export default {
invocationState: function () {
return this.invocation?.state || "new";
},
invocationStateSuccess: function () {
return (
this.invocationState !== "failed" &&
this.invocationState !== "cancelled" &&
this.errorCount === 0 &&
this.runningCount === 0 &&
this.stepStates.scheduled === this.stepCount
);
},
stepCount: function () {
return this.invocation?.steps.length;
},
Expand Down

0 comments on commit e298855

Please sign in to comment.