Skip to content

[License Compliance MR Widget Extension] - Frontend - Implement missing MR widget link buttons to reports and manage licenses page by consuming MR widget extension API

Description

The current MR Widget extension spec does not support adding buttons in the header. Adding support to the core extension framework will be tracked in a separate issue and will be marked as blocking this issue.

This issue covers the work to consume the the MR Widget Extension API and add the needed buttons.

Note

We may end up closing this issue if the WorkingGroupMergeRequestReportWidgets decides not to support additional buttons in the Widget header

Implementation Plan

  • Blocked, and TBD based on IF and HOW the API is implemented in the core widget extension

What we have

Screen_Shot_2022-03-16_at_12.01.40_AM

What we would implement

license_compliance_v13_0_buttons

Implementation Plan

We need to pass the report paths down from the backend.

    tertiaryButtons() {
      return [{
        text: 'Manage Licenses',
        href: this.manageLicensePath,
        target: '_blank', // Optional
      },{
        text: 'Full Report',
        href: this.licensesFullReportPath,
        target: '_blank', // Optional
      }]
    }
  expose :manage_liceses_path do |merge_request|
    if merge_request.has_license_scanning_reports?
      <manage_licenses_path>(merge_request.project, merge_request, format: :json)
    end
  end

  expose :licenses_full_report_path do |merge_request|
    if merge_request.has_license_scanning_reports??
      <licenses_full_report_path>(merge_request.project, merge_request, format: :json)
    end
  end

Testing

SET to update License Compliance MR Widget E2E UI test

Edited by Will Meek