Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into task/avc-banner-pac…
Browse files Browse the repository at this point in the history
…kage
  • Loading branch information
parkiino committed Jul 18, 2024
2 parents 419de0f + b562c8e commit 90d18e4
Show file tree
Hide file tree
Showing 166 changed files with 2,011 additions and 1,772 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ steps:
- group: "API MKI - GenAI"
key: api_test_ai_assistant
steps:
- label: Running genai:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh genai:qa:serverless
key: genai:qa:serverless
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running nlp_cleanup_task:complete:qa:serverless
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh nlp_cleanup_task:complete:qa:serverless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,6 @@ steps:
- group: "API MKI - GenAI"
key: api_test_ai_assistant
steps:
- label: Running genai:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh genai:qa:serverless:release
key: genai:qa:serverless:release
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-4
preemptible: true
timeout_in_minutes: 120
retry:
automatic:
- exit_status: "1"
limit: 2

- label: Running nlp_cleanup_task:complete:qa:serverless:release
command: .buildkite/scripts/pipelines/security_solution_quality_gate/api_integration/api-integration-tests.sh nlp_cleanup_task:complete:qa:serverless:release
key: nlp_cleanup_task:complete:qa:serverless:release
Expand Down
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions docs/management/cases/manage-cases-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

To change case closure options and add custom fields, templates, and connectors for external incident management systems, go to *{stack-manage-app} > Cases* and click *Settings*.

To perform these tasks, you must have <<setup-cases,full access>> to the appropriate case and connector features in {kib}.

[role="screenshot"]
image::images/cases-settings.png[View case settings]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
Expand Down Expand Up @@ -52,6 +54,29 @@ To change the default connector for new cases, select the connector from the

To update a connector, click *Update <connector name>* and edit the connector fields as required.

[[case-custom-fields]]
=== Custom fields

You can add optional and required fields for customized case collaboration. added:[8.15.0]

To create a custom field:

. In the *Custom fields* section, click *Add field*.
+
--
[role="screenshot"]
image::images/cases-custom-fields-add.png[Add a custom field in case settings]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
--

. You must provide a field label and type (text or toggle).
You can optionally designate it as a required field and provide a default value.

When you create a custom field, it's added to all new and existing cases.
Existing cases have null values for new text fields until you set them in each case.

You can subsequently remove or edit custom fields on the *Settings* page.

[[case-templates]]
=== Templates

Expand Down
49 changes: 1 addition & 48 deletions docs/management/cases/manage-cases.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ text.
. Optionally, add a category, assignees, and tags.
You can add users only if they meet the necessary <<setup-cases,prerequisites>>.

. If you defined any custom fields, they appear in the *Additional fields* section.
Check out <<case-custom-fields>>. preview:[]
. If you defined any <<case-custom-fields,custom fields>>, they appear in the *Additional fields* section. added:[8.15.0]

. For the *External incident management system*, select a connector. For more
information, refer to <<case-connectors>>.
Expand All @@ -45,52 +44,6 @@ By default, the rule adds all of the alerts within a specified time window to a
You can optionally choose a field to group the alerts and create separate cases for each group.
You can also choose whether you want the rule to reopen cases or open new ones when the time window elapses.

[[case-custom-fields]]
=== Add custom fields

preview::[]

You can add optional and required fields for customized case collaboration.

. Go to *{stack-manage-app} > Cases* and click *Settings*.
+
--
[role="screenshot"]
image::images/cases-custom-fields-view.png[View custom fields in case settings]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

NOTE: To view and change case settings, you must have the appropriate {kib} feature privileges. Refer to <<setup-cases>>.
--

. In the *Custom fields* section, click *Add field*.
+
--
[role="screenshot"]
image::images/cases-custom-fields-add.png[Add a custom field in case settings]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
--

. Enter a field label.

. Choose a field type: text or toggle.

. If you want the text field to be mandatory in all cases, select *Make this field required*.

. Optionally add a default value.

. Click *Save field*.

You can subsequently remove or edit custom fields on the *Settings* page.

After you create custom fields, they're added to all new and existing cases.

Existing cases have null values for the new text fields until you set them in each case.
For example, you must click the pencil icon next to `my-field` to set it:

[role="screenshot"]
image::images/cases-custom-fields.png[A case that has an unset custom field]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

[[add-case-notifications]]
=== Add email notifications

