changing disabled tooltip to be more detailed for users

This commit is contained in:
Assunta DeSanto
2023-12-08 19:31:22 -05:00
parent fe5966c0d9
commit fd36deddfb
@@ -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"
@@ -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: {
@@ -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;