Skip to content

Commit 9b7b1e5

Browse files
committed
Refactor ReportHeader component to display report title within category wrapper and adjust margin styles for better layout
1 parent 19ad304 commit 9b7b1e5

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

frontend/src/pages/Processing/ProcessingPage.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const ProcessingPage: React.FC = () => {
2626
const [processingError, setProcessingError] = useState<string | null>(null);
2727
const [errorHeading, setErrorHeading] = useState<string | null>(null);
2828
const statusCheckIntervalRef = useRef<number | null>(null);
29-
const lastTriggeredTime = useRef<number | null>(null);
3029

3130
// Get the location state which may contain the reportId (previously filePath)
3231
const location = useLocation<{ reportId: string }>();
@@ -127,17 +126,12 @@ const ProcessingPage: React.FC = () => {
127126
// Reset error state and try processing the same file again
128127
setError(null, null);
129128
setIsProcessing(true);
130-
lastTriggeredTime.current = Date.now();
131129
processFile();
132130
};
133131

134132
// Send the API request when component mounts
135133
useEffect(() => {
136-
// check last triggered time to prevent multiple calls, if it's within 100ms then ignore
137-
if ((lastTriggeredTime.current && lastTriggeredTime.current > Date.now() - 100) || !reportId) {
138-
return;
139-
}
140-
134+
clearStatusCheckInterval();
141135
execute();
142136

143137
// Clean up the interval when the component unmounts

frontend/src/pages/Reports/ReportDetailPage.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
justify-content: space-between;
5151
align-items: center;
5252
margin-top: 16px;
53-
margin-bottom: 4px;
5453
}
5554

5655
&__category {
@@ -84,7 +83,7 @@
8483
font-family: var(--font-family-base);
8584
font-size: 18px;
8685
font-weight: 600;
87-
margin: 4px 0 16px;
86+
margin: 0 0 16px;
8887
color: #313e4c;
8988
}
9089

frontend/src/pages/Reports/components/ReportHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const ReportHeader: React.FC<ReportHeaderProps> = ({ reportData, onClose }) => {
2626
<div className="report-detail-page__category-wrapper">
2727
<span className="report-detail-page__category">
2828
{reportData.category && t(`list.${reportData.category}Category`, { ns: 'reportDetail' })}
29+
<h2 className="report-detail-page__subtitle">{reportData.title}</h2>
2930
</span>
3031
<button className="report-detail-page__bookmark-button">
3132
{reportData.bookmarked ? (
@@ -35,7 +36,6 @@ const ReportHeader: React.FC<ReportHeaderProps> = ({ reportData, onClose }) => {
3536
)}
3637
</button>
3738
</div>
38-
<h2 className="report-detail-page__subtitle">{reportData.title}</h2>
3939
</div>
4040
);
4141
};

0 commit comments

Comments
 (0)