Skip to content

Commit

Permalink
use scroll controller in wp relation index component
Browse files Browse the repository at this point in the history
  • Loading branch information
bsatarnejad committed Dec 5, 2024
1 parent 0dda802 commit e1bfcd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@
%>

<%=
flex_layout(mb: 3) do |flex|
flex_layout(mb: 3, data: {
"application-target": "dynamic",
controller: "work-packages--relations-tab--scroll",
"work-packages--relations-tab--scroll-target-id-value": @scroll_target_id,
}) do |flex|
if any_relations?
key_namespace = "#{I18N_NAMESPACE}.relations"

Expand Down
3 changes: 2 additions & 1 deletion app/components/work_package_relations_tab/index_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ class WorkPackageRelationsTab::IndexComponent < ApplicationComponent

attr_reader :work_package, :relations, :children, :directionally_aware_grouped_relations

def initialize(work_package:, relations:, children:)
def initialize(work_package:, relations:, children:, scroll_target_id: nil)
super()

@work_package = work_package
@relations = relations
@children = children
@directionally_aware_grouped_relations = group_relations_by_directional_context
@scroll_target_id = scroll_target_id
end

def self.wrapper_key
Expand Down

0 comments on commit e1bfcd3

Please sign in to comment.