Skip to content

Conversation

@rusanpas
Copy link

@rusanpas rusanpas commented Dec 8, 2025

🚀 Feature: Add Toast Notifications for Custom Action Results

Summary
This Pull Request introduces the functionality to display toast notifications in the UI to inform the user about the success or failure of a custom action executed from the admin interface.

Motivation
Currently, when a user executes a custom action (e.g., "Ban User," "Process Order," "Send Email"), the action runs on the backend, but the user receives no immediate, visible feedback on the frontend confirming the outcome. This can lead to an uncertain user experience.

By implementing toast notifications, we can provide instant, non-intrusive feedback, improving the overall usability and clarity of custom actions.

Implementation Details

1. Backend changes

  • Created a flash function to store the message, with an optional title and a customizable color based on the message category (e.g., success, warning, info, danger).

  • Created a get_flash_messages function to retrieve the stored messages for use within the templates.

2. Frontend changes

  • Modified the list.html and edit.html templates to use the get_flash_messages function for displaying notifications.
  • The colors are defined by the category that corresponds to the Bootstrap style.

3. Samples screenshots

  • Toast error without title
   flash(
      request,
      "this is a error toast without title",
      category="danger",
  )
error
  • Toast error with title
   flash(
      request,
      "this is a error toast with title",
      category="danger",
      title = "Error"
  )
error_title
  • Toast success without title
   flash(
      request,
      "this is a success toast without title",
      category="danger",
  )
success
  • Toast info without title (default)
   flash(
      request,
      "this is a info toast without title",
  )
info

Copy link
Contributor

@mmzeynalli mmzeynalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALso add some screenshots of the result please

@rusanpas rusanpas requested a review from mmzeynalli December 10, 2025 11:35
@mmzeynalli mmzeynalli mentioned this pull request Dec 10, 2025
1 task
Copy link
Contributor

@mmzeynalli mmzeynalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @aminalaee

@oscarpvr
Copy link

Is there any estimated time for this feature? I'm interested in it.

@mmzeynalli
Copy link
Contributor

@aminalaee ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants