mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 12:56:27 +08:00
Merge pull request #7633 from aignatov-bio/ai-sci-8865-fix-experiment-selection-for-new-task-modal
Fix experiment selection for new task modal [SCI-8865]
This commit is contained in:
commit
0bf43be8c9
2 changed files with 20 additions and 3 deletions
|
@ -49,10 +49,10 @@
|
||||||
</div>
|
</div>
|
||||||
<hr class="my-6">
|
<hr class="my-6">
|
||||||
<div class="flex items-center justify-end gap-4">
|
<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") }}
|
{{ i18n.t("dashboard.create_task_modal.cancel") }}
|
||||||
</button>
|
</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") }}
|
{{ i18n.t("dashboard.create_task_modal.create") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,11 +116,16 @@ export default {
|
||||||
userRoles: [],
|
userRoles: [],
|
||||||
taskName: '',
|
taskName: '',
|
||||||
publicProject: false,
|
publicProject: false,
|
||||||
defaultRole: null
|
defaultRole: null,
|
||||||
|
creatingTask: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createMyModule() {
|
createMyModule() {
|
||||||
|
if (this.creatingTask) return;
|
||||||
|
|
||||||
|
this.creatingTask = true;
|
||||||
|
|
||||||
axios.post(this.createUrl, {
|
axios.post(this.createUrl, {
|
||||||
my_module: {
|
my_module: {
|
||||||
name: this.taskName
|
name: this.taskName
|
||||||
|
@ -137,6 +142,7 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
this.creatingTask = false;
|
||||||
window.location.href = response.data.my_module_path;
|
window.location.href = response.data.my_module_path;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -151,6 +157,14 @@ export default {
|
||||||
this.selectedExperiment = value;
|
this.selectedExperiment = value;
|
||||||
this.newExperimentName = label;
|
this.newExperimentName = label;
|
||||||
},
|
},
|
||||||
|
closeModal() {
|
||||||
|
$('#create-task-modal').modal('hide');
|
||||||
|
this.taskName = '';
|
||||||
|
this.selectedProject = null;
|
||||||
|
this.newProjectName = '';
|
||||||
|
this.selectedExperiment = null;
|
||||||
|
this.newExperimentName = '';
|
||||||
|
},
|
||||||
fetchUserRoles() {
|
fetchUserRoles() {
|
||||||
axios.get(this.rolesUrl)
|
axios.get(this.rolesUrl)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|
|
@ -272,6 +272,9 @@ export default {
|
||||||
this.$refs.search?.focus();
|
this.$refs.search?.focus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
urlParams() {
|
||||||
|
this.fetchOptions();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue