Commit ab56f4ef authored by Phil Hughes's avatar Phil Hughes

Merge branch '50101-shared-runners-limit-vue' into 'master'

Creates vue component for shared runner limit

See merge request gitlab-org/gitlab-ee!6858
parents e73bc041 917c7b70
<script>
export default {
props: {
quotaUsed: {
type: Number,
required: true,
},
quotaLimit: {
type: Number,
required: true,
},
runnersPath: {
type: String,
required: false,
default: null,
},
},
};
</script>
<template>
<div class="bs-callout bs-callout-warning">
<p>
{{ s__("Runners|You have used all your shared Runners pipeline minutes.") }}
{{ quotaUsed }} of {{ quotaLimit }}
<template v-if="runnersPath">
{{ __("For more information, go to the ") }}
<a :href="runnersPath">
{{ __("Runners page.") }}
</a>
</template>
</p>
</div>
</template>
---
title: Creates vue component for shared runner limit
merge_request:
author:
type: other
......@@ -3161,6 +3161,9 @@ msgstr ""
msgid "For internal projects, any logged in user can view pipelines and access job details (output logs and artifacts)"
msgstr ""
msgid "For more information, go to the "
msgstr ""
msgid "For private projects, any member (guest or higher) can view pipelines and access job details (output logs and artifacts)"
msgstr ""
......@@ -6053,6 +6056,12 @@ msgstr ""
msgid "Runners can be placed on separate users, servers, and even on your local machine."
msgstr ""
msgid "Runners page."
msgstr ""
msgid "Runners|You have used all your shared Runners pipeline minutes."
msgstr ""
msgid "Running"
msgstr ""
......
import Vue from 'vue';
import component from 'ee/jobs/components/shared_runner_limit_block.vue';
import mountComponent from '../helpers/vue_mount_component_helper';
import { trimText } from '../helpers/vue_component_helper';
describe('Shared Runner Limit Block', () => {
const Component = Vue.extend(component);
let vm;
afterEach(() => {
vm.$destroy();
});
describe('quota information', () => {
it('renders provided quota limit and used quota', () => {
vm = mountComponent(Component, {
quotaUsed: 1000,
quotaLimit: 4000,
runnersPath: 'root/project/runners',
});
expect(vm.$el.textContent).toContain('You have used all your shared Runners pipeline minutes.');
expect(vm.$el.textContent).toContain('1000 of 4000');
});
});
describe('with runnersPath', () => {
it('renders runner link', () => {
vm = mountComponent(Component, {
quotaUsed: 1000,
quotaLimit: 4000,
runnersPath: 'root/project/runners',
});
expect(trimText(vm.$el.textContent)).toContain('For more information, go to the Runners page.');
});
});
describe('without runnersPath', () => {
it('does not renbder runner link', () => {
vm = mountComponent(Component, {
quotaUsed: 1000,
quotaLimit: 4000,
});
expect(trimText(vm.$el.textContent)).not.toContain('For more information, go to the Runners page.');
});
});
});
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