diff --git a/VERSION b/VERSION
index a50908ca3..8ba2fd98c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.42.0
+1.42.0.1
diff --git a/app/assets/stylesheets/reports.scss b/app/assets/stylesheets/reports.scss
index d3d2689f9..940f57c20 100644
--- a/app/assets/stylesheets/reports.scss
+++ b/app/assets/stylesheets/reports.scss
@@ -255,7 +255,6 @@ label {
.user-time {
color: $color-silver-chalice;
- white-space: nowrap;
}
.report-element-body {
@@ -462,7 +461,6 @@ label {
.user-time {
display: inline-block;
- white-space: nowrap;
}
}
diff --git a/app/controllers/results_controller.rb b/app/controllers/results_controller.rb
index ff0ce393f..6c15331f1 100644
--- a/app/controllers/results_controller.rb
+++ b/app/controllers/results_controller.rb
@@ -41,7 +41,12 @@ class ResultsController < ApplicationController
end
def list
- @results = @my_module.results.active
+ if params[:with_linked_step_id].present?
+ step = @my_module.protocol.steps.find_by(id: params[:with_linked_step_id])
+ @results = @my_module.results.where(archived: false).or(@my_module.results.where(id: step.results.select(:id)))
+ else
+ @results = @my_module.results.active
+ end
update_and_apply_user_sort_preference!
end
diff --git a/app/controllers/step_results_controller.rb b/app/controllers/step_results_controller.rb
index 468cbf9d5..35afce7ff 100644
--- a/app/controllers/step_results_controller.rb
+++ b/app/controllers/step_results_controller.rb
@@ -87,7 +87,8 @@ class StepResultsController < ApplicationController
my_module: my_module.id,
step: step.id,
result: result.id,
- position: step.position + 1
+ step_position: { id: step.id,
+ value_for: 'position_plus_one' }
})
end
end
diff --git a/app/controllers/steps_controller.rb b/app/controllers/steps_controller.rb
index ecc26234b..cf09bb029 100644
--- a/app/controllers/steps_controller.rb
+++ b/app/controllers/steps_controller.rb
@@ -285,7 +285,7 @@ class StepsController < ApplicationController
render json: {
paginated: true,
next_page: steps.next_page,
- data: steps.map { |step| [step.id, step.name] }
+ data: steps.map { |step| [step.id, step.name, { position: step.position }] }
}
end
diff --git a/app/javascript/vue/protocol/modals/link_results.vue b/app/javascript/vue/protocol/modals/link_results.vue
index 55de5e4a8..7c092cefe 100644
--- a/app/javascript/vue/protocol/modals/link_results.vue
+++ b/app/javascript/vue/protocol/modals/link_results.vue
@@ -11,7 +11,10 @@
{{ i18n.t('protocols.steps.modals.link_results.title') }}
-
+
+
{{ i18n.t('protocols.steps.modals.link_results.description') }}
@@ -32,7 +35,7 @@
{{ i18n.t('protocols.steps.modals.link_results.empty_description') }}
-
-
+
+
{{ i18n.t('my_modules.results.modals.link_steps.description') }}
@@ -22,6 +25,7 @@
:value="selectedSteps"
:searchable="true"
@change="changeSteps"
+ :option-renderer="stepRenderer"
:multiple="true"
:withCheckboxes="true"
:placeholder="i18n.t('my_modules.results.modals.link_steps.placeholder')" />
@@ -32,7 +36,7 @@
{{ i18n.t('my_modules.results.modals.link_steps.empty_description') }}
-
@@ -302,6 +304,11 @@ export default {
}
this.$emit('result:collapsed');
});
+
+ window.initTooltip(this.$refs.linkButton);
+ },
+ beforeUnmount() {
+ window.destroyTooltip(this.$refs.linkButton);
},
computed: {
reorderableElements() {
@@ -627,9 +634,13 @@ export default {
});
},
updateLinkedSteps(steps) {
+ window.destroyTooltip(this.$refs.linkButton);
+
this.$emit('result:update', this.result.id,{
steps: steps
- })
+ });
+
+ this.$nextTick(() => window.initTooltip(this.$refs.linkButton));
},
protocolUrl(step_id) {
return protocols_my_module_path({ id: this.result.attributes.my_module_id }, { step_id: step_id })
diff --git a/app/javascript/vue/shared/datatable/table.vue b/app/javascript/vue/shared/datatable/table.vue
index 754e5b1a4..d3138ad23 100644
--- a/app/javascript/vue/shared/datatable/table.vue
+++ b/app/javascript/vue/shared/datatable/table.vue
@@ -270,7 +270,8 @@ export default {
maxWidth: 40,
resizable: true,
pinned: 'left',
- lockPosition: 'left'
+ lockPosition: 'left',
+ sortable: false
});
}
@@ -453,6 +454,9 @@ export default {
currentViewRender: this.currentViewRender,
perPage: this.perPage
};
+
+ columnsState.find((column) => column.colId === 'checkbox').pinned = 'left';
+
const settings = {
key: this.stateKey,
data: tableState
@@ -532,6 +536,11 @@ export default {
this.restoreSelection();
this.handleScroll();
+ })
+ .catch(() => {
+ this.dataLoading = false;
+ this.$emit('tableReloaded', [], { filtered: this.searchValue.length > 0 });
+ window.HelperModule.flashAlertMsg(this.i18n.t('general.error'), 'danger');
});
},
handleInfiniteScroll(response) {
diff --git a/app/models/protocol.rb b/app/models/protocol.rb
index d849a21f1..4ab04c978 100644
--- a/app/models/protocol.rb
+++ b/app/models/protocol.rb
@@ -260,7 +260,7 @@ class Protocol < ApplicationRecord
def self.viewable_by_user_my_module_protocols(user, teams)
distinct.joins(:my_module)
- .where(my_modules: MyModule.viewable_by_user(user, teams))
+ .where(my_modules: { id: MyModule.viewable_by_user(user, teams).select(:id) })
end
def self.filter_by_teams(teams = [])
diff --git a/app/models/result.rb b/app/models/result.rb
index b23b63e49..a93a4dcce 100644
--- a/app/models/result.rb
+++ b/app/models/result.rb
@@ -39,6 +39,7 @@ class Result < ApplicationRecord
accepts_nested_attributes_for :tables
before_save :ensure_default_name
+ after_discard :delete_step_results
after_discard do
CleanupUserSettingsJob.perform_later('result_states', id)
end
@@ -51,8 +52,12 @@ class Result < ApplicationRecord
teams = options[:teams] || current_team || user.teams.select(:id)
new_query = joins(:my_module)
- .where(my_modules: MyModule.with_granted_permissions(user, MyModulePermissions::READ)
- .where(user_assignments: { team: teams }))
+ .where(
+ my_modules: {
+ id: MyModule.with_granted_permissions(user, MyModulePermissions::READ)
+ .where(user_assignments: { team: teams }).select(:id)
+ }
+ )
unless include_archived
new_query = new_query.joins(my_module: { experiment: :project })
@@ -187,4 +192,8 @@ class Result < ApplicationRecord
def ensure_default_name
self.name = name.presence || I18n.t('my_modules.results.default_name')
end
+
+ def delete_step_results
+ step_results.destroy_all
+ end
end
diff --git a/config/application.rb b/config/application.rb
index fd973052e..8ef8938cf 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -81,6 +81,9 @@ module Scinote
config.x.export_all_limit_24h = (ENV['EXPORT_ALL_LIMIT_24_HOURS'] || 3).to_i
+ # Fallback to old variant behaviour (pre 7.2)
+ config.active_storage.track_variants = false
+
# SciNote Core Application version
VERSION = File.read(Rails.root.join('VERSION')).strip.freeze
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 3d08d4ccb..80c64c1c7 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -430,7 +430,7 @@ en:
attachments:
menu:
- office_file: "New Office file"
+ office_file: "New Microsoft 365 file"
chemical_drawing: "New chemical drawing"
file_from_pc: "File from your PC"
modified_label: "Modified:"
@@ -2215,9 +2215,9 @@ en:
success_flash: "File result successfully deleted."
wopi_open_file: "Open in %{app}"
wopi_edit_file: "Open in %{app}"
- wopi_word: "Microsoft Word for the Web"
- wopi_excel: "Microsoft Excel for the Web"
- wopi_powerpoint: "Microsoft PowerPoint for the Web"
+ wopi_word: "Microsoft Word for the web"
+ wopi_excel: "Microsoft Excel for the web"
+ wopi_powerpoint: "Microsoft PowerPoint for the web"
error_flash: 'Something went wrong! Please try again later.'
result_tables:
@@ -4440,9 +4440,9 @@ en:
wopi_supported_table_formats_title: 'Only .xlsx, .xlsm, .xlsb, .ods file formats are supported for editing in Excel for the web.'
wopi_supported_presentation_formats_title: 'Only .pptx, ppsx, .odp file formats are supported for editing in PowerPoint for the web.'
create_wopi_file:
- button_text: 'New Microsoft Office file'
- li_text: "Office file"
- modal_title: 'Create new Microsoft Office document'
+ button_text: 'New Microsoft 365 file'
+ li_text: "Microsoft 365 file"
+ modal_title: 'Create new Microsoft 365 document'
text_field_label: 'Document name'
type_select_label: 'Document type'
text_field_placeholder: 'Enter document name...'
diff --git a/config/locales/global_activities/en.yml b/config/locales/global_activities/en.yml
index 6143e7873..d40c4046f 100644
--- a/config/locales/global_activities/en.yml
+++ b/config/locales/global_activities/en.yml
@@ -122,12 +122,12 @@ en:
move_experiment_html: "%{user} moved experiment %{experiment} from project %{project_original} to project %{project_new}."
clone_experiment_html: "%{user} duplicated experiment %{experiment_new} from experiment %{experiment_original} as template."
archive_experiment_html: "%{user} archived experiment %{experiment}."
- edit_wopi_file_on_result_html: "%{user} edited Office online file %{asset_name} on result %{result}: %{action}."
+ edit_wopi_file_on_result_html: "%{user} edited Microsoft 365 file %{asset_name} on result %{result}: %{action}."
export_protocol_from_task_html: "%{user} exported protocol from task %{my_module}"
copy_protocol_in_repository_html: "%{user} duplicated protocol %{protocol_new} from protocol %{protocol_original} as a template"
user_leave_team_html: "%{user} left team %{team}"
- edit_wopi_file_on_step_html: "%{user} edited Office online file %{asset_name} on protocol's step %{step_position} %{step} on task %{my_module}: %{action}."
- edit_wopi_file_on_step_in_repository_html: "%{user} edited Office online file %{asset_name} on protocol %{protocol}'s step %{step_position} %{step} in Protocol repository: %{action}."
+ edit_wopi_file_on_step_html: "%{user} edited Microsoft 365 file %{asset_name} on protocol's step %{step_position} %{step} on task %{my_module}: %{action}."
+ edit_wopi_file_on_step_in_repository_html: "%{user} edited Microsoft 365 file %{asset_name} on protocol %{protocol}'s step %{step_position} %{step} in Protocol repository: %{action}."
restore_experiment_html: "%{user} restored experiment %{experiment}."
rename_task_html: "%{user} renamed task %{my_module}."
move_task_html: "%{user} moved task %{my_module} from experiment %{experiment_original} to experiment %{experiment_new}."
@@ -313,7 +313,7 @@ en:
edit_task_result_file_locally_html: "%{user} locally edited file %{file} on result %{result}"
export_inventories_html: "%{user} exported inventory %{inventories}"
edit_image_on_inventory_item_html: "%{user} edited image %{asset_name} on inventory item %{repository_row} in inventory %{repository}: %{action}."
- edit_wopi_file_on_inventory_item_html: "%{user} edited Office online file %{asset_name} on inventory item %{repository_row} in inventory %{repository}: %{action}."
+ edit_wopi_file_on_inventory_item_html: "%{user} edited Microsoft 365 file %{asset_name} on inventory item %{repository_row} in inventory %{repository}: %{action}."
export_inventory_stock_consumption_html: "%{user} exported stock consumption for inventory item(s) %{inventory_items} in inventory %{repository}."
task_step_file_duplicated_html: "%{user} duplicated file
%{file} on protocol's step
%{step} on task
%{my_module}."
result_file_duplicated_html: "%{user} duplicated file
%{file} on result
%{result} on task
%{my_module}."
@@ -410,6 +410,8 @@ en:
my_module_access_changed_user_group_html: "%{user} changed %{user_group}'s role on task %{my_module} to %{role}."
step_and_result_linked_html: "%{user} linked result
%{result} and step
%{position} %{step} on task
%{my_module}."
step_and_result_unlinked_html: "%{user} unlinked result
%{result} and step
%{position} %{step} on task
%{my_module}."
+ step_and_result_linked_html: "%{user} linked result
%{result} and step
%{step_position} %{step} on task
%{my_module}."
+ step_and_result_unlinked_html: "%{user} unlinked result
%{result} and step
%{step_position} %{step} on task
%{my_module}."
activity_name:
create_project: "Project created"
edit_project: "Project edited"
@@ -486,9 +488,9 @@ en:
move_experiment: "Experiment moved"
clone_experiment: "Experiment duplicated"
archive_experiment: "Experiment archived"
- edit_wopi_file_on_result: "Office online file on result edited"
- edit_wopi_file_on_step: "Office online file on task step edited"
- edit_wopi_file_on_step_in_repository: "Office online file on step edited"
+ edit_wopi_file_on_result: "Microsoft 365 file on result edited"
+ edit_wopi_file_on_step: "Microsoft 365 file on task step edited"
+ edit_wopi_file_on_step_in_repository: "Microsoft 365 file on step edited"
restore_experiment: "Experiment restored"
rename_task: "Task renamed"
move_task: "Task moved"
diff --git a/db/seeds.rb b/db/seeds.rb
index 2cb73ae89..0289b7ec2 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -1,8 +1,6 @@
include UsersGenerator
-if ActiveRecord::Base.connection.migration_context.needs_migration?
- raise "There are pending migrations. Run 'rails db:migrate' first."
-end
+ActiveRecord::Migration.check_all_pending!
MyModuleStatusFlow.ensure_default