diff --git a/VERSION b/VERSION index aac65497d..a65ca0dd1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.26.6.3 +1.26.6.4 diff --git a/app/controllers/step_elements/tables_controller.rb b/app/controllers/step_elements/tables_controller.rb index 52d426ffe..428bd3bf1 100644 --- a/app/controllers/step_elements/tables_controller.rb +++ b/app/controllers/step_elements/tables_controller.rb @@ -25,7 +25,13 @@ module StepElements def update ActiveRecord::Base.transaction do - @table.update!(table_params) + @table.assign_attributes(table_params.except(:metadata)) + begin + @table.metadata = JSON.parse(table_params[:metadata]) if table_params[:metadata].present? + rescue JSON::ParserError + @table.metadata = {} + end + @table.save! log_step_activity(:table_edited, { table_name: @table.name }) end @@ -61,7 +67,7 @@ module StepElements private def table_params - params.permit(:name, :contents, metadata: {}) + params.permit(:name, :contents, :metadata) end def load_table diff --git a/app/javascript/vue/protocol/step_elements/table.vue b/app/javascript/vue/protocol/step_elements/table.vue index f4ab3d3f0..86a7e61da 100644 --- a/app/javascript/vue/protocol/step_elements/table.vue +++ b/app/javascript/vue/protocol/step_elements/table.vue @@ -156,25 +156,25 @@ updateTable() { if (this.editingTable == false) return; - let tableData = JSON.stringify({data: this.tableObject.getData()}); - this.element.attributes.orderable.contents = tableData; - this.element.attributes.orderable.metadata = {cells: this.tableObject.getCellsMeta().map( - (x) => { - if (x) { - return { - col: x.col, - row: x.row, - className: x.className || '' - } - } else { - return null - } - }).filter(e => { return e !== null}) - }; this.update(); this.editingTable = false; }, update() { + this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() }); + this.element.attributes.orderable.metadata = JSON.stringify({ + cells: this.tableObject.getCellsMeta().map( + (x) => { + if (x) { + return { + col: x.col, + row: x.row, + className: x.className || '' + } + } else { + return null + } + }).filter(e => { return e !== null }) + }); this.$emit('update', this.element) }, loadTableData() { diff --git a/app/services/report_actions/report_content.rb b/app/services/report_actions/report_content.rb index e5d0f3efa..8ca49db4f 100644 --- a/app/services/report_actions/report_content.rb +++ b/app/services/report_actions/report_content.rb @@ -82,7 +82,7 @@ module ReportActions my_module_element = save_element!({ 'my_module_id' => my_module.id }, :my_module, experiment_element) my_module.live_and_snapshot_repositories_list.each do |repository| - next unless @repositories.include?(repository.id) + next unless @repositories.include?(repository.parent_id || repository.id) save_element!( { 'my_module_id' => my_module.id, 'repository_id' => repository.id }, diff --git a/app/views/reports/wizard/_third_step.html.erb b/app/views/reports/wizard/_third_step.html.erb index 113dec882..5110f07c9 100644 --- a/app/views/reports/wizard/_third_step.html.erb +++ b/app/views/reports/wizard/_third_step.html.erb @@ -71,7 +71,7 @@ />