mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
Improve code [SCI-10292]
This commit is contained in:
parent
b59392b932
commit
53039ba5ee
4 changed files with 6 additions and 7 deletions
|
@ -240,9 +240,9 @@ export default {
|
||||||
duplicate(_e, experiment) {
|
duplicate(_e, experiment) {
|
||||||
[this.duplicateModalObject] = experiment;
|
[this.duplicateModalObject] = experiment;
|
||||||
},
|
},
|
||||||
move(_e, rows) {
|
move(event, rows) {
|
||||||
[this.moveModalObject] = rows;
|
[this.moveModalObject] = rows;
|
||||||
this.moveModalObject.experimentIds = rows.map((exp) => exp.id);
|
this.moveModalObject.movePath = event.path;
|
||||||
},
|
},
|
||||||
edit(_e, experiment) {
|
edit(_e, experiment) {
|
||||||
[this.editModalObject] = experiment;
|
[this.editModalObject] = experiment;
|
||||||
|
|
|
@ -54,9 +54,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async submit() {
|
async submit() {
|
||||||
this.disableSubmit = true;
|
this.disableSubmit = true;
|
||||||
await axios.post(this.experiment.urls.move, {
|
await axios.post(this.experiment.movePath, {
|
||||||
project_id: this.targetProject,
|
project_id: this.targetProject
|
||||||
ids: this.experiment.experimentIds
|
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
this.$emit('move');
|
this.$emit('move');
|
||||||
window.location.replace(response.data.path);
|
window.location.replace(response.data.path);
|
||||||
|
|
|
@ -69,7 +69,6 @@ module Lists
|
||||||
actions: actions_toolbar_experiments_path(items: [{ id: object.id }].to_json),
|
actions: actions_toolbar_experiments_path(items: [{ id: object.id }].to_json),
|
||||||
projects_to_clone: projects_to_clone_experiment_path(object),
|
projects_to_clone: projects_to_clone_experiment_path(object),
|
||||||
projects_to_move: projects_to_move_experiment_path(object),
|
projects_to_move: projects_to_move_experiment_path(object),
|
||||||
move: move_experiments_path,
|
|
||||||
clone: clone_experiment_path(object),
|
clone: clone_experiment_path(object),
|
||||||
update: experiment_path(object),
|
update: experiment_path(object),
|
||||||
show_access: access_permissions_experiment_path(object),
|
show_access: access_permissions_experiment_path(object),
|
||||||
|
|
|
@ -87,7 +87,8 @@ module Toolbars
|
||||||
name: 'move',
|
name: 'move',
|
||||||
label: I18n.t('experiments.toolbar.move_button'),
|
label: I18n.t('experiments.toolbar.move_button'),
|
||||||
icon: 'sn-icon sn-icon-move',
|
icon: 'sn-icon sn-icon-move',
|
||||||
type: :emit
|
type: :emit,
|
||||||
|
path: move_experiments_path(ids: @experiments.pluck(:id))
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue