remove upload success alert
Some checks failed
Security Scan / security (pull_request) Successful in 40s
Test Suite / test (3.11) (pull_request) Successful in 1m25s
Test Suite / build (pull_request) Has been skipped
Security Scan / dependency-check (pull_request) Successful in 35s
Test Suite / lint (pull_request) Failing after 26s
Some checks failed
Security Scan / security (pull_request) Successful in 40s
Test Suite / test (3.11) (pull_request) Successful in 1m25s
Test Suite / build (pull_request) Has been skipped
Security Scan / dependency-check (pull_request) Successful in 35s
Test Suite / lint (pull_request) Failing after 26s
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
"Bash(uv add:*)"
|
"Bash(uv add:*)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": [],
|
||||||
|
"defaultMode": "acceptEdits"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -90,7 +90,7 @@ uv run python main.py
|
|||||||
|
|
||||||
The application follows a modular architecture for improved maintainability and testability:
|
The application follows a modular architecture for improved maintainability and testability:
|
||||||
|
|
||||||
```
|
```text
|
||||||
src/embeddingbuddy/
|
src/embeddingbuddy/
|
||||||
├── config/ # Configuration management
|
├── config/ # Configuration management
|
||||||
│ └── settings.py # Centralized app settings
|
│ └── settings.py # Centralized app settings
|
||||||
|
@@ -13,8 +13,6 @@ class DataProcessingCallbacks:
|
|||||||
Output("processed-data", "data", allow_duplicate=True),
|
Output("processed-data", "data", allow_duplicate=True),
|
||||||
Output("upload-error-alert", "children", allow_duplicate=True),
|
Output("upload-error-alert", "children", allow_duplicate=True),
|
||||||
Output("upload-error-alert", "is_open", allow_duplicate=True),
|
Output("upload-error-alert", "is_open", allow_duplicate=True),
|
||||||
Output("upload-success-alert", "children", allow_duplicate=True),
|
|
||||||
Output("upload-success-alert", "is_open", allow_duplicate=True),
|
|
||||||
],
|
],
|
||||||
Input("upload-data", "contents"),
|
Input("upload-data", "contents"),
|
||||||
State("upload-data", "filename"),
|
State("upload-data", "filename"),
|
||||||
@@ -22,7 +20,7 @@ class DataProcessingCallbacks:
|
|||||||
)
|
)
|
||||||
def process_uploaded_file(contents, filename):
|
def process_uploaded_file(contents, filename):
|
||||||
if contents is None:
|
if contents is None:
|
||||||
return None, "", False, "", False
|
return None, "", False
|
||||||
|
|
||||||
processed_data = self.processor.process_upload(contents, filename)
|
processed_data = self.processor.process_upload(contents, filename)
|
||||||
|
|
||||||
@@ -32,11 +30,8 @@ class DataProcessingCallbacks:
|
|||||||
{"error": processed_data.error},
|
{"error": processed_data.error},
|
||||||
error_message,
|
error_message,
|
||||||
True, # Show error alert
|
True, # Show error alert
|
||||||
"",
|
|
||||||
False, # Hide success alert
|
|
||||||
)
|
)
|
||||||
|
|
||||||
success_message = f"Successfully loaded {len(processed_data.documents)} documents from {filename or 'file'}"
|
|
||||||
return (
|
return (
|
||||||
{
|
{
|
||||||
"documents": [
|
"documents": [
|
||||||
@@ -46,8 +41,6 @@ class DataProcessingCallbacks:
|
|||||||
},
|
},
|
||||||
"",
|
"",
|
||||||
False, # Hide error alert
|
False, # Hide error alert
|
||||||
success_message,
|
|
||||||
True, # Show success alert
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@callback(
|
@callback(
|
||||||
|
@@ -12,7 +12,6 @@ class SidebarComponent:
|
|||||||
[
|
[
|
||||||
html.H5("Upload Data", className="mb-3"),
|
html.H5("Upload Data", className="mb-3"),
|
||||||
self.upload_component.create_error_alert(),
|
self.upload_component.create_error_alert(),
|
||||||
self.upload_component.create_success_alert(),
|
|
||||||
self.upload_component.create_data_upload(),
|
self.upload_component.create_data_upload(),
|
||||||
self.upload_component.create_prompts_upload(),
|
self.upload_component.create_prompts_upload(),
|
||||||
self.upload_component.create_reset_button(),
|
self.upload_component.create_reset_button(),
|
||||||
|
@@ -63,13 +63,3 @@ class UploadComponent:
|
|||||||
className="mb-3",
|
className="mb-3",
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def create_success_alert():
|
|
||||||
"""Create success alert component for successful uploads."""
|
|
||||||
return dbc.Alert(
|
|
||||||
id="upload-success-alert",
|
|
||||||
dismissable=True,
|
|
||||||
is_open=False,
|
|
||||||
color="success",
|
|
||||||
className="mb-3",
|
|
||||||
)
|
|
||||||
|
Reference in New Issue
Block a user