-
Notifications
You must be signed in to change notification settings - Fork 75
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
Conversation
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
openbas-api/src/main/java/io/openbas/service/ReportService.java
Outdated
Show resolved
Hide resolved
@@ -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 = []) => { |
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.
Can you explain this changes ?
Thank you
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.
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.
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.
Great, thanks for the explanation
openbas-front/src/admin/components/simulations/simulation/reports/InjectReportResult.tsx
Outdated
Show resolved
Hide resolved
openbas-front/src/admin/components/simulations/simulation/reports/InjectReportResult.tsx
Outdated
Show resolved
Hide resolved
openbas-front/src/admin/components/simulations/simulation/reports/InjectReportResult.tsx
Outdated
Show resolved
Hide resolved
openbas-model/src/main/java/io/openbas/database/model/ReportInjectComment.java
Show resolved
Hide resolved
@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>
12b1e59
to
d357eb8
Compare
openbas-api/src/main/java/io/openbas/service/ReportService.java
Outdated
Show resolved
Hide resolved
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"; |
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.
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 = []) => { |
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.
Great, thanks for the explanation
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
I have a question about the path: /reports/exerciseId/reportId, maybe could be better: /exercises/exerciseId/reports/reportId ? ty! |
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
issue : #1080
Chunk 2
add result inject inside report