Skip to content

Commit 0eecbf3

Browse files
committed
ok
1 parent e12fec7 commit 0eecbf3

20 files changed

Lines changed: 573 additions & 307 deletions

analyticq-frontend/src/components/layout/EmptyState.jsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from "react";
22
import {
3-
Box,
4-
Alert
3+
Alert,
4+
Flex,
5+
CloseButton
56
} from "@chakra-ui/react";
67

78
/**
@@ -15,25 +16,30 @@ import {
1516
*/
1617
const EmptyState = ({ title, message }) => {
1718
return (
18-
<Box
19+
<Flex
1920
p={6}
20-
maxW="md"
2121
textAlign="center"
22+
width="100%"
23+
height="100%"
24+
align="center"
25+
justify="center"
2226
>
2327
<Alert.Root
2428
status="info"
2529
title={title}
2630
role="alert" // Ensure the alert is announced immediately
2731
aria-live="assertive" // Ensure screen readers announce this content as soon as it appears
2832
aria-atomic="true"
33+
width="100%"
2934
>
3035
<Alert.Indicator />
31-
<Alert.Content maxWidth="md">
36+
<Alert.Content textAlign="center">
3237
<Alert.Title>{title}</Alert.Title>
3338
<Alert.Description>{message}</Alert.Description>
3439
</Alert.Content>
40+
<CloseButton pos="relative" top="-2" insetEnd="-2" />
3541
</Alert.Root>
36-
</Box>
42+
</Flex>
3743
);
3844
};
3945

analyticq-frontend/src/components/layout/ErrorDisplay.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from "react";
22
import {
3+
Box,
34
Alert,
45
HStack,
5-
Flex
6+
Flex,
67
} from "@chakra-ui/react";
78

89
/**
@@ -17,18 +18,19 @@ import {
1718
*/
1819
const ErrorDisplay = ({ title, error, backButton }) => (
1920
<Flex
20-
justify="center"
21-
align="center"
22-
2321
>
2422
<Alert.Root
2523
role="alert"
2624
aria-live="assertive"
2725
aria-labelledby="error-title"
2826
status="error"
2927
mb={4}
28+
width="100%"
29+
height="100%"
30+
align="center"
31+
justify="center"
3032
>
31-
<Alert.Content>
33+
<Alert.Content textAlign="center">
3234
<Alert.Indicator />
3335
<Alert.Title>{title}</Alert.Title>
3436
<Alert.Description>{error}</Alert.Description>

analyticq-frontend/src/components/ui/ExclusionStatsSummary.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { ProgessBarLabeled } from "./ProgessBarLabeled";
3232
*/
3333
export const ExclusionSummary = ({ excludedFiles, totalScanned, repoName }) => {
3434

35-
const [showAllFiles, setShowAllFiles] = useState(false);
3635

3736
const totalAnalyzed = totalScanned + excludedFiles.total_size;
3837
const excludedPercentage = (excludedFiles.total_size / totalAnalyzed) * 100;
@@ -55,12 +54,10 @@ export const ExclusionSummary = ({ excludedFiles, totalScanned, repoName }) => {
5554

5655
excludedFiles.files.forEach(file => {
5756
const fileName = getFileName(file);
58-
const extension = getFileExtension(file);
5957

6058
fileCountMap[fileName] = fileCountMap[fileName] || {
6159
fullPath: file,
6260
count: 0,
63-
extension: extension,
6461
estimatedSize: Math.round(excludedFiles.total_size / excludedFiles.count)
6562
};
6663
fileCountMap[fileName].count++;
@@ -74,7 +71,7 @@ export const ExclusionSummary = ({ excludedFiles, totalScanned, repoName }) => {
7471
}))
7572
.sort((a, b) => b.count - a.count);
7673

77-
}, [excludedFiles.files]);
74+
}, [excludedFiles]);
7875

7976
return (
8077
<Card.Root

analyticq-frontend/src/components/ui/ExportScanReport.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useMemo } from "react";
1+
import React, { useState, useMemo, useCallback } from "react";
22
import { useDownloadScanReport } from "hooks/useDownloadScanReport";
33
import {
44
Box,
@@ -55,7 +55,7 @@ export const ExportScanReport = ({ scanId, isCompact = false }) => {
5555
}
5656
], []);
5757

58-
const handleExport = async (format) => {
58+
const handleExport = useCallback(async (format) => {
5959

6060
if (isDownloading) return;
6161

@@ -80,7 +80,7 @@ export const ExportScanReport = ({ scanId, isCompact = false }) => {
8080
max: 4
8181
})
8282
}
83-
}
83+
}, [downloadReport, isDownloading, scanId]);
8484

8585
return (
8686
<Box
@@ -108,7 +108,7 @@ export const ExportScanReport = ({ scanId, isCompact = false }) => {
108108
spinner={<Spinner size="sm"/>}
109109
data-testid="export-report-button"
110110
>
111-
{menuOpened ? <FiChevronDown /> : <FiChevronUp />}
111+
{menuOpened ? <FiChevronUp /> : <FiChevronDown />}
112112
{isCompact ? "Export" : "Export Report"}
113113
<FaFileDownload />
114114
</Button>

0 commit comments

Comments
 (0)