Merge branch 'ee-8346-hide-unlicensed-alerts' into 'master'

Backport to resolve conflicts for gitlab-ee!9224

See merge request gitlab-org/gitlab-ce!24889
This commit is contained in:
Fatih Acet 2019-02-07 09:43:43 +00:00
commit 6e51960788
3 changed files with 11 additions and 13 deletions

View File

@ -160,7 +160,8 @@ export default {
{{ s__('Metrics|Environment') }}
<div class="dropdown prepend-left-10">
<button class="dropdown-menu-toggle" data-toggle="dropdown" type="button">
<span> {{ currentEnvironmentName }} </span> <icon name="chevron-down" />
<span>{{ currentEnvironmentName }}</span>
<icon name="chevron-down" />
</button>
<div
v-if="store.environmentsData.length > 0"
@ -172,9 +173,8 @@ export default {
:href="environment.metrics_path"
:class="{ 'is-active': environment.name == currentEnvironmentName }"
class="dropdown-item"
>{{ environment.name }}</a
>
{{ environment.name }}
</a>
</li>
</ul>
</div>

View File

@ -1,3 +1,3 @@
import monitoringBundle from '~/monitoring/monitoring_bundle';
import monitoringBundle from 'ee_else_ce/monitoring/monitoring_bundle';
document.addEventListener('DOMContentLoaded', monitoringBundle);

View File

@ -25,15 +25,22 @@ export default propsData;
describe('Dashboard', () => {
let DashboardComponent;
let mock;
beforeEach(() => {
setFixtures(`
<div class="prometheus-graphs"></div>
<div class="layout-page"></div>
`);
mock = new MockAdapter(axios);
DashboardComponent = Vue.extend(Dashboard);
});
afterEach(() => {
mock.restore();
});
describe('no metrics are available yet', () => {
it('shows a getting started empty state when no metrics are present', () => {
const component = new DashboardComponent({
@ -47,16 +54,10 @@ describe('Dashboard', () => {
});
describe('requests information to the server', () => {
let mock;
beforeEach(() => {
mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
});
afterEach(() => {
mock.restore();
});
it('shows up a loading state', done => {
const component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
@ -152,15 +153,12 @@ describe('Dashboard', () => {
});
describe('when the window resizes', () => {
let mock;
beforeEach(() => {
mock = new MockAdapter(axios);
mock.onGet(mockApiEndpoint).reply(200, metricsGroupsAPIResponse);
jasmine.clock().install();
});
afterEach(() => {
mock.restore();
jasmine.clock().uninstall();
});