From 3a8fd9b12ae13a6b1bcde3637e1a4d8d8ecc7f87 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 6 Jun 2024 11:04:41 +0200 Subject: [PATCH] Fix experiment selection for new task modal [SCI-8865] --- app/javascript/vue/dashboard/new_task.vue | 20 ++++++++++++++++--- app/javascript/vue/shared/select_dropdown.vue | 3 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/javascript/vue/dashboard/new_task.vue b/app/javascript/vue/dashboard/new_task.vue index 3edee0e36..5743df771 100644 --- a/app/javascript/vue/dashboard/new_task.vue +++ b/app/javascript/vue/dashboard/new_task.vue @@ -49,10 +49,10 @@
- -
@@ -116,11 +116,16 @@ export default { userRoles: [], taskName: '', publicProject: false, - defaultRole: null + defaultRole: null, + creatingTask: false }; }, methods: { createMyModule() { + if (this.creatingTask) return; + + this.creatingTask = true; + axios.post(this.createUrl, { my_module: { name: this.taskName @@ -137,6 +142,7 @@ export default { } }) .then((response) => { + this.creatingTask = false; window.location.href = response.data.my_module_path; }); }, @@ -151,6 +157,14 @@ export default { this.selectedExperiment = value; this.newExperimentName = label; }, + closeModal() { + $('#create-task-modal').modal('hide'); + this.taskName = ''; + this.selectedProject = null; + this.newProjectName = ''; + this.selectedExperiment = null; + this.newExperimentName = ''; + }, fetchUserRoles() { axios.get(this.rolesUrl) .then((response) => { diff --git a/app/javascript/vue/shared/select_dropdown.vue b/app/javascript/vue/shared/select_dropdown.vue index b4141969c..cae93d036 100644 --- a/app/javascript/vue/shared/select_dropdown.vue +++ b/app/javascript/vue/shared/select_dropdown.vue @@ -272,6 +272,9 @@ export default { this.$refs.search?.focus(); }); } + }, + urlParams() { + this.fetchOptions(); } }, methods: {