Skip to content

Commit

Permalink
Merge branch 'main' into fix/heatmap-legend
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme authored Oct 11, 2024
2 parents 7be384d + f9417fb commit a78d8c0
Show file tree
Hide file tree
Showing 379 changed files with 9,189 additions and 8,716 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
env:
TARGET_ENV: production
CHECK_SLO: true
CHECK_SLO_TAG: kibana
CHECK_SLO_TAG: kbn-quality-gate
CHECK_SLO_WAITING_PERIOD: 15m
CHECK_SLO_BURN_RATE_THRESHOLD: 0.1
DEPLOYMENT_SLICES: ${DEPLOYMENT_SLICES:-""}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ steps:
command: "make -C /agent trigger-manual-verification-phase"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.6"
if: build.env("DEPLOYMENT_SLICES") =~ /.*staging-ds-2.*/
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ steps:
env:
TARGET_ENV: production
CHECK_SLO: true
CHECK_SLO_TAG: kibana
CHECK_SLO_TAG: kbn-quality-gate
CHECK_SLO_WAITING_PERIOD: 15m
CHECK_SLO_BURN_RATE_THRESHOLD: 0.1
DEPLOYMENT_SLICES: ${DEPLOYMENT_SLICES:-""}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const ObservabilityUptimeAlertOptional = rt.partial({
value: schemaStringArray,
})
),
labels: schemaUnknown,
'location.id': schemaStringArray,
'location.name': schemaStringArray,
'monitor.id': schemaString,
Expand All @@ -97,6 +98,7 @@ const ObservabilityUptimeAlertOptional = rt.partial({
'monitor.type': schemaString,
'observer.geo.name': schemaStringArray,
'observer.name': schemaStringArray,
'service.name': schemaString,
'tls.server.hash.sha256': schemaString,
'tls.server.x509.issuer.common_name': schemaString,
'tls.server.x509.not_after': schemaDate,
Expand Down
10 changes: 10 additions & 0 deletions packages/kbn-search-index-documents/components/result/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export const PERMANENTLY_TRUNCATED_FIELDS = ['dense_vector', 'sparse_vector'];
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export {
resultMetaData,
resultToFieldFromMappingResponse,
resultToFieldFromMappings as resultToField,
reorderFieldsInImportance,
} from './result_metadata';
34 changes: 25 additions & 9 deletions packages/kbn-search-index-documents/components/result/result.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
.resultField:nth-child(odd) {
background-color: $euiColorLightestShade;
}

.resultField {
padding: $euiSizeXS $euiSizeS;
padding: 0;
border-bottom: 1px solid $euiColorLightShade;
position: relative;

&:last-child {
border-bottom: none;
}

> .euiTableRowCell {
>.euiTableRow:hover {
background-color: $euiColorEmptyShade;
}

>.euiTableRowCell {
border-top: none;
border-bottom: none;

> .euiTableCellContent {
padding: $euiSizeXS;
>.euiTableCellContent {
padding: $euiSizeS;
font-family: $euiCodeFontFamily;
color: $euiColorMediumShade;
}
}
}

.denseVectorFieldValue {
position: absolute;
right: 0;
top: $euiSizeS;
background-color: $euiColorEmptyShade;
padding: 0 $euiSizeS;
}

.resultExpandColumn {
border-left: $euiBorderThin;
align-items: flex-start;
Expand All @@ -31,4 +47,4 @@
display: flex;
align-items: center;
justify-content: flex-start;
}
}
152 changes: 59 additions & 93 deletions packages/kbn-search-index-documents/components/result/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
EuiButtonIcon,
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
EuiSpacer,
EuiHorizontalRule,
EuiSplitPanel,
EuiToolTip,
} from '@elastic/eui';

Expand Down Expand Up @@ -66,99 +66,65 @@ export const Result: React.FC<ResultProps> = ({
const toolTipContent = <>{tooltipText}</>;

return (
<EuiPanel
hasBorder
data-test-subj="search-index-documents-result"
paddingSize={compactCard ? 's' : 'l'}
>
<EuiFlexGroup gutterSize="none">
<EuiFlexItem>
<EuiFlexGroup
direction="column"
gutterSize="none"
responsive={false}
justifyContent="spaceAround"
>
<EuiFlexItem grow={false}>
{compactCard && (
<ResultHeader
title={
metaData.title ??
i18n.translate('searchIndexDocuments.result.title.id', {
defaultMessage: 'Document id: {id}',
values: { id: metaData.id },
})
}
metaData={{
...metaData,
onDocumentDelete,
}}
/>
)}
{!compactCard && (
<RichResultHeader
showScore={showScore}
title={
metaData.title ??
i18n.translate('searchIndexDocuments.result.title.id', {
defaultMessage: 'Document id: {id}',
values: { id: metaData.id },
})
}
onTitleClick={onDocumentClick}
metaData={{
...metaData,
onDocumentDelete,
}}
rightSideActions={
<EuiFlexItem grow={false}>
<EuiToolTip position="left" content={toolTipContent}>
<EuiButtonIcon
iconType={isExpanded ? 'fold' : 'unfold'}
color={isExpanded ? 'danger' : 'primary'}
onClick={(e: React.MouseEvent<HTMLElement>) => {
e.stopPropagation();
setIsExpanded(!isExpanded);
}}
aria-label={tooltipText}
/>
</EuiToolTip>
</EuiFlexItem>
}
/>
)}
</EuiFlexItem>
<EuiFlexItem>
{!compactCard &&
((isExpanded && fields.length > 0) ||
(!isExpanded && fields.slice(0, defaultVisibleFields).length > 0)) && (
<EuiSpacer size="l" />
)}
<ResultFields
isExpanded={isExpanded}
fields={isExpanded ? fields : fields.slice(0, defaultVisibleFields)}
<EuiSplitPanel.Outer hasBorder={true} data-test-subj="search-index-documents-result">
<EuiSplitPanel.Inner paddingSize="m" color="plain" className="resultHeaderContainer">
<EuiFlexGroup gutterSize="none" alignItems="center">
<EuiFlexItem>
{compactCard && (
<ResultHeader
title={
metaData.title ??
i18n.translate('searchIndexDocuments.result.title.id', {
defaultMessage: 'Document id: {id}',
values: { id: metaData.id },
})
}
metaData={metaData}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{compactCard && (
)}

{!compactCard && (
<RichResultHeader
showScore={showScore}
title={
metaData.title ??
i18n.translate('searchIndexDocuments.result.title.id', {
defaultMessage: 'Document id: {id}',
values: { id: metaData.id },
})
}
onTitleClick={onDocumentClick}
metaData={{
...metaData,
onDocumentDelete,
}}
/>
)}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<div className="resultExpandColumn">
<EuiToolTip position="left" content={toolTipContent}>
<EuiButtonIcon
iconType={isExpanded ? 'fold' : 'unfold'}
color="text"
onClick={(e: React.MouseEvent<HTMLElement>) => {
e.stopPropagation();
setIsExpanded(!isExpanded);
}}
aria-label={tooltipText}
/>
</EuiToolTip>
</div>
<EuiToolTip position="left" content={toolTipContent}>
<EuiButtonIcon
size="xs"
iconType={isExpanded ? 'fold' : 'unfold'}
color={isExpanded ? 'danger' : 'primary'}
data-test-subj={isExpanded ? 'documentShowLessFields' : 'documentShowMoreFields'}
onClick={(e: React.MouseEvent<HTMLElement>) => {
e.stopPropagation();
setIsExpanded(!isExpanded);
}}
aria-label={tooltipText}
/>
</EuiToolTip>
</EuiFlexItem>
)}
</EuiFlexGroup>
</EuiPanel>
</EuiFlexGroup>
</EuiSplitPanel.Inner>
<EuiHorizontalRule margin="none" />
<EuiSplitPanel.Inner paddingSize="m">
<ResultFields
isExpanded={isExpanded}
fields={isExpanded ? fields : fields.slice(0, defaultVisibleFields)}
/>
</EuiSplitPanel.Inner>
</EuiSplitPanel.Outer>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@

import React from 'react';

import {
EuiCodeBlock,
EuiIcon,
EuiTableRow,
EuiTableRowCell,
EuiText,
EuiToken,
} from '@elastic/eui';
import { EuiTableRow, EuiTableRowCell, EuiText, EuiToken } from '@elastic/eui';

import { euiThemeVars } from '@kbn/ui-theme';
import { ResultFieldProps } from './result_types';
import { PERMANENTLY_TRUNCATED_FIELDS } from './constants';
import { ResultFieldValue } from './result_field_value';

const iconMap: Record<string, string> = {
boolean: 'tokenBoolean',
Expand Down Expand Up @@ -64,9 +59,11 @@ export const ResultField: React.FC<ResultFieldProps> = ({
iconType,
fieldName,
fieldValue,
fieldType,
fieldType = 'object',
isExpanded,
}) => {
const shouldTruncate = !isExpanded || PERMANENTLY_TRUNCATED_FIELDS.includes(fieldType);

return (
<EuiTableRow className="resultField">
<EuiTableRowCell className="resultFieldRowCell" width={euiThemeVars.euiSizeL} valign="middle">
Expand All @@ -79,31 +76,16 @@ export const ResultField: React.FC<ResultFieldProps> = ({
</EuiTableRowCell>
<EuiTableRowCell
className="resultFieldRowCell"
width="25%"
width="20%"
truncateText={!isExpanded}
valign="middle"
>
<EuiText size="xs">{fieldName}</EuiText>
</EuiTableRowCell>
<EuiTableRowCell
className="resultFieldRowCell"
width={euiThemeVars.euiSizeXXL}
valign="middle"
>
<EuiIcon type="sortRight" color="subdued" />
<EuiText size="s" color="default">
{fieldName}
</EuiText>
</EuiTableRowCell>
<EuiTableRowCell className="resultFieldRowCell" truncateText={!isExpanded} valign="middle">
{(fieldType === 'object' ||
fieldType === 'array' ||
fieldType === 'nested' ||
Array.isArray(fieldValue)) &&
isExpanded ? (
<EuiCodeBlock language="json" overflowHeight="250" transparentBackground>
{fieldValue}
</EuiCodeBlock>
) : (
<EuiText size="xs">{fieldValue}</EuiText>
)}
<EuiTableRowCell className="resultFieldRowCell" truncateText={shouldTruncate} valign="middle">
<ResultFieldValue fieldValue={fieldValue} fieldType={fieldType} isExpanded={isExpanded} />
</EuiTableRowCell>
</EuiTableRow>
);
Expand Down
Loading

0 comments on commit a78d8c0

Please sign in to comment.