Skip to content
Snippets Groups Projects
Unverified Commit e06cb80e authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett Committed by Luke Bennett
Browse files

Simplify admin instance licenses page

Displays all licenses on the admin license
page.
Allows for downloading and delete previous
licenses.
parent 9b58a431
No related branches found
No related tags found
No related merge requests found
Showing
with 372 additions and 0 deletions
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SkeletonCell renders a skeleton cell with a title and value loading bar 1`] = `
<cell-stub
isflexible="true"
>
<glskeletonloading-stub
class="w-75 skeleton-bar"
lines="1"
/>
<glskeletonloading-stub
class="w-50 skeleton-bar"
lines="1"
/>
</cell-stub>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`SkeletonHeaderCell renders a skeleton cell with a single title loading bar 1`] = `
<cell-stub
class="license-header-cell"
>
<glskeletonloading-stub
class="w-75 skeleton-bar"
lines="1"
/>
</cell-stub>
`;
import { shallowMount } from '@vue/test-utils';
import { Cell } from 'ee/licenses/components/cells';
describe('Cell', () => {
let wrapper;
const defaultProps = {
title: 'title',
value: 'value',
};
function createComponent(props, slots) {
const propsData = Object.assign({}, defaultProps, props);
wrapper = shallowMount(Cell, {
propsData,
slots,
});
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a string value and title through props', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
it('renders a number value and title through props', () => {
createComponent({ value: 100 });
expect(wrapper.element).toMatchSnapshot();
});
it('renders value and title slots that override props', () => {
createComponent(null, { title: '<h1>tanuki</h1>', value: '<marquee>party</marquee>' });
expect(wrapper.element).toMatchSnapshot();
});
it('renders an inflexible variant', () => {
createComponent({ isFlexible: false });
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount } from '@vue/test-utils';
import { DateCell } from 'ee/licenses/components/cells';
describe('DateCell', () => {
let wrapper;
const defaultProps = {
title: 'title',
value: '2018/10/24',
};
function createComponent(props) {
const propsData = Object.assign({}, defaultProps, props);
wrapper = shallowMount(DateCell, {
propsData,
});
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a string value that represents a date in words and title through props', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
it('renders a date value that represents a date in words and title through props', () => {
createComponent({ value: new Date('2018/03/06') });
expect(wrapper.element).toMatchSnapshot();
});
it('renders an expired warning if isExpirable and date value is before now', () => {
createComponent({ isExpirable: true });
expect(wrapper.element).toMatchSnapshot();
});
it('renders date value with no warning if isExpirable and date value is after now', () => {
createComponent({ isExpirable: true, dateNow: new Date('2017/10/10') });
expect(wrapper.element).toMatchSnapshot();
});
it('renders a fallback value if isExpirable and no value', () => {
createComponent({ isExpirable: true, value: undefined });
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount } from '@vue/test-utils';
import { HeaderCell } from 'ee/licenses/components/cells';
describe('HeaderCell', () => {
let wrapper;
function createComponent() {
wrapper = shallowMount(HeaderCell, {
propsData: {
title: 'title',
icon: 'retry',
},
});
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders an inflexible cell with a title with an icon through props', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount } from '@vue/test-utils';
import { InfoCell } from 'ee/licenses/components/cells';
describe('InfoCell', () => {
let wrapper;
const defaultProps = {
title: 'title',
value: 'value',
popoverContent: 'popoverContent',
};
function createComponent(props, slots) {
const propsData = Object.assign({}, defaultProps, props);
wrapper = shallowMount(InfoCell, {
propsData,
slots,
});
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a title and string value with an info popover through props', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
it('renders a number value', () => {
createComponent({ value: 100 });
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount } from '@vue/test-utils';
import { SkeletonCell } from 'ee/licenses/components/cells';
describe('SkeletonCell', () => {
let wrapper;
function createComponent() {
wrapper = shallowMount(SkeletonCell);
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a skeleton cell with a title and value loading bar', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount } from '@vue/test-utils';
import { SkeletonHeaderCell } from 'ee/licenses/components/cells';
describe('SkeletonHeaderCell', () => {
let wrapper;
function createComponent() {
wrapper = shallowMount(SkeletonHeaderCell);
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a skeleton cell with a single title loading bar', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
});
import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex';
import InstanceCardsList from 'ee/licenses/components/license_cards_list.vue';
import * as getters from 'ee/licenses/store/getters';
import createState from 'ee/licenses/store/state';
describe('InstanceCardsList', () => {
const newLicensePath = '/newLicensePath';
let wrapper;
const localVue = createLocalVue();
localVue.use(Vuex);
function createStore(store) {
const state = Object.assign(createState(), store, {
newLicensePath,
});
return new Vuex.Store({ state, getters });
}
function createComponent(store) {
wrapper = shallowMount(InstanceCardsList, {
store: createStore(store),
localVue,
});
}
afterEach(() => {
if (wrapper) wrapper.destroy();
});
it('renders a list of license cards', () => {
createComponent({ licenses: [{ id: 1 }, { id: 2 }], isLoadingLicenses: false });
expect(wrapper.element).toMatchSnapshot();
});
it('renders a skeleton loading card if loading licenses', () => {
createComponent({ isLoadingLicenses: true });
expect(wrapper.element).toMatchSnapshot();
});
it('renders a message when there are no licenses', () => {
createComponent({ licenses: [], isLoadingLicenses: false });
expect(wrapper.element).toMatchSnapshot();
});
});
Loading
Loading
@@ -1221,6 +1221,9 @@ msgstr ""
msgid "Are you sure you want to lose your issue information?"
msgstr ""
 
msgid "Are you sure you want to permanently delete this license?"
msgstr ""
msgid "Are you sure you want to regenerate the public key? You will have to update the public key on the remote server before mirroring will work again."
msgstr ""
 
Loading
Loading
@@ -2834,6 +2837,9 @@ msgstr ""
msgid "Commit…"
msgstr ""
 
msgid "Company"
msgstr ""
msgid "Compare"
msgstr ""
 
Loading
Loading
@@ -3374,6 +3380,9 @@ msgstr ""
msgid "Delete comment"
msgstr ""
 
msgid "Delete license"
msgstr ""
msgid "Delete list"
msgstr ""
 
Loading
Loading
@@ -3386,6 +3395,15 @@ msgstr ""
msgid "Deleted"
msgstr ""
 
msgid "Deleting the license failed."
msgstr ""
msgid "Deleting the license failed. The license was not found."
msgstr ""
msgid "Deleting the license failed. You are not permitted to perform this action."
msgstr ""
msgid "Deny"
msgstr ""
 
Loading
Loading
@@ -3679,6 +3697,9 @@ msgstr ""
msgid "Download asset"
msgstr ""
 
msgid "Download license"
msgstr ""
msgid "Download source code"
msgstr ""
 
Loading
Loading
@@ -3772,6 +3793,9 @@ msgstr ""
msgid "Email"
msgstr ""
 
msgid "Email address"
msgstr ""
msgid "Email patch"
msgstr ""
 
Loading
Loading
@@ -3868,6 +3892,9 @@ msgstr ""
msgid "Enabling this will only make licensed EE features available to projects if the project namespace's plan includes the feature or if the project is public."
msgstr ""
 
msgid "End date"
msgstr ""
msgid "Ends at (UTC)"
msgstr ""
 
Loading
Loading
@@ -4273,6 +4300,9 @@ msgstr ""
msgid "Expiration date"
msgstr ""
 
msgid "Expired"
msgstr ""
msgid "Expired %{expiredOn}"
msgstr ""
 
Loading
Loading
@@ -4519,6 +4549,15 @@ msgstr ""
msgid "Fetching incoming email"
msgstr ""
 
msgid "Fetching licenses failed."
msgstr ""
msgid "Fetching licenses failed. The request endpoint was not found."
msgstr ""
msgid "Fetching licenses failed. You are not permitted to perform this action."
msgstr ""
msgid "Fields on this page are now uneditable, you can configure"
msgstr ""
 
Loading
Loading
@@ -5160,6 +5199,9 @@ msgstr ""
msgid "GitLab CI Linter has been moved"
msgstr ""
 
msgid "GitLab Enterprise Edition %{plan}"
msgstr ""
msgid "GitLab Geo"
msgstr ""
 
Loading
Loading
@@ -5175,6 +5217,9 @@ msgstr ""
msgid "GitLab User"
msgstr ""
 
msgid "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."
msgstr ""
msgid "GitLab metadata URL"
msgstr ""
 
Loading
Loading
@@ -5836,6 +5881,9 @@ msgstr ""
msgid "Instance does not support multiple Kubernetes clusters"
msgstr ""
 
msgid "Instance license"
msgstr ""
msgid "Integrations"
msgstr ""
 
Loading
Loading
@@ -6354,6 +6402,9 @@ msgstr ""
msgid "LicenseManagement|You are about to remove the license, %{name}, from this project."
msgstr ""
 
msgid "Licensed to"
msgstr ""
msgid "Licenses"
msgstr ""
 
Loading
Loading
@@ -6461,6 +6512,9 @@ msgstr ""
msgid "Make sure you're logged into the account that owns the projects you'd like to import."
msgstr ""
 
msgid "Manage"
msgstr ""
msgid "Manage Git repositories with fine-grained access controls that keep your code secure. Perform code reviews and enhance collaboration with merge requests. Each project can also have an issue tracker and a wiki."
msgstr ""
 
Loading
Loading
@@ -6539,6 +6593,9 @@ msgstr ""
msgid "Max access level"
msgstr ""
 
msgid "Max seats used"
msgstr ""
msgid "Maximum artifacts size (MB)"
msgstr ""
 
Loading
Loading
@@ -7159,6 +7216,9 @@ msgstr ""
msgid "No license. All rights reserved"
msgstr ""
 
msgid "No licenses found."
msgstr ""
msgid "No matching results"
msgstr ""
 
Loading
Loading
@@ -8702,6 +8762,9 @@ msgstr ""
msgid "Register and see your runners for this project."
msgstr ""
 
msgid "Registration"
msgstr ""
msgid "Registry"
msgstr ""
 
Loading
Loading
@@ -8777,6 +8840,9 @@ msgstr ""
msgid "Removing group will cause all child projects and resources to be removed."
msgstr ""
 
msgid "Removing license…"
msgstr ""
msgid "Rename"
msgstr ""
 
Loading
Loading
@@ -9266,6 +9332,12 @@ msgstr ""
msgid "SearchResults|Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\""
msgstr ""
 
msgid "Seats currently in use"
msgstr ""
msgid "Seats in license"
msgstr ""
msgid "Secret"
msgstr ""
 
Loading
Loading
@@ -10779,6 +10851,9 @@ msgstr ""
msgid "This is the author's first Merge Request to this project."
msgstr ""
 
msgid "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."
msgstr ""
msgid "This issue is confidential"
msgstr ""
 
Loading
Loading
@@ -11392,6 +11467,9 @@ msgstr ""
msgid "Unknown"
msgstr ""
 
msgid "Unlimited"
msgstr ""
msgid "Unlock"
msgstr ""
 
Loading
Loading
@@ -11521,12 +11599,18 @@ msgstr ""
msgid "UploadLink|click to upload"
msgstr ""
 
msgid "Uploaded on"
msgstr ""
msgid "Upstream"
msgstr ""
 
msgid "Upvotes"
msgstr ""
 
msgid "Usage"
msgstr ""
msgid "Usage ping is not enabled"
msgstr ""
 
Loading
Loading
@@ -11689,12 +11773,18 @@ msgstr ""
msgid "Users"
msgstr ""
 
msgid "Users outside of license"
msgstr ""
msgid "Users requesting access to"
msgstr ""
 
msgid "Users were successfully added."
msgstr ""
 
msgid "Users with a Guest role or those who don't belong to any projects or groups don't count towards seats in use."
msgstr ""
msgid "Validate"
msgstr ""
 
Loading
Loading
@@ -11704,6 +11794,9 @@ msgstr ""
msgid "Validations failed."
msgstr ""
 
msgid "Validity"
msgstr ""
msgid "Value"
msgstr ""
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment