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:
Zanz2 2018-09-26 12:04:09 +02:00 committed by GitHub
commit 1a512698e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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