Skip to content

Commit

Permalink
Merge branch 'main' into allow-editing-prebuilt-in-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 11, 2024
2 parents d40177a + f54b951 commit 6928207
Show file tree
Hide file tree
Showing 99 changed files with 2,250 additions and 1,475 deletions.
26 changes: 25 additions & 1 deletion docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,37 @@ All columns that belong to the same layer pane group are sorted in the table.

* *Text alignment* — Aligns the values in the cell to the *Left*, *Center*, or *Right*.

* *Color by value* — Applies color to the cell or text values. To change the color, click the *Edit colors* icon.

* *Hide column* — Hides the column for the field.

* *Directly filter on click* — Turns column values into clickable links that allow you to filter or drill down into the data.

* *Summary row* — Adds a row that displays the summary value. When specified, allows you to enter a *Summary label*.

* *Color by value* — Applies color to the cell or text values. To change the color, click *Edit*.
[float]
[[assign-colors-to-terms]]
===== Assign colors to terms

preview::[]

For term-based metrics, assign a color to each term with color mapping.

. Create a custom table.

. In the layer pane, select a *Rows* or *Metrics* field.

. In the *Color by value* option, select *Cell* or *Text*.

. Click the *Edit colors* icon.

. Toggle the button to use the Color Mapping feature.

. Select a color palette and mode.

. Click *Add assignment* to assign a color to a specific term, or click *Add all unassigned terms* to assign colors to all terms. Assigning colors to dates is unsupported.

. Configure color assignments. You can also select whether unassigned terms should be mapped to the selected color palette or a single color.

