mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix experiment selection for new task modal [SCI-8865]
This commit is contained in:
parent
4c4fcd68ae
commit
3a8fd9b12a
2 changed files with 20 additions and 3 deletions
|
@ -49,10 +49,10 @@
|
|||
</div>
|
||||
<hr class="my-6">
|
||||
<div class="flex items-center justify-end gap-4">
|
||||
<button class="btn btn-light" @click="$emit('close')">
|
||||
<button class="btn btn-light" @click="closeModal">
|
||||
{{ i18n.t("dashboard.create_task_modal.cancel") }}
|
||||
</button>
|
||||
<button class="btn btn-primary" @click="createMyModule" :disabled="!validTaskName || !validExperiment || !validProject">
|
||||
<button class="btn btn-primary" @click="createMyModule" :disabled="!validTaskName || !validExperiment || !validProject || creatingTask">
|
||||
{{ i18n.t("dashboard.create_task_modal.create") }}
|
||||
</button>
|
||||
</div>
|
||||
|
@ -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) => {
|
||||
|
|
|
@ -272,6 +272,9 @@ export default {
|
|||
this.$refs.search?.focus();
|
||||
});
|
||||
}
|
||||
},
|
||||
urlParams() {
|
||||
this.fetchOptions();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
Loading…
Reference in a new issue