Skip to content

Commit 4adf039

Browse files
authored
Merge branch 'main' into discover-tabs-recently-closed-tabs-improvements
2 parents 5b2d9fb + 9785c55 commit 4adf039

File tree

90 files changed

+3321
-1192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3321
-1192
lines changed

oas_docs/bundle.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58448,7 +58448,8 @@
5844858448
"double",
5844958449
"date",
5845058450
"boolean",
58451-
"ip"
58451+
"ip",
58452+
"geo_point"
5845258453
],
5845358454
"type": "string"
5845458455
}
@@ -68081,7 +68082,8 @@
6808168082
"double",
6808268083
"date",
6808368084
"boolean",
68084-
"ip"
68085+
"ip",
68086+
"geo_point"
6808568087
],
6808668088
"type": "string"
6808768089
}
@@ -77985,7 +77987,8 @@
7798577987
"double",
7798677988
"date",
7798777989
"boolean",
77988-
"ip"
77990+
"ip",
77991+
"geo_point"
7798977992
],
7799077993
"type": "string"
7799177994
}
@@ -82567,7 +82570,8 @@
8256782570
"double",
8256882571
"date",
8256982572
"boolean",
82570-
"ip"
82573+
"ip",
82574+
"geo_point"
8257182575
],
8257282576
"type": "string"
8257382577
}

oas_docs/bundle.serverless.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57527,7 +57527,8 @@
5752757527
"double",
5752857528
"date",
5752957529
"boolean",
57530-
"ip"
57530+
"ip",
57531+
"geo_point"
5753157532
],
5753257533
"type": "string"
5753357534
}
@@ -67160,7 +67161,8 @@
6716067161
"double",
6716167162
"date",
6716267163
"boolean",
67163-
"ip"
67164+
"ip",
67165+
"geo_point"
6716467166
],
6716567167
"type": "string"
6716667168
}
@@ -77064,7 +77066,8 @@
7706477066
"double",
7706577067
"date",
7706677068
"boolean",
77067-
"ip"
77069+
"ip",
77070+
"geo_point"
7706877071
],
7706977072
"type": "string"
7707077073
}
@@ -81646,7 +81649,8 @@
8164681649
"double",
8164781650
"date",
8164881651
"boolean",
81649-
"ip"
81652+
"ip",
81653+
"geo_point"
8165081654
],
8165181655
"type": "string"
8165281656
}

oas_docs/output/kibana.serverless.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58442,6 +58442,7 @@ paths:
5844258442
- date
5844358443
- boolean
5844458444
- ip
58445+
- geo_point
5844558446
type: string
5844658447
required:
5844758448
- type
@@ -63410,6 +63411,7 @@ paths:
6341063411
- date
6341163412
- boolean
6341263413
- ip
63414+
- geo_point
6341363415
type: string
6341463416
required:
6341563417
- type
@@ -68595,6 +68597,7 @@ paths:
6859568597
- date
6859668598
- boolean
6859768599
- ip
68600+
- geo_point
6859868601
type: string
6859968602
required:
6860068603
- type
@@ -70952,6 +70955,7 @@ paths:
7095270955
- date
7095370956
- boolean
7095470957
- ip
70958+
- geo_point
7095570959
type: string
7095670960
required:
7095770961
- type

oas_docs/output/kibana.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62816,6 +62816,7 @@ paths:
6281662816
- date
6281762817
- boolean
6281862818
- ip
62819+
- geo_point
6281962820
type: string
6282062821
required:
6282162822
- type
@@ -67784,6 +67785,7 @@ paths:
6778467785
- date
6778567786
- boolean
6778667787
- ip
67788+
- geo_point
6778767789
type: string
6778867790
required:
6778967791
- type
@@ -72969,6 +72971,7 @@ paths:
7296972971
- date
7297072972
- boolean
7297172973
- ip
72974+
- geo_point
7297272975
type: string
7297372976
required:
7297472977
- type
@@ -75326,6 +75329,7 @@ paths:
7532675329
- date
7532775330
- boolean
7532875331
- ip
75332+
- geo_point
7532975333
type: string
7533075334
required:
7533175335
- type

src/platform/packages/shared/kbn-connector-specs/src/auth_types/bearer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const authSchema = z
1717
token: z
1818
.string()
1919
.min(1, { message: i18n.BEARER_AUTH_REQUIRED_MESSAGE })
20-
.meta({ sensitive: true }),
20+
.meta({ sensitive: true, label: i18n.BEARER_TOKEN_LABEL }),
2121
})
2222
.meta({ label: i18n.BEARER_AUTH_LABEL });
2323

src/platform/packages/shared/kbn-connector-specs/src/auth_types/translations.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export const BEARER_AUTH_LABEL = i18n.translate('connectorSpecs.authType.bearerA
6868
defaultMessage: 'Bearer token',
6969
});
7070

