Skip to content

Commit

Permalink
[UA] Removes logs explorer panel from UI (elastic#203833)
Browse files Browse the repository at this point in the history
## Summary

resolves elastic#201532

Removed the panel containing the logs explorer link. Updated tests and
i18n.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
jesuswr and kibanamachine authored Dec 12, 2024
1 parent 6154ddf commit b059879
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26137,9 +26137,9 @@
"xpack.lens.app.settingsAriaLabel": "Ouvrir le menu de paramètres Lens",
"xpack.lens.app.share.defaultDashboardTitle": "Visualisation Lens [{date}]",
"xpack.lens.app.shareButtonDisabledWarning": "La visualisation ne comprend aucune donnée à partager.",
"xpack.lens.app.shareModal.title": "Partager cette visualisation Lens",
"xpack.lens.app.shareModal.draftModeCallout.link.warning": "Copiez le lien afin d’obtenir un lien temporaire. Enregistrez la visualisation Lens pour créer un lien permanent.",
"xpack.lens.app.shareModal.draftModeCallout.title": "Modifications non enregistrées",
"xpack.lens.app.shareModal.title": "Partager cette visualisation Lens",
"xpack.lens.app.shareTitle": "Partager",
"xpack.lens.app.shareTitleAria": "Partager la visualisation",
"xpack.lens.app.showUnderlyingDataMultipleLayers": "Impossible d’afficher les données sous-jacentes pour les visualisations avec plusieurs calques.",
Expand Down Expand Up @@ -48594,7 +48594,6 @@
"xpack.upgradeAssistant.overview.logsStep.title": "Traiter les déclassements d'API",
"xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "Afficher les logs",
"xpack.upgradeAssistant.overview.observe.discoveryDescription": "Recherchez et filtrez les logs de déclassement pour comprendre les types de modifications que vous devez effectuer.",
"xpack.upgradeAssistant.overview.observe.observabilityDescription": "Obtenez des informations sur les API déclassées qui sont utilisées et les applications que vous devez mettre à jour.",
"xpack.upgradeAssistant.overview.pageDescription": "Préparez-vous pour la prochaine version de la Suite Elastic !",
"xpack.upgradeAssistant.overview.pageTitle": "Assistant de mise à niveau",
"xpack.upgradeAssistant.overview.snapshotRestoreLink": "Créer un snapshot",
Expand Down Expand Up @@ -48631,7 +48630,6 @@
"xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "Réinitialiser le compteur",
"xpack.upgradeAssistant.overview.verifyChanges.retryButton": "Réessayer",
"xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Analyser les logs dans Discover",
"xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Afficher les logs d'obsolescence dans Logs Explorer",
"xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "Vous ne disposez pas des privilèges appropriés pour réindexer \"{indexName}\".",
"xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "Tous les avertissements de déclassement ont été résolus.",
"xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "Les problèmes suivants doivent être résolus avant la mise à niveau : {upgradeIssues}.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25996,9 +25996,9 @@
"xpack.lens.app.settingsAriaLabel": "Lens設定メニューを開く",
"xpack.lens.app.share.defaultDashboardTitle": "Lensビジュアライゼーション[{date}]",
"xpack.lens.app.shareButtonDisabledWarning": "ビジュアライゼーションには共有するデータがありません。",
"xpack.lens.app.shareModal.title": "このLensビジュアライゼーションを共有",
"xpack.lens.app.shareModal.draftModeCallout.link.warning": "リンクをコピーして、一時リンクを取得します。Lensビジュアライゼーションを保存して、永続リンクを作成します。",
"xpack.lens.app.shareModal.draftModeCallout.title": "保存されていない変更",
"xpack.lens.app.shareModal.title": "このLensビジュアライゼーションを共有",
"xpack.lens.app.shareTitle": "共有",
"xpack.lens.app.shareTitleAria": "ビジュアライゼーションを共有",
"xpack.lens.app.showUnderlyingDataMultipleLayers": "複数レイヤーのビジュアライゼーションでは、基本データを表示できません",
Expand Down Expand Up @@ -48442,7 +48442,6 @@
"xpack.upgradeAssistant.overview.logsStep.title": "API廃止予定に対処",
"xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "ログを表示",
"xpack.upgradeAssistant.overview.observe.discoveryDescription": "廃止予定ログを検索およびフィルターし、必要な変更のタイプを把握します。",
"xpack.upgradeAssistant.overview.observe.observabilityDescription": "使用中のAPIのうち廃止予定のAPIと、更新が必要なアプリケーションを特定できます。",
"xpack.upgradeAssistant.overview.pageDescription": "次のバージョンのElastic Stackをお待ちください。",
"xpack.upgradeAssistant.overview.pageTitle": "アップグレードアシスタント",
"xpack.upgradeAssistant.overview.snapshotRestoreLink": "スナップショットの作成",
Expand Down Expand Up @@ -48479,7 +48478,6 @@
"xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "カウンターのリセット",
"xpack.upgradeAssistant.overview.verifyChanges.retryButton": "再試行",
"xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Discoverでログを分析",
"xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Logs Explorerで廃止予定ログを表示",
"xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "「{indexName}」に再インデックスするための権限が不十分です。",
"xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "すべての廃止予定の警告が解決されました。",
"xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "アップグレード前に次の問題を解決する必要があります:{upgradeIssues}。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25558,9 +25558,9 @@
"xpack.lens.app.settingsAriaLabel": "打开 Lens 设置菜单",
"xpack.lens.app.share.defaultDashboardTitle": "Lens 可视化 [{date}]",
"xpack.lens.app.shareButtonDisabledWarning": "此可视化没有可共享的数据。",
"xpack.lens.app.shareModal.title": "共享此 Lens 可视化",
"xpack.lens.app.shareModal.draftModeCallout.link.warning": "复制链接以获取临时链接。保存 Lens 可视化以创建永久链接。",
"xpack.lens.app.shareModal.draftModeCallout.title": "未保存的更改",
"xpack.lens.app.shareModal.title": "共享此 Lens 可视化",
"xpack.lens.app.shareTitle": "共享",
"xpack.lens.app.shareTitleAria": "共享可视化",
"xpack.lens.app.showUnderlyingDataMultipleLayers": "无法显示具有多个图层的可视化的底层数据",
Expand Down Expand Up @@ -47731,7 +47731,6 @@
"xpack.upgradeAssistant.overview.logsStep.title": "解决 API 弃用",
"xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "查看日志",
"xpack.upgradeAssistant.overview.observe.discoveryDescription": "搜索并筛选弃用日志以了解需要进行的更改类型。",
"xpack.upgradeAssistant.overview.observe.observabilityDescription": "深入了解正在使用哪些已弃用 API 以及需要更新哪些应用程序。",
"xpack.upgradeAssistant.overview.pageDescription": "准备使用下一版 Elastic Stack!",
"xpack.upgradeAssistant.overview.pageTitle": "升级助手",
"xpack.upgradeAssistant.overview.snapshotRestoreLink": "创建快照",
Expand Down Expand Up @@ -47768,7 +47767,6 @@
"xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "重置计数器",
"xpack.upgradeAssistant.overview.verifyChanges.retryButton": "重试",
"xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "在 Discover 中分析日志",
"xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "在日志浏览器中查看弃用日志",
"xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "所有弃用警告均已解决。",
"xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "在升级之前必须解决以下问题:{upgradeIssues}。",
"xpack.upgradeAssistant.status.esTotalCriticalDepsMessage": "{esTotalCriticalDeps} 个 Elasticsearch 弃用{esTotalCriticalDeps, plural, other {问题}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import {
APPS_WITH_DEPRECATION_LOGS,
DEPRECATION_LOGS_ORIGIN_FIELD,
} from '../../../common/constants';
import { stringifySearchParams } from '../helpers/app_context.mock';

