Ensure legacy types use full page reload from work items list

Feature context

This MR is part of a series of MRs that will ensure we always load the legacy views for incidents and Service Desk issues until they're migrated to work items (or we created all missing widgets). There's a POC that I'll update regularly that contains all workflow paths.

  • 👷 Detail view of unsupported types uses legacy view (no matter the user preference)
  • 🎯 List view -- we're here 👈
    • Do the full page load for unsupported types (and load legacy view)
    • Don't open the drawer (behind FF) and instead do the full page load for unsupported types
  • Work items feedback badge not visible on detail page of unsupported types
  • New route
    • Add type selection to work items new modal (so users can continue to create incidents from issue list)
    • 👷 Add missing widgets to incidents (that already exist)
    • Open work items new modal from incidents list with preselected type (no type selection)

What does this MR do and why?

Contributes to Ensure incidents and Service Desk issues use le... (#502823 - closed)

Ensure legacy types use full page reload from work items list

Incidents and Service Desk issues should continue to use the legacy issue detail view even after setting the user preference use_work_items_view to true.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

With feature flag 🎏 :issues_list_drawer = off:

With new issue look = off:

Before After
Screen_Recording_2024-12-17_at_14.38.00 No change 👍

With new issue look = on:

Before After
Screen_Recording_2024-12-17_at_14.45.32 Screen_Recording_2024-12-17_at_14.47.58

With feature flag 🎏 :issues_list_drawer = on:

With new issue look = off:

Before After
Screen_Recording_2024-12-17_at_14.43.02 No change 👍

With new issue look = on:

Before After
Same as above ☝️ Screen_Recording_2024-12-17_at_14.50.43

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

In order to test everything we need to create a few records.

  1. Select a project (by default flightjs) and create a Service Desk issue and an incident. Note that incidents are already work items under the hood but use legacy list and show views.

    user = User.find_by(username: 'root') # Adjust to your local username. Root is id 1
    project = Project.find(7) # Or select another project. Get the id from the project general settings page
    
    ::Issues::CreateService.new(
      container: project,
      current_user: Users::Internal.support_bot,
      params: {
        title: 'Service Desk issue',
        description: 'Easy to spot Service Desk issue',
        confidential: true,
        external_author: 'user@example.com'
      },
      perform_spam_check: false
    ).execute
    
    ::WorkItems::CreateService.new(
      container: project,
      current_user: user,
      params: {
        title: 'Incident',
        description: 'Easy to spot Incident',
        work_item_type: ::WorkItems::Type.find_by(base_type: 1) # incident
      },
      widget_params: {}
    ).execute
  2. Create a regular issue (or reuse an existing one from the seeds)

  3. Enable the feature flag work_items_view_preference

    Feature.enable(:work_items_view_preference)
  4. Browse to http://127.0.0.1:3000/flightjs/Flight/-/issues (change to your selected project)

  5. Ensure the new issue look is turned off.

  6. Make sure you can see at least one regular issue, the Service Desk issue and an incident in the list view.

  7. Now select each of them, see it performs a full page load (current behavior).

  8. Ensure new issue look is turned on.

  9. Browse to http://127.0.0.1:3000/flightjs/Flight/-/issues (change to your selected project).

  10. Select the issue. This should use the router (no hard reload) and render the work items detail view.

  11. Go back to the issue list.

  12. Select the incident. The browser should perform a full page load. (until !175109 (merged) wasn't merged this will correctly show the work item view)

  13. Go back to the issue list.

  14. Select the Service Desk issue. The browser should perform a full page load. (until !175109 (merged) wasn't merged this will correctly show the work item view)

  15. Enable the feature flag :issues_list_drawer via the console or via http://127.0.0.1:3000/rails/features:

    Feature.enable(:issues_list_drawer)
  16. Browse to http://127.0.0.1:3000/flightjs/Flight/-/issues (change to your selected project)

  17. Ensure the new issue look is turned off.

  18. Make sure you can see at least one regular issue, the Service Desk issue and an incident in the list view.

  19. Now select each of them, see the item opens in the drawer (current behavior).

  20. Ensure new issue look is turned on.

  21. Browse to http://127.0.0.1:3000/flightjs/Flight/-/issues (change to your selected project).

  22. Select the issue. The item should open in the drawer and render the work items detail view.

  23. Go back to the issue list.

  24. Select the incident. The browser should perform a full page load. (until !175109 (merged) wasn't merged this will correctly show the work item view)

  25. Go back to the issue list.

  26. Select the Service Desk issue. The browser should perform a full page load. (until !175109 (merged) wasn't merged this will correctly show the work item view)

Edited by Marc Saleiko

Merge request reports

Loading