Move feature flag checks inside classes

What does this MR do and why?

Fix epic hierarchy cleanup behavior during work item moves

What does this MR do and why?

This MR fixes an issue where moved work items remained visible in their original parent epic, causing duplicate visibility. When a work item is moved, we create a duplicate in the new location, but the original was not being properly cleaned up from its parent epic.

The fix moves the cleanup_data_source_work_item_data feature flag check from the handler level down to individual widget classes. This allows us to:

  • Clean up the parent-child relationship for epic hierarchies specifically
  • Maintain the existing behavior for other widget types
  • Provide more granular control over the cleanup process

Changes made

  1. Moved feature flag check to widget level: The cleanup_data_source_work_item_data? method is now implemented in the base widget class and checked within each widget's post_move_cleanup method
  2. Updated cleanup logic: The hierarchy widget now properly removes parent links when feature flag is enabled
  3. Maintained backwards compatibility: All widgets respect the feature flag to ensure no unexpected behavior changes

Testing

All existing tests have been updated to cover both feature flag states (enabled/disabled) to ensure the behavior works as expected in both scenarios.

Related issues

When moving issues from one project to another ... (#549444 - closed)

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

  1. Create issue in some epic
  2. Move issue to different project
  3. Observe epic: it should only contain the newly created issue
  4. Old issue should be close and parent-less.

Related to #549444 (closed)

Edited by Gosia Ksionek

Merge request reports

Loading