Skip to content

Commit d072b5c

Browse files
Remove unused type definitions and improve error handling in API utility functions
1 parent 2a6c2bf commit d072b5c

File tree

5 files changed

+7
-36
lines changed

5 files changed

+7
-36
lines changed

src/ContentProcessorWeb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@types/node": "^22.15.0",
6262
"@types/react": "^19.2.14",
6363
"@types/react-dom": "^19.2.3",
64-
"@types/react-router-dom": "^5.3.3",
64+
6565
"@types/react-virtualized": "^9.22.3",
6666
"@types/react-window": "^2.0.0",
6767
"customize-cra": "^1.0.0",

src/ContentProcessorWeb/pnpm-lock.yaml

Lines changed: 0 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ContentProcessorWeb/src/Pages/DefaultPage/PanelCenter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const PanelCenter: React.FC<PanelCenterProps> = ({ togglePanel }) => {
183183
}
184184
}
185185
// Only fetch for document selection
186-
if (store.selectionType === 'document' && (store.activeProcessId != null || store.activeProcessId !== '') && !status.includes(store.selectedItem.status as string) && store.selectedItem?.process_id === store.activeProcessId) {
186+
if (store.selectionType === 'document' && (store.activeProcessId != null && store.activeProcessId !== '') && !status.includes(store.selectedItem.status as string) && store.selectedItem?.process_id === store.activeProcessId) {
187187
fetchContent();
188188
}
189189
}, [store.activeProcessId, store.selectedItem, store.selectionType, store.refreshTrigger])
@@ -291,7 +291,7 @@ const PanelCenter: React.FC<PanelCenterProps> = ({ togglePanel }) => {
291291
try {
292292
dispatch(startLoader("1"));
293293
dispatch(setUpdateComments(comment))
294-
const result = await dispatch(saveContentJson({ 'processId': store.activeProcessId, 'contentJson': store.modified_result as unknown as string, 'comments': comment, 'savedComments': store.comments }))
294+
const result = await dispatch(saveContentJson({ 'processId': store.activeProcessId, 'contentJson': JSON.stringify(store.modified_result), 'comments': comment, 'savedComments': store.comments }))
295295
if (result?.type === 'SaveContentJSON-Comments/fulfilled') {
296296
dispatch(setRefreshGrid(true));
297297
}

src/ContentProcessorWeb/src/Services/httpUtility.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export const handleApiThunk = async <T>(
5252
if (response.status === 200 || response.status === 202) {
5353
return response.data as T;
5454
} else {
55-
return rejectWithValue(`${errorMessage}. Status: ${response.status}`) as T;
55+
return rejectWithValue(`${errorMessage}. Status: ${response.status}`);
5656
}
5757
} catch (error: unknown) {
5858
const apiError = error as ApiError;
5959
if (apiError.status === 415 || apiError.status === 404) {
60-
return rejectWithValue(apiError.data?.message || `Unexpected error: ${errorMessage}`) as T;
60+
return rejectWithValue(apiError.data?.message || `Unexpected error: ${errorMessage}`);
6161
}
62-
return rejectWithValue(apiError.message || `Unexpected error: ${errorMessage}`) as T;
62+
return rejectWithValue(apiError.message || `Unexpected error: ${errorMessage}`);
6363
}
6464
};
6565

tests/e2e-test/pages/HomePageV2.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,6 @@ def validate_source_document_visible(self):
491491
logger.info("Starting Source Document pane validation...")
492492

493493
logger.info("Validating Source Document pane has content...")
494-
_source_doc_pane = self.page.locator(
495-
"//div[contains(text(),'Source Document')]/ancestor::div[1]/following-sibling::*"
496-
)
497494

498495
# Verify "No document available" is NOT shown
499496
no_data = self.page.locator(self.SOURCE_DOC_NO_DATA)
@@ -1139,7 +1136,7 @@ def upload_files_with_mismatched_schemas(self):
11391136
"repair_estimate.pdf": "Auto Insurance Claim Form",
11401137
}
11411138

1142-
_dialog = self.open_import_dialog_with_files()
1139+
self.open_import_dialog_with_files()
11431140

11441141
# Select mismatched schemas for each file
11451142
files = self.get_testdata_files()
@@ -1195,7 +1192,6 @@ def validate_schema_dropdown_after_file_removal(self):
11951192

11961193
# Try to remove the first file using the delete/remove button next to it
11971194
logger.info("Attempting to remove first file from the list...")
1198-
_file_labels = dialog.locator("strong")
11991195
first_file_name = os.path.basename(files[0])
12001196

12011197
# Look for a delete/remove button near the first file entry

0 commit comments

Comments
 (0)