mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-09 16:01:30 +08:00
Merge branch 'hotfix/1.26.6.4' into develop
This commit is contained in:
commit
89a45d2b14
5 changed files with 26 additions and 20 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
1.26.6.3
|
1.26.6.4
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,13 @@ module StepElements
|
||||||
|
|
||||||
def update
|
def update
|
||||||
ActiveRecord::Base.transaction do
|
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 })
|
log_step_activity(:table_edited, { table_name: @table.name })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -61,7 +67,7 @@ module StepElements
|
||||||
private
|
private
|
||||||
|
|
||||||
def table_params
|
def table_params
|
||||||
params.permit(:name, :contents, metadata: {})
|
params.permit(:name, :contents, :metadata)
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_table
|
def load_table
|
||||||
|
|
|
||||||
|
|
@ -156,25 +156,25 @@
|
||||||
updateTable() {
|
updateTable() {
|
||||||
if (this.editingTable == false) return;
|
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.update();
|
||||||
this.editingTable = false;
|
this.editingTable = false;
|
||||||
},
|
},
|
||||||
update() {
|
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)
|
this.$emit('update', this.element)
|
||||||
},
|
},
|
||||||
loadTableData() {
|
loadTableData() {
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ module ReportActions
|
||||||
my_module_element = save_element!({ 'my_module_id' => my_module.id }, :my_module, experiment_element)
|
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|
|
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!(
|
save_element!(
|
||||||
{ 'my_module_id' => my_module.id, 'repository_id' => repository.id },
|
{ 'my_module_id' => my_module.id, 'repository_id' => repository.id },
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
<span class="sci-checkbox-container">
|
<span class="sci-checkbox-container">
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="sci-checkbox repositories-setting"
|
class="sci-checkbox repositories-setting"
|
||||||
value="<%= repository.id %>"
|
value="<%= repository.is_a?(RepositorySnapshot) ? repository.parent_id : repository.id %>"
|
||||||
<%= 'checked' if report.new_record? ||
|
<%= 'checked' if report.new_record? ||
|
||||||
@project_contents[:repositories].include?(repository.id) ||
|
@project_contents[:repositories].include?(repository.id) ||
|
||||||
(repository.is_a?(Repository) && repository.repository_snapshots.exists?(id: @project_contents[:repositories])) %> />
|
(repository.is_a?(Repository) && repository.repository_snapshots.exists?(id: @project_contents[:repositories])) %> />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue