Problem/Motivation

The "Discard changes" form currently has an "Include dependencies" checkbox. When checked, the changes made to the dependent entities are also discarded. It would be good to list the dependencies down and allow the user to select if they were to keep changes to certain dependencies.

User interface changes

Add list of dependent entities and allow the user to "unselect" any discard option for a dependency.

API changes

The Drupal\wse\WseWorkspaceAssociation::gatherAffectedDependencies needs to be made public with some changes.

CommentFileSizeAuthor
#11 3548237-without-ajax.diff25.99 KBajits
#11 2025-10-07_13-31.png42.94 KBajits

Issue fork wse-3548237

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ajits created an issue. See original summary.

ajits’s picture

Status: Active » Needs review

Created a MR.

ajits’s picture

Assigned: Unassigned » ajits
Status: Needs review » Needs work

Looking at the test failures.

ajits’s picture

Assigned: ajits » Unassigned
Status: Needs work » Needs review

It looks like other MRs had the same failures. So, this seems unrelated to the issue.

ajits’s picture

All raised issues were addressed. This is ready for another review. Thanks!

alecsmrekar’s picture

Status: Needs review » Reviewed & tested by the community

Looks great!

ajits’s picture

Title: Allow uses to selectively discard the dependencies » Allow users to selectively discard the dependencies

amateescu made their first commit to this issue’s fork.

ajits’s picture

@amateescu - The changes you've made work great! I should have mentioned that I tried going through the AJAX route too. However, it took a lot of time for the dependencies to load me on the project I was working on. So, I decided to opt for getting the dependencies on form load. Seemed better for the UX. I will try to get some numbers.

ajits’s picture

StatusFileSize
new42.94 KB
new25.99 KB

I did some profiling and found that the time taken to load the dependencies with and without AJAX is about the same.

There are other function calls without AJAX pushing up the total time. So, not a huge difference in terms of performance gain. However, the difference will happen when the user clicks the "Include dependencies" checkbox, unchecks it, and then checks it again. This will cause the AJAX to fire again and take about the same time to gather and list the dependencies.

I am also adding the patch I used it is from the commits I've made and the merge from 2.0.x branch.

P.S - I did not attach detailed report of profiling as there were no notable difference.

ajits’s picture

  • amateescu committed a9679401 on 3.0.x authored by ajits
    feat: #3548237 Allow users to selectively discard the dependencies
    
    By:...

  • amateescu committed cc9d26fa on 2.0.x authored by ajits
    feat: #3548237 Allow users to selectively discard the dependencies
    
    By:...
amateescu’s picture

Version: 2.0.x-dev » 3.0.x-dev
Status: Reviewed & tested by the community » Fixed

Merged into 3.0.x and cherry-picked to 2.0.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.