-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Replace reporting page with stimulus #19214
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
Conversation
1fe407c
to
1d1a881
Compare
d2bfd7e
to
c052430
Compare
c052430
to
8d25e1d
Compare
modules/reporting/spec/features/support/components/cost_reports_base_table.rb
Outdated
Show resolved
Hide resolved
modules/reporting/spec/features/support/components/cost_reports_base_table.rb
Outdated
Show resolved
Hide resolved
1fea7ac
to
cf447b1
Compare
frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts
Outdated
Show resolved
Hide resolved
frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts
Outdated
Show resolved
Hide resolved
frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts
Outdated
Show resolved
Hide resolved
}, | ||
}; | ||
|
||
jQuery('.filter_rem') |
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.
You are attaching many .on('change'), .on('click') handlers without removing them. While it's common in older jQuery systems, it can result in memory leaks if DOM is dynamically re-rendered.
My suggestion is jQuery('.filter_rem').off('click').on('click', ...)
What's your opinion?
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.
I replaced them with stimulus actions. There is a dynamically created element that still has it, but that gets cleared up once the element is destroyed in DOM
frontend/src/stimulus/controllers/dynamic/reporting/page.controller.ts
Outdated
Show resolved
Hide resolved
114371d
to
66a25fe
Compare
Hi @bsatarnejad , I addressed your remarks. Could you take another look? 🙏 |
Hi @oliverguenther
I checked it, now filters are in incorrect order, but it works correctly. Is it something that we can handle? |
66a25fe
to
5d78933
Compare
Hi @bsatarnejad , when adding new filters, they get added to the bottom and do not have an explicit sort order. When we load the page, the filters are sorted, so they appear different. That behavior seems okay to me for now. |
Ticket
https://community.openproject.org/work_packages/64590
What are you trying to accomplish?
Ensure that reporting page works with turbo by refactoring the previous reporting_page code to a stimulus controller, so that is imported and initialized according to our standards
Merge checklist