lightning icon indicating copy to clipboard operation
lightning copied to clipboard

Delegate menu customization and create menu components

Open jyeshe opened this issue 1 year ago • 1 comments

Validation Steps

Feature tests available on umbrella app. Regression tests:

  1. Run Lightning.
  2. Select user profile on upper right corner. The menu items on the left should be the same as before: User Profile, Credentials and API Tokens
  3. Select each of these menu items from 2 and the menu items are unchanged.
  4. Select one project on the dropdown. The expected menu items are the same as before: Workflows, History and Settings
  5. Select each of these menu items from 4 and the menu items are unchanged.

Notes for the reviewer

This PR preserves the logic to render Lightning menu items while allows a component from umbrella to use a different menu. The projects dropdown and other set of inline menu items from LightningWeb.LayoutComponents.menu_items/1 were moved to LightningWeb.Components.Menu so that they can be reused.

Related issue

Fixes #1988

Review checklist

  • [x] I have performed a self-review of my code
  • [x] I have verified that all appropriate authorization policies (:owner, :admin, :editor, :viewer) have been implemented and tested
  • [x] If needed, I have updated the changelog
  • [ ] Product has QA'd this feature

jyeshe avatar May 22 '24 17:05 jyeshe

Codecov Report

Attention: Patch coverage is 96.49123% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 89.60%. Comparing base (2e3abe8) to head (7d3f06b).

Files Patch % Lines
lib/lightning_web/live/components/menu.ex 95.74% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2131      +/-   ##
==========================================
+ Coverage   89.59%   89.60%   +0.01%     
==========================================
  Files         268      268              
  Lines        8941     8940       -1     
==========================================
  Hits         8011     8011              
+ Misses        930      929       -1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 23 '24 10:05 codecov[bot]