Skip to content

Commit

Permalink
[8.7] [Synthetics UI] Correct link in the integration deprecation cal…
Browse files Browse the repository at this point in the history
…lout (#150879) (#151706)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Synthetics UI] Correct link in the integration deprecation callout
(#150879)](#150879)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Alejandro Fernández
Gómez","email":"alejandro.fernandez@elastic.co"},"sourceCommit":{"committedDate":"2023-02-21T13:47:46Z","message":"[Synthetics
UI] Correct link in the integration deprecation callout
(#150879)\n\nCloses
#150872","sha":"f1fa5d764f6bd5e25cb9249aeb0a92ade1024de5","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:uptime","release_note:skip","v8.7.0","v8.8.0"],"number":150879,"url":"https://github.com/elastic/kibana/pull/150879","mergeCommit":{"message":"[Synthetics
UI] Correct link in the integration deprecation callout
(#150879)\n\nCloses
#150872","sha":"f1fa5d764f6bd5e25cb9249aeb0a92ade1024de5"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150879","number":150879,"mergeCommit":{"message":"[Synthetics
UI] Correct link in the integration deprecation callout
(#150879)\n\nCloses
#150872","sha":"f1fa5d764f6bd5e25cb9249aeb0a92ade1024de5"}}]}]
BACKPORT-->

Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co>
  • Loading branch information
kibanamachine and Alejandro Fernández Gómez authored Feb 21, 2023
1 parent ba57a80 commit 0c600fd
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 19 deletions.
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 @@ -472,6 +472,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 @@ -354,6 +354,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 @@ -33253,8 +33253,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 @@ -33224,8 +33224,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 @@ -33259,8 +33259,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

0 comments on commit 0c600fd

Please sign in to comment.