Commit b97227f8 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch 'remove-free-user-info-non-ultimate-license' into 'master'

Remove free user info from non-ultimate license

Closes #11790

See merge request gitlab-org/gitlab-ee!14010
parents 2d8555c4 12cf16e5
......@@ -47,6 +47,11 @@ export default {
},
};
},
computed: {
seatsInUseComponent() {
return this.license.plan === 'ultimate' ? 'info-cell' : 'cell';
},
},
methods: {
licenseeValue(key) {
return this.license.licensee[key] || __('Unknown');
......@@ -68,7 +73,8 @@ export default {
<div class="license-row d-flex">
<header-cell :title="__('Usage')" icon="monitor" />
<cell :title="__('Seats in license')" :value="license.userLimit || __('Unlimited')" />
<info-cell
<component
:is="seatsInUseComponent"
:title="__('Seats currently in use')"
:value="currentActiveUserCount"
:popover-content="info.currentActiveUserCount"
......
---
title: Remove free user info from non-ultimate license
merge_request: 14010
author:
type: fixed
......@@ -97,6 +97,104 @@ exports[`LicenseCardBody renders a license card body 1`] = `
</div>
`;
exports[`LicenseCardBody renders a license card body without free user info for non-ultimate licenses 1`] = `
<div
class="card-body license-card-body p-0"
>
<div
class="license-table js-license-table"
>
<div
class="license-row d-flex"
>
<headercell-stub
icon="monitor"
title="Usage"
/>
<cell-stub
isflexible="true"
title="Seats in license"
value="10"
/>
<cell-stub
isflexible="true"
popover-content="Users with a Guest role or those who don't belong to any projects or groups don't count towards seats in use."
title="Seats currently in use"
value="10"
/>
<infocell-stub
popovercontent="This is the maximum number of users that have existed at the same time since the license started. This is the minimum number of seats you will need to buy when you renew your license."
title="Max seats used"
value="20"
/>
<infocell-stub
popovercontent="GitLab allows you to continue using your license even if you exceed the number of seats you purchased. You will be required to pay for these seats when you renew your license."
title="Users outside of license"
value="5"
/>
</div>
<div
class="license-row d-flex"
>
<headercell-stub
icon="calendar"
title="Validity"
/>
<datecell-stub
datenow="2017/10/10"
title="Start date"
value="2013/10/10"
/>
<datecell-stub
datenow="2017/10/10"
isexpirable="true"
title="End date"
value="2015/10/10"
/>
<datecell-stub
datenow="2017/10/10"
title="Uploaded on"
/>
</div>
<div
class="license-row d-flex"
>
<headercell-stub
icon="user"
title="Registration"
/>
<cell-stub
isflexible="true"
title="Licensed to"
value="Jon Dough"
/>
<cell-stub
isflexible="true"
title="Email address"
value="email@address.tanuki"
/>
<cell-stub
isflexible="true"
title="Company"
value="TanukiVille"
/>
</div>
</div>
</div>
`;
exports[`LicenseCardBody renders a loading state if isRemoving 1`] = `
<div
class="card-body license-card-body p-0"
......
......@@ -5,6 +5,7 @@ describe('LicenseCardBody', () => {
let wrapper;
const defaultProps = {
license: {
plan: 'ultimate',
userLimit: 10,
historicalMax: 20,
overage: 5,
......@@ -20,8 +21,10 @@ describe('LicenseCardBody', () => {
currentActiveUserCount: 10,
};
function createComponent(props) {
const propsData = Object.assign({}, defaultProps, props);
function createComponent(props = {}) {
let propsData = props;
propsData.license = Object.assign({}, defaultProps.license, props.license || {});
propsData = Object.assign({}, defaultProps, props);
wrapper = shallowMount(LicenseCardBody, {
propsData,
......@@ -43,6 +46,12 @@ describe('LicenseCardBody', () => {
expect(wrapper.element).toMatchSnapshot();
});
it('renders a license card body without free user info for non-ultimate licenses', () => {
createComponent({ license: { plan: 'premium' } });
expect(wrapper.element).toMatchSnapshot();
});
it('renders a loading state if isRemoving', () => {
createComponent({ isRemoving: true });
......
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