71+
export const BEARER_TOKEN_LABEL = i18n.translate('connectorSpecs.bearerAuth.token.label', {
72+
defaultMessage: 'Token',
73+
});
74+
7175
export const BEARER_AUTH_REQUIRED_MESSAGE = i18n.translate(
7276
'connectorSpecs.bearerAuth.token.requiredMessage',
7377
{

src/platform/packages/shared/kbn-connector-specs/src/lib/__snapshots__/generate_secrets_schema_from_spec.test.ts.snap

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/platform/packages/shared/kbn-management/settings/setting_ids/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ export const AI_ANONYMIZATION_SETTINGS = 'ai:anonymizationSettings';
141141
export const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = 'observability:searchExcludedDataTiers';
142142
export const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS =
143143
'observability:streamsEnableSignificantEvents';
144+
export const OBSERVABILITY_STREAMS_ENABLE_SIGNIFICANT_EVENTS_ANALYZER =
145+
'observability:streamsEnableSignificantEventsAnalyzer';
144146
export const OBSERVABILITY_STREAMS_ENABLE_GROUP_STREAMS = 'observability:streamsEnableGroupStreams';
145147
export const OBSERVABILITY_STREAMS_ENABLE_CONTENT_PACKS = 'observability:streamsEnableContentPacks';
146148
export const OBSERVABILITY_STREAMS_ENABLE_ATTACHMENTS = 'observability:streamsEnableAttachments';

src/platform/packages/shared/response-ops/form-generator/src/field_builder.test.tsx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ import {
2020
import { getFieldFromSchema, getFieldsFromSchema, renderField } from './field_builder';
2121
import type { FormConfig } from './form';
2222
import { addMeta } from './schema_connector_metadata';
23+
import { getWidgetComponent } from './widgets';
24+
25+
jest.mock('./widgets', () => {
26+
const module = jest.requireActual('./widgets');
27+
return {
28+
...module,
29+
getWidgetComponent: jest.fn(module.getWidgetComponent),
30+
};
31+
});
32+
33+
const getWidgetComponentMock = getWidgetComponent as jest.Mock;
2334

2435
const wrapper = ({ children }: { children: React.ReactNode }) => (
2536
<IntlProvider locale="en">{children}</IntlProvider>
@@ -364,3 +375,57 @@ describe('Field Builder', () => {
364375
});
365376
});
366377
});
378+
379+
describe('mocked getWidgetComponent', () => {
380+
const formConfig: FormConfig = { isEdit: true };
381+
const mockWidgetComponent = jest.fn((props) => {
382+
return <div data-testid="mock-widget" />;
383+
});
384+
385+
beforeAll(() => {
386+
getWidgetComponentMock.mockReturnValue(mockWidgetComponent);
387+
});
388+
389+
beforeEach(() => {
390+
jest.clearAllMocks();
391+
});
392+
393+
it('should pass correct props structure to WidgetComponent', () => {
394+
const schema = z.string().default('default-value').meta({
395+
label: 'Username Label',
396+
placeholder: 'Enter your username',
397+
helpText: 'This is help text',
398+
disabled: true,
399+
});
400+
401+
const path = 'username';
402+
403+
const field = getFieldFromSchema({ schema, path, formConfig });
404+
render(renderField({ field }));
405+
406+
expect(mockWidgetComponent).toHaveBeenCalledTimes(1);
407+
408+
const receivedProps = mockWidgetComponent.mock.calls[0][0];
409+
410+
expect(receivedProps.path).toBe('username');
411+
expect(receivedProps.formConfig).toBe(formConfig);
412+
413+
expect(receivedProps.fieldConfig).toBeDefined();
414+
expect(receivedProps.fieldConfig.label).toBe('Username Label');
415+
expect(receivedProps.fieldConfig.defaultValue).toBe('default-value');
416+
expect(receivedProps.fieldConfig.validations).toHaveLength(1);
417+
expect(typeof receivedProps.fieldConfig.validations[0].validator).toBe('function');
418+
419+
expect(receivedProps.fieldProps).toBeDefined();
420+
expect(receivedProps.fieldProps.helpText).toBe('This is help text');
421+
expect(receivedProps.fieldProps.fullWidth).toBe(true);
422+
expect(receivedProps.fieldProps.labelAppend).toBeNull();
423+
424+
expect(receivedProps.fieldProps.euiFieldProps).toBeDefined();
425+
expect(receivedProps.fieldProps.euiFieldProps.placeholder).toBe('Enter your username');
426+
expect(receivedProps.fieldProps.euiFieldProps.disabled).toBe(true);
427+
expect(receivedProps.fieldProps.euiFieldProps['data-test-subj']).toBe(
428+
'generator-field-username'
429+
);
430+
});
431+
});

src/platform/packages/shared/response-ops/form-generator/src/field_builder.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export const renderField = ({ field }: RenderFieldProps) => {
140140
schema={schema}
141141
formConfig={formConfig}
142142
fieldConfig={{
143+
label,
143144
defaultValue,
144145
validations: [
145146
{
@@ -148,10 +149,8 @@ export const renderField = ({ field }: RenderFieldProps) => {
148149
],
149150
}}
150151
fieldProps={{
151-
label,
152152
helpText,
153153
fullWidth: true,
154-
155154
labelAppend: isOptional ? (
156155
<EuiText size="xs" color="subdued">
157156
{OPTIONAL_LABEL}

0 commit comments

Comments
 (0)