[float]
[[drag-and-drop-keyboard-navigation]]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/ebt": "^1.1.1",
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.15.0",
"@elastic/elasticsearch": "^8.15.1",
"@elastic/ems-client": "8.5.3",
"@elastic/eui": "97.3.0",
"@elastic/filesaver": "1.1.2",
Expand Down Expand Up @@ -1498,7 +1498,7 @@
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@redocly/cli": "^1.25.10",
"@redocly/cli": "^1.25.11",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
"@storybook/addon-actions": "^6.5.16",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,25 @@ describe('catchRetryableEsClientErrors', () => {
type: 'retryable_es_client_error',
});
});
it('ResponseError with retryable status code', async () => {
const statusCodes = [503, 401, 403, 408, 410, 429];
return Promise.all(
statusCodes.map(async (status) => {
const error = new esErrors.ResponseError(
elasticsearchClientMock.createApiResponse({
statusCode: status,
body: { error: { type: 'reason' } },
})
);
expect(
((await Promise.reject(error).catch(catchRetryableEsClientErrors)) as any).left
).toMatchObject({
message: 'reason',
type: 'retryable_es_client_error',
});
})
);
});
it.each([503, 401, 403, 408, 410, 429])(
'ResponseError with retryable status code (%d)',
async (status) => {
const error = new esErrors.ResponseError(
elasticsearchClientMock.createApiResponse({
statusCode: status,
body: { error: { type: 'reason' } },
})
);
expect(
((await Promise.reject(error).catch(catchRetryableEsClientErrors)) as any).left
).toMatchObject({
message:
status === 410
? 'This API is unavailable in the version of Elasticsearch you are using.'
: 'reason',
type: 'retryable_es_client_error',
});
}
);
});
});
1 change: 0 additions & 1 deletion packages/kbn-apm-synthtrace/src/lib/shared/base_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class SynthtraceEsClient<TFields extends Fields> {
await this.client.indices.resolveIndex({
name: this.indices.join(','),
expand_wildcards: ['open', 'hidden'],
// @ts-expect-error ignore_unavailable is not in the type definition, but it is accepted by es
ignore_unavailable: true,
})
).indices.map((index: { name: string }) => index.name)
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/controls/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const CONTROL_CHAINING_OPTIONS = { NONE: 'NONE', HIERARCHICAL: 'HIERARCHI
export const DEFAULT_CONTROL_WIDTH: ControlWidth = CONTROL_WIDTH_OPTIONS.MEDIUM;
export const DEFAULT_CONTROL_LABEL_POSITION: ControlLabelPosition =
CONTROL_LABEL_POSITION_OPTIONS.ONE_LINE;
export const DEFAULT_CONTROL_GROW: boolean = true;
export const DEFAULT_CONTROL_GROW: boolean = false;
export const DEFAULT_CONTROL_CHAINING: ControlGroupChainingSystem =
CONTROL_CHAINING_OPTIONS.HIERARCHICAL;
export const DEFAULT_IGNORE_PARENT_SETTINGS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export const ControlGroupEditor = ({ onCancel, onSave, onDeleteAll, stateManager
return (
<>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<EuiTitle size="s">
<h2>{ControlGroupStrings.management.getFlyoutTitle()}</h2>
</EuiTitle>
</EuiFlyoutHeader>
<EuiFlyoutBody data-test-subj="control-group-settings-flyout">
<EuiForm component="form" fullWidth>
<EuiFormRow label={ControlGroupStrings.management.labelPosition.getLabelPositionTitle()}>
<EuiButtonGroup
color="primary"
buttonSize="compressed"
options={CONTROL_LAYOUT_OPTIONS}
data-test-subj="control-group-layout-options"
idSelected={selectedLabelPosition}
Expand Down Expand Up @@ -193,7 +193,7 @@ export const ControlGroupEditor = ({ onCancel, onSave, onDeleteAll, stateManager
<EuiFlexItem grow={false}>
<EuiButtonEmpty
aria-label={`cancel-editing-group`}
iconType="cross"
flush="left"
onClick={() => {
onCancel();
}}
Expand All @@ -204,7 +204,7 @@ export const ControlGroupEditor = ({ onCancel, onSave, onDeleteAll, stateManager
<EuiFlexItem grow={false}>
<EuiButton
aria-label={`save-group`}
iconType="check"
fill
color="primary"
data-test-subj="control-group-editor-save"
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n';
export const ControlGroupStrings = {
getSaveChangesTitle: () =>
i18n.translate('controls.controlGroup.manageControl.saveChangesTitle', {
defaultMessage: 'Save and close',
defaultMessage: 'Save',
}),
getCancelTitle: () =>
i18n.translate('controls.controlGroup.manageControl.cancelTitle', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ describe('getNewControlState', () => {
test('should contain defaults when there are no existing controls', () => {
const controlsManager = initControlsManager({}, new BehaviorSubject<ControlPanelsState>({}));
expect(controlsManager.getNewControlState()).toEqual({
grow: true,
grow: false,
width: 'medium',
dataViewId: undefined,
});
Expand All @@ -284,7 +284,7 @@ describe('getNewControlState', () => {
new BehaviorSubject<ControlPanelsState>(intialControlsState)
);
expect(controlsManager.getNewControlState()).toEqual({
grow: true,
grow: false,
width: 'medium',
dataViewId: 'myOtherDataViewId',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export const openEditControlGroupFlyout = (
'aria-label': i18n.translate('controls.controlGroup.manageControl', {
defaultMessage: 'Edit control settings',
}),
size: 'm',
maxWidth: 500,
paddingSize: 'm',
outsideClickCloses: false,
onClose: () => closeOverlay(overlay),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ export const DataControlEditorStrings = {
defaultMessage: 'Edit control',
}),
dataSource: {
getFormGroupTitle: () =>
i18n.translate('controls.controlGroup.manageControl.dataSource.formGroupTitle', {
defaultMessage: 'Data source',
}),
getFormGroupDescription: () =>
i18n.translate('controls.controlGroup.manageControl.dataSource.formGroupDescription', {
defaultMessage: 'Select the data view and field that you want to create a control for.',
}),
getSelectDataViewMessage: () =>
i18n.translate('controls.controlGroup.manageControl.dataSource.selectDataViewMessage', {
defaultMessage: 'Please select a data view',
Expand Down Expand Up @@ -95,14 +87,6 @@ export const DataControlEditorStrings = {
},
},
displaySettings: {
getFormGroupTitle: () =>
i18n.translate('controls.controlGroup.manageControl.displaySettings.formGroupTitle', {
defaultMessage: 'Display settings',
}),
getFormGroupDescription: () =>
i18n.translate('controls.controlGroup.manageControl.displaySettings.formGroupDescription', {
defaultMessage: 'Change how the control appears on your dashboard.',
}),
getTitleInputTitle: () =>
i18n.translate('controls.controlGroup.manageControl.displaySettings.titleInputTitle', {
defaultMessage: 'Label',
Expand Down Expand Up @@ -133,7 +117,7 @@ export const DataControlEditorStrings = {
},
getSaveChangesTitle: () =>
i18n.translate('controls.controlGroup.manageControl.saveChangesTitle', {
defaultMessage: 'Save and close',
defaultMessage: 'Save',
}),
getCancelTitle: () =>
i18n.translate('controls.controlGroup.manageControl.cancelTitle', {
Expand Down
Loading

0 comments on commit 6928207

Please sign in to comment.