From ea5016f5bbcfe07d65d4bcd4632d23a0e3514e69 Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Wed, 13 Mar 2024 13:58:17 +0100 Subject: [PATCH] Fix save to invetory modal [SCI-10331] --- app/controllers/reports_controller.rb | 4 ++-- app/javascript/vue/reports/modals/save_to_inventory.vue | 6 +++++- app/javascript/vue/reports/table.vue | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/reports_controller.rb b/app/controllers/reports_controller.rb index 1829d1f00..c148511f3 100644 --- a/app/controllers/reports_controller.rb +++ b/app/controllers/reports_controller.rb @@ -349,7 +349,7 @@ class ReportsController < ApplicationController @available_repositories = [] repositories = Repository.active .accessible_by_teams(current_team) - .name_like(search_params[:q]) + .name_like(search_params[:query]) .limit(Constants::SEARCH_LIMIT) repositories.each do |repository| next unless can_manage_repository_rows?(current_user, repository) @@ -365,7 +365,7 @@ class ReportsController < ApplicationController end def search_params - params.permit(:q) + params.permit(:query) end def save_pdf_params diff --git a/app/javascript/vue/reports/modals/save_to_inventory.vue b/app/javascript/vue/reports/modals/save_to_inventory.vue index cf6a24cca..24976c9bb 100644 --- a/app/javascript/vue/reports/modals/save_to_inventory.vue +++ b/app/javascript/vue/reports/modals/save_to_inventory.vue @@ -71,7 +71,7 @@ import axios from '../../../packs/custom_axios.js'; import modalMixin from '../../shared/modal_mixin'; export default { - name: 'NewProtocolModal', + name: 'SaveToInventoryModal', props: { report: Object, repositoriesUrl: String, @@ -129,6 +129,10 @@ export default { }); }, changeRepository(repository) { + if (typeof repository === 'object') { + return; + } + this.selectedColumn = null; this.selectedRepository = null; this.selectedRow = null; diff --git a/app/javascript/vue/reports/table.vue b/app/javascript/vue/reports/table.vue index ab45bf73e..e6472244c 100644 --- a/app/javascript/vue/reports/table.vue +++ b/app/javascript/vue/reports/table.vue @@ -26,6 +26,7 @@ :repositoriesUrl="availableRepositoriesUrl" :columnsUrl="availableColumnsUrl" :rowsUrl="availableRowsUrl" + @close="reportToSave = false" ref="saveToInventoryModal"/>