Skip to content

Commit

Permalink
Merge branch 'main' into 2024_09_06-extract_es_took_time
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 authored Sep 6, 2024
2 parents 885211a + bec5117 commit daf1a0d
Show file tree
Hide file tree
Showing 81 changed files with 1,895 additions and 617 deletions.
1 change: 1 addition & 0 deletions packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type LogDocument = Fields &
'orchestrator.resource.id'?: string;
'kubernetes.pod.uid'?: string;
'aws.s3.bucket.name'?: string;
'aws.kinesis.name'?: string;
'orchestrator.namespace'?: string;
'container.name'?: string;
'cloud.provider'?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

type Method = 'get' | 'post' | 'put' | 'delete';
type Method = 'get' | 'post' | 'put' | 'patch' | 'delete';

export function parseEndpoint(endpoint: string) {
const parts = endpoint.split(' ');
Expand All @@ -15,7 +15,7 @@ export function parseEndpoint(endpoint: string) {
const pathname = parts[1].trim();
const version = parts[2]?.trim();

if (!['get', 'post', 'put', 'delete'].includes(method)) {
if (!['get', 'post', 'put', 'patch', 'delete'].includes(method)) {
throw new Error(`Endpoint ${endpoint} was not prefixed with a valid HTTP method`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const TitleField = ({
<EuiFormRow
label={field.label}
labelAppend={field.labelAppend}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ButtonGroupField = ({ field, euiFieldProps, idAria, ...rest }: Prop
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const CardRadioGroupField = ({
<EuiFormRow
label={field.label}
labelType="legend"
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const CheckBoxField = ({ field, euiFieldProps = {}, idAria, ...rest }: Pr

return (
<EuiFormRow
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ComboBoxField = ({ field, euiFieldProps = {}, idAria, ...rest }: Pr
<EuiFormRow
label={field.label}
labelAppend={field.labelAppend}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const DatePickerField = ({ field, euiFieldProps, idAria, ...rest }: Props
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const FilePickerField = ({
<EuiFormRow
label={field.label}
labelAppend={field.labelAppend}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const MultiButtonGroupField = ({ field, euiFieldProps, idAria, ...rest }:
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const MultiSelectField = ({ field, euiFieldProps = {}, idAria, ...rest }:
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const NumericField = ({ field, euiFieldProps = {}, idAria, ...rest }: Pro
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const PasswordField = ({ field, euiFieldProps, idAria, ...rest }: Props)
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const RadioGroupField = ({ field, euiFieldProps = {}, idAria, ...rest }:
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const RangeField = ({ field, euiFieldProps = {}, idAria, ...rest }: Props
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const SelectField = ({ field, euiFieldProps, idAria, ...rest }: Props) =>
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const SuperSelectField = ({
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const TextAreaField = ({ field, euiFieldProps = {}, idAria, ...rest }: Pr
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const TextField = ({ field, euiFieldProps = {}, idAria, ...rest }: Props)
<EuiFormRow
label={field.label}
labelAppend={field.labelAppend}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const ToggleField = ({ field, euiFieldProps = {}, idAria, ...rest }: Prop

return (
<EuiFormRow
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const MyComponent = () => {
return (
<EuiFormRow
label={label}
helpText={typeof helpText === 'function' ? helpText() : helpText}
helpText={helpText}
error={errorMessage}
isInvalid={isInvalid}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const MyComponent = () => {
return (
<EuiFormRow
label={field.label}
helpText={typeof field.helpText === 'function' ? field.helpText() : helpText}
helpText={helpText}
error={errorMessage}
isInvalid={isInvalid}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ export const useField = <T, FormType = FormData, I = T>(
type,
label,
labelAppend,
helpText,
helpText: typeof helpText === 'function' ? helpText() : helpText,
value,
errors,
isPristine,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export interface FieldHook<T = unknown, I = T> {
export interface FieldConfig<T = unknown, FormType extends FormData = FormData, I = T> {
readonly label?: string;
readonly labelAppend?: string | ReactNode;
readonly helpText?: string | ReactNode;
readonly helpText?: string | ReactNode | (() => ReactNode);
readonly type?: string;
readonly defaultValue?: T;
readonly validations?: Array<ValidationConfig<FormType, string, I>>;
Expand Down
55 changes: 52 additions & 3 deletions x-pack/packages/kbn-entities-schema/oas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ components:
type: object
properties:
installOnly:
type: boolean
anyOf:
- type: string
enum:
- "true"
- "false"
- type: boolean
default: false
additionalProperties: false
getEntityDefinitionQuerySchema:
Expand Down Expand Up @@ -39,7 +44,12 @@ components:
type: object
properties:
deleteData:
type: boolean
anyOf:
- type: string
enum:
- "true"
- "false"
- type: boolean
default: false
additionalProperties: false
entityDefinitionSchema:
Expand Down Expand Up @@ -393,6 +403,7 @@ paths:
application/json:
schema:
type: object
required: enabled
properties:
enabled:
type: boolean
Expand Down Expand Up @@ -422,6 +433,7 @@ paths:
application/json:
schema:
type: object
required: success
properties:
success:
type: boolean
Expand All @@ -447,6 +459,7 @@ paths:
application/json:
schema:
type: object
required: success
properties:
success:
type: boolean
Expand Down Expand Up @@ -491,7 +504,8 @@ paths:
$ref: "#/components/schemas/entityDefinitionSchema"
"400":
description: The entity definition cannot be installed; see the error for more
details
details but commonly due to validation failures of the definition ID
or metrics format
"409":
description: An entity definition with this ID already exists
delete:
Expand Down Expand Up @@ -564,4 +578,39 @@ paths:
type: boolean
running:
type: boolean
patch:
description: Update an entity definition.
tags:
- definitions
parameters:
- in: query
name: installOnly
description: If true, the definition transforms will not be started
required: false
schema:
type: boolean
default: false
requestBody:
description: The definition properties to update
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/entityDefinitionUpdateSchema"
responses:
"200":
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/entityDefinitionSchema"
"400":
description: The entity definition cannot be installed; see the error for more
details
"403":
description: User is not allowed to update the entity definition
"404":
description: The entity definition does not exist
"409":
description: The entity definition is being updated by another request
tags: []
2 changes: 0 additions & 2 deletions x-pack/packages/kbn-entities-schema/src/rest_spec/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ import { BooleanFromString } from '@kbn/zod-helpers';
export const createEntityDefinitionQuerySchema = z.object({
installOnly: z.optional(BooleanFromString).default(false),
});

export type CreateEntityDefinitionQuery = z.infer<typeof createEntityDefinitionQuerySchema>;
2 changes: 0 additions & 2 deletions x-pack/packages/kbn-entities-schema/src/rest_spec/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,3 @@ export const deleteEntityDefinitionParamsSchema = z.object({
export const deleteEntityDefinitionQuerySchema = z.object({
deleteData: z.optional(BooleanFromString).default(false),
});

export type DeleteEntityDefinitionQuery = z.infer<typeof deleteEntityDefinitionQuerySchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const IndicesSelector = ({ field, euiFieldProps, ...rest }: Props) => {
<EuiFormRow
label={field.label}
labelAppend={field.labelAppend}
helpText={typeof field.helpText === 'function' ? field.helpText() : field.helpText}
helpText={field.helpText}
error={errorMessage}
isInvalid={isInvalid}
fullWidth
Expand Down
Loading

0 comments on commit daf1a0d

Please sign in to comment.