Skip to content

Commit

Permalink
changing disabled tooltip to be more detailed for users
Browse files Browse the repository at this point in the history
  • Loading branch information
assuntad23 committed Dec 9, 2023
1 parent fe5966c commit fd36ded
Showing 1 changed file with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</b-button>
<b-button
v-b-tooltip.hover
:title="invocationStateSuccess ? generatePdfTooltip : disabledPdfTooltip"
:title="invocationStateSuccess ? generatePdfTooltip : disabledReportTooltip"
:disabled="!invocationStateSuccess"
size="sm"
class="invocation-pdf-link"
Expand Down Expand Up @@ -119,10 +119,6 @@ export default {
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 @@ -141,12 +137,26 @@ export default {
return this.invocation?.state || "new";
},
invocationStateSuccess: function () {
return (
this.invocationState == "scheduled" &&
this.errorCount === 0 &&
this.runningCount === 0 &&
this.invocationAndJobTerminal
);
return this.invocationState == "scheduled" && this.runningCount === 0 && this.invocationAndJobTerminal;
},
disabledReportTooltip: function () {
const state = this.invocationState;
const runCount = this.runningCount;
if (this.invocationState != "scheduled") {
return (
"This workflow is not currently scheduled. The current state is ",
state,
". Once the workflow is fully scheduled and jobs have complete this option will become available."
);
} else if (runCount != 0) {
return (
"The workflow invocation still contains ",
runCount,
" running job(s). Once these jobs have completed this option will become available. "
);
} else {
return "Steps for this workflow are still running. A report will be available once complete.";
}
},
stepCount: function () {
return this.invocation?.steps.length;
Expand Down

0 comments on commit fd36ded

Please sign in to comment.