Skip to content

Commit

Permalink
[8.x] [Onboarding] UX Feedback - Slight Tweaks to search detail (#194873
Browse files Browse the repository at this point in the history
) (#196314)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Onboarding] UX Feedback - Slight Tweaks to search detail
(#194873)](#194873)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Michael
DeFazio","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T13:33:31Z","message":"[Onboarding]
UX Feedback - Slight Tweaks to search detail (#194873)\n\nTweaks to
search
details\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a583a9d9-b059-4ce1-beaa-f7c733feabf0\r\n\r\n---------\r\n\r\nCo-authored-by:
Joseph McElroy <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"545f5a42f7af27bad33e272aa67eb59ac27e04ce","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:prev-minor"],"title":"[Onboarding]
UX Feedback - Slight Tweaks to search
detail","number":194873,"url":"https://github.com/elastic/kibana/pull/194873","mergeCommit":{"message":"[Onboarding]
UX Feedback - Slight Tweaks to search detail (#194873)\n\nTweaks to
search
details\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a583a9d9-b059-4ce1-beaa-f7c733feabf0\r\n\r\n---------\r\n\r\nCo-authored-by:
Joseph McElroy <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"545f5a42f7af27bad33e272aa67eb59ac27e04ce"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194873","number":194873,"mergeCommit":{"message":"[Onboarding]
UX Feedback - Slight Tweaks to search detail (#194873)\n\nTweaks to
search
details\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a583a9d9-b059-4ce1-beaa-f7c733feabf0\r\n\r\n---------\r\n\r\nCo-authored-by:
Joseph McElroy <[email protected]>\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"545f5a42f7af27bad33e272aa67eb59ac27e04ce"}}]}]
BACKPORT-->

Co-authored-by: Michael DeFazio <[email protected]>
  • Loading branch information
