Skip to content

Commit dcd6040

Browse files
Merge pull request #255 from microsoft/code-quality
refactor: clean up imports and remove unused code across multiple components
2 parents 1ffd8b4 + 59a5950 commit dcd6040

7 files changed

Lines changed: 6 additions & 52 deletions

File tree

src/frontend/src/commonComponents/ProgressModal/progressModal.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,6 @@ const ProgressModal: React.FC<ProgressModalProps> = ({
272272
const actionsMatch = raw.match(/📊\s*(\d+)\s*actions?/);
273273
const actionCount = actionsMatch ? parseInt(actionsMatch[1]) : 0;
274274

275-
// Extract blocking info from 🚧 segment
276-
const blockingMatch = raw.match(/🚧\s*Blocking\s*(\d+)/);
277-
const blockingCount = blockingMatch ? parseInt(blockingMatch[1]) : 0;
278-
279275
// Special handling for Coordinator: parse routing info from message
280276
let coordinatorTarget = '';
281277
let coordinatorInstruction = '';

src/frontend/src/components/bottomBar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Button, Card, Dropdown, DropdownProps, Option } from "@fluentui/react-components"
22
import React from "react"
3-
import { useNavigate } from "react-router-dom"
43

54
// Define possible upload states
65
const UploadState = {

src/frontend/src/main.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,6 @@ const Main = () => {
106106

107107
initMsal(); // Call the async function inside useEffect
108108
}, []);
109-
async function checkConnection() {
110-
if (!config) return;
111-
112-
const baseURL = config.API_URL.replace(/\/api$/, ''); // Remove '/api' if it appears at the end
113-
console.log('Checking connection to:', baseURL);
114-
try {
115-
const response = await fetch(`${baseURL}/health`);
116-
if (response.ok) {
117-
console.log('========> Backend connection successful');
118-
} else {
119-
console.log('========> Backend responded with error status:', response.status);
120-
}
121-
} catch (error) {
122-
console.log('========> Backend not available (this is okay for frontend-only testing):', error.message);
123-
}
124-
}
125109

126110
// useEffect(() => {
127111
// if (config) {

src/frontend/src/pages/batchView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import PanelRight from "../components/Panels/PanelRight";
3838
import PanelRightToolbar from "../components/Panels/PanelRightToolbar";
3939
import BatchHistoryPanel from "../components/batchHistoryPanel";
4040
import ConfirmationDialog from "../commonComponents/ConfirmationDialog/confirmationDialogue";
41-
import { determineFileStatus, filesLogsBuilder, renderErrorSection, useStyles, renderFileError, filesErrorCounter, completedFiles, hasFiles, fileErrorCounter, BatchSummary, fileWarningCounter } from "../api/utils";
41+
import { renderErrorSection, useStyles, renderFileError, BatchSummary } from "../api/utils";
4242
export const History = bundleIcon(HistoryFilled, HistoryRegular);
4343

4444

src/frontend/src/pages/landingPage.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useState } from "react";
1+
import React, { useEffect } from "react";
22
import { useSelector, useDispatch } from "react-redux";
33
import { RootState } from "../store/store";
44
import { togglePanel, closePanel } from "../slices/historyPanelSlice";
@@ -32,10 +32,8 @@ export const LandingPage = (): JSX.Element => {
3232
dispatch(resetState());
3333
}, [dispatch]);
3434

35-
const [uploadState, setUploadState] = useState<"IDLE" | "UPLOADING" | "COMPLETED">('IDLE');
36-
37-
const handleUploadStateChange = (state) => {
38-
setUploadState(state);
35+
const handleUploadStateChange = (_state) => {
36+
// State change handler - currently unused but kept for future use
3937
};
4038

4139
const handleStartTranslating = async () => {

src/frontend/src/pages/modernizationPage.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"
3232
const unwrapHljs = (mod: any) => (typeof mod === "function" ? mod : mod.default);
3333
SyntaxHighlighter.registerLanguage("sql", unwrapHljs(sqlLang))
3434
import { useNavigate, useParams } from "react-router-dom"
35-
import { useState, useEffect, useCallback, useRef } from "react"
35+
import { useState, useEffect } from "react"
3636
import { getApiUrl, headerBuilder } from '../api/config';
3737
import BatchHistoryPanel from "../components/batchHistoryPanel"
3838
import PanelRight from "../components/Panels/PanelRight";
@@ -412,25 +412,6 @@ const fetchBatchSummary = async (batchId: string): Promise<any> => {
412412
}
413413
};
414414

415-
416-
enum ProcessingStage {
417-
NotStarted = 1,
418-
Queued = 10,
419-
Starting = 20,
420-
Parsing = 40,
421-
Processing = 60,
422-
FinalChecks = 95,
423-
Completed = 100
424-
}
425-
426-
enum Agents {
427-
Verifier = "Semantic Verifier agent",
428-
Checker = "Syntax Checker agent",
429-
Picker = "Picker agent",
430-
Migrator = "Migrator agent",
431-
Agents = "Agent"
432-
}
433-
434415
const getPrintFileStatus = (status: string): string => {
435416
switch (status) {
436417
case "completed":
@@ -481,7 +462,7 @@ const ModernizationPage = () => {
481462
const selectedFile = files.find((f) => f.id === selectedFileId);
482463
if (!selectedFile || !selectedFile.translatedCode) {
483464
setFileLoading(true);
484-
const newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || "");
465+
await fetchFileFromAPI(selectedFile?.fileId || "");
485466
setFileLoading(false);
486467
}
487468

src/frontend/src/pages/processPage.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { useSelector, useDispatch } from "react-redux";
33
import { useNavigate, useParams } from "react-router-dom";
44
import { RootState } from "../store/store";
55
import { togglePanel, closePanel } from "../slices/historyPanelSlice";
6-
import {
7-
Button,
8-
Tooltip,
9-
} from "@fluentui/react-components";
106
import { MessageBar, MessageBarType } from "@fluentui/react";
117
import Header from "../components/Header/Header";
128
import HeaderTools from "../components/Header/HeaderTools";

0 commit comments

Comments
 (0)