Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stateful Admin UI Alerts backend #3279

Open
martijnvdbrug opened this issue Dec 18, 2024 · 1 comment
Open

Stateful Admin UI Alerts backend #3279

martijnvdbrug opened this issue Dec 18, 2024 · 1 comment
Labels
design 📐 This issue deals with high-level design of a feature P4: low Non-critical, workarounds exist type: feature ✨

Comments

@martijnvdbrug
Copy link
Collaborator

martijnvdbrug commented Dec 18, 2024

Is your feature request related to a problem? Please describe.
I would like to make use of the Admin Ui Alerts / notifications feature in our plugins more, but it currently requires quite a bit of work to set up for each plugin.

I would like some of my plugins to push notifications to the admin in a generic way, where the admin can just click seen or something like this. Similar to how GitHub notifications work.

Use case example: Order failed to sync to Order Picking platform. Admin needs to look into address details.

Describe the solution you'd like
I would like all my customizations to be able to do something like adminAlertService.create(ctx, message, link, requiresPermisson) in the backend.

I imagine we have a simple entity named admin-alert.entity.ts and an Admin query adminAlerts() the gets the open/new alerts for the current administrator.

Describe alternatives you've considered
Make it as a plugin. This is possible, but each of our plugins would need some configurable strategy createAlert() to not be dependent on the alert-plugin. When it's in core, we don't need such a strategy.

❓ The question is really: Does this belong in Vendure Core? I would be willing to implement it, but I am still a bit in doubt if this should be in there.

@martijnvdbrug martijnvdbrug added the P4: low Non-critical, workarounds exist label Dec 18, 2024
@martijnvdbrug martijnvdbrug changed the title Admin UI Alerts backend Stateful Admin UI Alerts backend Dec 18, 2024
@michaelbromley
Copy link
Member

This is a feature I've been thinking about for a while, and I share your considerations about where exactly it belongs.

In core:

  • pro: all plugins can use it without depending on an external plugin
  • con: it could be considered out of scope since it specifically relates to the admin ui. Although the counter-argument here is that it is a general-purpose notification system for any admin interface, which is pretty strong.

In plugin:

  • pro: keeps core lean
  • con: more difficult for plugins to use. One pattern we could use is to have plugins export any notifications they want to expose, and then at the config level we pass those to the alert plugin. Similar to how email handlers or admin ui extensions work currently.

@michaelbromley michaelbromley added type: feature ✨ design 📐 This issue deals with high-level design of a feature labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design 📐 This issue deals with high-level design of a feature P4: low Non-critical, workarounds exist type: feature ✨
Projects
None yet
Development

No branches or pull requests

2 participants