From 6277761b56973ed6a48d515ff3af4615497d321b Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Fri, 28 Oct 2022 22:45:16 -0400 Subject: [PATCH] fixes tests and deep links --- .../cypress/e2e/read_only_user/deep_links.cy.ts | 6 ++++++ .../header_filters/header_filters.cy.ts | 1 + x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts | 10 ++++++++++ x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts | 1 + .../app/service_groups/service_groups_tour.tsx | 2 +- .../app/service_groups/use_service_groups_tour.tsx | 1 - x-pack/plugins/apm/public/plugin.ts | 9 ++++++++- x-pack/plugins/translations/translations/fr-FR.json | 1 - x-pack/plugins/translations/translations/ja-JP.json | 1 - x-pack/plugins/translations/translations/zh-CN.json | 1 - 10 files changed, 27 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts index 00b842f3265c7..513d9afeccf9d 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/deep_links.cy.ts @@ -14,6 +14,7 @@ describe('APM deep links', () => { cy.getByTestSubj('nav-search-input').type('APM'); cy.contains('APM'); cy.contains('APM / Services'); + cy.contains('APM / Service groups'); cy.contains('APM / Traces'); cy.contains('APM / Service Map'); @@ -28,6 +29,11 @@ describe('APM deep links', () => { cy.contains('APM / Services').click({ force: true }); cy.url().should('include', '/apm/services'); + cy.getByTestSubj('nav-search-input').type('APM'); + // navigates to service groups page + cy.contains('APM / Service groups').click({ force: true }); + cy.url().should('include', '/apm/service-groups'); + cy.getByTestSubj('nav-search-input').type('APM'); // navigates to traces page cy.contains('APM / Traces').click({ force: true }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts index 4f72e968d81f8..e689e126d4bfd 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/e2e/read_only_user/service_inventory/header_filters/header_filters.cy.ts @@ -28,6 +28,7 @@ describe('Service inventory - header filters', () => { specialServiceName, }) ); + cy.dismissServiceGroupsTour(); }); after(() => { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts index 013296d815a58..e0af1e1a84729 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/commands.ts @@ -125,6 +125,16 @@ Cypress.Commands.add( } ); +Cypress.Commands.add('dismissServiceGroupsTour', () => { + window.localStorage.setItem( + 'apm.serviceGroupsTour', + JSON.stringify({ + createGroup: false, + editGroup: false, + }) + ); +}); + // A11y configuration const axeConfig = { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts index 5d59d4691820a..d9675f2536315 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/support/types.d.ts @@ -23,5 +23,6 @@ declare namespace Cypress { }): void; updateAdvancedSettings(settings: Record): void; getByTestSubj(selector: string): Chainable>; + dismissServiceGroupsTour(): void; } } diff --git a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx index a8ca5fdd6ec43..4f7a457be49b4 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/service_groups_tour.tsx @@ -17,7 +17,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { ElasticDocsLink } from '../../shared/links/elastic_docs_link'; -export type TourType = 'createGroup' | 'editGroup' | 'serviceGroupsAllServices'; +export type TourType = 'createGroup' | 'editGroup'; interface Props { title: string; diff --git a/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx b/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx index a6f4f89cdd04c..400a88a026e01 100644 --- a/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx +++ b/x-pack/plugins/apm/public/components/app/service_groups/use_service_groups_tour.tsx @@ -11,7 +11,6 @@ import { TourType } from './service_groups_tour'; const INITIAL_STATE: Record = { createGroup: true, editGroup: true, - serviceGroupsAllServices: true, }; export function useServiceGroupsTour(type: TourType) { diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index 994fcfbe9ce2c..0b3137ee6ad99 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -103,6 +103,13 @@ const servicesTitle = i18n.translate('xpack.apm.navigation.servicesTitle', { defaultMessage: 'Services', }); +const serviceGroupsTitle = i18n.translate( + 'xpack.apm.navigation.serviceGroupsTitle', + { + defaultMessage: 'Service groups', + } +); + const tracesTitle = i18n.translate('xpack.apm.navigation.tracesTitle', { defaultMessage: 'Traces', }); @@ -270,7 +277,7 @@ export class ApmPlugin implements Plugin { deepLinks: [ { id: 'service-groups-list', - title: servicesTitle, + title: serviceGroupsTitle, path: '/service-groups', }, { diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 662d44f03445d..087c56fab47b9 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -7431,7 +7431,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "Mettre à jour les tâches", "xpack.apm.mlCallout.updateAvailableCalloutText": "Nous avons mis à jour les tâches de détection des anomalies qui fournissent des indications sur la dégradation des performances et ajouté des détecteurs de débit et de taux de transactions ayant échoué. Si vous choisissez de mettre à jour, nous créerons les nouvelles tâches et fermerons les tâches héritées. Les données affichées dans l'application APM passeront automatiquement aux nouvelles. Veuillez noter que l'option de migration de toutes les tâches existantes ne sera pas disponible si vous choisissez de créer une nouvelle tâche.", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "Mises à jour disponibles", - "xpack.apm.navigation.allServicesTitle": "Tous les services", "xpack.apm.navigation.apmSettingsTitle": "Paramètres", "xpack.apm.navigation.dependenciesTitle": "Dépendances", "xpack.apm.navigation.serviceMapTitle": "Carte des services", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index f864bbebfae62..f4c281167d8b6 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -7419,7 +7419,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "ジョブの更新", "xpack.apm.mlCallout.updateAvailableCalloutText": "劣化したパフォーマンスに関する詳細な分析を提供する異常検知ジョブを更新し、スループットと失敗したトランザクションレートの検知機能を追加しました。アップグレードを選択する場合は、新しいジョブが作成され、既存のレガシージョブが終了します。APMアプリに表示されるデータは自動的に新しいジョブに切り替わります。新しいジョブの作成を選択した場合は、すべての既存のジョブを移行するオプションを使用できません。", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "更新が可能です", - "xpack.apm.navigation.allServicesTitle": "すべてのサービス", "xpack.apm.navigation.apmSettingsTitle": "設定", "xpack.apm.navigation.dependenciesTitle": "依存関係", "xpack.apm.navigation.serviceMapTitle": "サービスマップ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 7a1cbd4a82cc7..ce903ab668bef 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -7435,7 +7435,6 @@ "xpack.apm.mlCallout.updateAvailableCalloutButtonText": "更新作业", "xpack.apm.mlCallout.updateAvailableCalloutText": "我们已更新有助于深入了解性能降级的异常检测作业,并添加了检测工具以获取吞吐量和失败事务率。如果您选择进行升级,我们将创建新作业,并关闭现有的旧版作业。APM 应用中显示的数据将自动切换到新数据。请注意,如果您选择创建新作业,用于迁移所有现有作业的选项将不可用。", "xpack.apm.mlCallout.updateAvailableCalloutTitle": "可用更新", - "xpack.apm.navigation.allServicesTitle": "所有服务", "xpack.apm.navigation.apmSettingsTitle": "设置", "xpack.apm.navigation.dependenciesTitle": "依赖项", "xpack.apm.navigation.serviceMapTitle": "服务地图",