forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Adds 7.x migration message to 'no services' view (elastic#30811) (
elastic#30937) * Adds 7.x migration message to 'no services message' * Small tweaks and adds a test * Removed comment after confirming link url with operations team * Updates test descriptions to be more descriptive per review
- Loading branch information
1 parent
02c8dc9
commit 9d49e91
Showing
5 changed files
with
160 additions
and
32 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
x-pack/plugins/apm/public/components/app/ServiceOverview/NoServicesMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiEmptyPrompt } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
import { KibanaLink } from '../../shared/Links/KibanaLink'; | ||
import { SetupInstructionsLink } from '../../shared/Links/SetupInstructionsLink'; | ||
|
||
interface Props { | ||
// any data submitted from APM agents found (not just in the given time range) | ||
historicalDataFound: boolean; | ||
} | ||
|
||
export function NoServicesMessage({ historicalDataFound }: Props) { | ||
if (historicalDataFound) { | ||
return ( | ||
<EuiEmptyPrompt | ||
title={ | ||
<div> | ||
{i18n.translate('xpack.apm.servicesTable.notFoundLabel', { | ||
defaultMessage: 'No services found' | ||
})} | ||
</div> | ||
} | ||
titleSize="s" | ||
/> | ||
); | ||
} else { | ||
return ( | ||
<EuiEmptyPrompt | ||
title={ | ||
<div> | ||
{i18n.translate('xpack.apm.servicesTable.noServicesLabel', { | ||
defaultMessage: `Looks like you don't have any APM services installed. Let's add some!` | ||
})} | ||
</div> | ||
} | ||
titleSize="s" | ||
body={ | ||
<React.Fragment> | ||
<p> | ||
{i18n.translate( | ||
'xpack.apm.servicesTable.7xUpgradeServerMessage', | ||
{ | ||
defaultMessage: `Upgrading from a pre-7.x version? Make sure you've also upgraded | ||
your APM server instance(s) to at least 7.0.` | ||
} | ||
)} | ||
</p> | ||
<p> | ||
{i18n.translate('xpack.apm.servicesTable.7xOldDataMessage', { | ||
defaultMessage: | ||
'You may also have old data that needs to be migrated.' | ||
})}{' '} | ||
<KibanaLink | ||
pathname="/app/kibana" | ||
hash="/management/elasticsearch/upgrade_assistant" | ||
> | ||
{i18n.translate( | ||
'xpack.apm.servicesTable.MigrationAssistantLink', | ||
{ | ||
defaultMessage: | ||
'Learn more by visiting the Kibana Migration Assistant' | ||
} | ||
)} | ||
</KibanaLink> | ||
. | ||
</p> | ||
</React.Fragment> | ||
} | ||
actions={<SetupInstructionsLink buttonFill={true} />} | ||
/> | ||
); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/apm/public/components/app/ServiceOverview/__test__/NoServicesMessage.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { shallow } from 'enzyme'; | ||
import React from 'react'; | ||
import { NoServicesMessage } from '../NoServicesMessage'; | ||
|
||
describe('NoServicesMessage', () => { | ||
it('should show only a "not found" message when historical data is found', () => { | ||
const wrapper = shallow(<NoServicesMessage historicalDataFound={true} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
it('should show a "no services installed" message, a link to the set up instructions page, a message about upgrading APM server, and a link to the migration assistant when NO historical data is found', () => { | ||
const wrapper = shallow(<NoServicesMessage historicalDataFound={false} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
...lic/components/app/ServiceOverview/__test__/__snapshots__/NoServicesMessage.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NoServicesMessage should show a "no services installed" message, a link to the set up instructions page, a message about upgrading APM server, and a link to the migration assistant when NO historical data is found 1`] = ` | ||
<EuiEmptyPrompt | ||
actions={ | ||
<SetupInstructionsLink | ||
buttonFill={true} | ||
/> | ||
} | ||
body={ | ||
<React.Fragment> | ||
<p> | ||
Upgrading from a pre-7.x version? Make sure you've also upgraded | ||
your APM server instance(s) to at least 7.0. | ||
</p> | ||
<p> | ||
You may also have old data that needs to be migrated. | ||
<Connect(UnconnectedKibanaLink) | ||
hash="/management/elasticsearch/upgrade_assistant" | ||
pathname="/app/kibana" | ||
> | ||
Learn more by visiting the Kibana Migration Assistant | ||
</Connect(UnconnectedKibanaLink)> | ||
. | ||
</p> | ||
</React.Fragment> | ||
} | ||
iconColor="subdued" | ||
title={ | ||
<div> | ||
Looks like you don't have any APM services installed. Let's add some! | ||
</div> | ||
} | ||
titleSize="s" | ||
/> | ||
`; | ||
|
||
exports[`NoServicesMessage should show only a "not found" message when historical data is found 1`] = ` | ||
<EuiEmptyPrompt | ||
iconColor="subdued" | ||
title={ | ||
<div> | ||
No services found | ||
</div> | ||
} | ||
titleSize="s" | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters