Skip to content

Commit

Permalink
Merge branch 'main' into move-config-schema-to-server/triggers_action…
Browse files Browse the repository at this point in the history
…s_ui
  • Loading branch information
afharo authored Aug 29, 2024
2 parents 96a88a6 + b5f5631 commit 20d8b55
Show file tree
Hide file tree
Showing 739 changed files with 3,620 additions and 4,380 deletions.
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ role_users.json
.devcontainer/.env

# Ignore temporary files in oas_docs
output/kibana.serverless.tmp1.yaml
output/kibana.serverless.tmp2.yaml
output/kibana.tmp1.yaml
output/kibana.tmp2.yaml
output/kibana.new.yaml
output/kibana.serverless.new.yaml
oas_docs/output/kibana.serverless.tmp1.yaml
oas_docs/output/kibana.serverless.tmp2.yaml
oas_docs/output/kibana.tmp1.yaml
oas_docs/output/kibana.tmp2.yaml
oas_docs/output/kibana.new.yaml
oas_docs/output/kibana.serverless.new.yaml
2 changes: 1 addition & 1 deletion docs/setup/configuring-reporting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ If using PNG/PDF {report-features}, make sure the {kib} server operating system

If you are using RHEL operating systems, install the following packages:

* `ipa-gothic-fonts`
* `xorg-x11-fonts-100dpi`
* `xorg-x11-fonts-75dpi`
* `xorg-x11-utils`
* `xorg-x11-fonts-cyrillic`
* `xorg-x11-fonts-Type1`
* `xorg-x11-fonts-misc`
* `vlgothic-fonts`
* `fontconfig`
* `freetype`

Expand Down
4 changes: 2 additions & 2 deletions oas_docs/kibana.info.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ info:
```
version: "1.0.2"
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: https://creativecommons.org/licenses/by-nc-nd/4.0/
contact:
name: Kibana Team
x-feedbackLink:
Expand Down
4 changes: 2 additions & 2 deletions oas_docs/kibana.info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ info:
For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html).
version: '1.0.2'
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: https://creativecommons.org/licenses/by-nc-nd/4.0/
contact:
name: Kibana Team
x-feedbackLink:
Expand Down
4 changes: 2 additions & 2 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ info:

```
license:
name: Elastic License 2.0
url: 'https://www.elastic.co/licensing/elastic-license'
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/'
title: Kibana Serverless APIs
version: 1.0.2
x-feedbackLink:
Expand Down
4 changes: 2 additions & 2 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ info:
For more information about the console, refer to [Run API
requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html).
license:
name: Elastic License 2.0
url: 'https://www.elastic.co/licensing/elastic-license'
name: Attribution-NonCommercial-NoDerivatives 4.0 International
url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/'
title: Kibana APIs
version: 1.0.2
x-feedbackLink:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@

import { i18n } from '@kbn/i18n';
import useUpdateEffect from 'react-use/lib/useUpdateEffect';
import React, { useState, useCallback, Dispatch, FocusEvent, useContext, useMemo } from 'react';
import React, {
useState,
useCallback,
Dispatch,
FocusEvent,
useContext,
useMemo,
ChangeEventHandler,
} from 'react';
import { css } from '@emotion/react';

