Skip to content

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

Merged
merged 2 commits into from
Jun 30, 2025
Merged

Conversation

oliverguenther
Copy link
Member

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

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch from 1fe407c to 1d1a881 Compare June 17, 2025 14:15
@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch 3 times, most recently from d2bfd7e to c052430 Compare June 20, 2025 07:46
@oliverguenther oliverguenther marked this pull request as ready for review June 20, 2025 07:56
@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch from c052430 to 8d25e1d Compare June 20, 2025 08:34
@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch 2 times, most recently from 1fea7ac to cf447b1 Compare June 20, 2025 10:41
},
};

jQuery('.filter_rem')
Copy link
Contributor

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?

Copy link
Member Author

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

@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch 6 times, most recently from 114371d to 66a25fe Compare June 24, 2025 19:06
@oliverguenther
Copy link
Member Author

Hi @bsatarnejad , I addressed your remarks. Could you take another look? 🙏

@bsatarnejad bsatarnejad self-requested a review June 25, 2025 07:57
@bsatarnejad
Copy link
Contributor

Hi @bsatarnejad , I addressed your remarks. Could you take another look? 🙏

Hi @oliverguenther
Code wise, it is good now 👍
It's working properly now, but Ivana mentioned that

In order to reproduce the problem, add some filters and then go to any other module, then come back to Time and costs page. Result: filters you added are in incorrect order and they don't work (dropdown doesn't open).

I checked it, now filters are in incorrect order, but it works correctly. Is it something that we can handle?

@oliverguenther oliverguenther force-pushed the fix/reporting-page-stimulus branch from 66a25fe to 5d78933 Compare June 30, 2025 19:02
@oliverguenther
Copy link
Member Author

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.

@oliverguenther oliverguenther merged commit 5911936 into dev Jun 30, 2025
17 checks passed
@oliverguenther oliverguenther deleted the fix/reporting-page-stimulus branch June 30, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants