Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Design changes to main panels #165687

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
flex-direction: column;
flex-wrap: nowrap;
height: 100%;

.euiDataGrid__content {
background: transparent;
}
}

.unifiedDataTable__table {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const FieldNameSearch: React.FC<FieldNameSearchProps> = ({
placeholder={searchPlaceholder}
value={nameFilter}
append={append}
compressed
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import './field_list_sidebar.scss';
import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPageSidebar } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiPageSidebar } from '@elastic/eui';
import { ToolbarButton } from '@kbn/shared-ux-button-toolbar';
import { type DataViewField } from '@kbn/data-views-plugin/public';
import { getDataViewFieldSubtypeMulti } from '@kbn/es-query/src/utils';
import { FIELDS_LIMIT_SETTING, SEARCH_FIELDS_FROM_SOURCE } from '@kbn/discover-utils';
Expand Down Expand Up @@ -295,19 +296,18 @@ export const UnifiedFieldListSidebarComponent: React.FC<UnifiedFieldListSidebarP
)}
{!!onEditField && (
<EuiFlexItem grow={false}>
<EuiButton
<ToolbarButton
iconType="indexOpen"
label={i18n.translate('unifiedFieldList.fieldListSidebar.addFieldButtonLabel', {
defaultMessage: 'Add a field',
})}
data-test-subj={
stateService.creationOptions.dataTestSubj?.fieldListAddFieldButtonTestSubj ??
'unifiedFieldListAddField'
}
onClick={() => onEditField()}
size="s"
>
{i18n.translate('unifiedFieldList.fieldListSidebar.addFieldButtonLabel', {
defaultMessage: 'Add a field',
})}
</EuiButton>
/>
</EuiFlexItem>
)}
</FieldList>
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-unified-field-list/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@kbn/shared-ux-utility",
"@kbn/discover-utils",
"@kbn/ebt-tools",
"@kbn/shared-ux-button-toolbar",
],
"exclude": ["target/**/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ discover-app {
overflow: hidden;
}

.dscPageBody__sidebar {
.unifiedFieldListItemButton.domDragDrop-isDraggable {
box-shadow: none;
}
}

.dscPageContent__wrapper {
padding: $euiSizeS $euiSizeS $euiSizeS 0;
overflow: hidden; // Ensures horizontal scroll of table

@include euiBreakpoint('xs', 's') {
padding: 0 $euiSizeS $euiSizeS;
}
}

.dscPageContent {
position: relative;
overflow: hidden;
border: $euiBorderThin;
height: 100%;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import {
EuiPage,
EuiPageBody,
EuiPanel,
EuiSpacer,
useEuiBackgroundColor,
useEuiTheme,
} from '@elastic/eui';
import { css } from '@emotion/react';
import { i18n } from '@kbn/i18n';
import { METRIC_TYPE } from '@kbn/analytics';
import classNames from 'classnames';
Expand Down Expand Up @@ -77,6 +79,8 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
spaces,
inspector,
} = useDiscoverServices();
const { euiTheme } = useEuiTheme();
const pageBackgroundColor = useEuiBackgroundColor('plain');
const globalQueryState = data.query.getState();
const { main$ } = stateContainer.dataState.data$;
const [query, savedQuery, columns, sort] = useAppStateSelector((state) => [
Expand Down Expand Up @@ -240,7 +244,13 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
]);

return (
<EuiPage className="dscPage" data-fetch-counter={fetchCounter.current}>
<EuiPage
className="dscPage"
data-fetch-counter={fetchCounter.current}
css={css`
background-color: ${pageBackgroundColor};
`}
>
<h1
id="savedSearchTitle"
className="euiScreenReaderOnly"
Expand Down Expand Up @@ -274,8 +284,8 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
spaces={spaces}
history={history}
/>
<EuiFlexGroup className="dscPageBody__contents" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiFlexGroup className="dscPageBody__contents" gutterSize="none">
<EuiFlexItem grow={false} className="dscPageBody__sidebar">
<SidebarMemoized
documents$={stateContainer.dataState.data$.documents$}
onAddField={onAddColumn}
Expand All @@ -292,9 +302,14 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
/>
</EuiFlexItem>
<EuiHideFor sizes={['xs', 's']}>
<EuiFlexItem grow={false}>
<EuiFlexItem
grow={false}
css={css`
padding: ${euiTheme.size.m} ${euiTheme.size.s} 0;
border-right: ${euiTheme.border.thin};
`}
>
<div>
<EuiSpacer size="s" />
<EuiButtonIcon
iconType={isSidebarClosed ? 'menuRight' : 'menuLeft'}
iconSize="m"
Expand Down Expand Up @@ -335,7 +350,10 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
role="main"
panelRef={resizeRef}
paddingSize="none"
borderRadius="none"
hasShadow={false}
hasBorder={false}
color="transparent"
className={classNames('dscPageContent', {
'dscPageContent--centered': contentCentered,
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export const NoResultsSuggestions: React.FC<NoResultsSuggestionProps> = ({
return (
<EuiEmptyPrompt
layout="horizontal"
color="plain"
color="transparent"
icon={<NoResultsIllustration />}
hasBorder
hasBorder={false}
title={
<h2 data-test-subj="discoverNoResults">
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { EuiTabs, EuiTab, useEuiPaddingSize } from '@elastic/eui';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import { SHOW_FIELD_STATISTICS } from '@kbn/discover-utils';
import { VIEW_MODE } from '../../../common/constants';
import { useDiscoverServices } from '../../hooks/use_discover_services';
Expand All @@ -26,7 +25,6 @@ export const DocumentViewModeToggle = ({

const tabsCss = css`
padding: 0 ${useEuiPaddingSize('s')};
background-color: ${euiThemeVars.euiPageBackgroundColor};
`;

const showViewModeToggle = uiSettings.get(SHOW_FIELD_STATISTICS) ?? false;
Expand Down