diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 0781d2552..b0f086394 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -267,6 +267,18 @@ class ExperimentsController < ApplicationController } end + def projects_to_clone + projects = @experiment.project.team.projects.active + .with_user_permission(current_user, ProjectPermissions::EXPERIMENTS_CREATE) + .map { |p| [p.id, p.name] } + render json: { data: projects }, status: :ok + end + + def projects_to_move + projects = @experiment.movable_projects(current_user).map { |p| [p.id, p.name] } + render json: { data: projects }, status: :ok + end + # POST: clone_experiment(id) def clone project = current_team.projects.find(move_experiment_param) @@ -279,11 +291,10 @@ class ExperimentsController < ApplicationController if service.succeed? flash[:success] = t('experiments.clone.success_flash', experiment: @experiment.name) - redirect_to canvas_experiment_path(service.cloned_experiment) + render json: { url: canvas_experiment_path(service.cloned_experiment) } else - flash[:error] = t('experiments.clone.error_flash', - experiment: @experiment.name) - redirect_to experiments_path(project_id: @experiment.project) + render json: { message: t('experiments.clone.error_flash', + experiment: @experiment.name) }, status: :unprocessable_entity end end @@ -534,7 +545,7 @@ class ExperimentsController < ApplicationController actions: Toolbars::ExperimentsService.new( current_user, - experiment_ids: params[:experiment_ids].split(',') + experiment_ids: JSON.parse(params[:items]).map { |i| i['id'] } ).actions } end diff --git a/app/javascript/vue/experiments/list.vue b/app/javascript/vue/experiments/list.vue index 31c7255d9..21c609b0d 100644 --- a/app/javascript/vue/experiments/list.vue +++ b/app/javascript/vue/experiments/list.vue @@ -13,22 +13,58 @@ :filters="filters" :viewRenders="viewRenders" @tableReloaded="reloadingTable = false" + @archive="archive" + @restore="restore" + @showDescription="showDescription" + @duplicate="duplicate" + @move="move" > + + + + + diff --git a/app/javascript/vue/experiments/modals/description.vue b/app/javascript/vue/experiments/modals/description.vue new file mode 100644 index 000000000..0a88a6603 --- /dev/null +++ b/app/javascript/vue/experiments/modals/description.vue @@ -0,0 +1,35 @@ + + + diff --git a/app/javascript/vue/experiments/modals/duplicate.vue b/app/javascript/vue/experiments/modals/duplicate.vue new file mode 100644 index 000000000..63334804f --- /dev/null +++ b/app/javascript/vue/experiments/modals/duplicate.vue @@ -0,0 +1,68 @@ + + + diff --git a/app/javascript/vue/experiments/modals/move.vue b/app/javascript/vue/experiments/modals/move.vue new file mode 100644 index 000000000..f6c0158cb --- /dev/null +++ b/app/javascript/vue/experiments/modals/move.vue @@ -0,0 +1,69 @@ + + + diff --git a/app/javascript/vue/experiments/renderers/completed_tasks.vue b/app/javascript/vue/experiments/renderers/completed_tasks.vue index 67723c179..9ef8de555 100644 --- a/app/javascript/vue/experiments/renderers/completed_tasks.vue +++ b/app/javascript/vue/experiments/renderers/completed_tasks.vue @@ -6,7 +6,7 @@ all: params.data.total_tasks }) }}
-
+
diff --git a/app/javascript/vue/experiments/renderers/description.vue b/app/javascript/vue/experiments/renderers/description.vue index b7cc52509..3a22664d5 100644 --- a/app/javascript/vue/experiments/renderers/description.vue +++ b/app/javascript/vue/experiments/renderers/description.vue @@ -25,7 +25,7 @@ export default { }, methods: { showMore() { - + this.params.dtComponent.$emit('showDescription', null, [this.params.data]); }, }, }; diff --git a/app/javascript/vue/label_template/insert_field_dropdown.vue b/app/javascript/vue/label_template/insert_field_dropdown.vue index 4d54048fa..ad3c9a360 100644 --- a/app/javascript/vue/label_template/insert_field_dropdown.vue +++ b/app/javascript/vue/label_template/insert_field_dropdown.vue @@ -1,6 +1,7 @@ diff --git a/app/javascript/vue/label_template/table.vue b/app/javascript/vue/label_template/table.vue index ccf14d683..ab2c09f31 100644 --- a/app/javascript/vue/label_template/table.vue +++ b/app/javascript/vue/label_template/table.vue @@ -24,51 +24,83 @@ diff --git a/app/javascript/vue/projects/card.vue b/app/javascript/vue/projects/card.vue index dc3b5b23c..81e2c6dca 100644 --- a/app/javascript/vue/projects/card.vue +++ b/app/javascript/vue/projects/card.vue @@ -12,7 +12,9 @@
{{ params.code }}
- + {{ params.name }}
@@ -24,8 +26,9 @@ {{ params.archived_on }} {{ i18n.t('projects.index.card.visibility') }} - {{ params.hidden ? i18n.t('projects.index.hidden') : i18n.t('projects.index.visible') }} - + + {{ params.hidden ? i18n.t('projects.index.hidden') : i18n.t('projects.index.visible') }} + {{ i18n.t('projects.index.card.users') }}
@@ -45,7 +48,9 @@
- + {{ params.name }} @@ -57,20 +62,20 @@ diff --git a/app/javascript/vue/projects/list.vue b/app/javascript/vue/projects/list.vue index d72cdd253..01ef1cfc8 100644 --- a/app/javascript/vue/projects/list.vue +++ b/app/javascript/vue/projects/list.vue @@ -27,7 +27,8 @@ - + - - - - - - + + + + + + diff --git a/app/javascript/vue/projects/modals/edit.vue b/app/javascript/vue/projects/modals/edit.vue index 69c1e9cf7..ddd19c3b5 100644 --- a/app/javascript/vue/projects/modals/edit.vue +++ b/app/javascript/vue/projects/modals/edit.vue @@ -3,7 +3,9 @@ @@ -31,7 +37,7 @@ export default { data() { return { opendedFolders: {}, - } + }; }, -} +}; diff --git a/app/javascript/vue/projects/modals/new.vue b/app/javascript/vue/projects/modals/new.vue index 68bbc386a..334d2d460 100644 --- a/app/javascript/vue/projects/modals/new.vue +++ b/app/javascript/vue/projects/modals/new.vue @@ -3,7 +3,9 @@