forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serverless Search] getting started: update connection details section (
elastic#172320) ## Summary Updating the cloud details section per the updated design: <img width="1428" alt="image" src="https://github.com/elastic/kibana/assets/1972968/51b11320-7abf-466b-a05c-10a72ebec4f1"> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Liam Thompson <[email protected]> Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
55c837a
commit 9034cb6
Showing
5 changed files
with
129 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
x-pack/plugins/serverless_search/public/application/components/overview/cloud_details.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
* 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, { useState } from 'react'; | ||
import { | ||
EuiCheckableCard, | ||
EuiCodeBlock, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiPanel, | ||
EuiSpacer, | ||
EuiText, | ||
EuiThemeProvider, | ||
EuiTitle, | ||
EuiBadge, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { OverviewPanel } from '@kbn/search-api-panels'; | ||
|
||
export interface CloudDetailsPanelProps { | ||
cloudId?: string; | ||
elasticsearchUrl?: string; | ||
} | ||
|
||
enum CloudDetail { | ||
ElasticsearchEndpoint = 'es_url', | ||
CloudId = 'cloud_id', | ||
} | ||
|
||
export const CloudDetailsPanel = ({ cloudId, elasticsearchUrl }: CloudDetailsPanelProps) => { | ||
const [selectedDetail, setSelectedCloudDetail] = useState<CloudDetail>( | ||
CloudDetail.ElasticsearchEndpoint | ||
); | ||
return ( | ||
<OverviewPanel | ||
description={i18n.translate('xpack.serverlessSearch.cloudIdDetails.description', { | ||
defaultMessage: 'Get ready to ingest and query your data by choosing a connection option:', | ||
})} | ||
leftPanelContent={ | ||
<EuiThemeProvider colorMode="dark"> | ||
<EuiPanel paddingSize="xs"> | ||
<EuiCodeBlock isCopyable fontSize="m" className="serverlessSearchCloudDetailsCopyPanel"> | ||
{selectedDetail === CloudDetail.CloudId && cloudId} | ||
{selectedDetail === CloudDetail.ElasticsearchEndpoint && elasticsearchUrl} | ||
</EuiCodeBlock> | ||
</EuiPanel> | ||
</EuiThemeProvider> | ||
} | ||
links={[]} | ||
title={i18n.translate('xpack.serverlessSearch.cloudIdDetails.title', { | ||
defaultMessage: 'Copy your connection details', | ||
})} | ||
> | ||
<EuiSpacer size="l" /> | ||
<EuiCheckableCard | ||
id={CloudDetail.ElasticsearchEndpoint} | ||
name={CloudDetail.ElasticsearchEndpoint} | ||
label={ | ||
<EuiFlexGroup alignItems="center"> | ||
<EuiFlexItem> | ||
<EuiTitle size="xxs"> | ||
<h5> | ||
<FormattedMessage | ||
id="xpack.serverlessSearch.cloudIdDetails.elasticsearchEndpoint.title" | ||
defaultMessage="Elasticsearch endpoint" | ||
/> | ||
</h5> | ||
</EuiTitle> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<span> | ||
<EuiBadge color="success"> | ||
<FormattedMessage | ||
id="xpack.serverlessSearch.cloudIdDetails.elasticsearchEndpoint.recommendedBadge" | ||
defaultMessage="Recommended" | ||
/> | ||
</EuiBadge> | ||
</span> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
} | ||
checked={selectedDetail === CloudDetail.ElasticsearchEndpoint} | ||
onChange={() => setSelectedCloudDetail(CloudDetail.ElasticsearchEndpoint)} | ||
> | ||
<EuiText size="s"> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.serverlessSearch.cloudIdDetails.elasticsearchEndpoint.description" | ||
defaultMessage="The most common method for establishing an Elasticsearch connection." | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiCheckableCard> | ||
<EuiSpacer /> | ||
<EuiCheckableCard | ||
id={CloudDetail.CloudId} | ||
name={CloudDetail.CloudId} | ||
label={ | ||
<EuiTitle size="xxs"> | ||
<h5> | ||
<FormattedMessage | ||
id="xpack.serverlessSearch.cloudIdDetails.cloudId.title" | ||
defaultMessage="Cloud ID" | ||
/> | ||
</h5> | ||
</EuiTitle> | ||
} | ||
checked={selectedDetail === CloudDetail.CloudId} | ||
onChange={() => setSelectedCloudDetail(CloudDetail.CloudId)} | ||
> | ||
<EuiText size="s"> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.serverlessSearch.cloudIdDetails.cloudId.description" | ||
defaultMessage="Specific client libraries and connectors can use this unique identifier specific to Elastic Cloud." | ||
/> | ||
</p> | ||
</EuiText> | ||
</EuiCheckableCard> | ||
</OverviewPanel> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters