Skip to content
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

[frontend/backend] add inject result inside report #1519

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

MarineLeM
Copy link
Contributor

@MarineLeM MarineLeM commented Sep 23, 2024

issue : #1080
Chunk 2

add result inject inside report
image

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Sep 23, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 51.61290% with 15 lines in your changes missing coverage. Please review.

Project coverage is 32.76%. Comparing base (6ed8b90) to head (91f118f).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...rc/main/java/io/openbas/rest/inject/InjectApi.java 0.00% 10 Missing ⚠️
...rc/main/java/io/openbas/rest/report/ReportApi.java 60.00% 0 Missing and 2 partials ⚠️
...rc/main/java/io/openbas/service/InjectService.java 0.00% 2 Missing ⚠️
...bas/rest/report/form/ReportInjectCommentInput.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1519      +/-   ##
============================================
+ Coverage     32.53%   32.76%   +0.23%     
- Complexity     1464     1540      +76     
============================================
  Files           534      540       +6     
  Lines         13777    14434     +657     
  Branches        824      917      +93     
============================================
+ Hits           4482     4729     +247     
- Misses         9086     9483     +397     
- Partials        209      222      +13     
Flag Coverage Δ
32.76% <51.61%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -18,7 +18,7 @@ const ERROR_30S_DELAY = 30000;
let sseClient;
let lastPingDate = new Date().getTime();
const listeners = new Map();
const useDataLoader = (loader = () => {}) => {
const useDataLoader = (loader = () => {}, refetchArg = []) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this changes ?
Thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s return to the exerciseReportContent folder. I need the useDataLoader function to refetch data every time the report changes. To achieve this, I want to pass a refetch argument into the useEffect hook inside the useDataLoader function.

By implementing this approach, I ensure that only the necessary data for the report is loaded, rather than fetching all available data. Whenever I update my report configuration, the useDataLoader function will refetch only the specific data required for the updated report.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the explanation

@MarineLeM MarineLeM self-assigned this Sep 25, 2024
@MarineLeM
Copy link
Contributor Author

@RomuDeuxfois ready for a second round

}

private Optional<ReportInjectComment> findReportInjectComment(String reportId, String injectId) {
String jpql = "SELECT r FROM ReportInjectComment r WHERE r.report.id = :reportId AND r.inject.id = :injectId";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be better to have this directly in the ReportRepository

@Query(value = "SELECT r FROM ReportInjectComment r WHERE r.report.id = :reportId AND r.inject.id = :injectId", nativeQuery = true)
Optional<ReportInjectComment> method(@Param("PARAM")...);

@@ -18,7 +18,7 @@ const ERROR_30S_DELAY = 30000;
let sseClient;
let lastPingDate = new Date().getTime();
const listeners = new Map();
const useDataLoader = (loader = () => {}) => {
const useDataLoader = (loader = () => {}, refetchArg = []) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the explanation

Signed-off-by: Marine LM <[email protected]>
@savacano28
Copy link
Contributor

I have a question about the path: /reports/exerciseId/reportId, maybe could be better: /exercises/exerciseId/reports/reportId ? ty!

@savacano28
Copy link
Contributor

Maybe we could manage better when a report no longer exists. Currently, we have :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create customizable debrief page - generate a report page with a global note
3 participants