Skip to content

Commit fe488a9

Browse files
Merge pull request #366 from microsoft/dev
chore: sync psl-abhar with dev
2 parents 6b768ae + 0593023 commit fe488a9

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

src/frontend/src/components/uploadButton.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,17 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
387387
}
388388
}, [fileLimitExceeded]);
389389

390+
// Auto-hide file rejection errors after 10 seconds
391+
useEffect(() => {
392+
if (fileRejectionErrors.length > 0) {
393+
const timer = setTimeout(() => {
394+
setFileRejectionErrors([]);
395+
}, 5000);
396+
397+
return () => clearTimeout(timer);
398+
}
399+
}, [fileRejectionErrors]);
400+
390401
return (
391402
<div style={{ width: '100%', minWidth: '720px', maxWidth: '800px', margin: '0 auto', marginTop: '0', padding: '16px', paddingBottom: '60px' }}>
392403
<ConfirmationDialog
@@ -565,9 +576,12 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
565576
<div style={{ display: 'flex', flexDirection: 'column', gap: '13px', width: '837px', paddingBottom: 10, borderRadius: '4px', }}>
566577
{/* Show file rejection errors for invalid type or size */}
567578
{fileRejectionErrors.length > 0 && (
579+
<div style={{ width: uploadingFiles.some(f => f.status === 'completed') ? '837px' : '880px' }}>
568580
<MessageBar
569581
messageBarType={MessageBarType.error}
570582
isMultiline={true}
583+
onDismiss={() => setFileRejectionErrors([])}
584+
dismissButtonAriaLabel="Close"
571585
styles={messageBarErrorStyles}
572586
>
573587
<div style={{ display: "flex", alignItems: "center" }}>
@@ -578,6 +592,7 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
578592
<div key={idx} style={{ marginLeft: "24px", marginTop: "2px" }}>{err}</div>
579593
))}
580594
</MessageBar>
595+
</div>
581596
)}
582597
{/* Show network error message bar if any file has error */}
583598
{uploadingFiles.some(f => f.status === 'error') && (

src/frontend/src/pages/batchView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ const BatchStoryPage = () => {
7373
const [selectedFileId, setSelectedFileId] = useState<string>("");
7474
const [expandedSections, setExpandedSections] = useState(["errors"]);
7575
const [batchSummary, setBatchSummary] = useState<BatchSummary | null>(null);
76-
const [selectedFileContent, setSelectedFileContent] = useState<string>("");
7776
const [selectedFileTranslatedContent, setSelectedFileTranslatedContent] = useState<string>("");
7877

7978

@@ -195,7 +194,6 @@ const BatchStoryPage = () => {
195194
const data = await response.json();
196195

197196
if (data) {
198-
setSelectedFileContent(data.content || "");
199197
setSelectedFileTranslatedContent(data.translated_content || "");
200198
}
201199

src/frontend/src/pages/modernizationPage.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ const ModernizationPage = () => {
497497
const [fileId, setFileId] = React.useState<string>("");
498498
const [expandedSections, setExpandedSections] = React.useState<string[]>([]);
499499
const [allFilesCompleted, setAllFilesCompleted] = useState(false);
500-
const [progressPercentage, setProgressPercentage] = useState(0);
501500
const [isZipButtonDisabled, setIsZipButtonDisabled] = useState(true);
502501
const [fileLoading, setFileLoading] = useState(false);
503502
const [lastActivityTime, setLastActivityTime] = useState<number>(Date.now());
@@ -1014,16 +1013,16 @@ useEffect(() => {
10141013
};
10151014
}, [handleWebSocketMessage]);
10161015

1017-
// Set a timeout for initial loading - if no progress after 30 seconds, show error
1016+
// Set a timeout for initial loading - if still loading after 30 seconds, show a warning message
10181017
useEffect(() => {
10191018
const loadingTimeout = setTimeout(() => {
1020-
if (progressPercentage < 5 && showLoading) {
1019+
if (showLoading) {
10211020
setLoadingError('Processing is taking longer than expected. You can continue waiting or try again later.');
10221021
}
10231022
}, 30000);
10241023

10251024
return () => clearTimeout(loadingTimeout);
1026-
}, [progressPercentage, showLoading]);
1025+
}, [showLoading]);
10271026

10281027
// Add timeout mechanism to navigate if no activity for 30 seconds
10291028
useEffect(() => {

src/tests/backend/sql_agents/convert_script_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async def test_convert_script_cleanup_always_runs(self):
187187
mock_sql_agents
188188
)
189189
except RuntimeError:
190-
pass
190+
pass # Expected exception; verifying cleanup below
191191

192192
# Cleanup should be called even on exception
193193
mock_comms_manager.cleanup.assert_called_once()

tests/e2e-test/pages/HomePage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class HomePage(BasePage):
5252
HARMFUL_FILE_2 = "//span[.='harmful_content_2 2.sql']"
5353

5454
def __init__(self, page):
55-
self.page = page
55+
super().__init__(page)
5656

5757
def navigate_to_base_url(self):
5858
"""

tests/e2e-test/pages/loginPage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class LoginPage(BasePage):
1111
PERMISSION_ACCEPT_BUTTON = "//input[@type='submit']"
1212

1313
def __init__(self, page):
14-
self.page = page
14+
super().__init__(page)
1515

1616
def authenticate(self, username, password):
1717
# login with username and password in web url

0 commit comments

Comments
 (0)