import {
Expand Down Expand Up @@ -126,9 +134,9 @@ export function ColorRangeItem({
[colorRange.start, colorRanges, dispatch, index, popoverInFocus, dataBounds, palettes, isLast]
);

const onValueChange = useCallback(
const onValueChange = useCallback<ChangeEventHandler<HTMLInputElement>>(
({ target: { value: targetValue } }) => {
setLocalValue(targetValue);
setLocalValue(+targetValue);
dispatch({
type: 'updateValue',
payload: { index, value: targetValue, accessor, dataBounds, palettes },
Expand All @@ -138,7 +146,7 @@ export function ColorRangeItem({
);

const onUpdateColor = useCallback(
(color) => {
(color: string) => {
dispatch({ type: 'updateColor', payload: { index, color, dataBounds, palettes } });
},
[dispatch, index, dataBounds, palettes]
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-dom-drag-drop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export {
type DraggingIdentifier,
type DragDropAction,
type DropOverlayWrapperProps,
type DroppableProps,
Draggable,
Droppable,
useDragDropContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const GroupPanelComponent = <T,>({
);

const onToggle = useCallback(
(isOpen) => {
(isOpen: boolean) => {
if (onToggleGroup) {
onToggleGroup(isOpen, groupBucket);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-grouping/src/hooks/use_grouping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type DynamicGroupingProps<T> = Pick<
/** Interface for configuring grouping package where T is the consumer `GroupingAggregation`
* @interface GroupingArgs<T>
*/
interface GroupingArgs<T> {
export interface GroupingArgs<T> {
componentProps: StaticGroupingProps<T>;
defaultGroupingOptions: GroupOption[];
fields: FieldSpec[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/

import * as t from 'io-ts';
import { investigationItemsSchema } from '../schema';
import { itemSchema } from '../schema';
import { investigationItemResponseSchema } from './investigation_item';

const createInvestigationItemParamsSchema = t.type({
path: t.type({
investigationId: t.string,
}),
body: investigationItemsSchema,
body: itemSchema,
});

const createInvestigationItemResponseSchema = investigationItemResponseSchema;
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-investigation-shared/src/rest_specs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type * from './investigation_note';
export type * from './create_item';
export type * from './delete_item';
export type * from './get_items';
export type * from './investigation_item';

export * from './create';
export * from './create_note';
Expand All @@ -29,3 +30,4 @@ export * from './investigation_note';
export * from './create_item';
export * from './delete_item';
export * from './get_items';
export * from './investigation_item';
25 changes: 14 additions & 11 deletions packages/kbn-investigation-shared/src/schema/investigation_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@

import * as t from 'io-ts';

const esqlItemSchema = t.type({
const itemSchema = t.type({
title: t.string,
type: t.literal('esql'),
params: t.type({
esql: t.string,
suggestion: t.any,
}),
type: t.string,
params: t.record(t.string, t.any),
});

const investigationItemsSchema = esqlItemSchema; // replace with union with various item types

const investigationItemSchema = t.intersection([
t.type({ id: t.string, createdAt: t.number, createdBy: t.string }),
investigationItemsSchema,
t.type({
id: t.string,
createdAt: t.number,
createdBy: t.string,
}),
itemSchema,
]);

export { investigationItemSchema, investigationItemsSchema, esqlItemSchema };
type Item = t.TypeOf<typeof itemSchema>;
type InvestigationItem = t.TypeOf<typeof investigationItemSchema>;

export type { Item, InvestigationItem };
export { investigationItemSchema, itemSchema };
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const CodeEditor = ({ onChange, type, isReadOnly, name, ...props }: CodeE
editorModel.setValue(trimmedValue);
}, []);

const editorDidMount = useCallback(
const editorDidMount = useCallback<NonNullable<KibanaReactCodeEditorProps['editorDidMount']>>(
(editor) => {
setEditorCalculatedHeight(editor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { getFieldInputValue } from '@kbn/management-settings-utilities';
import { useUpdate } from '@kbn/management-settings-utilities';

import { debounce } from 'lodash';
import { OnInputChangeFn } from '@kbn/management-settings-types';
import { useServices } from '../services';
import { InputProps } from '../types';
import { TEST_SUBJ_PREFIX_FIELD } from '.';
Expand All @@ -39,7 +40,7 @@ export const ArrayInput = ({
const onUpdate = useUpdate({ onInputChange, field });

const updateValue = useCallback(
async (newValue: string, onUpdateFn) => {
async (newValue: string, onUpdateFn: OnInputChangeFn<'array'>) => {
const parsedValue = newValue
.replace(REGEX, ',')
.split(',')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { EuiFieldNumber, EuiFieldNumberProps } from '@elastic/eui';
import { getFieldInputValue, useUpdate } from '@kbn/management-settings-utilities';

import { debounce } from 'lodash';
import { OnInputChangeFn } from '@kbn/management-settings-types';
import { InputProps } from '../types';
import { TEST_SUBJ_PREFIX_FIELD } from '.';
import { useServices } from '../services';
Expand All @@ -36,7 +37,7 @@ export const NumberInput = ({
const onUpdate = useUpdate({ onInputChange, field });

const updateValue = useCallback(
async (newValue: number, onUpdateFn) => {
async (newValue: number, onUpdateFn: OnInputChangeFn<'number'>) => {
const validationResponse = await validateChange(field.id, newValue);
if (validationResponse.successfulValidation && !validationResponse.valid) {
onUpdateFn({
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-management/settings/setting_ids/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ export const OBSERVABILITY_ENTITY_CENTRIC_EXPERIENCE = 'observability:entityCent
export const OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID = 'observability:logSources';
export const OBSERVABILITY_AI_ASSISTANT_LOGS_INDEX_PATTERN_ID =
'observability:aiAssistantLogsIndexPattern';
export const OBSERVABILITY_AI_ASSISTANT_RESPONSE_LANGUAGE =
'observability:aiAssistantResponseLanguage';
export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING =
'observability:aiAssistantSimulatedFunctionCalling';
export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const AutocompleteFieldListsComponent: React.FC<AutocompleteFieldListsPro
largeLists: [],
});
const { loading, result, start } = useFindListsBySize();
const getLabel = useCallback(({ name }) => name, []);
const getLabel = useCallback(({ name }: ListSchema) => name, []);

const optionsMemo = useMemo(
() => filterFieldToList(listData, selectedField),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const OperatorComponent: React.FC<OperatorState> = ({
selectedField,
'aria-label': ariaLabel,
}): JSX.Element => {
const getLabel = useCallback(({ message }): string => message, []);
const getLabel = useCallback(({ message }: OperatorOption): string => message, []);
const optionsMemo = useMemo(
(): OperatorOption[] =>
operatorOptions != null && operatorOptions.length > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { useCallback } from 'react';
import type { FC } from 'react';

import type { IconType, SearchFilterConfig } from '@elastic/eui';
import type { EuiSearchBarProps, IconType, SearchFilterConfig } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiSearchBar } from '@elastic/eui';
import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types';
import type { GetExceptionItemProps } from '../types';
Expand Down Expand Up @@ -73,7 +73,7 @@ const SearchBarComponent: FC<SearchBarProps> = ({
onSearch,
onAddExceptionClick,
}) => {
const handleOnSearch = useCallback(
const handleOnSearch = useCallback<NonNullable<EuiSearchBarProps['onChange']>>(
({ queryText }): void => {
onSearch({ search: queryText });
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { EuiFormRow, EuiHorizontalRule, EuiRange } from '@elastic/eui';
import { EuiFormRow, EuiHorizontalRule, EuiRange, EuiRangeProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { debounce } from 'lodash';
import { RowHeightSettings, RowHeightSettingsProps } from './row_height_settings';
Expand Down Expand Up @@ -63,9 +63,9 @@ export const UnifiedDataTableAdditionalDisplaySettings: React.FC<
[onChangeSampleSize]
);

const onChangeActiveSampleSize = useCallback(
const onChangeActiveSampleSize = useCallback<NonNullable<EuiRangeProps['onChange']>>(
(event) => {
if (!event.target.value) {
if (!('value' in event.target) || !event.target.value) {
setActiveSampleSize('');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ const tooltipContent = {
}),
};

export interface ColorPickerProps {
overwriteColor?: string | null;
defaultColor?: string | null;
isClearable?: boolean;
setConfig: (config: { color?: string }) => void;
label?: string;
disableHelpTooltip?: boolean;
disabledMessage?: string;
showAlpha?: boolean;
}

export const ColorPicker = ({
overwriteColor,
defaultColor,
Expand All @@ -37,16 +48,7 @@ export const ColorPicker = ({
disableHelpTooltip,
disabledMessage,
showAlpha,
}: {
overwriteColor?: string | null;
defaultColor?: string | null;
isClearable?: boolean;
setConfig: (config: { color?: string }) => void;
label?: string;
disableHelpTooltip?: boolean;
disabledMessage?: string;
showAlpha?: boolean;
}) => {
}: ColorPickerProps) => {
const [colorText, setColorText] = useState(overwriteColor || defaultColor);
const [validatedColor, setValidatedColor] = useState(overwriteColor || defaultColor);
const [currentColorAlpha, setCurrentColorAlpha] = useState(getColorAlpha(colorText));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ export const defaultFilter: Query = {
language: 'kuery',
};

export interface FilterQueryInputProps {
inputFilter: Query | undefined;
onChange: (query: Query) => void;
dataView: DataViewBase;
helpMessage?: string | null;
label?: string;
initiallyOpen?: boolean;
['data-test-subj']?: string;
queryInputServices: QueryInputServices;
appName: string;
}

export function FilterQueryInput({
inputFilter,
onChange,
Expand All @@ -43,17 +55,7 @@ export function FilterQueryInput({
['data-test-subj']: dataTestSubj,
queryInputServices,
appName,
}: {
inputFilter: Query | undefined;
onChange: (query: Query) => void;
dataView: DataViewBase;
helpMessage?: string | null;
label?: string;
initiallyOpen?: boolean;
['data-test-subj']?: string;
queryInputServices: QueryInputServices;
appName: string;
}) {
}: FilterQueryInputProps) {
const [filterPopoverOpen, setFilterPopoverOpen] = useState(Boolean(initiallyOpen));

const onClosePopup: EuiPopoverProps['closePopover'] = useCallback(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-visualization-ui-components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type {
IconSet,
AccessorConfig,
QueryInputServices,
ColorPickerProps,
} from './components';

export type { FormatFactory, LineStyle } from './types';
Loading

0 comments on commit 20d8b55

Please sign in to comment.