Commit ad791aba authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '213325-elastic-recommendation-alert-appears-when-the-screen-is-loaded' into 'master'

Resolve "Elastic recommendation alert appears when the screen is loaded"

Closes #213325

See merge request gitlab-org/gitlab!29097
parents 4b0f5f00 e1aa3dd6
......@@ -70,9 +70,10 @@ export default {
return this.logs.isLoading;
},
shouldShowElasticStackCallout() {
return (
!this.isElasticStackCalloutDismissed &&
(this.environments.isLoading || !this.showAdvancedFilters)
return !(
this.environments.isLoading ||
this.isElasticStackCalloutDismissed ||
this.showAdvancedFilters
);
},
},
......@@ -120,7 +121,8 @@ export default {
<div class="environment-logs-viewer d-flex flex-column py-3">
<gl-alert
v-if="shouldShowElasticStackCallout"
class="mb-3 js-elasticsearch-alert"
ref="elasticsearchNotice"
class="mb-3"
@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', () => {
const findSimpleFilters = () => wrapper.find({ ref: 'log-simple-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 findInfiniteScroll = () => wrapper.find({ ref: 'infiniteScroll' });
......@@ -160,6 +160,10 @@ describe('EnvironmentLogs', () => {
initWrapper();
});
it('does not display an alert to upgrade to ES', () => {
expect(findElasticsearchNotice().exists()).toBe(false);
});
it('displays a disabled environments dropdown', () => {
expect(findEnvironmentsDropdown().attributes('disabled')).toBe('true');
expect(findEnvironmentsDropdown().findAll(GlDropdownItem).length).toBe(0);
......@@ -204,7 +208,7 @@ describe('EnvironmentLogs', () => {
});
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', () => {
......@@ -235,7 +239,7 @@ describe('EnvironmentLogs', () => {
});
it('does not display an alert to upgrade to ES', () => {
expect(findInfoAlert().exists()).toBe(false);
expect(findElasticsearchNotice().exists()).toBe(false);
});
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