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

change invisible to ghost as it is in specifications

Behrokh Satarnejadfe0a3cef8883
diff --git a/app/components/work_package_relations_tab/index_component.html.erb b/app/components/work_package_relations_tab/index_component.html.erb
index 0e461ca6f65..a114b1be1ea 100644
--- a/app/components/work_package_relations_tab/index_component.html.erb
+++ b/app/components/work_package_relations_tab/index_component.html.erb
@@ -52,7 +52,7 @@
# Combine visible and invisible relations into a single list
all_relations = relation_group.visible_relations.map { |r| [r, :visible] } +
- relation_group.invisible_relations.map { |r| [r, :ghost] }
+ relation_group.ghost_relations.map { |r| [r, :ghost] }
flex.with_row(mb: 4) do
render_relation_group(
@@ -76,7 +76,7 @@
# Combine visible and invisible children into a single list
all_children = visible_children.map { |r| [r, :visible] } +
- invisible_children.map { |r| [r, :ghost] }
+ ghost_children.map { |r| [r, :ghost] }
flex.with_row do
render_relation_group(
diff --git a/app/components/work_package_relations_tab/index_component.rb b/app/components/work_package_relations_tab/index_component.rb
index b51006e48ae..2187bf67755 100644
--- a/app/components/work_package_relations_tab/index_component.rb
+++ b/app/components/work_package_relations_tab/index_component.rb
@@ -20,7 +20,7 @@ class WorkPackageRelationsTab::IndexComponent < ApplicationComponent
delegate :work_package,
:visible_children,
- :invisible_children,
+ :ghost_children,
:directionally_aware_grouped_relations,
:any_relations?,
:any_children?,
@@ -34,7 +34,6 @@ class WorkPackageRelationsTab::IndexComponent < ApplicationComponent
super()
@relations_mediator = WorkPackageRelationsTab::RelationsMediator.new(work_package:)
-
@relation_to_scroll_to = relation_to_scroll_to
end
diff --git a/app/components/work_package_relations_tab/relations_mediator.rb b/app/components/work_package_relations_tab/relations_mediator.rb
index fad79e2d3fa..db9fb3b5706 100644
--- a/app/components/work_package_relations_tab/relations_mediator.rb
+++ b/app/components/work_package_relations_tab/relations_mediator.rb
@@ -29,7 +29,7 @@
#++
class WorkPackageRelationsTab::RelationsMediator
- RelationGroup = Data.define(:type, :visible_relations, :invisible_relations)
+ RelationGroup = Data.define(:type, :visible_relations, :ghost_relations)
attr_reader :work_package
@@ -45,12 +45,12 @@ class WorkPackageRelationsTab::RelationsMediator
@visible_children ||= work_package.children.visible
end
- def invisible_relations
- @invisible_relations = work_package.relations.includes(:to, :from).where.not(id: @visible_relations.select(:id))
+ def ghost_relations
+ @ghost_relations = work_package.relations.includes(:to, :from).where.not(id: @visible_relations.select(:id))
end
- def invisible_children
- @invisible_children ||= work_package.children.where.not(id: @visible_children.select(:id))
+ def ghost_children
+ @ghost_children ||= work_package.children.where.not(id: @visible_children.select(:id))
end
def directionally_aware_grouped_relations
@@ -62,27 +62,27 @@ class WorkPackageRelationsTab::RelationsMediator
RelationGroup.new(
type: type,
visible_relations: filter_relations_by_type(visible_relations, type),
- invisible_relations: filter_relations_by_type(invisible_relations, type)
+ ghost_relations: filter_relations_by_type(ghost_relations, type)
)
end
end
def any_relations?
- visible_relations.any? || invisible_relations.any? || visible_children.any? || invisible_children.any?
+ visible_relations.any? || ghost_relations.any? || visible_children.any? || ghost_children.any?
end
def all_relations_count
- visible_relations.count + invisible_relations.count + visible_children.count + invisible_children.count
+ visible_relations.count + ghost_relations.count + visible_children.count + ghost_children.count
end
def any_children?
- visible_children.any? || invisible_children.any?
+ visible_children.any? || ghost_children.any?
end
private
def collect_all_relation_types
- (visible_relations + invisible_relations).map do |relation|
+ (visible_relations + ghost_relations).map do |relation|
relation.relation_type_for(work_package)
end.uniq
end
diff --git a/spec/features/work_packages/details/relations/primerized_relations_spec.rb b/spec/features/work_packages/details/relations/primerized_relations_spec.rb
index d85d77005b9..67672376a64 100644
--- a/spec/features/work_packages/details/relations/primerized_relations_spec.rb
+++ b/spec/features/work_packages/details/relations/primerized_relations_spec.rb
@@ -33,7 +33,6 @@ RSpec.describe "Primerized work package relations tab",
include Components::Autocompleter::NgSelectAutocompleteHelpers
shared_let(:project) { create(:project) }
- shared_let(:admin) { create(:admin) }
shared_let(:user) do
create(:user,
member_with_permissions: {