// Once the logs team register the kibana locators in their app, we should be able
// to remove this mock and follow a similar approach to how discover link is tested.
// See: https://github.com/elastic/kibana/issues/104855
const MOCKED_TIME = '2021-09-05T10:49:01.805Z';
jest.mock('../../../public/application/lib/logs_checkpoint', () => {
const originalModule = jest.requireActual('../../../public/application/lib/logs_checkpoint');

Expand Down Expand Up @@ -157,40 +155,6 @@ describe('ES deprecation logs', () => {
httpRequestsMockHelpers.setLoadDeprecationLoggingResponse(getLoggingResponse(true));
});

test('Has a link to see logs in observability app', async () => {
await act(async () => {
testBed = await setupESDeprecationLogsPage(httpSetup, {
http: {
basePath: {
prepend: (url: string) => url,
},
},
});
});

const { component, exists, find } = testBed;

component.update();

expect(exists('viewObserveLogs')).toBe(true);
const locatorParams = stringifySearchParams({
id: DEPRECATION_LOGS_INDEX,
timeRange: {
from: MOCKED_TIME,
to: 'now',
},
query: {
language: 'kuery',
query: `not ${DEPRECATION_LOGS_ORIGIN_FIELD} : (${APPS_WITH_DEPRECATION_LOGS.join(
' or '
)})`,
},
});
const href = find('viewObserveLogs').props().href;
expect(href).toContain('logsExplorerUrl');
expect(href).toContain(locatorParams);
});

test('Has a link to see logs in discover app', async () => {
await act(async () => {
testBed = await setupESDeprecationLogsPage(httpSetup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,15 @@ import { buildPhrasesFilter, PhrasesFilter } from '@kbn/es-query';

import { FormattedMessage } from '@kbn/i18n-react';
import { METRIC_TYPE } from '@kbn/analytics';
import { EuiLink, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel, EuiText } from '@elastic/eui';
import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui';
import { DataView } from '@kbn/data-views-plugin/common';
import {
OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR_ID,
ObsLogsExplorerDataViewLocatorParams,
} from '@kbn/deeplinks-observability';
import {
APPS_WITH_DEPRECATION_LOGS,
DEPRECATION_LOGS_ORIGIN_FIELD,
} from '../../../../../common/constants';
import { DataPublicPluginStart } from '../../../../shared_imports';
import { useAppContext } from '../../../app_context';
import {
uiMetricService,
UIM_OBSERVABILITY_CLICK,
UIM_DISCOVER_CLICK,
} from '../../../lib/ui_metric';
import { uiMetricService, UIM_DISCOVER_CLICK } from '../../../lib/ui_metric';

import { DEPRECATION_LOGS_INDEX_PATTERN } from '../../../../../common/constants';

Expand Down Expand Up @@ -129,48 +121,6 @@ const DiscoverAppLink: FunctionComponent<Props> = ({ checkpoint, deprecationData
);
};

const ObservabilityAppLink: FunctionComponent<Props> = ({ checkpoint, deprecationDataView }) => {
const {
plugins: {
share: { url },
},
} = useAppContext();

const logsLocator = url.locators.get<ObsLogsExplorerDataViewLocatorParams>(
OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR_ID
)!;

if (!deprecationDataView.id) return null;

const logsUrl = logsLocator.getRedirectUrl({
id: deprecationDataView.id,
timeRange: {
from: checkpoint,
to: 'now',
},
query: {
language: 'kuery',
query: `not ${DEPRECATION_LOGS_ORIGIN_FIELD} : (${APPS_WITH_DEPRECATION_LOGS.join(' or ')})`,
},
});

return (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiLink
href={logsUrl}
onClick={() => {
uiMetricService.trackUiMetric(METRIC_TYPE.CLICK, UIM_OBSERVABILITY_CLICK);
}}
data-test-subj="viewObserveLogs"
>
<FormattedMessage
id="xpack.upgradeAssistant.overview.viewObservabilityResultsAction"
defaultMessage="View deprecation logs in Logs Explorer"
/>
</EuiLink>
);
};

export const ExternalLinks: FunctionComponent<Omit<Props, 'deprecationDataView'>> = ({
checkpoint,
}) => {
Expand All @@ -190,42 +140,19 @@ export const ExternalLinks: FunctionComponent<Omit<Props, 'deprecationDataView'>
}, [dataService, checkpoint, share.url.locators]);

return (
<EuiFlexGroup>
<EuiFlexItem>
<EuiPanel>
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.upgradeAssistant.overview.observe.observabilityDescription"
defaultMessage="Get insight into which deprecated APIs are being used and what applications you need to update."
/>
</p>
</EuiText>
<EuiSpacer size="m" />
{deprecationDataView ? (
<ObservabilityAppLink
checkpoint={checkpoint}
deprecationDataView={deprecationDataView}
/>
) : null}
</EuiPanel>
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel>
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.upgradeAssistant.overview.observe.discoveryDescription"
defaultMessage="Search and filter the deprecation logs to understand the types of changes you need to make."
/>
</p>
</EuiText>
<EuiSpacer size="m" />
{deprecationDataView ? (
<DiscoverAppLink checkpoint={checkpoint} deprecationDataView={deprecationDataView} />
) : null}
</EuiPanel>
</EuiFlexItem>
</EuiFlexGroup>
<>
<EuiText size="s">
<p>
<FormattedMessage
id="xpack.upgradeAssistant.overview.observe.discoveryDescription"
defaultMessage="Search and filter the deprecation logs to understand the types of changes you need to make."
/>
</p>
</EuiText>
<EuiSpacer size="m" />
{deprecationDataView ? (
<DiscoverAppLink checkpoint={checkpoint} deprecationDataView={deprecationDataView} />
) : null}
</>
);
};

0 comments on commit b059879

Please sign in to comment.