Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Starshot should include ECA, to allow custom business logic to be implemented in the admin UI #99

Closed
mandclu-acquia opened this issue May 28, 2024 · 8 comments · Fixed by #114

Comments

@mandclu-acquia
Copy link

In the same way that the goal for Experience Builder is for site builders to fully customize their theme without having to write and upload files to the site, the popular ECA module allows site builders to customize the business logic of their site using BPMN.io as a visual interface.

The growing community around the ECA ecosystem has also defined a robust library of existing models that can be used as a starting point, and there is discussion about converting them to recipes.

I propose that Starshot should require the following modules in the composer.json file:

  • drupal/eca
  • drupal/bpmn_io
  • drupal/eca_webform (assuming webform will stay in Starshot)

There could also be one or more recipes included to set up a model, for example to use ECA to send email notifications during specific changes in the content moderation workflow.

@jurgenhaas
Copy link
Contributor

I second that proposal and want to bring 2 more modules to the list for consideration, similar to the eca_webform suggestion from @mandclu-acquia :

  • drupal/eca_tamper: this is a pretty popular ECA addon as it allows tampering of data pretty nicely. However, the downside may be that the required API module drupal/tamper is still in alpha. As it seems to be in good shape, we could reach out to its maintainers and ask for a stable release, though.
  • drupal/eca_metatag: this may make sense as the drupal/metatag module is also already included.

When it comes to the library, also mentioned above by @mandclu-acquia , I'd suggest to only use them as recipes and not the provided archives. The latter have been a "dirty hack" from more than 2 years ago, and they wanted to fill in until something like recipe was available, which is the case now. So, as soon as Drupal 10.3 is available, the importable archives are likely to disappear silently and only recipes should be supported then. The missing ones will be converted from archive to recipe very soon anyways.

@phenaproxima
Copy link
Owner

I'm certainly in favor of adding ECA, but only when there's a recipe that uses it to deliver something useful and tangible. We shouldn't add the plumbing until we need it for a user-facing feature. :)

@jurgenhaas
Copy link
Contributor

This is a great approach @phenaproxima. I'd be happy to provide a set of recipes. The following list seems to be of general interest to the Starshot audience, subject to be extended:

  • Notification about new comments.
  • Notification about new content.
  • Notification about publish/unpublish status change of content.
  • Notification about content moderation status change.
  • Scheduled status changes.
  • Redirect after login depending upon user role, e.g. admins go to a dashboard, content editors go to content overview, others go to their user profile.
  • Automatic assignment or removal of an internal role to users, depending upon the domain of their email address.
  • to be continued

When it comes to notifications, they would be sent by email and go to the email address configured in /admin/config/system/site-information, until recipes allow for user input when they are applied, then we can ask for individual addresses from the site owner.

Other notification channels (Slack, Discord, etc.) would also be possible, but that's probably something for later.

@gitressa
Copy link
Contributor

Sounds great @jurgenhaas, I am ready to test a PR, as soon as it's ready.

@phenaproxima
Copy link
Owner

That all sounds good, but let's do this in smaller chunks.

How about we only implement one case (notifications of new comments), to start with? Let's do that directly in the starshot_blog recipe, since that enables commenting on blog posts. Seems like a natural place to add notifications for comments.

I'm not sure notifications should go to the site email, though; why not send them to the author of the blog post?

If you want to do a PR of that functionality only, I would love to take a look!

@jurgenhaas
Copy link
Contributor

Sure, starting with a single one to see how it goes, we can then add others step by step.

The notification on comment recipe already exists, please have a look at https://gitlab.lakedrops.com/drupal/recipes/notify_new_comments

This is currently sending to the site email, but I like your idea of the node author and will add that too. Will ping you when it's available.

@jurgenhaas
Copy link
Contributor

The above recipe is now available as v2 which notifies both, the site owner and the content author.

Note 1: The site needs to be properly configured to be able to send emails, that's not part of the recipe.

Note 2: I'm now starting the PR for adding this to the project here.

@mandclu
Copy link
Contributor

mandclu commented Jun 22, 2024

I've added #115 to propose including a recipe to set up the site to send HTML emails. Happy to work on it if there's agreement it would be worth including.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants