From 88e81be9c927713a2efbcd991d211f5a70b33983 Mon Sep 17 00:00:00 2001 From: Henry Jonas Date: Thu, 27 Mar 2025 16:28:06 -0400 Subject: [PATCH 01/16] FOUR-23419: S1: FE - Implement new UI for new comments (Task Section) --- resources/js/tasks/api/index.js | 58 ++++ .../js/tasks/components/TasksPreview.vue | 267 +++++++++--------- .../taskPreview/TaskPreviewAssignment.vue | 105 +++++++ resources/js/tasks/edit.js | 4 +- resources/js/tasks/variables/index.js | 8 + 5 files changed, 311 insertions(+), 131 deletions(-) create mode 100644 resources/js/tasks/api/index.js create mode 100644 resources/js/tasks/components/taskPreview/TaskPreviewAssignment.vue create mode 100644 resources/js/tasks/variables/index.js diff --git a/resources/js/tasks/api/index.js b/resources/js/tasks/api/index.js new file mode 100644 index 0000000000..c8bd09f0df --- /dev/null +++ b/resources/js/tasks/api/index.js @@ -0,0 +1,58 @@ +import { getApi } from "../variables/index"; + +// getReassignUsers(filter = null) { +// const params = { }; +// if (filter) { +// params.filter = filter; +// } +// if (this.task?.id) { +// params.assignable_for_task_id = this.task.id; +// } + +// ProcessMaker.apiClient.get('users_task_count', { params }).then(response => { +// this.reassignUsers = []; +// response.data.data.forEach((user) => { +// if (this.currentTaskUserId === user.id) { +// return; +// } +// this.reassignUsers.push({ +// text: user.fullname, +// value: user.id, +// active_tasks_count: user.active_tasks_count +// }); +// }); +// }); +// } + +export const getReassignUsers = async (filter = null, taskId = null) => { + const api = getApi(); + console.log("getReassignUsers", filter, taskId); + const response = await api.get("users_task_count", { params: { filter, assignable_for_task_id: taskId } }); + return response.data; +}; + +export const updateReassignUser = async (taskId, userId) => { + const api = getApi(); + const response = await api.put(`tasks/${taskId}`, { user_id: userId }); + return response.data; +}; + +// const reassignUser = async (redirect = false) => { +// if (selectedUser.value) { +// ProcessMaker.apiClient +// .put(`tasks/${this.task.id}`, { +// user_id: this.selectedUser, +// }) +// .then((response) => { +// this.$emit("on-reassign-user", this.selectedUser); +// this.showReassignment = false; +// this.selectedUser = null; +// if (redirect) { +// this.redirect("/tasks"); +// } +// if (this.showPreview) { +// this.showPreview = false; +// } +// }); +// } +// }; diff --git a/resources/js/tasks/components/TasksPreview.vue b/resources/js/tasks/components/TasksPreview.vue index fd45f5817a..47d0ef83d6 100644 --- a/resources/js/tasks/components/TasksPreview.vue +++ b/resources/js/tasks/components/TasksPreview.vue @@ -1,75 +1,81 @@