From 6d18343ec4d04501125bd40fb627d1a46079b988 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 24 Jun 2025 11:46:35 +0200 Subject: [PATCH 01/14] Fix link modal for collapsed step and results [SCI-12052] --- app/javascript/vue/protocol/step.vue | 14 ++++++++------ app/javascript/vue/results/result.vue | 16 +++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/app/javascript/vue/protocol/step.vue b/app/javascript/vue/protocol/step.vue index e08d9e51e..da15e6ce8 100644 --- a/app/javascript/vue/protocol/step.vue +++ b/app/javascript/vue/protocol/step.vue @@ -214,12 +214,14 @@ @close="openFormSelectModal = false" @submit="createElement('form_response', null, null, $event); openFormSelectModal = false" /> - + + + diff --git a/app/javascript/vue/results/result.vue b/app/javascript/vue/results/result.vue index 7e2dad839..2329352fa 100644 --- a/app/javascript/vue/results/result.vue +++ b/app/javascript/vue/results/result.vue @@ -181,13 +181,15 @@ @cancel="closeCustomWellPlateModal" @create:table="(...args) => this.createElement('table', ...args)" /> - + + + From 99c2b626a77e9b7614e170ed3128f9b228141d3c Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 26 Jun 2025 11:02:57 +0200 Subject: [PATCH 02/14] Add step number to dropodown [SCI-12037] --- app/controllers/steps_controller.rb | 2 +- app/javascript/vue/results/modals/link_steps.vue | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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/results/modals/link_steps.vue b/app/javascript/vue/results/modals/link_steps.vue index 1ef861882..d53f20cd3 100644 --- a/app/javascript/vue/results/modals/link_steps.vue +++ b/app/javascript/vue/results/modals/link_steps.vue @@ -22,6 +22,7 @@ :value="selectedSteps" :searchable="true" @change="changeSteps" + :option-renderer="stepRenderer" :multiple="true" :withCheckboxes="true" :placeholder="i18n.t('my_modules.results.modals.link_steps.placeholder')" /> @@ -137,6 +138,9 @@ export default { .then((response) => { this.steps = response.data; }); + }, + stepRenderer(option) { + return `${option[2].position + 1}. ${option[1]}`; } } }; From a4defbdcbb4c6d43cd5856371ba25667de767e4f Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 26 Jun 2025 14:26:01 +0200 Subject: [PATCH 03/14] Fix linking for archived and deleted results [SCI-12061][SCI-12060] --- app/controllers/results_controller.rb | 7 ++++++- app/javascript/vue/protocol/modals/link_results.vue | 2 +- app/models/result.rb | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) 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/javascript/vue/protocol/modals/link_results.vue b/app/javascript/vue/protocol/modals/link_results.vue index 55de5e4a8..3d5fccdf9 100644 --- a/app/javascript/vue/protocol/modals/link_results.vue +++ b/app/javascript/vue/protocol/modals/link_results.vue @@ -94,7 +94,7 @@ export default { }, computed: { resultsListUrl() { - return list_my_module_results_path({ my_module_id: this.step.attributes.my_module_id }); + return list_my_module_results_path({ my_module_id: this.step.attributes.my_module_id, with_linked_step_id: this.step.id }); }, resultsPageUrl() { return my_module_results_path({ my_module_id: this.step.attributes.my_module_id }); diff --git a/app/models/result.rb b/app/models/result.rb index b23b63e49..9b51088f5 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 @@ -187,4 +188,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 From 5da6418c2dea808f04d6b452214a375257f816b5 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 27 Jun 2025 11:50:28 +0200 Subject: [PATCH 04/14] Amend Microsoft 365 naming [SCI-12070] --- config/locales/en.yml | 14 +++++++------- config/locales/global_activities/en.yml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 1cb5a5665..6ad7636fc 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:" @@ -2199,9 +2199,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: @@ -4357,9 +4357,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 b028922c5..b8d912c23 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}." @@ -468,9 +468,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" From 46ef842514616eba32dc65a0c92dddd69e996442 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 27 Jun 2025 11:50:36 +0200 Subject: [PATCH 05/14] Bump version to 1.42.0.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a50908ca3..8ba2fd98c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.42.0 +1.42.0.1 From 63a6867ab8f9fbac771b0e9f393e955fb4f10577 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 27 Jun 2025 12:44:33 +0200 Subject: [PATCH 06/14] Improve checkbox handling for tables [SCI-12062] --- app/javascript/vue/shared/datatable/table.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) { From 966d5b516033c84cf607a8589d79b51df9bb4e65 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 27 Jun 2025 13:09:35 +0200 Subject: [PATCH 07/14] Fix long linked results in reports [SCI-11889] --- app/assets/stylesheets/reports.scss | 2 -- 1 file changed, 2 deletions(-) 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; } } From 4c944da9a0af77c4400801aee2f8adc671ba04d1 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 27 Jun 2025 13:27:23 +0200 Subject: [PATCH 08/14] Add loader for linking modal [SCI-12065] --- .../vue/protocol/modals/link_results.vue | 14 +++++++++++--- app/javascript/vue/results/modals/link_steps.vue | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/javascript/vue/protocol/modals/link_results.vue b/app/javascript/vue/protocol/modals/link_results.vue index 55de5e4a8..8c60b963c 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') }} -