[License Compliance MR Widget Extension] - Frontend - Use dedicated API endpoint for collapsed/uncollapsed state
As a follow up to #338281 (closed) we want to optimize the use of the reduced endpoint data to load only the counts for the collapsed state.
UX changes
None
Collapsed
Uncollapsed
Summary of change
The MR widget extension receives two endpoints. One for the collapsed state, and one for the expanded state. We currently use the same endpoint for both. Ideally, we should only load the initial summary version of the data that simply contains the license counts for new licenses
Implementation Plan
-
Build on the changes in !75341 (merged)
-
Will need to pass in the new endpoint path all the way from the HAML template in
ee/app/views/projects/merge_requests/show.html.haml
and consume inee/app/assets/javascripts/vue_merge_request_widget/stores/mr_widget_store.js
andee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js
-
Update
fetchCollapsedData
inee/app/assets/javascripts/vue_merge_request_widget/extensions/license_compliance/index.js
to consume counts from new endpoint. -
Ensure both
fetchCollapsedData
andfetchFullData
to usepollUntilComplete
to handle 204 status codes while pipeline is running and/or parsing results. For reference use: https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/assets/javascripts/vue_shared/license_compliance/store/actions.js#L90 -
Update unit tests
Testing
Frontend engineer to update unit tests. SET to update Browser level tests to test for collapsed / expanded states.