From 366bd7201f69674c4b30e36945284381dec73c60 Mon Sep 17 00:00:00 2001 From: wandji20 Date: Wed, 20 Mar 2024 15:51:51 +0100 Subject: [PATCH] Preselect current user in new task designated user dropdown [SCI-10455] --- app/javascript/vue/my_modules/list.vue | 2 ++ app/javascript/vue/my_modules/modals/new.vue | 5 ++++- app/views/my_modules/index.html.erb | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/vue/my_modules/list.vue b/app/javascript/vue/my_modules/list.vue index fa32c45f2..85d034d49 100644 --- a/app/javascript/vue/my_modules/list.vue +++ b/app/javascript/vue/my_modules/list.vue @@ -35,6 +35,7 @@ :createUrl="createUrl" :projectTagsUrl="projectTagsUrl" :assignedUsersUrl="assignedUsersUrl" + :currentUserId="currentUserId" @create="updateTable" @close="newModalOpen = false" /> @@ -83,7 +84,8 @@ export default { props: { createUrl: String, projectTagsUrl: String, - assignedUsersUrl: String + assignedUsersUrl: String, + currentUserId: { type: String, required: true } }, components: { DateTimePicker, @@ -171,6 +173,7 @@ export default { loadUsers() { axios.get(this.assignedUsersUrl).then((response) => { this.allUsers = response.data.data; + this.users = [this.currentUserId]; }); }, tagsRenderer(tag) { diff --git a/app/views/my_modules/index.html.erb b/app/views/my_modules/index.html.erb index 9b7650048..c75c78a8f 100644 --- a/app/views/my_modules/index.html.erb +++ b/app/views/my_modules/index.html.erb @@ -11,6 +11,7 @@ active-page-url="<%= my_modules_path(experiment_id: @experiment, view_mode: :active) %>" archived-page-url="<%= my_modules_path(experiment_id: @experiment, view_mode: :archived) %>" current-view-mode="<%= view_mode %>" + current-user-id="<%= current_user.id %>" assigned-users-url="<%= assigned_users_experiment_path(@experiment) %>" users-filter-url="<%= users_filter_projects_path %>"v user-roles-url="<%= user_roles_projects_path %>"