[App Search] Remove external "Launch App Search" button (#100815)

* Remove markup

* Remove i18n translations

* Remove telemetry metric
This commit is contained in:
Constance 2021-06-23 11:30:36 -07:00 committed by GitHub
parent 4d514c6db6
commit 391d0eca27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 4 additions and 88 deletions

View file

@ -5,6 +5,5 @@
* 2.0.
*/
export { LaunchAppSearchButton } from './launch_as_button';
export { EmptyState } from './empty_state';
export { EmptyMetaEnginesState } from './empty_meta_engines_state';

View file

@ -1,27 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import '../../../../__mocks__/enterprise_search_url.mock';
import { mockTelemetryActions } from '../../../../__mocks__/kea_logic';
import React from 'react';
import { shallow } from 'enzyme';
import { LaunchAppSearchButton } from './';
describe('LaunchAppSearchButton', () => {
it('renders a launch app search button that sends telemetry on click', () => {
const button = shallow(<LaunchAppSearchButton />);
expect(button.prop('href')).toBe('http://localhost:3002/as');
expect(button.prop('isDisabled')).toBeFalsy();
button.simulate('click');
expect(mockTelemetryActions.sendAppSearchTelemetry).toHaveBeenCalled();
});
});

View file

@ -1,41 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { useActions } from 'kea';
import { EuiButton } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { getAppSearchUrl } from '../../../../shared/enterprise_search_url';
import { TelemetryLogic } from '../../../../shared/telemetry';
export const LaunchAppSearchButton: React.FC = () => {
const { sendAppSearchTelemetry } = useActions(TelemetryLogic);
return (
// eslint-disable-next-line @elastic/eui/href-or-on-click
<EuiButton
size="s"
iconType="popout"
href={getAppSearchUrl()}
target="_blank"
onClick={() =>
sendAppSearchTelemetry({
action: 'clicked',
metric: 'header_launch_button',
})
}
data-test-subj="launchButton"
>
{i18n.translate('xpack.enterpriseSearch.appSearch.productCta', {
defaultMessage: 'Launch App Search',
})}
</EuiButton>
);
};

View file

@ -20,7 +20,7 @@ import { ENGINE_CREATION_PATH, META_ENGINE_CREATION_PATH } from '../../routes';
import { DataPanel } from '../data_panel';
import { AppSearchPageTemplate } from '../layout';
import { LaunchAppSearchButton, EmptyState, EmptyMetaEnginesState } from './components';
import { EmptyState, EmptyMetaEnginesState } from './components';
import { EnginesTable } from './components/tables/engines_table';
import { MetaEnginesTable } from './components/tables/meta_engines_table';
import {
@ -65,10 +65,7 @@ export const EnginesOverview: React.FC = () => {
<AppSearchPageTemplate
pageViewTelemetry="engines_overview"
pageChrome={[ENGINES_TITLE]}
pageHeader={{
pageTitle: ENGINES_OVERVIEW_TITLE,
rightSideItems: [<LaunchAppSearchButton />],
}}
pageHeader={{ pageTitle: ENGINES_OVERVIEW_TITLE }}
isLoading={dataLoading}
isEmptyState={!engines.length}
emptyState={<EmptyState />}

View file

@ -25,8 +25,7 @@ describe('App Search Telemetry Usage Collector', () => {
'ui_error.cannot_connect': 3,
'ui_error.not_found': 7,
'ui_clicked.create_first_engine_button': 40,
'ui_clicked.header_launch_button': 50,
'ui_clicked.engine_table_link': 60,
'ui_clicked.engine_table_link': 50,
},
}),
incrementCounter: jest.fn(),
@ -66,8 +65,7 @@ describe('App Search Telemetry Usage Collector', () => {
},
ui_clicked: {
create_first_engine_button: 40,
header_launch_button: 50,
engine_table_link: 60,
engine_table_link: 50,
},
});
});
@ -93,7 +91,6 @@ describe('App Search Telemetry Usage Collector', () => {
},
ui_clicked: {
create_first_engine_button: 0,
header_launch_button: 0,
engine_table_link: 0,
},
});

View file

@ -23,7 +23,6 @@ interface Telemetry {
};
ui_clicked: {
create_first_engine_button: number;
header_launch_button: number;
engine_table_link: number;
};
}
@ -54,7 +53,6 @@ export const registerTelemetryUsageCollector = (
},
ui_clicked: {
create_first_engine_button: { type: 'long' },
header_launch_button: { type: 'long' },
engine_table_link: { type: 'long' },
},
},
@ -85,7 +83,6 @@ const fetchTelemetryMetrics = async (savedObjects: SavedObjectsServiceStart, log
},
ui_clicked: {
create_first_engine_button: 0,
header_launch_button: 0,
engine_table_link: 0,
},
};
@ -110,7 +107,6 @@ const fetchTelemetryMetrics = async (savedObjects: SavedObjectsServiceStart, log
'ui_clicked.create_first_engine_button',
0
),
header_launch_button: get(savedObjectAttributes, 'ui_clicked.header_launch_button', 0),
engine_table_link: get(savedObjectAttributes, 'ui_clicked.engine_table_link', 0),
},
} as Telemetry;

View file

@ -1924,9 +1924,6 @@
"create_first_engine_button": {
"type": "long"
},
"header_launch_button": {
"type": "long"
},
"engine_table_link": {
"type": "long"
}

View file

@ -7857,7 +7857,6 @@
"xpack.enterpriseSearch.appSearch.multiInputRows.removeValueButtonLabel": "値を削除",
"xpack.enterpriseSearch.appSearch.ownerRoleTypeDescription": "所有者はすべての操作を実行できます。アカウントには複数の所有者がいる場合がありますが、一度に少なくとも1人の所有者が必要です。",
"xpack.enterpriseSearch.appSearch.productCardDescription": "Elastic App Search には、強力な検索を設計し、Web サイトや Web/モバイルアプリケーションにデプロイするための使いやすいツールがあります。",
"xpack.enterpriseSearch.appSearch.productCta": "App Searchの起動",
"xpack.enterpriseSearch.appSearch.productDescription": "ダッシュボード、分析、APIを活用し、高度なアプリケーション検索をシンプルにします。",
"xpack.enterpriseSearch.appSearch.productName": "App Search",
"xpack.enterpriseSearch.appSearch.result.documentDetailLink": "ドキュメントの詳細を表示",

View file

@ -7924,7 +7924,6 @@
"xpack.enterpriseSearch.appSearch.multiInputRows.removeValueButtonLabel": "删除值",
"xpack.enterpriseSearch.appSearch.ownerRoleTypeDescription": "所有者可以执行任何操作。该帐户可以有很多所有者,但任何时候必须至少有一个所有者。",
"xpack.enterpriseSearch.appSearch.productCardDescription": "Elastic App Search 提供用户友好的工具,用于设计强大的搜索功能,并将其部署到您的网站或 Web/移动应用程序。",
"xpack.enterpriseSearch.appSearch.productCta": "启动 App Search",
"xpack.enterpriseSearch.appSearch.productDescription": "利用仪表板、分析和 API 执行高级应用程序搜索简单易行。",
"xpack.enterpriseSearch.appSearch.productName": "App Search",
"xpack.enterpriseSearch.appSearch.result.documentDetailLink": "访问文档详情",