Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem: if I modify a rule there is no way I can undo/cancel my changes.
Solution: we should implement a cancel button like views_ui does which just deletes the modified rule from the temporary storage. Then it is in its original state again.
Comments
Comment #2
dasjoComment #3
KiranJoshi CreditAttribution: KiranJoshi as a volunteer and commentedComment #4
KiranJoshi CreditAttribution: KiranJoshi as a volunteer and commentedSubmitted pull request
https://github.com/fago/rules/pull/363
Comment #5
Sentei CreditAttribution: Sentei commentedComment #6
Sentei CreditAttribution: Sentei commentedThe cancel button works, the temporary changes are deleted when cancel is being clicked.
Comment #7
klausiCan you add a Functional test to TempStorageTest to check that the cancel button works? I think a new test method there should demonstrate that the cancel button works.
Comment #8
markie CreditAttribution: markie at Mediacurrent commentedAdded PR https://github.com/fago/rules/pull/370 to insert test as requested. Had to add result text to test.
Comment #9
dasjoComment #10
KiranJoshi CreditAttribution: KiranJoshi as a volunteer and commentedAdded Tests for:
* Clicking cancel displays the text "Canceled"
* Clicking cancel returns to the main Rules screen
* Clicking cancel does not cancel temporary changes if another user is editing and has lock the rule
I'm not sure if more tests should be added to verify the temp storage is actually removed.
PR https://github.com/fago/rules/pull/371
Comment #11
fagoThanks, I think that's fine as test coverage for now! Committed.
While testing I ran into #2659806: Warnings when adding an action, but that does not seem to be related to this change.
Comment #13
klausiThe test case added here was a bit wrong, I fixed it in #2659954: TempStorageTest::testLocking has random fails.