Skip to content

Commit 126481d

Browse files
committed
Added file names to success and fail messages
1 parent d52efa6 commit 126481d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/back-end/src/events/workspace_export_event.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def handle_workspace_export_feedback(data):
5656
- `status` (str): The status of the file export operation ("success" or "failure").
5757
- `uuid` (str): The unique identifier for the user's session.
5858
- `sid` (str): The session identifier used for emitting real-time feedback.
59+
- `fileName` (str): The name of the file that is being exported.
5960
6061
Emits:
6162
- Success message to the user's console if the status is "success".
@@ -68,14 +69,14 @@ def handle_workspace_export_feedback(data):
6869
if data["status"] == "success":
6970
socketio_emit_to_user_session(
7071
CONSOLE_FEEDBACK_EVENT,
71-
{"type": "succ", "message": "File export completed successfully."},
72+
{"type": "succ", "message": f"File '{data['fileName']}' export was completed successfully."},
7273
data["uuid"],
7374
data["sid"],
7475
)
7576
else:
7677
socketio_emit_to_user_session(
7778
CONSOLE_FEEDBACK_EVENT,
78-
{"type": "errr", "message": "File export failed."},
79+
{"type": "errr", "message": f"File '{data['fileName']}' export failed."},
7980
data["uuid"],
8081
data["sid"],
8182
)

app/front-end/src/features/editor/components/fileTreeView/fileTreeItem/fileTreeItemContextMenu.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ export const FileTreeItemContextMenu: React.FC<FileTreeItemContextMenuProps> = (
175175
link.click();
176176
window.URL.revokeObjectURL(url);
177177

178-
socket.emit(Events.WORKSPACE_EXPORT_FEEDBACK_EVENT, { uuid: getUUID(), sid: getSID(), status: 'success' });
178+
socket.emit(Events.WORKSPACE_EXPORT_FEEDBACK_EVENT, {
179+
uuid: getUUID(),
180+
sid: getSID(),
181+
status: 'success',
182+
fileName: item.id,
183+
});
179184
} catch (error) {
180185
socket.emit(Events.WORKSPACE_EXPORT_FEEDBACK_EVENT, { uuid: getUUID(), sid: getSID(), status: 'failure' });
181186
console.error('Error exporting file:', error);

0 commit comments

Comments
 (0)