-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code maintenance/59280 ensure that the new activity tab renders quickly also for work packages with over 100 comments #17224
Merged
jjabari-op
merged 13 commits into
release/15.0
from
code-maintenance/59280-ensure-that-the-new-activity-tab-renders-quickly-also-for-work-packages-with-over-100-comments
Nov 21, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dfd664b
[#59280] Ensure that the new Activity tab renders quickly also for wo…
jjabari-op bb8f133
refactored stem rendering for better rendering performance
jjabari-op 8b06a06
introduce deffered loading for older journals
jjabari-op c6f5f47
simple waiting mechanism in order to wait for anchor to be rendered i…
jjabari-op 6c6e7ca
enhanced and used eager loading wrapper in order to avoid n+1, added …
jjabari-op 56ce2ff
limit scope of notification update streams
jjabari-op 17f92db
Merge branch 'release/15.0' into code-maintenance/59280-ensure-that-t…
jjabari-op 7d0b69a
quickly disable the journals API call, which is not required anymore,…
jjabari-op d2c72d6
Merge branch 'release/15.0' into code-maintenance/59280-ensure-that-t…
jjabari-op 5ca7abe
Update app/controllers/work_packages/activities_tab_controller.rb
jjabari-op fbb39b4
revert angular based comment loading removal, breaks specs, needs to …
jjabari-op 2ba1b5e
tests[Op#59280]: add unit tests for eager loading wrapper
akabiru 292a116
resolve Performance/CollectionLiteralInLoop
akabiru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 42 additions & 36 deletions
78
app/components/work_packages/activities_tab/index_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
<%= | ||
content_tag("turbo-frame", id: "work-package-activities-tab-content") do | ||
flex_layout(classes: "work-packages-activities-tab-index-component", mb: [5, 5, 5, 5, 0]) do |activties_tab_wrapper_container| | ||
activties_tab_wrapper_container.with_row(classes: "work-packages-activities-tab-index-component--errors") do | ||
render( | ||
WorkPackages::ActivitiesTab::ErrorStreamComponent.new | ||
) | ||
end | ||
activties_tab_wrapper_container.with_row do | ||
component_wrapper(data: wrapper_data_attributes) do | ||
flex_layout do |activties_tab_container| | ||
activties_tab_container.with_row(mb: 2) do | ||
render( | ||
WorkPackages::ActivitiesTab::Journals::FilterAndSortingComponent.new( | ||
work_package:, | ||
filter: | ||
) | ||
) | ||
end | ||
activties_tab_container.with_row(flex_layout: true, mt: 3) do |journals_wrapper_container| | ||
journals_wrapper_container.with_row( | ||
classes: "work-packages-activities-tab-index-component--journals-container work-packages-activities-tab-index-component--journals-container_with-initial-input-compensation", | ||
data: { "work-packages--activities-tab--index-target": "journalsContainer" } | ||
) do | ||
unless deferred | ||
content_tag("turbo-frame", id: "work-package-activities-tab-content") do | ||
flex_layout(classes: "work-packages-activities-tab-index-component", mb: [5, 5, 5, 5, 0]) do |activties_tab_wrapper_container| | ||
activties_tab_wrapper_container.with_row(classes: "work-packages-activities-tab-index-component--errors") do | ||
render( | ||
WorkPackages::ActivitiesTab::ErrorStreamComponent.new | ||
) | ||
end | ||
activties_tab_wrapper_container.with_row do | ||
component_wrapper(data: wrapper_data_attributes) do | ||
flex_layout do |activties_tab_container| | ||
activties_tab_container.with_row(mb: 2) do | ||
render( | ||
WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:) | ||
WorkPackages::ActivitiesTab::Journals::FilterAndSortingComponent.new( | ||
work_package:, | ||
filter: | ||
) | ||
) | ||
end | ||
if adding_comment_allowed? | ||
activties_tab_container.with_row(flex_layout: true, mt: 3) do |journals_wrapper_container| | ||
journals_wrapper_container.with_row( | ||
classes: "work-packages-activities-tab-index-component--input-container work-packages-activities-tab-index-component--input-container_sort-#{journal_sorting}", | ||
mt: 3, | ||
mb: [3, nil, nil, nil, 0], | ||
pt: 2, | ||
pb: 2, | ||
pl: 3, | ||
pr: [3, nil, nil, nil, 2], | ||
border: [nil, nil, nil, nil, :top], | ||
border_radius: [2, nil, nil, nil, 0], | ||
bg: :subtle | ||
classes: "work-packages-activities-tab-index-component--journals-container work-packages-activities-tab-index-component--journals-container_with-initial-input-compensation", | ||
data: { "work-packages--activities-tab--index-target": "journalsContainer" } | ||
) do | ||
render( | ||
WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:) | ||
WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:) | ||
) | ||
end | ||
if adding_comment_allowed? | ||
journals_wrapper_container.with_row( | ||
classes: "work-packages-activities-tab-index-component--input-container work-packages-activities-tab-index-component--input-container_sort-#{journal_sorting}", | ||
mt: 3, | ||
mb: [3, nil, nil, nil, 0], | ||
pt: 2, | ||
pb: 2, | ||
pl: 3, | ||
pr: [3, nil, nil, nil, 2], | ||
border: [nil, nil, nil, nil, :top], | ||
border_radius: [2, nil, nil, nil, 0], | ||
bg: :subtle | ||
) do | ||
render( | ||
WorkPackages::ActivitiesTab::Journals::NewComponent.new(work_package:) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
else | ||
render( | ||
WorkPackages::ActivitiesTab::Journals::IndexComponent.new(work_package:, filter:, deferred:) | ||
) | ||
end | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 51 additions & 24 deletions
75
app/components/work_packages/activities_tab/journals/index_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