[frontend] Add page titles to Data pages
Proposed changes
This PR is a follow-up to the the PR which introduced custom page titles (https://github.com/OpenCTI-Platform/opencti/pull/7374). This PR converts several 'Data' components from classes to functional and adds page titles. These components were not included in the original PR because they were class components and could not use the page title hook.
Impacted Pages *
Related issues
- https://github.com/OpenCTI-Platform/opencti/pull/7374
Checklist
- [x] I consider the submitted work as finished
- [x] I tested the code for its functionality
- [ ] I wrote test cases for the relevant uses case (coverage and e2e)
- [ ] I added/update the relevant documentation (either on github or on notion)
- [x] Where necessary I refactored code to improve the overall quality
Further comments
This PR has a known issue, which has also been reported in a comment on (https://github.com/OpenCTI-Platform/opencti/pull/7753). Every time a page renders, both the the custom page title setting function useConnectedDocumentModifier.setTitle and the default page title setting function useDocumentLangModifier run and set the title. In some instances, the default page title is set after the custom page title is set. This results in the default page title being displayed. I was unable to find a cause or pattern for which components exhibit this bug.
The following components from this PR are impacted:
- Entities / Sectors (entities/Sectors.jsx)
- Data / Ingestion / Connectors (data/Connectors.jsx)
- Data / Data sharing / Live streams (data/Streams.tsx)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 64.96%. Comparing base (
402d6bc) to head (f7efeb9). Report is 16 commits behind head on release/6.5.0.
Additional details and impacted files
@@ Coverage Diff @@
## release/6.5.0 #8300 +/- ##
=================================================
- Coverage 64.97% 64.96% -0.01%
=================================================
Files 623 623
Lines 59496 59496
Branches 6577 6575 -2
=================================================
- Hits 38656 38651 -5
- Misses 20840 20845 +5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.