diff --git a/resources/js/tasks/components/TaskListRowButtons.vue b/resources/js/tasks/components/TaskListRowButtons.vue index 41e2b3560f..d8ffd65238 100644 --- a/resources/js/tasks/components/TaskListRowButtons.vue +++ b/resources/js/tasks/components/TaskListRowButtons.vue @@ -5,7 +5,7 @@ -
@@ -51,6 +52,12 @@ showButtons: null }, methods: { + shouldShow(button) { + if (typeof button.show === "function") { + return button.show(this.row); + } + return button.show; + }, show() { this.triggerFloatingButtons(() => { if (!this.showButtons) { @@ -89,6 +96,7 @@ position: relative; display: inline-block; height: 30px; + vertical-align: middle; } .task-vertical-separator { display: inline; diff --git a/resources/js/tasks/components/TasksList.vue b/resources/js/tasks/components/TasksList.vue index 504fd202d5..bee44601ca 100644 --- a/resources/js/tasks/components/TasksList.vue +++ b/resources/js/tasks/components/TasksList.vue @@ -109,7 +109,7 @@
{{ getNestedPropertyValue(row, header) }}
this.shouldShowPreviewButton(row), }, { id: "openCaseButton", title: this.$t("Open Case"), click: this.redirectToRequest, imgSrc: "/img/smartinbox-images/open-case.svg", - show: !this.verifyURL("saved-searches") || true, + show: true, }, { id: "openTaskButton", title: this.$t("Open Task"), click: this.redirectToTask, icon: "fas fa-external-link-alt", - show: !this.verifyURL("saved-searches") || true, + show: true, }, ], actions: [ @@ -445,6 +444,7 @@ export default { record.process_request, record, ); + record.task_status = record.status; record.status = this.formatStatus(record); record.assignee = this.formatAvatar(record.user); record.request = this.formatRequest(record); @@ -550,7 +550,7 @@ export default { return link; }, previewTasks(info, size = null, fromButton = null) { - if (!info || !this.$refs.preview) { + if (!info || !this.$refs.preview || !this.shouldShowPreviewButton(info)) { return; } this.tooltipFromButton = fromButton; @@ -589,10 +589,7 @@ export default { label = this.$t("Completed"); } - return ` - - ${label} - `; + return `${label}`; }, formatDueDate(date) { return date === null ? "-" : moment(date).format("MM/DD/YY HH:mm"); @@ -752,13 +749,16 @@ export default { this.sortOrder[0].sortField = by; this.sortOrder[0].direction = direction; }, - verifyURL(string) { - const currentUrl = window.location.href; - let isInUrl = currentUrl.includes(string); - if (this.processesIManage) { - isInUrl = false; + /** + * Preview is available for active/self-service tasks (including on saved searches). + * Completed tasks are excluded on normal task lists, but Quick Fill / Inbox Rules + * intentionally preview completed tasks (fromButton: previewTask|fullTask|inboxRules). + */ + shouldShowPreviewButton(row) { + if (["previewTask", "fullTask", "inboxRules"].includes(this.fromButton)) { + return true; } - return isInUrl; + return row?.task_status !== "CLOSED"; }, /** * This method is used in PMColumnFilterPopoverCommonMixin.js