Implement action/condition reordering with drag & drop

Created on 10 December 2019, almost 5 years ago
Updated 2 July 2024, 5 months ago

I'm addressing this issue in two parts (explained below).

The first part is to modify Rules core so that expressions have weights, and so that evaluation of expressions occurs in weight order. I have posted a patch for that in the Rules queue at #2648334-16: Implement action/condition reordering with drag & drop β†’ . That patch is very similar to what @yanniboi posted in that issue, but instead of explicitly sorting each time the expression is used (which puts the burden on the using code and requires a lot of code duplication) I put the sorting into the ExpressionContainerBase so that the using code is automatically returned a sorted array with no extra work required.

The second part is to modify the UI to make use of weights. This means implementing tabledrag on the Reaction Rule and Rules Component edit forms, as well as saving the weights when those forms are saved. I am providing this part as a patch here because this module has a much-improved UI for Rules that I will be moving into Rules proper over the next few months. It would be a lot more work for me to implement this part in both the current Rules UI and in the new UI, and I don't think the extra effort is worth it.

So to fully test this feature you will need to apply the patch here in this issue AND you will need to use the patch to Rules from #2648334-16: Implement action/condition reordering with drag & drop β†’

✨ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024