mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 03:59:51 +08:00
Merge pull request #1286 from Zanz2/zz_search_page_update_bug_sci2684_v2
( better solution ) Search page results from different teams than active not switching active team on click [SCI-2684]
This commit is contained in:
commit
1a512698e8
5 changed files with 14 additions and 3 deletions
|
@ -349,6 +349,8 @@ class ExperimentsController < ApplicationController
|
|||
end
|
||||
|
||||
def load_projects_tree
|
||||
# Switch to correct team
|
||||
current_team_switch(@experiment.project.team) unless @experiment.project.nil?
|
||||
@projects_tree = current_user.projects_tree(current_team, nil)
|
||||
end
|
||||
|
||||
|
|
|
@ -266,6 +266,7 @@ class MyModulesController < ApplicationController
|
|||
def repository
|
||||
@repository = Repository.find_by_id(params[:repository_id])
|
||||
render_403 if @repository.nil? || !can_read_team?(@repository.team)
|
||||
current_team_switch(@repository.team)
|
||||
end
|
||||
|
||||
def archive
|
||||
|
@ -661,6 +662,8 @@ class MyModulesController < ApplicationController
|
|||
end
|
||||
|
||||
def load_projects_tree
|
||||
# Switch to correct team
|
||||
current_team_switch(@project.team) unless @project.nil?
|
||||
@projects_tree = current_user.projects_tree(current_team, nil)
|
||||
end
|
||||
|
||||
|
|
|
@ -316,6 +316,8 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def load_projects_tree
|
||||
# Switch to correct team
|
||||
current_team_switch(@project.team) unless @project.nil?
|
||||
if current_user.teams.any?
|
||||
@current_team = current_team if current_team
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ class ProtocolsController < ApplicationController
|
|||
include ProtocolsExporter
|
||||
include InputSanitizeHelper
|
||||
include ProtocolsIoHelper
|
||||
include TeamsHelper
|
||||
|
||||
before_action :check_create_permissions, only: %i(
|
||||
create_new_modal
|
||||
|
@ -142,7 +143,10 @@ class ProtocolsController < ApplicationController
|
|||
move_protocol('restore')
|
||||
end
|
||||
|
||||
def edit; end
|
||||
def edit
|
||||
# Switch to correct team
|
||||
current_team_switch(@protocol.team)
|
||||
end
|
||||
|
||||
def update_metadata
|
||||
@protocol.record_timestamps = false
|
||||
|
|
|
@ -11,11 +11,11 @@ module SearchHelper
|
|||
if search_team != current_team
|
||||
link_to text,
|
||||
path,
|
||||
data: { no_turbolink: true,
|
||||
data: { turbolinks: false,
|
||||
confirm: t('users.settings.changed_team_in_search',
|
||||
team: search_team.name) }
|
||||
else
|
||||
link_to text, path, data: { no_turbolink: true }
|
||||
link_to text, path, data: { turbolinks: false }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue