Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics UI] Correct link in the integration deprecation callout #150879

Merged
merged 6 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
createAlerts: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/create-alerts.html`,
syntheticsCommandReference: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetics-configuration.html#synthetics-configuration-playwright-options`,
syntheticsProjectMonitors: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetic-run-tests.html#synthetic-monitor-choose-project`,
syntheticsMigrateFromIntegration: `${ELASTIC_WEBSITE_URL}guide/en/observability/${DOC_LINK_VERSION}/synthetics-migrate-from-integration.html`,
},
alerting: {
guide: `${KIBANA_DOCS}create-and-manage-rules.html`,
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ export interface DocLinks {
createAlerts: string;
syntheticsCommandReference: string;
syntheticsProjectMonitors: string;
syntheticsMigrateFromIntegration: string;
}>;
readonly alerting: Readonly<{
guide: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,34 @@
import { journey, step, expect, before } from '@elastic/synthetics';
import { assertText, byTestId, TIMEOUT_60_SEC } from '@kbn/observability-plugin/e2e/utils';
import { recordVideo } from '@kbn/observability-plugin/e2e/record_video';
import { cleanTestMonitors } from '../../synthetics/services/add_monitor';
import { monitorManagementPageProvider } from '../../../page_objects/uptime/monitor_management';

journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) => {
journey('AddPrivateLocationMonitor', async ({ page, params }) => {
recordVideo(page);

page.setDefaultTimeout(TIMEOUT_60_SEC.timeout);
const kibanaUrl = params.kibanaUrl;

const uptime = monitorManagementPageProvider({ page, kibanaUrl });

let monitorId: string;

before(async () => {
await uptime.waitForLoadingToFinish();
await cleanTestMonitors(params);
page.on('request', (evt) => {
if (
evt.resourceType() === 'fetch' &&
evt.url().includes('/internal/uptime/service/monitors?preserve_namespace=true')
) {
evt
.response()
?.then((res) => res?.json())
.then((res) => {
monitorId = res.id;
});
}
});
});

step('Go to monitor-management', async () => {
Expand All @@ -39,7 +58,7 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) =>

await page.click('input[name="name"]');
await page.fill('input[name="name"]', 'Private location monitor');
await page.click('label:has-text("Test private location Private")', TIMEOUT_60_SEC);
await page.click('label:has-text("Test private location Private")');
await page.selectOption('select', 'http');
await page.click(byTestId('syntheticsUrlField'));
await page.fill(byTestId('syntheticsUrlField'), 'https://www.google.com');
Expand All @@ -66,7 +85,9 @@ journey('AddPrivateLocationMonitor', async ({ page, params: { kibanaUrl } }) =>
step('Click text=Edit Elastic Synthetics integration', async () => {
await assertText({ page, text: 'This table contains 1 rows out of 1 rows; Page 1 of 1.' });
await page.click('[data-test-subj="integrationNameLink"]');
await page.click('text=Edit in uptime');
const btn = await page.locator(byTestId('syntheticsEditMonitorButton'));
expect(await btn.getAttribute('href')).toBe(`/app/synthetics/edit-monitor/${monitorId}`);
await btn.click();
await page.click('text=Private location monitor');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ export const SyntheticsPolicyEditExtensionWrapper = memo<PackagePolicyEditExtens
if (currentPolicy.is_managed) {
return (
<EuiCallOut>
<p>{EDIT_IN_UPTIME_DESC}</p>
<p>{EDIT_IN_SYNTHETICS_DESC}</p>
{/* TODO Add a link to exact monitor*/}
<EuiButton href={`${http?.basePath.get()}/app/uptime/manage-monitors/all`}>
{EDIT_IN_UPTIME_LABEL}
<EuiButton
data-test-subj="syntheticsEditMonitorButton"
href={`${http?.basePath.get()}/app/synthetics/edit-monitor/${
defaultConfig[ConfigKey.CONFIG_ID]
}`}
>
{EDIT_IN_SYNTHETICS_LABEL}
</EuiButton>
</EuiCallOut>
);
Expand Down Expand Up @@ -143,10 +148,13 @@ export const SyntheticsPolicyEditExtensionWrapper = memo<PackagePolicyEditExtens
);
SyntheticsPolicyEditExtensionWrapper.displayName = 'SyntheticsPolicyEditExtensionWrapper';

const EDIT_IN_UPTIME_LABEL = i18n.translate('xpack.synthetics.editPackagePolicy.inUptime', {
defaultMessage: 'Edit in uptime',
const EDIT_IN_SYNTHETICS_LABEL = i18n.translate('xpack.synthetics.editPackagePolicy.inSynthetics', {
defaultMessage: 'Edit in synthetics',
});

const EDIT_IN_UPTIME_DESC = i18n.translate('xpack.synthetics.editPackagePolicy.inUptimeDesc', {
defaultMessage: 'This package policy is managed by uptime app.',
});
const EDIT_IN_SYNTHETICS_DESC = i18n.translate(
'xpack.synthetics.editPackagePolicy.inSyntheticsDesc',
{
defaultMessage: 'This package policy is managed by synthetics app.',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function IntegrationDeprecationCallout({
link: (
<EuiLink
target="_blank"
href={getDocLinks()?.links?.observability?.syntheticsProjectMonitors}
href={getDocLinks()?.links?.observability?.syntheticsMigrateFromIntegration}
external
>
<FormattedMessage
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -33240,8 +33240,6 @@
"xpack.synthetics.durationTrend.percentile75": "75e",
"xpack.synthetics.editMonitor.errorDetailsRoute.title": "Détails de l'erreur",
"xpack.synthetics.editMonitor.pageHeader.title": "Modifier le moniteur",
"xpack.synthetics.editPackagePolicy.inUptime": "Modifier dans Uptime",
"xpack.synthetics.editPackagePolicy.inUptimeDesc": "Cette politique de package est gérée par l’application Uptime.",
"xpack.synthetics.emptyState.loadingMessage": "Chargement…",
"xpack.synthetics.emptyStateError.notAuthorized": "Vous n'êtes pas autorisé à afficher les données Uptime, veuillez contacter votre administrateur système.",
"xpack.synthetics.emptyStateError.notFoundPage": "Page introuvable",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -33211,8 +33211,6 @@
"xpack.synthetics.durationTrend.percentile75": "75番目",
"xpack.synthetics.editMonitor.errorDetailsRoute.title": "詳細を入力",
"xpack.synthetics.editMonitor.pageHeader.title": "モニターを編集",
"xpack.synthetics.editPackagePolicy.inUptime": "アップタイムで編集",
"xpack.synthetics.editPackagePolicy.inUptimeDesc": "このパッケージポリシーは、アップタイムアプリで管理されます。",
"xpack.synthetics.emptyState.loadingMessage": "読み込み中…",
"xpack.synthetics.emptyStateError.notAuthorized": "アップタイムデータの表示が承認されていません。システム管理者にお問い合わせください。",
"xpack.synthetics.emptyStateError.notFoundPage": "ページが見つかりません",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -33246,8 +33246,6 @@
"xpack.synthetics.durationTrend.percentile75": "第 75 个",
"xpack.synthetics.editMonitor.errorDetailsRoute.title": "错误详细信息",
"xpack.synthetics.editMonitor.pageHeader.title": "编辑监测",
"xpack.synthetics.editPackagePolicy.inUptime": "在 Uptime 中编辑",
"xpack.synthetics.editPackagePolicy.inUptimeDesc": "此软件包策略由 Uptime 应用托管。",
"xpack.synthetics.emptyState.loadingMessage": "正在加载……",
"xpack.synthetics.emptyStateError.notAuthorized": "您无权查看 Uptime 数据,请联系系统管理员。",
"xpack.synthetics.emptyStateError.notFoundPage": "未找到页面",
Expand Down