@@ -34,6 +34,8 @@ import {
34
34
Ref ,
35
35
Archetype ,
36
36
TaskDashboard ,
37
+ AnalysisRuleReport ,
38
+ AnalysisIssueReport ,
37
39
} from "@app/api/models" ;
38
40
import { COLOR_HEX_VALUES_BY_NAME } from "@app/Constants" ;
39
41
import { useFetchFacts } from "@app/queries/facts" ;
@@ -65,6 +67,7 @@ import { useFetchArchetypes } from "@app/queries/archetypes";
65
67
import { useFetchAssessments } from "@app/queries/assessments" ;
66
68
import { DecoratedApplication } from "../../applications-table/useDecoratedApplications" ;
67
69
import { TaskStates } from "@app/queries/tasks" ;
70
+ import { useFetchIssueReports } from "@app/queries/issues" ;
68
71
69
72
export interface IApplicationDetailDrawerProps
70
73
extends Pick < IPageDrawerContentProps , "onCloseClick" > {
@@ -182,6 +185,19 @@ const TabDetailsContent: React.FC<{
182
185
. filter ( ( fullArchetype ) => fullArchetype ?. review )
183
186
. filter ( Boolean ) ;
184
187
188
+ const issueReportsQuery = useFetchIssueReports ( application . id ) ;
189
+ const {
190
+ result : { data, total : totalReportCount } ,
191
+ isFetching : isFetchingReports ,
192
+ fetchError : reportsFetchError ,
193
+ } = issueReportsQuery ;
194
+ const currentPageReports = data as (
195
+ | AnalysisRuleReport
196
+ | AnalysisIssueReport
197
+ ) [ ] ;
198
+ const minor = currentPageReports . filter ( ( u ) => u . effort === 1 ) . length ;
199
+ const critical = currentPageReports . filter ( ( u ) => u . effort > 1 ) . length ;
200
+
185
201
return (
186
202
< >
187
203
< TextContent className = { `${ spacing . mtMd } ${ spacing . mbMd } ` } >
@@ -194,6 +210,17 @@ const TabDetailsContent: React.FC<{
194
210
< Link to = { getIssuesSingleAppSelectedLocation ( application . id ) } >
195
211
Issues
196
212
</ Link >
213
+ < Text component = "small" >
214
+ { application . tasks . currentAnalyzer === undefined ||
215
+ application . tasks . currentAnalyzer . state === "Failed"
216
+ ? t ( "terms.unassigned" )
217
+ : currentPageReports . length === 0
218
+ ? t ( "issues.noIssues" )
219
+ : t ( "issues.issuesFound" , {
220
+ minor : minor ,
221
+ critical : critical ,
222
+ } ) }
223
+ </ Text >
197
224
</ ListItem >
198
225
< ListItem >
199
226
< Link
0 commit comments