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

✨ Added a summary of issues indicating that the analysis was successful #2139

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@
"medium": "Medium",
"small": "Small"
},
"issues": {
"noIssues": "Congratulations! No issues were found",
"issuesFound": "{{minor}} minor, {{critical}} critical"
},
"message": {
"archetypeApplicationCount": "{{count}} application",
"archetypeApplicationCount_plural": "{{count}} applications",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ import { useFetchArchetypes } from "@app/queries/archetypes";
import { useFetchAssessments } from "@app/queries/assessments";
import { DecoratedApplication } from "../../applications-table/useDecoratedApplications";
import { TaskStates } from "@app/queries/tasks";
import { useFetchIssueReports } from "@app/queries/issues";
import { fork } from "radash";

export interface IApplicationDetailDrawerProps
extends Pick<IPageDrawerContentProps, "onCloseClick"> {
Expand Down Expand Up @@ -182,6 +184,18 @@ const TabDetailsContent: React.FC<{
.filter((fullArchetype) => fullArchetype?.review)
.filter(Boolean);

const issueReportsQuery = useFetchIssueReports(application.id);
DvoraShechter1 marked this conversation as resolved.
Show resolved Hide resolved
const {
result: { data, total: totalReportCount },
} = issueReportsQuery;
const currentPageReports = data;
const [minor, critical] = fork(currentPageReports, (u) => u.effort <= 1).map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@sjd78 @dymurray what makes an issue a critical one please?
Here is a screenshot of analysis with one mandatory issue which is summarized as a minor issue (effort =1)
Screenshot_20250209_210537

(a) => a.length
);

const taskState = application.tasks.currentAnalyzer?.state ?? "";
const taskSucceeded = TaskStates.Success.includes(taskState);

return (
<>
<TextContent className={`${spacing.mtMd} ${spacing.mbMd}`}>
Expand All @@ -194,6 +208,16 @@ const TabDetailsContent: React.FC<{
<Link to={getIssuesSingleAppSelectedLocation(application.id)}>
Issues
</Link>
<Text component="small">
{!taskSucceeded
? t("terms.unassigned")
: currentPageReports.length === 0
? t("issues.noIssues")
: t("issues.issuesFound", {
minor: minor,
critical: critical,
})}
</Text>
</ListItem>
<ListItem>
<Link
Expand Down