Commit c2689e0b authored by David O'Regan's avatar David O'Regan

Merge branch '283889-fix-spacing-license-compliance-mr-widget' into 'master'

Fix License Compliance widget button spacing

See merge request gitlab-org/gitlab!54701
parents 88d45610 64bc3b13
...@@ -176,25 +176,27 @@ export default { ...@@ -176,25 +176,27 @@ export default {
</gl-link> </gl-link>
</div> </div>
</template> </template>
<div v-if="showActionButtons" slot="action-buttons" class="gl-mr-3"> <template v-if="showActionButtons" #action-buttons>
<a <div class="gl-display-flex gl-mr-3">
v-if="licenseManagementSettingsPath" <a
:class="{ 'gl-mr-3': fullReportPath }" v-if="licenseManagementSettingsPath"
:href="licenseManagementSettingsPath" :class="{ 'gl-mr-3': fullReportPath }"
class="btn btn-default btn-sm js-manage-licenses" :href="licenseManagementSettingsPath"
data-qa-selector="manage_licenses_button" class="btn btn-default btn-sm js-manage-licenses"
> data-qa-selector="manage_licenses_button"
{{ s__('ciReport|Manage licenses') }} >
</a> {{ s__('ciReport|Manage licenses') }}
<a </a>
v-if="fullReportPath" <a
:href="fullReportPath" v-if="fullReportPath"
target="_blank" :href="fullReportPath"
class="btn btn-default btn-sm js-full-report" target="_blank"
> class="btn btn-default btn-sm js-full-report"
{{ s__('ciReport|View full report') }} <gl-icon :size="16" name="external-link" /> >
</a> {{ s__('ciReport|View full report') }} <gl-icon :size="16" name="external-link" />
</div> </a>
</div>
</template>
</report-section> </report-section>
</div> </div>
</template> </template>
---
title: Fix License Compliance widget button spacing
merge_request: 54701
author:
type: other
...@@ -28,49 +28,3 @@ exports[`License Report MR Widget report section report body should render corre ...@@ -28,49 +28,3 @@ exports[`License Report MR Widget report section report body should render corre
</smart-virtual-list-stub> </smart-virtual-list-stub>
`; `;
exports[`License Report MR Widget report section should render correctly 1`] = `
<report-section-stub
class="license-report-widget mr-report"
component="LicenseIssueBody"
data-qa-selector="license_report_widget"
errortext="FOO"
hasissues="true"
loadingtext="FOO"
neutralissues="[object Object]"
popoveroptions="[object Object]"
resolvedissues=""
showreportsectionstatusicon="true"
status="SUCCESS"
successtext=""
unresolvedissues=""
>
<div
class="gl-mr-3"
>
<a
class="btn btn-default btn-sm js-manage-licenses gl-mr-3"
data-qa-selector="manage_licenses_button"
href="http://test.host/lm_settings"
>
Manage licenses
</a>
<a
class="btn btn-default btn-sm js-full-report"
href="http://test.host/path/to/the/full/report"
target="_blank"
>
View full report
<gl-icon-stub
name="external-link"
size="16"
/>
</a>
</div>
</report-section-stub>
`;
...@@ -68,7 +68,7 @@ describe('License Report MR Widget', () => { ...@@ -68,7 +68,7 @@ describe('License Report MR Widget', () => {
getters = defaultGetters, getters = defaultGetters,
state = defaultState, state = defaultState,
actions = defaultActions, actions = defaultActions,
stubs = {}, stubs = { ReportSection },
} = {}) => { } = {}) => {
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
...@@ -185,21 +185,6 @@ describe('License Report MR Widget', () => { ...@@ -185,21 +185,6 @@ describe('License Report MR Widget', () => {
}); });
describe('report section', () => { describe('report section', () => {
it('should render correctly', () => {
const mockReportGroups = [generateReportGroup()];
mountComponent({
getters: {
...defaultGetters,
licenseReportGroups() {
return mockReportGroups;
},
},
});
expect(wrapper.find(ReportSection).element).toMatchSnapshot();
});
describe('report body', () => { describe('report body', () => {
it('should render correctly', () => { it('should render correctly', () => {
const mockReportGroups = [generateReportGroup()]; const mockReportGroups = [generateReportGroup()];
...@@ -211,7 +196,6 @@ describe('License Report MR Widget', () => { ...@@ -211,7 +196,6 @@ describe('License Report MR Widget', () => {
return mockReportGroups; return mockReportGroups;
}, },
}, },
stubs: { ReportSection },
}); });
expect(wrapper.find({ ref: 'reportSectionBody' }).element).toMatchSnapshot(); expect(wrapper.find({ ref: 'reportSectionBody' }).element).toMatchSnapshot();
...@@ -234,7 +218,6 @@ describe('License Report MR Widget', () => { ...@@ -234,7 +218,6 @@ describe('License Report MR Widget', () => {
return mockReportGroups; return mockReportGroups;
}, },
}, },
stubs: { ReportSection },
}); });
expect(wrapper.findAll({ ref: 'reportHeading' })).toHaveLength( expect(wrapper.findAll({ ref: 'reportHeading' })).toHaveLength(
...@@ -259,7 +242,6 @@ describe('License Report MR Widget', () => { ...@@ -259,7 +242,6 @@ describe('License Report MR Widget', () => {
return mockReportGroups; return mockReportGroups;
}, },
}, },
stubs: { ReportSection },
}); });
expect(findAllReportItems()).toHaveLength(numberOfLicenses); expect(findAllReportItems()).toHaveLength(numberOfLicenses);
...@@ -280,7 +262,6 @@ describe('License Report MR Widget', () => { ...@@ -280,7 +262,6 @@ describe('License Report MR Widget', () => {
return mockReportGroups; return mockReportGroups;
}, },
}, },
stubs: { ReportSection },
}); });
const allReportItems = findAllReportItems(); const allReportItems = findAllReportItems();
...@@ -360,9 +341,7 @@ describe('License Report MR Widget', () => { ...@@ -360,9 +341,7 @@ describe('License Report MR Widget', () => {
const findSecurityApprovalHelpLink = () => wrapper.find('.js-security-approval-help-link'); const findSecurityApprovalHelpLink = () => wrapper.find('.js-security-approval-help-link');
it('does not show a link to security approval help page if report does not contain blacklisted licenses', () => { it('does not show a link to security approval help page if report does not contain blacklisted licenses', () => {
mountComponent({ mountComponent();
stubs: { ReportSection },
});
expect(findSecurityApprovalHelpLink().exists()).toBe(false); expect(findSecurityApprovalHelpLink().exists()).toBe(false);
}); });
...@@ -376,7 +355,6 @@ describe('License Report MR Widget', () => { ...@@ -376,7 +355,6 @@ describe('License Report MR Widget', () => {
}; };
mountComponent({ mountComponent({
getters, getters,
stubs: { ReportSection },
}); });
const securityApprovalHelpLink = findSecurityApprovalHelpLink(); const securityApprovalHelpLink = findSecurityApprovalHelpLink();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment