mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Merge branch 'release/14.6' into dev
This commit is contained in:
@@ -30,7 +30,7 @@ module WorkPackages
|
||||
before_action :load_and_authorize_in_optional_project
|
||||
|
||||
def show
|
||||
@sidebar_menu_items = WorkPackages::Menu.new(project: @project, params:, request:).menu_items
|
||||
@sidebar_menu_items = WorkPackages::Menu.new(project: @project, params:).menu_items
|
||||
render layout: nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,9 +29,8 @@ module WorkPackages
|
||||
class Menu < Submenu
|
||||
attr_reader :view_type, :project, :params
|
||||
|
||||
def initialize(project: nil, params: nil, request: nil)
|
||||
def initialize(project: nil, params: nil)
|
||||
@view_type = "work_packages_table"
|
||||
@request = request
|
||||
|
||||
super(view_type:, project:, params:)
|
||||
end
|
||||
@@ -66,16 +65,17 @@ module WorkPackages
|
||||
|
||||
def selected?(query_params)
|
||||
return true if check_for_redirected_urls(query_params)
|
||||
|
||||
if query_params[:work_package_default] &&
|
||||
(%i[filters query_props query_id name].none? { |k| params.key? k }) &&
|
||||
@request.referer.include?("work_packages")
|
||||
return true
|
||||
end
|
||||
return true if highlight_on_work_packages?(query_params)
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def highlight_on_work_packages?(query_params)
|
||||
query_params[:work_package_default] &&
|
||||
(%i[filters query_props query_id name].none? { |k| params.key? k }) &&
|
||||
params[:on_work_package_path] == "true"
|
||||
end
|
||||
|
||||
def ee_upsale_path(query_params)
|
||||
share_upsale_work_packages_path({ name: query_params[:name] })
|
||||
end
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
<%
|
||||
on_work_package_path = request.path.include?('/work_packages')
|
||||
path =
|
||||
if @project
|
||||
menu_project_work_packages_path(@project, **params.permit(:query_props, :query_id, :name), on_work_package_path:)
|
||||
else
|
||||
work_packages_menu_path(**params.permit(:query_props, :query_id, :name), on_work_package_path:)
|
||||
end
|
||||
%>
|
||||
<%= turbo_frame_tag "work_packages_sidemenu",
|
||||
src: @project ? menu_project_work_packages_path(@project, params.permit(:query_props, :query_id, :name)) : work_packages_menu_path(params.permit(:query_props, :query_id, :name)),
|
||||
src: path,
|
||||
target: "_top",
|
||||
data: { turbo: false },
|
||||
loading: :lazy %>
|
||||
|
||||
Reference in New Issue
Block a user