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

Merged
merged 12 commits into from
Oct 3, 2024

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 53.12500% with 15 lines in your changes missing coverage. Please review.

Project coverage is 33.31%. Comparing base (6ed8b90) to head (be2e849).
Report is 35 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%   33.31%   +0.78%     
- Complexity     1464     1616     +152     
============================================
  Files           534      544      +10     
  Lines         13777    15198    +1421     
  Branches        824     1067     +243     
============================================
+ Hits           4482     5063     +581     
- Misses         9086     9909     +823     
- Partials        209      226      +17     
Flag Coverage Δ
?

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

Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
}

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 <marine.lemezo@filigran.io>
@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

Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
@MarineLeM MarineLeM merged commit c936004 into master Oct 3, 2024
7 checks passed
@MarineLeM MarineLeM deleted the issue/1080-inject-result branch October 3, 2024 08:35
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