Commit e1aa3dd6 authored by Miguel Rincon's avatar Miguel Rincon

Fix elastic callout condition

parent baee3dd3
...@@ -70,9 +70,10 @@ export default { ...@@ -70,9 +70,10 @@ export default {
return this.logs.isLoading; return this.logs.isLoading;
}, },
shouldShowElasticStackCallout() { shouldShowElasticStackCallout() {
return ( return !(
!this.isElasticStackCalloutDismissed && this.environments.isLoading ||
(this.environments.isLoading || !this.showAdvancedFilters) this.isElasticStackCalloutDismissed ||
this.showAdvancedFilters
); );
}, },
}, },
...@@ -120,7 +121,8 @@ export default { ...@@ -120,7 +121,8 @@ export default {
<div class="environment-logs-viewer d-flex flex-column py-3"> <div class="environment-logs-viewer d-flex flex-column py-3">
<gl-alert <gl-alert
v-if="shouldShowElasticStackCallout" v-if="shouldShowElasticStackCallout"
class="mb-3 js-elasticsearch-alert" ref="elasticsearchNotice"
class="mb-3"
@dismiss="isElasticStackCalloutDismissed = true" @dismiss="isElasticStackCalloutDismissed = true"
> >
{{ {{
......
---
title: Elasticsearch recommendation alert does not appears while screen is loaded
merge_request: 29097
author:
type: fixed
...@@ -43,7 +43,7 @@ describe('EnvironmentLogs', () => { ...@@ -43,7 +43,7 @@ describe('EnvironmentLogs', () => {
const findSimpleFilters = () => wrapper.find({ ref: 'log-simple-filters' }); const findSimpleFilters = () => wrapper.find({ ref: 'log-simple-filters' });
const findAdvancedFilters = () => wrapper.find({ ref: 'log-advanced-filters' }); const findAdvancedFilters = () => wrapper.find({ ref: 'log-advanced-filters' });
const findInfoAlert = () => wrapper.find('.js-elasticsearch-alert'); const findElasticsearchNotice = () => wrapper.find({ ref: 'elasticsearchNotice' });
const findLogControlButtons = () => wrapper.find({ name: 'log-control-buttons-stub' }); const findLogControlButtons = () => wrapper.find({ name: 'log-control-buttons-stub' });
const findInfiniteScroll = () => wrapper.find({ ref: 'infiniteScroll' }); const findInfiniteScroll = () => wrapper.find({ ref: 'infiniteScroll' });
...@@ -160,6 +160,10 @@ describe('EnvironmentLogs', () => { ...@@ -160,6 +160,10 @@ describe('EnvironmentLogs', () => {
initWrapper(); initWrapper();
}); });
it('does not display an alert to upgrade to ES', () => {
expect(findElasticsearchNotice().exists()).toBe(false);
});
it('displays a disabled environments dropdown', () => { it('displays a disabled environments dropdown', () => {
expect(findEnvironmentsDropdown().attributes('disabled')).toBe('true'); expect(findEnvironmentsDropdown().attributes('disabled')).toBe('true');
expect(findEnvironmentsDropdown().findAll(GlDropdownItem).length).toBe(0); expect(findEnvironmentsDropdown().findAll(GlDropdownItem).length).toBe(0);
...@@ -204,7 +208,7 @@ describe('EnvironmentLogs', () => { ...@@ -204,7 +208,7 @@ describe('EnvironmentLogs', () => {
}); });
it('displays an alert to upgrade to ES', () => { it('displays an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(true); expect(findElasticsearchNotice().exists()).toBe(true);
}); });
it('displays simple filters for kubernetes logs API', () => { it('displays simple filters for kubernetes logs API', () => {
...@@ -235,7 +239,7 @@ describe('EnvironmentLogs', () => { ...@@ -235,7 +239,7 @@ describe('EnvironmentLogs', () => {
}); });
it('does not display an alert to upgrade to ES', () => { it('does not display an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(false); expect(findElasticsearchNotice().exists()).toBe(false);
}); });
it('populates environments dropdown', () => { it('populates environments dropdown', () => {
......
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