Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#61126] Remove redundant allow_hover_card attribute

Tobias Dillmannc45e69dcc267
diff --git a/app/components/shares/invite_user_form_component.html.erb b/app/components/shares/invite_user_form_component.html.erb
index f1bc280c58b..dea952c59aa 100644
--- a/app/components/shares/invite_user_form_component.html.erb
+++ b/app/components/shares/invite_user_form_component.html.erb
@@ -10,7 +10,7 @@
) do |form|
grid_layout('invite-user-form', tag: :div) do |invite_form|
invite_form.with_area('invitee') do
- render(Shares::Invitee.new(form, allow_hover_cards:))
+ render(Shares::Invitee.new(form))
end
invite_form.with_area('permission') do
diff --git a/app/components/shares/invite_user_form_component.rb b/app/components/shares/invite_user_form_component.rb
index 07f5559506f..f8d40024bae 100644
--- a/app/components/shares/invite_user_form_component.rb
+++ b/app/components/shares/invite_user_form_component.rb
@@ -32,15 +32,14 @@ module Shares
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
- attr_reader :entity, :strategy, :errors, :allow_hover_cards
+ attr_reader :entity, :strategy, :errors
- def initialize(strategy:, errors: nil, allow_hover_cards: false)
+ def initialize(strategy:, errors: nil)
super
@strategy = strategy
@entity = strategy.entity
@errors = errors
- @allow_hover_cards = allow_hover_cards
end
def new_share
diff --git a/app/components/shares/manage_shares_component.html.erb b/app/components/shares/manage_shares_component.html.erb
index f92a1105b67..4412dbce2ae 100644
--- a/app/components/shares/manage_shares_component.html.erb
+++ b/app/components/shares/manage_shares_component.html.erb
@@ -1,7 +1,7 @@
<%=
if strategy.manageable?
modal_content.with_row do
- render(Shares::InviteUserFormComponent.new(strategy:, errors:, allow_hover_cards:))
+ render(Shares::InviteUserFormComponent.new(strategy:, errors:))
end
end
@@ -100,7 +100,7 @@
end
else
strategy.shares.each do |share|
- render(Shares::ShareRowComponent.new(share:, strategy:, container: border_box, allow_hover_cards:))
+ render(Shares::ShareRowComponent.new(share:, strategy:, container: border_box))
end
end
end
diff --git a/app/components/shares/manage_shares_component.rb b/app/components/shares/manage_shares_component.rb
index 22246aed01a..fa61c6afdd5 100644
--- a/app/components/shares/manage_shares_component.rb
+++ b/app/components/shares/manage_shares_component.rb
@@ -36,7 +36,6 @@ module Shares
attr_reader :strategy,
:entity,
:errors,
- :allow_hover_cards,
:modal_content
def initialize(strategy:, modal_content:, errors: nil)
@@ -46,7 +45,6 @@ module Shares
@entity = strategy.entity
@errors = errors
@modal_content = modal_content
- @allow_hover_cards = strategy.allow_hover_cards?
end
def self.wrapper_key
diff --git a/app/components/shares/share_row_component.html.erb b/app/components/shares/share_row_component.html.erb
index 47c931db3e7..b0a929c9d3c 100644
--- a/app/components/shares/share_row_component.html.erb
+++ b/app/components/shares/share_row_component.html.erb
@@ -14,7 +14,7 @@
user_row_grid.with_area(:avatar, tag: :div) do
render(Users::AvatarComponent.new(user: principal, show_name: false, size: :medium,
- hover_card: { active: allow_hover_cards, target: :custom }))
+ hover_card: { active: true }))
end
user_row_grid.with_area(:user_details, tag: :div, classes: 'ellipsis') do
diff --git a/app/components/shares/share_row_component.rb b/app/components/shares/share_row_component.rb
index ae3b9845768..45df3ab20e0 100644
--- a/app/components/shares/share_row_component.rb
+++ b/app/components/shares/share_row_component.rb
@@ -36,7 +36,7 @@ module Shares
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
- def initialize(share:, strategy:, container: nil, allow_hover_cards: false)
+ def initialize(share:, strategy:, container: nil)
super
@share = share
@@ -45,7 +45,6 @@ module Shares
@principal = share.principal
@available_roles = strategy.available_roles
@container = container
- @allow_hover_cards = allow_hover_cards
end
def wrapper_uniq_by
@@ -54,7 +53,7 @@ module Shares
private
- attr_reader :share, :entity, :principal, :container, :available_roles, :strategy, :allow_hover_cards
+ attr_reader :share, :entity, :principal, :container, :available_roles, :strategy
def share_editable?
@share_editable ||= User.current != share.principal && sharing_manageable?
diff --git a/app/forms/shares/invitee.rb b/app/forms/shares/invitee.rb
index c60ed79d1c3..d9bc3704304 100644
--- a/app/forms/shares/invitee.rb
+++ b/app/forms/shares/invitee.rb
@@ -53,15 +53,14 @@ module Shares
appendToComponent: true,
disabled: @disabled,
isOpenedInModal: true,
- hoverCards: @allow_hover_cards
+ hoverCards: true
}
)
end
- def initialize(disabled: false, allow_hover_cards: false)
+ def initialize(disabled: false)
super()
@disabled = disabled
- @allow_hover_cards = allow_hover_cards
end
end
end
diff --git a/app/models/sharing_strategies/base_strategy.rb b/app/models/sharing_strategies/base_strategy.rb
index 25c00ff2e85..bff01d94d89 100644
--- a/app/models/sharing_strategies/base_strategy.rb
+++ b/app/models/sharing_strategies/base_strategy.rb
@@ -50,10 +50,6 @@ module SharingStrategies
raise NotImplementedError, "Override in a subclass and return true if the current user can manage sharing"
end
- def allow_hover_cards?
- raise NotImplementedError, "Override in a subclass and return true if hover cards should appear hovering users"
- end
-
def create_contract_class
raise NotImplementedError, "Override in a subclass and return the contract class for creating a share"
end
diff --git a/app/models/sharing_strategies/project_query_strategy.rb b/app/models/sharing_strategies/project_query_strategy.rb
index 7a898438bb6..eb05b1970d7 100644
--- a/app/models/sharing_strategies/project_query_strategy.rb
+++ b/app/models/sharing_strategies/project_query_strategy.rb
@@ -54,10 +54,6 @@ module SharingStrategies
@entity.visible?
end
- def allow_hover_cards?
- true
- end
-
def create_contract_class
Shares::ProjectQueries::CreateContract
end
diff --git a/app/models/sharing_strategies/work_package_strategy.rb b/app/models/sharing_strategies/work_package_strategy.rb
index 2c383a7cec2..556767dc08a 100644
--- a/app/models/sharing_strategies/work_package_strategy.rb
+++ b/app/models/sharing_strategies/work_package_strategy.rb
@@ -53,10 +53,6 @@ module SharingStrategies
user.allowed_in_project?(:view_shared_work_packages, @entity.project)
end
- def allow_hover_cards?
- true
- end
-
def share_description(share) # rubocop:disable Metrics/PerceivedComplexity,Metrics/AbcSize
scope = %i[sharing user_details]