Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const getListItemStyle = ({ border, colors, size }: EuiThemeComputed<{}>)
`,
field: css`
border-bottom: ${border.thin};
height: calc(${size.xl} * 2);
min-height: calc(${size.xl} * 2);
margin-top: ${size.xs};
`,
fieldEnabled: css`
Expand All @@ -37,7 +37,7 @@ export const getListItemStyle = ({ border, colors, size }: EuiThemeComputed<{}>)
padding-left: ${size.m};
`,
content: css`
height: calc(${size.xl} * 2);
min-height: calc(${size.xl} * 2);
position: relative;
`,
contentIndent: css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ function FieldListItemComponent(
<EuiFlexGroup
gutterSize="s"
alignItems="center"
wrap
css={[
styles.content,
!hasChildFields &&
Expand Down Expand Up @@ -265,18 +266,22 @@ function FieldListItemComponent(
</EuiFlexItem>
)}

{isMultiField && (
<EuiFlexItem grow={false}>
<EuiIcon color="subdued" type="documents" />
</EuiFlexItem>
)}
<EuiFlexItem>
<EuiFlexGroup gutterSize="s" alignItems="center" wrap={false} responsive={false}>
{isMultiField && (
<EuiFlexItem grow={false}>
<EuiIcon color="subdued" type="documents" aria-hidden="true" />
</EuiFlexItem>
)}

<EuiFlexItem
grow={false}
data-test-subj={`fieldName ${dataTestSubj}-fieldName`}
aria-label={i18nTexts.fieldListNameLabel}
>
{source.name}
<EuiFlexItem
grow={false}
data-test-subj={`fieldName ${dataTestSubj}-fieldName`}
aria-label={i18nTexts.fieldListNameLabel}
>
{source.name}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>

<EuiFlexGroup aria-label={i18nTexts.fieldListTypesLabel}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,15 @@ export const DetailsPageMappingsContent: FunctionComponent<{
}
`;

const mappingsListPanelStyles = css`
min-width: 0;
width: 100%;
height: 100%;
${useEuiBreakpoint(['m', 'l', 'xl'])} {
min-width: 600px;
}
`;

const saveMappingsButton = (
<EuiButton
onClick={() => updateMappings()}
Expand Down Expand Up @@ -562,13 +571,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{
</EuiFlexItem>
)}
{hasMappings && (
<EuiFlexItem
grow={false}
css={css`
min-width: 600px;
height: 100%;
`}
>
<EuiFlexItem grow={false} css={mappingsListPanelStyles}>
<EuiPanel hasShadow={false} paddingSize="none">
{isJSONVisible ? jsonBlock : treeViewBlock}
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { every } from 'lodash';
import type { EuiPopoverProps, EuiButtonProps } from '@elastic/eui';
import { EuiButton, EuiContextMenu, EuiPopover, EuiSpacer, EuiText } from '@elastic/eui';
import {
EuiButton,
EuiContextMenu,
EuiPopover,
EuiSpacer,
EuiText,
useEuiTheme,
} from '@elastic/eui';
import { css } from '@emotion/react';

import type { HttpSetup } from '@kbn/core-http-browser';
import { flattenPanelTree } from '../../../../lib/flatten_panel_tree';
Expand Down Expand Up @@ -80,7 +88,7 @@ export const IndexActionsContextMenu = ({
indices,
isOnListView,
resetSelection,
anchorPosition = 'rightUp',
anchorPosition,
iconSide = 'right',
iconType = 'chevronSingleDown',
label,
Expand Down Expand Up @@ -108,6 +116,21 @@ export const IndexActionsContextMenu = ({

const [isPopoverOpen, setIsPopoverOpen] = useState<boolean>(false);
const modalRef = useRef<ModalHostHandles | null>(null);
const { euiTheme } = useEuiTheme();
const computedAnchorPosition: EuiPopoverProps['anchorPosition'] =
anchorPosition ?? (isOnListView ? 'downLeft' : 'downRight');

const popoverStyles = css`
overflow-x: hidden;
max-height: min(60vh, calc(100vh - ${euiTheme.size.xxxl} - ${euiTheme.size.m}));
max-width: calc(100vw - ${euiTheme.size.xl});
@supports (height: 100dvh) {
max-height: min(60dvh, calc(100dvh - ${euiTheme.size.xxxl} - ${euiTheme.size.m}));
}
@supports (width: 100dvw) {
max-width: calc(100dvw - ${euiTheme.size.xl});
}
`;

const onButtonClick = () => {
setIsPopoverOpen((prevState) => !prevState);
Expand Down Expand Up @@ -447,8 +470,12 @@ export const IndexActionsContextMenu = ({
isOpen={isPopoverOpen}
closePopover={closePopover}
panelPaddingSize="none"
anchorPosition={anchorPosition}
anchorPosition={computedAnchorPosition}
repositionOnScroll
repositionToCrossAxis={false}
panelProps={{
css: popoverStyles,
}}
>
<EuiContextMenu data-test-subj="indexContextMenu" initialPanelId={0} panels={panels} />
</EuiPopover>
Expand Down
Loading