Skip to content

Commit

Permalink
disable wf report and generate PDF buttons if WF is not complete or f…
Browse files Browse the repository at this point in the history
…ailed
  • Loading branch information
assuntad23 committed Dec 8, 2023
1 parent 8072dc8 commit 65454e0
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
<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-b-tooltip.hover
:title="invocationStateSuccess ? reportTooltip : disabledReportTooltip"
:disabled="!invocationStateSuccess"
size="sm"
class="invocation-report-link"
:href="invocationLink">
View Report
</b-button>
<b-button
v-b-tooltip.hover
:title="invocationStateSuccess ? generatePdfTooltip : disabledPdfTooltip"
:disabled="!invocationStateSuccess"
size="sm"
class="invocation-pdf-link"
:href="invocationPdfLink"
Expand Down Expand Up @@ -109,6 +117,12 @@ export default {
return {
stepStatesInterval: null,
jobStatesInterval: null,
reportTooltip: "View report for this workflow invocation",
generatePdfTooltip: "Generate PDF report for this workflow invocation",
disabledReportTooltip:
"Unable to create report because this workflow invocation is not complete or was not successful.",
disabledPdfTooltip:
"Unable to generate PDF because this workflow invocation is not complete or was not successful.",
};
},
computed: {
Expand All @@ -126,6 +140,17 @@ export default {
invocationState: function () {
return this.invocation?.state || "new";
},
invocationStateSuccess: function () {
return (
this.invocationState == "scheduled" &&
this.errorCount === 0 &&
this.runningCount === 0 &&
this.invocationAndJobTerminal
);
},
displayTooltip: function () {
return this.invocationStateSuccess ? "" : this.disabledTooltip;
},
stepCount: function () {
return this.invocation?.steps.length;
},
Expand Down

0 comments on commit 65454e0

Please sign in to comment.