Commit 06baa844 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '7073-remove-status-text-in-the-mr-widget-license-report' into 'master'

Resolve "Remove status text in the MR widget license report"

Closes #7073

See merge request gitlab-org/gitlab-ee!6802
parents 5dd9f54d d490dcb4
<script>
import { mapActions } from 'vuex';
import { s__ } from '~/locale/index';
import LicensePackages from './license_packages.vue';
import { LICENSE_APPROVAL_STATUS } from '../constants';
export default {
name: 'LicenseIssueBody',
......@@ -14,25 +12,12 @@ export default {
required: true,
},
},
computed: {
status() {
switch (this.issue.approvalStatus) {
case LICENSE_APPROVAL_STATUS.APPROVED:
return s__('LicenseManagement|Approved');
case LICENSE_APPROVAL_STATUS.BLACKLISTED:
return s__('LicenseManagement|Blacklisted');
default:
return s__('LicenseManagement|Unapproved');
}
},
},
methods: { ...mapActions(['setLicenseInModal']) },
};
</script>
<template>
<div class="report-block-info license-item">
<span class="append-right-5">{{ status }}:</span>
<button
class="btn-blank btn-link append-right-5"
type="button"
......
---
title: Removes status text from licence reports
merge_request: 6802
author:
type: changed
import Vue from 'vue';
import LicenseIssueBody from 'ee/vue_shared/license_management/components/license_issue_body.vue';
import { LICENSE_APPROVAL_STATUS } from 'ee/vue_shared/license_management/constants';
import { trimText } from 'spec/helpers/vue_component_helper';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import createStore from 'ee/vue_shared/license_management/store';
......@@ -22,42 +21,6 @@ describe('LicenseIssueBody', () => {
vm.$destroy();
});
describe('computed', () => {
describe('status', () => {
it('returns correct status for Approved licenses', done => {
vm.issue = { ...vm.issue, approvalStatus: LICENSE_APPROVAL_STATUS.APPROVED };
Vue.nextTick()
.then(() => {
expect(vm.status).toBe('Approved');
})
.then(done)
.catch(done.fail);
});
it('returns correct status for Blacklisted licenses', done => {
vm.issue = { ...vm.issue, approvalStatus: LICENSE_APPROVAL_STATUS.BLACKLISTED };
Vue.nextTick()
.then(() => {
expect(vm.status).toBe('Blacklisted');
})
.then(done)
.catch(done.fail);
});
it('returns correct status for Unapproved licenses', done => {
vm.issue = { ...vm.issue, approvalStatus: undefined };
Vue.nextTick()
.then(() => {
expect(vm.status).toBe('Unapproved');
})
.then(done)
.catch(done.fail);
});
});
});
describe('interaction', () => {
it('clicking the button triggers openModal with the current license', () => {
const linkEl = vm.$el.querySelector('.license-item > .btn-link');
......
......@@ -3940,9 +3940,6 @@ msgstr ""
msgid "LicenseManagement|URL"
msgstr ""
msgid "LicenseManagement|Unapproved"
msgstr ""
msgid "LicenseManagement|You are about to remove the license, %{name}, from this project."
msgstr ""
......
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