Expand Down
6 changes: 3 additions & 3 deletions oas_docs/.spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ rules:
oas3-valid-schema-example: false
oas2-valid-media-example: false
# Operations
operation-operationId: false
operation-operationId-unique: false
operation-operationId-valid-in-url: false
operation-operationId: warn
operation-operationId-unique: warn
operation-operationId-valid-in-url: warn
operation-tag-defined: warn
operation-tags: warn
# Responses
Expand Down
4 changes: 4 additions & 0 deletions oas_docs/kibana.info.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ openapi: 3.0.3
info:
title: Kibana Serverless APIs
description: |
**Technical preview**
This functionality is in technical preview and may be changed or removed in a future release.
Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
The Kibana REST APIs for Elastic serverless enable you to manage resources
such as connectors, data views, and saved objects. The API calls are
stateless. Each request that you make happens in isolation from other calls
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"@elastic/apm-rum": "^5.16.1",
"@elastic/apm-rum-core": "^5.21.0",
"@elastic/apm-rum-react": "^2.0.3",
"@elastic/charts": "66.0.5",
"@elastic/charts": "66.1.0",
"@elastic/datemath": "5.0.3",
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.14.0",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-discover-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export {
getLogLevelCoalescedValue,
getLogLevelCoalescedValueLabel,
LogLevelCoalescedValue,
LogLevelBadge,
} from './src';

export type { LogsContextService } from './src';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

export * from './log_level_badge';
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

import { render, screen } from '@testing-library/react';
import React from 'react';
import { LogLevelBadge } from './log_level_badge';

const renderBadge = (logLevel: string) => {
render(
<LogLevelBadge
logLevel={logLevel}
fallback={<span data-test-subj="logLevelBadge-unknown">{logLevel}</span>}
/>
);
};

describe('LogLevelBadge', () => {
it('renders badge with color based on provided logLevel', () => {
renderBadge('info');
const badge = screen.getByTestId('logLevelBadge-info');
expect(badge).toBeInTheDocument();
expect(badge).toHaveTextContent('info');
expect(getComputedStyle(badge).getPropertyValue('--euiBadgeBackgroundColor')).toEqual(
'#90b0d1'
);
});

it('renders without a badge if logLevel is not recognized', () => {
renderBadge('unknown_level');
const badge = screen.getByTestId('logLevelBadge-unknown');
expect(badge).toBeInTheDocument();
expect(badge).toHaveTextContent('unknown_level');
expect(getComputedStyle(badge).getPropertyValue('--euiBadgeBackgroundColor')).toEqual('');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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 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 or the Server
* Side Public License, v 1.
*/

import React, { ReactElement } from 'react';
import { EuiBadge, EuiBadgeProps, mathWithUnits, useEuiTheme } from '@elastic/eui';
import { CSSObject } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import { getLogLevelCoalescedValue, getLogLevelColor } from '../utils';

const badgeCss: CSSObject = {
maxWidth: mathWithUnits(euiThemeVars.euiSize, (size) => size * 7.5),
};

export const LogLevelBadge = ({
logLevel,
fallback,
'data-test-subj': dataTestSubj = 'logLevelBadge',
...badgeProps
}: Omit<EuiBadgeProps, 'children' | 'color'> & {
logLevel: {};
fallback?: ReactElement;
}) => {
const { euiTheme } = useEuiTheme();
const coalescedValue = getLogLevelCoalescedValue(logLevel);
const color = coalescedValue ? getLogLevelColor(coalescedValue, euiTheme) : undefined;
const castedBadgeProps = badgeProps as EuiBadgeProps;

if (!color || !coalescedValue) {
return fallback ? (
fallback
) : (
<EuiBadge
{...castedBadgeProps}
color="hollow"
data-test-subj={`${dataTestSubj}-unknown`}
css={badgeCss}
>
{logLevel}
</EuiBadge>
);
}

return (
<EuiBadge
{...castedBadgeProps}
color={color}
data-test-subj={`${dataTestSubj}-${coalescedValue}`}
css={badgeCss}
>
{logLevel}
</EuiBadge>
);
};
1 change: 1 addition & 0 deletions packages/kbn-discover-utils/src/data_types/logs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

export * from './types';
export * from './components';
export * from './utils';

export * from './logs_context_service';
6 changes: 4 additions & 2 deletions packages/kbn-discover-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"types": [
"jest",
"node",
"react"
"react",
"@testing-library/jest-dom"
]
},
"include": [
Expand All @@ -23,6 +24,7 @@
"@kbn/field-formats-plugin",
"@kbn/field-types",
"@kbn/i18n",
"@kbn/core-ui-settings-browser"
"@kbn/core-ui-settings-browser",
"@kbn/ui-theme"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,8 @@ export const getMappingConflictsInfo = (field: DataViewField): FieldConflictsInf
export const hasWrongOperatorWithWildcard = (
items: ExceptionsBuilderReturnExceptionItem[]
): boolean => {
return items[0]?.entries.some((e) => {
const allEntries = items.flatMap((item) => item.entries);
return allEntries.some((e) => {
if (e.type !== 'list' && 'value' in e) {
return validateHasWildcardWithWrongOperator({
operator: e.type,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 90d18e4

Please sign in to comment.