Detail view renders legacy issue view for unsupported work item types

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) -- we're here 👈
  • 👷 List view
    • 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)

Relates to Cleanup unused references of support_bot in fea... (#509629)

Detail view renders legacy issue view for unsupported work item types

Service Desk issues and legacy incidents are not fully migrated to the work items framework yet and so should not render the work item detail view, even if the user preference use_work_items_view is set to true.

Because the user preference is hidden behind a feature flag we don't consider this a feature change.

Changelog: other

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.

Detail

With new issue look = off:

Before After
(Please ignore the red test divs 😆) Screen_Recording_2024-12-06_at_15.41.11 No change 👍

With new issue look = on:

Before After
Screen_Recording_2024-12-06_at_15.59.00 Screen_Recording_2024-12-12_at_17.11.40

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 loads the legacy detail view. Then reload the detail view and see it uses the same view. Browse back and select the next item.

  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. Reload the page and see it still uses the work items detail view.

  11. See that the feedback badge is visible.

  12. Go back to the issue list.

  13. Select the incident. This should use the router (no hard reload) and render the work items detail view. Reload the page and see it uses the legacy detail view. (list changes will be made in separate MR)

  14. Go back to the issue list.

  15. Select the Service Desk issue. This should use the router (no hard reload) and render the work items detail view. Reload the page and see it uses the legacy detail view. (list changes will be made in separate MR)

Edited by Marc Saleiko

Merge request reports

Loading