[APM][ECO] Fix splash screen with the custom no data page (#189607)

## Summary

closes https://github.com/elastic/kibana/issues/189479






https://github.com/user-attachments/assets/889a5778-23c1-4e55-9757-b0df29738fc3
This commit is contained in:
Katerina 2024-07-31 17:32:35 +03:00 committed by GitHub
parent 0cc079a50c
commit 263f00c9de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
describe('Custom no data page', () => {
beforeEach(() => {
cy.loginAsEditorUser();
});
before(() => {
// make sure entity centric experience is disabled
cy.updateAdvancedSettings({
'observability:entityCentricExperience': false,
});
});
after(() => {
cy.updateAdvancedSettings({
'observability:entityCentricExperience': false,
});
});
it('shows the default no data screen when entity centric experience is disabled ', () => {
cy.visitKibana('/app/apm');
cy.contains('Welcome to Elastic Observability!');
});
it('shows the custom no data screen when entity centric experience is enabled', () => {
cy.updateAdvancedSettings({
'observability:entityCentricExperience': true,
});
cy.visitKibana('/app/apm');
cy.contains('Welcome to Elastic Observability!').should('not.exist');
cy.contains('Detect and resolve problems with your application');
cy.contains('Try collecting services from logs');
});
});

View file

@ -35,6 +35,9 @@ describe('When navigating between pages', () => {
after(() => {
synthtrace.clean();
cy.updateAdvancedSettings({
'observability:entityCentricExperience': false,
});
});
beforeEach(() => {
@ -70,4 +73,14 @@ describe('When navigating between pages', () => {
cy.get('@serviceIconsRequest.all').should('have.length', 1);
cy.get('@apmPoliciesRequest.all').should('have.length', 1);
});
it('should not show the custom no data screen', () => {
cy.updateAdvancedSettings({
'observability:entityCentricExperience': true,
});
cy.visitKibana('/app/apm');
cy.contains('Detect and resolve problems with your application').should('not.exist');
cy.contains('Traces').click();
cy.contains('Detect and resolve problems with your application').should('not.exist');
});
});

View file

@ -120,6 +120,7 @@ export function ApmMainTemplate({
const hasApmIntegrations = !!fleetApmPoliciesData?.hasApmPolicies;
const showCustomEmptyState =
!hasApmData &&
!isLoading &&
isEntityCentricExperienceSettingEnabled &&
serviceInventoryViewLocalStorageSetting === ServiceInventoryView.classic;