kibanamachine and mdefazio authored Oct 15, 2024
1 parent db2adf7 commit a8cec56
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const ApiKeyForm: React.FC<ApiKeyFormProps> = ({ hasTitle = true }) => {
actions={[
<EuiButtonIcon
iconType={apiKeyIsVisible ? 'eyeClosed' : 'eye'}
color="success"
color="text"
onClick={toggleApiKeyVisibility}
data-test-subj="showAPIKeyButton"
aria-label={i18n.translate('searchApiKeysComponents.apiKeyForm.showApiKey', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const SearchApiKeyProvider: React.FC<React.PropsWithChildren> = ({ childr
}, [state.status, createApiKey, validateApiKey]);

const value: APIKeyContext = {
displayedApiKey: state.status === Status.showHiddenKey ? API_KEY_MASK : state.apiKey,
displayedApiKey: state.status === Status.showPreviewKey ? state.apiKey : API_KEY_MASK,
apiKey: state.apiKey,
toggleApiKeyVisibility: handleShowKeyVisibility,
updateApiKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const FormInfoField: React.FC<FormInfoFieldProps> = ({
<EuiButtonIcon
onClick={copy}
iconType="copy"
color="text"
data-test-subj={copyValueDataTestSubj}
aria-label={i18n.translate('xpack.searchSharedUI.formInfoField.copyMessage', {
defaultMessage: 'Copy to clipboard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
*/

import {
EuiPageSection,
EuiButton,
EuiPageTemplate,
EuiFlexItem,
EuiFlexGroup,
EuiButtonEmpty,
EuiTabbedContent,
EuiTabbedContentTab,
useEuiTheme,
} from '@elastic/eui';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useParams } from 'react-router-dom';
Expand Down Expand Up @@ -159,6 +158,7 @@ export const SearchIndexDetailsPage = () => {
const handleDeleteIndexModal = useCallback(() => {
setShowDeleteIndexModal(!isShowingDeleteModal);
}, [isShowingDeleteModal]);
const { euiTheme } = useEuiTheme();

if (isInitialLoading || isMappingsInitialLoading) {
return (
Expand Down Expand Up @@ -187,24 +187,13 @@ export const SearchIndexDetailsPage = () => {
/>
) : (
<>
<EuiPageSection>
<EuiButton
data-test-subj="backToIndicesButton"
color="text"
iconType="arrowLeft"
onClick={() => navigateToIndexListPage()}
>
<FormattedMessage
id="xpack.searchIndices.backToIndicesButtonLabel"
defaultMessage="Back to indices"
/>
</EuiButton>
</EuiPageSection>
<EuiPageTemplate.Header
restrictWidth
data-test-subj="searchIndexDetailsHeader"
pageTitle={index?.name}
bottomBorder={false}
rightSideItems={[
<EuiFlexGroup gutterSize="none">
<EuiFlexGroup gutterSize="m">
<EuiFlexItem>
{!isDocumentsExists ? (
<EuiButtonEmpty
Expand Down Expand Up @@ -248,23 +237,29 @@ export const SearchIndexDetailsPage = () => {
</EuiFlexGroup>,
]}
/>
<EuiPageTemplate.Section grow={false}>
<EuiPageTemplate.Section
grow={false}
restrictWidth
css={{ padding: `0 ${euiTheme.size.l} ${euiTheme.size.l}` }}
>
<EuiFlexGroup direction="column">
<EuiFlexItem>
<EuiFlexGroup css={{ overflow: 'auto' }}>
<EuiFlexItem css={{ flexShrink: 0 }}>
<ConnectionDetails />
</EuiFlexItem>
<EuiFlexItem css={{ flexShrink: 0 }}>
<ApiKeyForm />
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexGroup>
<QuickStats index={index} mappings={mappings} />
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexGroup direction="column">
<EuiFlexItem>
<EuiFlexGroup css={{ overflow: 'auto' }} wrap>
<EuiFlexItem grow={false} css={{ minWidth: 400 }}>
<ConnectionDetails />
</EuiFlexItem>
<EuiFlexItem grow={false} css={{ minWidth: 400 }}>
<ApiKeyForm />
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem>
<EuiFlexGroup>
<QuickStats index={index} mappings={mappings} />
</EuiFlexGroup>
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexItem>
<EuiFlexItem>
<EuiTabbedContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiFlexItem,
EuiIcon,
EuiPanel,
EuiTitle,
EuiText,
useEuiTheme,
useGeneratedHtmlId,
Expand Down Expand Up @@ -83,12 +84,14 @@ export const QuickStat: React.FC<BaseQuickStatProps> = ({
<EuiIcon type={icon} color={iconColor} />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText>
<EuiTitle size="xxs">
<h4>{title}</h4>
</EuiText>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText color="subdued">{secondaryTitle}</EuiText>
<EuiText size="s" color="subdued">
{secondaryTitle}
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ export function SvlSearchIndexDetailPageProvider({ getService }: FtrProviderCont
async expectUseInPlaygroundLinkExists() {
await testSubjects.existOrFail('useInPlaygroundLink', { timeout: 5000 });
},
async expectBackToIndicesButtonExists() {
await testSubjects.existOrFail('backToIndicesButton', { timeout: 2000 });
},
async clickBackToIndicesButton() {
await testSubjects.click('backToIndicesButton');
},
async expectBackToIndicesButtonRedirectsToListPage() {
await testSubjects.existOrFail('indicesList');
},
async expectConnectionDetails() {
await testSubjects.existOrFail('connectionDetailsEndpoint', { timeout: 2000 });
expect(await (await testSubjects.find('connectionDetailsEndpoint')).getVisibleText()).to.be(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await pageObjects.svlSearchIndexDetailPage.expectAPIKeyToBeVisibleInCodeBlock(apiKey);
});

it('back to indices button should redirect to list page', async () => {
await pageObjects.svlSearchIndexDetailPage.expectBackToIndicesButtonExists();
await pageObjects.svlSearchIndexDetailPage.clickBackToIndicesButton();
await pageObjects.svlSearchIndexDetailPage.expectBackToIndicesButtonRedirectsToListPage();
});
describe('With data', () => {
before(async () => {
await es.index({
Expand Down

0 comments on commit a8cec56

Please sign in to comment.