From e306255c18d47baecc8b6b9ffffabeb47e3f6d32 Mon Sep 17 00:00:00 2001 From: Alexi Doak <109488926+doakalexi@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:23:05 -0500 Subject: [PATCH 01/10] [ResponseOps] Use the feature ID to get connector types for the stack management rule form (#201674) ## Summary This PR reinstates the `featureId` parameter in requests to the connector type API within the new stack management rule form. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### To verify 1. Create a connector with supportedFeatureIds that does not include AlertingConnectorFeatureId (e.g., the SentinelOne connector). 2. Use the new rule form to create a rule. 3. Confirm that the SentinelOne connector is not displayed in the rule form as an available option. --- .../common/hooks/use_load_connector_types.test.tsx | 6 ++++++ .../src/common/hooks/use_load_connector_types.ts | 7 ++++--- .../src/rule_form/create_rule_form.tsx | 3 +++ .../src/rule_form/edit_rule_form.tsx | 11 ++++++++++- .../src/rule_form/hooks/use_load_dependencies.ts | 3 +++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.test.tsx b/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.test.tsx index cc21ecef97458..217e963bb117b 100644 --- a/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.test.tsx +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.test.tsx @@ -48,6 +48,7 @@ describe('useLoadConnectorTypes', () => { useLoadConnectorTypes({ http, includeSystemActions: true, + featureId: 'alerting', }), { wrapper } ); @@ -68,6 +69,11 @@ describe('useLoadConnectorTypes', () => { supportedFeatureIds: ['alerting'], }, ]); + expect(http.get).toHaveBeenCalledWith('/internal/actions/connector_types', { + query: { + feature_id: 'alerting', + }, + }); }); test('should call the correct endpoint if system actions is true', async () => { diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.ts b/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.ts index 2810758a57f0f..a72315c19e798 100644 --- a/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.ts +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_load_connector_types.ts @@ -15,17 +15,18 @@ export interface UseLoadConnectorTypesProps { http: HttpStart; includeSystemActions?: boolean; enabled?: boolean; + featureId?: string; } export const useLoadConnectorTypes = (props: UseLoadConnectorTypesProps) => { - const { http, includeSystemActions, enabled = true } = props; + const { http, includeSystemActions, enabled = true, featureId } = props; const queryFn = () => { - return fetchConnectorTypes({ http, includeSystemActions }); + return fetchConnectorTypes({ http, featureId, includeSystemActions }); }; const { data, isLoading, isFetching, isInitialLoading } = useQuery({ - queryKey: ['useLoadConnectorTypes', includeSystemActions], + queryKey: ['useLoadConnectorTypes', includeSystemActions, featureId], queryFn, refetchOnWindowFocus: false, enabled, diff --git a/packages/kbn-alerts-ui-shared/src/rule_form/create_rule_form.tsx b/packages/kbn-alerts-ui-shared/src/rule_form/create_rule_form.tsx index 4399dc5239ec7..8bdadc69a6f1a 100644 --- a/packages/kbn-alerts-ui-shared/src/rule_form/create_rule_form.tsx +++ b/packages/kbn-alerts-ui-shared/src/rule_form/create_rule_form.tsx @@ -36,6 +36,7 @@ export interface CreateRuleFormProps { ruleTypeId: string; plugins: RuleFormPlugins; consumer?: string; + connectorFeatureId?: string; multiConsumerSelection?: RuleCreationValidConsumer | null; hideInterval?: boolean; validConsumers?: RuleCreationValidConsumer[]; @@ -52,6 +53,7 @@ export const CreateRuleForm = (props: CreateRuleFormProps) => { ruleTypeId, plugins, consumer = 'alerts', + connectorFeatureId = 'alerting', multiConsumerSelection, validConsumers = DEFAULT_VALID_CONSUMERS, filteredRuleTypes = [], @@ -107,6 +109,7 @@ export const CreateRuleForm = (props: CreateRuleFormProps) => { consumer, validConsumers, filteredRuleTypes, + connectorFeatureId, }); const onSave = useCallback( diff --git a/packages/kbn-alerts-ui-shared/src/rule_form/edit_rule_form.tsx b/packages/kbn-alerts-ui-shared/src/rule_form/edit_rule_form.tsx index 917fc87420f9a..ace31d1b7b6fb 100644 --- a/packages/kbn-alerts-ui-shared/src/rule_form/edit_rule_form.tsx +++ b/packages/kbn-alerts-ui-shared/src/rule_form/edit_rule_form.tsx @@ -31,12 +31,20 @@ export interface EditRuleFormProps { id: string; plugins: RuleFormPlugins; showMustacheAutocompleteSwitch?: boolean; + connectorFeatureId?: string; onCancel?: () => void; onSubmit?: (ruleId: string) => void; } export const EditRuleForm = (props: EditRuleFormProps) => { - const { id, plugins, showMustacheAutocompleteSwitch = false, onCancel, onSubmit } = props; + const { + id, + plugins, + showMustacheAutocompleteSwitch = false, + connectorFeatureId = 'alerting', + onCancel, + onSubmit, + } = props; const { http, notifications, docLinks, ruleTypeRegistry, i18n, theme, application } = plugins; const { toasts } = notifications; @@ -80,6 +88,7 @@ export const EditRuleForm = (props: EditRuleFormProps) => { capabilities: plugins.application.capabilities, ruleTypeRegistry, id, + connectorFeatureId, }); const onSave = useCallback( diff --git a/packages/kbn-alerts-ui-shared/src/rule_form/hooks/use_load_dependencies.ts b/packages/kbn-alerts-ui-shared/src/rule_form/hooks/use_load_dependencies.ts index 9fb0f173b9d21..b4a7d3bb777b0 100644 --- a/packages/kbn-alerts-ui-shared/src/rule_form/hooks/use_load_dependencies.ts +++ b/packages/kbn-alerts-ui-shared/src/rule_form/hooks/use_load_dependencies.ts @@ -35,6 +35,7 @@ export interface UseLoadDependencies { ruleTypeId?: string; validConsumers?: RuleCreationValidConsumer[]; filteredRuleTypes?: string[]; + connectorFeatureId?: string; } export const useLoadDependencies = (props: UseLoadDependencies) => { @@ -46,6 +47,7 @@ export const useLoadDependencies = (props: UseLoadDependencies) => { ruleTypeId, capabilities, filteredRuleTypes = [], + connectorFeatureId, } = props; const canReadConnectors = !!capabilities.actions?.show; @@ -113,6 +115,7 @@ export const useLoadDependencies = (props: UseLoadDependencies) => { http, includeSystemActions: true, enabled: canReadConnectors, + featureId: connectorFeatureId, }); const { From a800360ac3c43f1af55c0fcd4da37d4cbdc5721d Mon Sep 17 00:00:00 2001 From: Viduni Wickramarachchi Date: Wed, 27 Nov 2024 07:25:12 -0500 Subject: [PATCH 02/10] [Obs AI Assistant] Borealis theme integration (#200814) ## Summary Integrates changes from the Borealis theme to the components owned by `obs-ai-assistant`, `obs-knowledge` teams and for files related to `kbn-ai-assistant`. ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../kbn-ai-assistant/src/chat/chat_body.tsx | 32 +++++++++++-------- .../kbn-ai-assistant/src/chat/chat_header.tsx | 4 ++- .../src/chat/chat_item_title.tsx | 7 ++-- .../src/chat/incorrect_license_panel.tsx | 13 ++++---- .../src/chat/welcome_message_connectors.tsx | 15 ++++++--- .../src/conversation/conversation_view.tsx | 7 ++-- .../packages/kbn-ai-assistant/tsconfig.json | 1 - .../public/components/assistant_avatar.tsx | 5 ++- .../components/chat/chat_item_controls.tsx | 6 ++-- .../components/insight/insight_base.tsx | 2 +- .../inference/additional_options_fields.tsx | 6 ++-- 11 files changed, 57 insertions(+), 41 deletions(-) diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_body.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_body.tsx index 12cb747d148c4..b8ea673483372 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_body.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_body.tsx @@ -7,6 +7,7 @@ import { EuiCallOut, + euiCanAnimate, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, @@ -14,6 +15,7 @@ import { euiScrollBarStyles, EuiSpacer, useEuiTheme, + UseEuiTheme, } from '@elastic/eui'; import { css, keyframes } from '@emotion/css'; import { i18n } from '@kbn/i18n'; @@ -28,7 +30,6 @@ import { type Feedback, } from '@kbn/observability-ai-assistant-plugin/public'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; -import { euiThemeVars } from '@kbn/ui-theme'; import { findLastIndex } from 'lodash'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import type { UseKnowledgeBaseResult } from '../hooks/use_knowledge_base'; @@ -56,14 +57,16 @@ const timelineClassName = (scrollBarStyles: string) => css` ${scrollBarStyles} `; -const promptEditorClassname = css` +const promptEditorClassname = (euiTheme: UseEuiTheme['euiTheme']) => css` overflow: hidden; - transition: height ${euiThemeVars.euiAnimSpeedFast} ${euiThemeVars.euiAnimSlightResistance}; + ${euiCanAnimate} { + transition: height ${euiTheme.animation.fast} ${euiTheme.animation.resistance}; + } `; -const incorrectLicenseContainer = css` +const incorrectLicenseContainer = (euiTheme: UseEuiTheme['euiTheme']) => css` height: 100%; - padding: ${euiThemeVars.euiPanelPaddingModifiers.paddingMedium}; + padding: ${euiTheme.size.base}; `; const chatBodyContainerClassNameWithError = css` @@ -86,11 +89,13 @@ const fadeInAnimation = keyframes` } `; -const animClassName = css` +const animClassName = (euiTheme: UseEuiTheme['euiTheme']) => css` height: 100%; opacity: 0; - animation: ${fadeInAnimation} ${euiThemeVars.euiAnimSpeedNormal} - ${euiThemeVars.euiAnimSlightBounce} ${euiThemeVars.euiAnimSpeedNormal} forwards; + ${euiCanAnimate} { + animation: ${fadeInAnimation} ${euiTheme.animation.normal} ${euiTheme.animation.bounce} + ${euiTheme.animation.normal} forwards; + } `; const containerClassName = css` @@ -127,8 +132,9 @@ export function ChatBody({ }) { const license = useLicense(); const hasCorrectLicense = license?.hasAtLeast('enterprise'); - const euiTheme = useEuiTheme(); - const scrollBarStyles = euiScrollBarStyles(euiTheme); + const theme = useEuiTheme(); + const scrollBarStyles = euiScrollBarStyles(theme); + const { euiTheme } = theme; const chatService = useAIAssistantChatService(); @@ -310,7 +316,7 @@ export function ChatBody({ if (!hasCorrectLicense && !initialConversationId) { footer = ( <> - + @@ -347,7 +353,7 @@ export function ChatBody({ hasBorder={false} hasShadow={false} paddingSize="m" - className={animClassName} + className={animClassName(euiTheme)} > {connectors.connectors?.length === 0 || messages.length === 1 ? ( diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx index e55daf640082e..c4b4fcba0329f 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx @@ -104,7 +104,9 @@ export function ChatHeader({ size={breakpoint === 'xs' ? 'xs' : 's'} value={newTitle} className={css` - color: ${!!title ? theme.euiTheme.colors.text : theme.euiTheme.colors.subduedText}; + color: ${!!title + ? theme.euiTheme.colors.textParagraph + : theme.euiTheme.colors.textSubdued}; `} inputAriaLabel={i18n.translate('xpack.aiAssistant.chatHeader.editConversationInput', { defaultMessage: 'Edit conversation', diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_title.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_title.tsx index d6a26b0287e46..e38db02730867 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_title.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_title.tsx @@ -5,9 +5,9 @@ * 2.0. */ -import { euiThemeVars } from '@kbn/ui-theme'; import React, { ReactNode } from 'react'; import { css } from '@emotion/react'; +import { useEuiTheme } from '@elastic/eui'; interface ChatItemTitleProps { actionsTrigger?: ReactNode; @@ -15,11 +15,14 @@ interface ChatItemTitleProps { } export function ChatItemTitle({ actionsTrigger, title }: ChatItemTitleProps) { + const { euiTheme } = useEuiTheme(); + const containerCSS = css` position: absolute; top: 2; - right: ${euiThemeVars.euiSizeS}; + right: ${euiTheme.size.s}; `; + return ( <> {title} diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/incorrect_license_panel.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/incorrect_license_panel.tsx index c7d9c649f49c2..136f8d5918fb7 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/incorrect_license_panel.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/incorrect_license_panel.tsx @@ -15,21 +15,22 @@ import { EuiPanel, EuiText, EuiTitle, + useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; import { elasticAiAssistantImage } from '@kbn/observability-ai-assistant-plugin/public'; import { UPGRADE_LICENSE_TITLE } from '../i18n'; import { useLicenseManagementLocator } from '../hooks/use_license_management_locator'; -const incorrectLicenseContainer = css` - height: 100%; - padding: ${euiThemeVars.euiPanelPaddingModifiers.paddingMedium}; -`; - export function IncorrectLicensePanel() { const handleNavigateToLicenseManagement = useLicenseManagementLocator(); + const { euiTheme } = useEuiTheme(); + + const incorrectLicenseContainer = css` + height: 100%; + padding: ${euiTheme.size.base}; + `; return ( diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message_connectors.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message_connectors.tsx index af358c49f2c51..376ea8ad58aed 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message_connectors.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message_connectors.tsx @@ -15,9 +15,10 @@ import { EuiSpacer, EuiText, EuiIconTip, + useEuiTheme, + euiCanAnimate, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; import { isHttpFetchError } from '@kbn/core-http-browser'; import type { UseGenAIConnectorsResult } from '../hooks/use_genai_connectors'; @@ -30,10 +31,6 @@ const fadeInAnimation = keyframes` } `; -const fadeInClassName = css` - animation: ${fadeInAnimation} ${euiThemeVars.euiAnimSpeedNormal} ease-in-out; -`; - export function WelcomeMessageConnectors({ connectors, onSetupConnectorClick, @@ -41,6 +38,14 @@ export function WelcomeMessageConnectors({ connectors: UseGenAIConnectorsResult; onSetupConnectorClick?: () => void; }) { + const { euiTheme } = useEuiTheme(); + + const fadeInClassName = css` + ${euiCanAnimate} { + animation: ${fadeInAnimation} ${euiTheme.animation.normal} ease-in-out; + } + `; + if (connectors.error) { const isForbiddenError = isHttpFetchError(connectors.error) && diff --git a/x-pack/packages/kbn-ai-assistant/src/conversation/conversation_view.tsx b/x-pack/packages/kbn-ai-assistant/src/conversation/conversation_view.tsx index fb74ff7647a21..4e705b183aeba 100644 --- a/x-pack/packages/kbn-ai-assistant/src/conversation/conversation_view.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/conversation/conversation_view.tsx @@ -6,7 +6,6 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiSpacer, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/css'; -import { euiThemeVars } from '@kbn/ui-theme'; import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; import type { AssistantScope } from '@kbn/ai-assistant-common'; @@ -105,7 +104,7 @@ export const ConversationView: React.FC = ({ const conversationListContainerName = css` min-width: 250px; width: 250px; - border-right: solid 1px ${euiThemeVars.euiColorLightShade}; + border-right: solid 1px ${euiTheme.border.color}; `; const sidebarContainerClass = css` @@ -117,8 +116,8 @@ export const ConversationView: React.FC = ({ height: calc(100% - 56px); background-color: ${euiTheme.colors.lightestShade}; width: ${isSecondSlotVisible ? SECOND_SLOT_CONTAINER_WIDTH : 0}px; - border-top: solid 1px ${euiThemeVars.euiColorLightShade}; - border-left: solid 1px ${euiThemeVars.euiColorLightShade}; + border-top: solid 1px ${euiTheme.border.color}; + border-left: solid 1px ${euiTheme.border.color}; .euiFlyoutHeader { padding: ${euiTheme.size.m}; diff --git a/x-pack/packages/kbn-ai-assistant/tsconfig.json b/x-pack/packages/kbn-ai-assistant/tsconfig.json index 286bf8d5d1012..5ba1b161bccba 100644 --- a/x-pack/packages/kbn-ai-assistant/tsconfig.json +++ b/x-pack/packages/kbn-ai-assistant/tsconfig.json @@ -22,7 +22,6 @@ "@kbn/triggers-actions-ui-plugin", "@kbn/actions-plugin", "@kbn/i18n-react", - "@kbn/ui-theme", "@kbn/core", "@kbn/observability-ai-assistant-plugin", "@kbn/security-plugin", diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx index c9b0b21e70bcd..1ad8cd4d476c3 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx @@ -4,6 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { useEuiTheme } from '@elastic/eui'; import React, { ReactNode } from 'react'; export interface AssistantAvatarProps { @@ -22,7 +23,9 @@ export const sizeMap = { }; export function AssistantAvatar({ size = 's', css, className }: AssistantAvatarProps) { + const { euiTheme } = useEuiTheme(); const sizePx = sizeMap[size]; + return ( diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx index 2b8487fa45c9d..d2aa7a6379447 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiPanel, useEuiTheme } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiPanel } from '@elastic/eui'; import { css } from '@emotion/css'; import { Feedback, FeedbackButtons } from '../buttons/feedback_buttons'; import { StopGeneratingButton } from '../buttons/stop_generating_button'; @@ -34,8 +34,6 @@ export function ChatItemControls({ onRegenerateClick: () => void; onStopGeneratingClick: () => void; }) { - const { euiTheme } = useEuiTheme(); - const displayFeedback = !error && canGiveFeedback; const displayRegenerate = !loading && canRegenerate; @@ -64,7 +62,7 @@ export function ChatItemControls({ return controls ? ( <> - + {controls} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx index 97f2e0a71a0c6..ed7f13b936507 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx @@ -82,7 +82,7 @@ export function InsightBase({ position="right" /> - + {description} diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/additional_options_fields.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/additional_options_fields.tsx index 7a3b1abfd800b..fad8ed2f65978 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/additional_options_fields.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/additional_options_fields.tsx @@ -111,7 +111,7 @@ export const AdditionalOptionsConnectorFields: React.FC Date: Wed, 27 Nov 2024 07:41:52 -0500 Subject: [PATCH 03/10] fix(slo): Access Cases from SLO details page (#201834) --- .../observability_solution/slo/kibana.jsonc | 29 ++++++++++--------- .../slo/public/types.ts | 3 ++ .../observability_solution/slo/tsconfig.json | 1 + 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/observability_solution/slo/kibana.jsonc b/x-pack/plugins/observability_solution/slo/kibana.jsonc index 79302b58f8269..11eca10c6c8db 100644 --- a/x-pack/plugins/observability_solution/slo/kibana.jsonc +++ b/x-pack/plugins/observability_solution/slo/kibana.jsonc @@ -21,40 +21,41 @@ "charts", "dashboard", "data", - "dataViews", - "discoverShared", - "lens", "dataViewEditor", "dataViewFieldEditor", + "dataViews", + "discoverShared", + "embeddable", + "features", "fieldFormats", + "lens", + "licensing", "observability", "observabilityShared", + "presentationUtil", "ruleRegistry", + "share", "taskManager", "triggersActionsUi", - "share", - "unifiedSearch", "uiActions", - "embeddable", - "presentationUtil", - "features", - "licensing", - "usageCollection", + "unifiedSearch", + "usageCollection" ], "optionalPlugins": [ "cloud", - "serverless", "discover", "observabilityAIAssistant", + "serverless", "spaces", + "security" ], "requiredBundles": [ "controls", + "embeddable", + "ingestPipelines", "kibanaReact", "kibanaUtils", - "unifiedSearch", - "embeddable", - "ingestPipelines" + "unifiedSearch" ] } } \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/slo/public/types.ts b/x-pack/plugins/observability_solution/slo/public/types.ts index 1397b08a29528..964fb9b289ea3 100644 --- a/x-pack/plugins/observability_solution/slo/public/types.ts +++ b/x-pack/plugins/observability_solution/slo/public/types.ts @@ -47,6 +47,7 @@ import type { UsageCollectionSetup, UsageCollectionStart, } from '@kbn/usage-collection-plugin/public'; +import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin-types-public'; import type { SLORouteRepository } from '../server/routes/get_slo_server_route_repository'; import { SLOPlugin } from './plugin'; @@ -65,6 +66,7 @@ export interface SLOPublicPluginsSetup { triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; uiActions: UiActionsSetup; usageCollection: UsageCollectionSetup; + security?: SecurityPluginSetup; } export interface SLOPublicPluginsStart { @@ -94,6 +96,7 @@ export interface SLOPublicPluginsStart { uiActions: UiActionsStart; unifiedSearch: UnifiedSearchPublicPluginStart; usageCollection: UsageCollectionStart; + security?: SecurityPluginStart; } export type SLOPublicSetup = ReturnType; diff --git a/x-pack/plugins/observability_solution/slo/tsconfig.json b/x-pack/plugins/observability_solution/slo/tsconfig.json index 001c835fcb5cb..3b01431c3fb45 100644 --- a/x-pack/plugins/observability_solution/slo/tsconfig.json +++ b/x-pack/plugins/observability_solution/slo/tsconfig.json @@ -99,5 +99,6 @@ "@kbn/observability-alerting-rule-utils", "@kbn/discover-shared-plugin", "@kbn/server-route-repository-client", + "@kbn/security-plugin-types-public", ] } From 5ecfdf628fcac8632a53736867151a68aca93049 Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 06:52:50 -0600 Subject: [PATCH 04/10] Update dependency @launchdarkly/node-server-sdk to ^9.7.2 (main) (#201331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@launchdarkly/node-server-sdk](https://togithub.com/launchdarkly/js-core/tree/main/packages/sdk/server-node) ([source](https://togithub.com/launchdarkly/js-core)) | dependencies | patch | [`^9.7.1` -> `^9.7.2`](https://renovatebot.com/diffs/npm/@launchdarkly%2fnode-server-sdk/9.7.1/9.7.2) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Co-authored-by: Alejandro Fernández Haro --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 9a8807c5d2744..1b0714a384f87 100644 --- a/package.json +++ b/package.json @@ -1030,7 +1030,7 @@ "@langchain/langgraph": "0.2.19", "@langchain/openai": "^0.3.11", "@langtrase/trace-attributes": "^3.0.8", - "@launchdarkly/node-server-sdk": "^9.7.1", + "@launchdarkly/node-server-sdk": "^9.7.2", "@launchdarkly/openfeature-node-server": "^1.0.0", "@loaders.gl/core": "^3.4.7", "@loaders.gl/json": "^3.4.7", diff --git a/yarn.lock b/yarn.lock index 82a8c6c61da77..78523f5618d69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8058,20 +8058,20 @@ resolved "https://registry.yarnpkg.com/@launchdarkly/js-sdk-common/-/js-sdk-common-2.12.0.tgz#c22eb9fead687260d916a75f693c7d399f085b05" integrity sha512-HIDxvgo1vksC9hsYy3517sgW0Ql+iW3fgwlq/CEigeBNmaa9/J1Pxo7LrKPzezEA0kaGedmt/DCzVVxVBmxSsQ== -"@launchdarkly/js-server-sdk-common@2.9.1": - version "2.9.1" - resolved "https://registry.yarnpkg.com/@launchdarkly/js-server-sdk-common/-/js-server-sdk-common-2.9.1.tgz#a683d682897c20a6967f5454d932663e4da6fc5c" - integrity sha512-BGIjcfel1hURvX4hM4iVruWecWMntRzh1UuPtV0uOYnXLuETp5lfpqBB6KzFoERnEZoCyX6Tmo+tPFVwteIUGA== +"@launchdarkly/js-server-sdk-common@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@launchdarkly/js-server-sdk-common/-/js-server-sdk-common-2.10.0.tgz#5bb0de97d86d66ffb0a92018bab7def289af1b46" + integrity sha512-zbqpmEFQW/ZElZnRYX6N4gMZMpviE0F75/IyxcifLAFsjGNouxllpOOPbdtrLiJnJ0ixzt5vbtnem4tbhlYNOw== dependencies: "@launchdarkly/js-sdk-common" "2.12.0" semver "7.5.4" -"@launchdarkly/node-server-sdk@^9.7.1": - version "9.7.1" - resolved "https://registry.yarnpkg.com/@launchdarkly/node-server-sdk/-/node-server-sdk-9.7.1.tgz#bb228e5f8c4c7ca52579f909e4150b9a749b04a9" - integrity sha512-razZ/ine5hfHiS7ZNfM1r/G7GNDQ+wHV0pRN2A0Yk5spZTmT/ecu67e+aXu/KAfEQyL0V4ofEkXJpeGl7TYJ5Q== +"@launchdarkly/node-server-sdk@^9.7.2": + version "9.7.2" + resolved "https://registry.yarnpkg.com/@launchdarkly/node-server-sdk/-/node-server-sdk-9.7.2.tgz#23929639f4b09da1f4c5bb77ca858d32c56505a4" + integrity sha512-gcRarEh0yQrlwbWDORwbfTk19M/FtZje60EIo/c4298D/sqJ906MYq0J2MmyklEuIdQx/V4qPK+ss9LCCLpm/Q== dependencies: - "@launchdarkly/js-server-sdk-common" "2.9.1" + "@launchdarkly/js-server-sdk-common" "2.10.0" https-proxy-agent "^5.0.1" launchdarkly-eventsource "2.0.3" From 54d46986e676c0a824ac20204391f0212e59c880 Mon Sep 17 00:00:00 2001 From: Xavier Mouligneau Date: Wed, 27 Nov 2024 08:08:08 -0500 Subject: [PATCH 05/10] [CLOUD] Instant deployment (#201688) ## Summary We are having the same issue as here https://github.com/elastic/kibana/pull/197667 for instant deployment. We need to allow the solution_type `search`. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --- .../api/internal/set_solution_space.test.ts | 54 +++++++++++++++++++ .../routes/api/internal/set_solution_space.ts | 1 + .../apis/spaces/set_solution_space.ts | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.test.ts b/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.test.ts index 6b1127db821b1..b1a88f6bd645f 100644 --- a/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.test.ts +++ b/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.test.ts @@ -129,6 +129,60 @@ describe('PUT /internal/spaces/space/{id}/solution', () => { }); }); + it('should update the solution_type when it is search', async () => { + const payload = { + solution_type: 'search', + }; + + const { routeHandler, savedObjectsRepositoryMock } = await setup(); + + const request = httpServerMock.createKibanaRequest({ + params: { + id: 'a-space', + }, + body: payload, + method: 'post', + }); + + const response = await routeHandler(mockRouteContext, request, kibanaResponseFactory); + + const { status } = response; + + expect(status).toEqual(200); + expect(savedObjectsRepositoryMock.update).toHaveBeenCalledTimes(1); + expect(savedObjectsRepositoryMock.update).toHaveBeenCalledWith('space', 'a-space', { + solution: 'es', + name: 'a space', + color: undefined, + description: undefined, + disabledFeatures: [], + imageUrl: undefined, + initials: undefined, + }); + }); + + it('should failed when the solution_type is not the expected one', async () => { + const payload = { + solution_type: 'searchXoXo', + }; + + const { routeHandler } = await setup(); + + const request = httpServerMock.createKibanaRequest({ + params: { + id: 'a-space', + }, + body: payload, + method: 'post', + }); + + const response = await routeHandler(mockRouteContext, request, kibanaResponseFactory); + + const { status } = response; + + expect(status).toEqual(500); + }); + it('should not allow a new space to be created', async () => { const payload = { solution: 'oblt', diff --git a/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.ts b/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.ts index cfe14705a4e22..24508f6173bba 100644 --- a/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/internal/set_solution_space.ts @@ -21,6 +21,7 @@ const spaceSolutionSchema = schema.oneOf([ schema.literal('security'), schema.literal('observability'), schema.literal('elasticsearch'), + schema.literal('search'), ]), }), ]); diff --git a/x-pack/test/api_integration/apis/spaces/set_solution_space.ts b/x-pack/test/api_integration/apis/spaces/set_solution_space.ts index 8019b59ca817d..7f91c5fb606a7 100644 --- a/x-pack/test/api_integration/apis/spaces/set_solution_space.ts +++ b/x-pack/test/api_integration/apis/spaces/set_solution_space.ts @@ -139,7 +139,7 @@ export default function ({ getService }: FtrProviderContext) { .expect(400); expect(body.message).to.eql( - '[request body]: types that failed validation:\n- [request body.0.solution]: expected at least one defined value but got [undefined]\n- [request body.1.solution_type]: types that failed validation:\n - [request body.solution_type.0]: expected value to equal [security]\n - [request body.solution_type.1]: expected value to equal [observability]\n - [request body.solution_type.2]: expected value to equal [elasticsearch]' + '[request body]: types that failed validation:\n- [request body.0.solution]: expected at least one defined value but got [undefined]\n- [request body.1.solution_type]: types that failed validation:\n - [request body.solution_type.0]: expected value to equal [security]\n - [request body.solution_type.1]: expected value to equal [observability]\n - [request body.solution_type.2]: expected value to equal [elasticsearch]\n - [request body.solution_type.3]: expected value to equal [search]' ); }); From 4fbec3f31838f06e011c5a9ac9bb4d5d4ec97c84 Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:46:35 -0600 Subject: [PATCH 06/10] Update dependency @elastic/request-converter to ^8.16.2 (main) (#201856) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1b0714a384f87..cc37c29769637 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.20.2", "@elastic/react-search-ui-views": "^1.20.2", - "@elastic/request-converter": "^8.16.1", + "@elastic/request-converter": "^8.16.2", "@elastic/request-crypto": "^2.0.3", "@elastic/search-ui": "^1.20.2", "@elastic/search-ui-app-search-connector": "^1.20.2", diff --git a/yarn.lock b/yarn.lock index 78523f5618d69..bb29b6cf6261d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2394,10 +2394,10 @@ "@elastic/react-search-ui-views" "1.20.2" "@elastic/search-ui" "1.20.2" -"@elastic/request-converter@^8.16.1": - version "8.16.1" - resolved "https://registry.yarnpkg.com/@elastic/request-converter/-/request-converter-8.16.1.tgz#fad73db1a2ed0448501c389cf543fb77c6ffff57" - integrity sha512-lg2qCJ4kyxsP/0NpZo0+NsJfaY4JwyxGIVqD2l2Vmx9tv7ZNaZMn/TjHKBo2+jN0laJBInpxpnkPUgVWo5kw1g== +"@elastic/request-converter@^8.16.2": + version "8.16.2" + resolved "https://registry.yarnpkg.com/@elastic/request-converter/-/request-converter-8.16.2.tgz#e82c5c794adf8da37795cb8656e2f0334460cb08" + integrity sha512-bljPrXbXkImBglTz5N8Rrpmzc64ahpZxOkBIKFBX1mnU3kv/JDeMjsv1rvfHXrkuhtQQ4kRRZqfwmqzJIwzlag== dependencies: child-process-promise "^2.2.1" commander "^12.1.0" From 791a3f040237b7ac07f53c2e1b744f3c0e174c46 Mon Sep 17 00:00:00 2001 From: Jesus Wahrman <41008968+jesuswr@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:48:45 +0100 Subject: [PATCH 07/10] Add retry logic to license fetcher (#201843) ## Summary Added some retry logic to the license fetcher function and updated tests to match this new behavior. Resolves: https://github.com/elastic/kibana/issues/197074 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../licensing/server/license_fetcher.test.ts | 76 ++++++++++++++++--- .../licensing/server/license_fetcher.ts | 12 ++- x-pack/plugins/licensing/server/plugin.ts | 1 + 3 files changed, 76 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/licensing/server/license_fetcher.test.ts b/x-pack/plugins/licensing/server/license_fetcher.test.ts index a8a64d300e9f4..195c70c7c7c49 100644 --- a/x-pack/plugins/licensing/server/license_fetcher.test.ts +++ b/x-pack/plugins/licensing/server/license_fetcher.test.ts @@ -12,7 +12,8 @@ import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; type EsLicense = estypes.XpackInfoMinimalLicenseInformation; -const delay = (ms: number) => new Promise((res) => setTimeout(res, ms)); +const maxRetryDelay = 30 * 1000; +const sumOfRetryTimes = (1 + 2 + 4 + 8 + 16) * 1000; function buildRawLicense(options: Partial = {}): EsLicense { return { @@ -33,6 +34,9 @@ describe('LicenseFetcher', () => { logger = loggerMock.create(); clusterClient = elasticsearchServiceMock.createClusterClient(); }); + afterEach(() => { + jest.useRealTimers(); + }); it('returns the license for successful calls', async () => { clusterClient.asInternalUser.xpack.info.mockResponse({ @@ -46,6 +50,7 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); const license = await fetcher(); @@ -71,6 +76,7 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); let license = await fetcher(); @@ -81,6 +87,7 @@ describe('LicenseFetcher', () => { }); it('returns an error license in case of error', async () => { + jest.useFakeTimers(); clusterClient.asInternalUser.xpack.info.mockResponseImplementation(() => { throw new Error('woups'); }); @@ -89,13 +96,20 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); - const license = await fetcher(); + const licensePromise = fetcher(); + await jest.advanceTimersByTimeAsync(sumOfRetryTimes); + const license = await licensePromise; + expect(license.error).toEqual('woups'); + // should be called once to start and then in the retries after 1s, 2s, 4s, 8s and 16s + expect(clusterClient.asInternalUser.xpack.info).toHaveBeenCalledTimes(6); }); it('returns a license successfully fetched after an error', async () => { + jest.useFakeTimers(); clusterClient.asInternalUser.xpack.info .mockResponseImplementationOnce(() => { throw new Error('woups'); @@ -111,15 +125,20 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); - let license = await fetcher(); - expect(license.error).toEqual('woups'); - license = await fetcher(); + const licensePromise = fetcher(); + // wait one minute since we mocked only one error + await jest.advanceTimersByTimeAsync(1000); + const license = await licensePromise; + expect(license.uid).toEqual('license-1'); + expect(clusterClient.asInternalUser.xpack.info).toBeCalledTimes(2); }); it('returns the latest fetched license after an error within the cache duration period', async () => { + jest.useFakeTimers(); clusterClient.asInternalUser.xpack.info .mockResponseOnce({ license: buildRawLicense({ @@ -127,7 +146,7 @@ describe('LicenseFetcher', () => { }), features: {}, } as any) - .mockResponseImplementationOnce(() => { + .mockResponseImplementation(() => { throw new Error('woups'); }); @@ -135,15 +154,24 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); let license = await fetcher(); expect(license.uid).toEqual('license-1'); - license = await fetcher(); + expect(clusterClient.asInternalUser.xpack.info).toBeCalledTimes(1); + + const licensePromise = fetcher(); + await jest.advanceTimersByTimeAsync(sumOfRetryTimes); + license = await licensePromise; expect(license.uid).toEqual('license-1'); + // should be called once in the successful mock, once in the error mock + // and then in the retries after 1s, 2s, 4s, 8s and 16s + expect(clusterClient.asInternalUser.xpack.info).toBeCalledTimes(7); }); it('returns an error license after an error exceeding the cache duration period', async () => { + jest.useFakeTimers(); clusterClient.asInternalUser.xpack.info .mockResponseOnce({ license: buildRawLicense({ @@ -151,7 +179,7 @@ describe('LicenseFetcher', () => { }), features: {}, } as any) - .mockResponseImplementationOnce(() => { + .mockResponseImplementation(() => { throw new Error('woups'); }); @@ -159,14 +187,15 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 1, + maxRetryDelay, }); let license = await fetcher(); expect(license.uid).toEqual('license-1'); - await delay(50); - - license = await fetcher(); + const licensePromise = fetcher(); + await jest.advanceTimersByTimeAsync(sumOfRetryTimes); + license = await licensePromise; expect(license.error).toEqual('woups'); }); @@ -180,6 +209,7 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); const license = await fetcher(); @@ -203,6 +233,7 @@ describe('LicenseFetcher', () => { logger, clusterClient, cacheDurationMs: 50_000, + maxRetryDelay, }); const license = await fetcher(); @@ -213,4 +244,27 @@ describe('LicenseFetcher', () => { ] `); }); + + it('testing the fetcher retry with a different maxRetryDelay using only errors', async () => { + jest.useFakeTimers(); + clusterClient.asInternalUser.xpack.info.mockResponseImplementation(() => { + throw new Error('woups'); + }); + + const fetcher = getLicenseFetcher({ + logger, + clusterClient, + cacheDurationMs: 50_000, + maxRetryDelay: 10 * 1000, + }); + const sumOfRetryTimesUntilTen = (1 + 2 + 4 + 8) * 1000; + + const licensePromise = fetcher(); + await jest.advanceTimersByTimeAsync(sumOfRetryTimesUntilTen); + const license = await licensePromise; + + expect(license.error).toEqual('woups'); + // should be called once to start and then in the retries after 1s, 2s, 4s and 8s + expect(clusterClient.asInternalUser.xpack.info).toHaveBeenCalledTimes(5); + }); }); diff --git a/x-pack/plugins/licensing/server/license_fetcher.ts b/x-pack/plugins/licensing/server/license_fetcher.ts index 56a89fe221c9d..278142e5c39b2 100644 --- a/x-pack/plugins/licensing/server/license_fetcher.ts +++ b/x-pack/plugins/licensing/server/license_fetcher.ts @@ -7,6 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { createHash } from 'crypto'; +import pRetry from 'p-retry'; import stringify from 'json-stable-stringify'; import type { MaybePromise } from '@kbn/utility-types'; import { isPromise } from '@kbn/std'; @@ -25,18 +26,23 @@ export const getLicenseFetcher = ({ clusterClient, logger, cacheDurationMs, + maxRetryDelay, }: { clusterClient: MaybePromise; logger: Logger; cacheDurationMs: number; + maxRetryDelay: number; }): LicenseFetcher => { let currentLicense: ILicense | undefined; let lastSuccessfulFetchTime: number | undefined; + const maxRetries = Math.floor(Math.log2(maxRetryDelay / 1000)) + 1; return async () => { const client = isPromise(clusterClient) ? await clusterClient : clusterClient; try { - const response = await client.asInternalUser.xpack.info(); + const response = await pRetry(() => client.asInternalUser.xpack.info(), { + retries: maxRetries, + }); const normalizedLicense = response.license && response.license.type !== 'missing' ? normalizeServerLicense(response.license) @@ -63,7 +69,9 @@ export const getLicenseFetcher = ({ lastSuccessfulFetchTime = Date.now(); return currentLicense; - } catch (error) { + } catch (err) { + const error = err.originalError ?? err; + logger.warn( `License information could not be obtained from Elasticsearch due to ${error} error` ); diff --git a/x-pack/plugins/licensing/server/plugin.ts b/x-pack/plugins/licensing/server/plugin.ts index 1f9cfaf20af77..77de999c4f958 100644 --- a/x-pack/plugins/licensing/server/plugin.ts +++ b/x-pack/plugins/licensing/server/plugin.ts @@ -125,6 +125,7 @@ export class LicensingPlugin implements Plugin Date: Wed, 27 Nov 2024 07:49:44 -0600 Subject: [PATCH 08/10] skip failing test suite (#177791) --- .../public/components/category/category_form_field.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx b/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx index e2aed2c397835..1b7a7c2eba7d7 100644 --- a/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx +++ b/x-pack/plugins/cases/public/components/category/category_form_field.test.tsx @@ -14,7 +14,8 @@ import { categories } from '../../containers/mock'; import { MAX_CATEGORY_LENGTH } from '../../../common/constants'; import { FormTestComponent } from '../../common/test_utils'; -describe('Category', () => { +// Failing: See https://github.com/elastic/kibana/issues/177791 +describe.skip('Category', () => { const onSubmit = jest.fn(); it('renders the category field correctly', async () => { From 87af12d21def2ff03e47d0df59b28dfa11436fa8 Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Wed, 27 Nov 2024 16:18:48 +0200 Subject: [PATCH 09/10] fix: [Search:AppSearch:Engines:Schema page]Add a new field modal dialog missing title from announcement (#201786) Closes: #201338 ## Description Dialog modal visible title should be announced for the users, especially using assistive technology to know what dialog modal, flyout opened. ## What was changed?: 1. aria-labelledby={modalTitleId} attribute was added for mentioned EuiModal # Screen Screenshot 2024-11-26 at 15 40 20 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../shared/schema/add_field_modal/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.tsx index 32191abbbae21..b717de04d21da 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.tsx @@ -22,6 +22,7 @@ import { EuiModalHeader, EuiModalHeaderTitle, EuiSpacer, + useGeneratedHtmlId, } from '@elastic/eui'; import { SchemaFieldTypeSelect } from '..'; @@ -78,10 +79,12 @@ export const SchemaAddFieldModal: React.FC = ({ ? FIELD_NAME_CORRECTED_NOTE(formattedFieldName) : FIELD_NAME_CORRECT_NOTE; + const modalTitleId = useGeneratedHtmlId(); + return ( - + - {ADD_FIELD_MODAL_TITLE} + {ADD_FIELD_MODAL_TITLE} = ({ - {CANCEL_BUTTON_LABEL} + + {CANCEL_BUTTON_LABEL} + Date: Wed, 27 Nov 2024 15:42:01 +0100 Subject: [PATCH 10/10] [UA] Update wizard copy to callout "x.last" (#201633) ## Summary We want to make sure users for the upgrade assistant are aware that the only way to safely perform a major version upgrade is to upgrade to the latest minor of the major they are on. ### Current Screenshot 2024-11-25 at 16 44 37 ### Next Screenshot 2024-11-27 at 13 52 30 Related https://github.com/elastic/kibana/issues/201377 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --- .../translations/translations/fr-FR.json | 2 -- .../translations/translations/ja-JP.json | 2 -- .../translations/translations/zh-CN.json | 2 -- .../components/overview/overview.tsx | 28 +++++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 970d4897b9e6a..765be17d98b5d 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -48859,7 +48859,6 @@ "xpack.upgradeAssistant.overview.apiCompatibilityNoteTitle": "Appliquer les en-têtes de compatibilité d'API (facultatif)", "xpack.upgradeAssistant.overview.backupStepDescription": "Assurez-vous de disposer d'un snapshot actuel avant d'effectuer des modifications.", "xpack.upgradeAssistant.overview.backupStepTitle": "Sauvegarder vos données", - "xpack.upgradeAssistant.overview.checkUpcomingVersion": "Si vous ne travaillez pas sur la dernière version de la Suite Elastic, utilisez l'assistant de mise à niveau pour effectuer la préparation de la prochaine mise à niveau.", "xpack.upgradeAssistant.overview.cloudBackup.hasSnapshotMessage": "Dernier snapshot créé le {lastBackupTime}.", "xpack.upgradeAssistant.overview.cloudBackup.loadingError": "Une erreur s'est produite lors de la récupération du dernier statut de snapshot", "xpack.upgradeAssistant.overview.cloudBackup.noSnapshotMessage": "Vos données n'ont pas été sauvegardées.", @@ -48934,7 +48933,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "Réessayer", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Analyser les logs dans Discover", "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Afficher les logs d'obsolescence dans Logs Explorer", - "xpack.upgradeAssistant.overview.whatsNewLink": "Consulter les points forts de la toute dernière version", "xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "Vous ne disposez pas des privilèges appropriés pour réindexer \"{indexName}\".", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "Tous les avertissements de déclassement ont été résolus.", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "Les problèmes suivants doivent être résolus avant la mise à niveau : {upgradeIssues}.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 1ae2f8380600d..3f1b10bdce8ae 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -48820,7 +48820,6 @@ "xpack.upgradeAssistant.overview.apiCompatibilityNoteTitle": "API互換性ヘッダーを適用(オプション)", "xpack.upgradeAssistant.overview.backupStepDescription": "変更を行う前に、現在のスナップショットがあることを確認してください。", "xpack.upgradeAssistant.overview.backupStepTitle": "データをバックアップ", - "xpack.upgradeAssistant.overview.checkUpcomingVersion": "最新バージョンのElastic Stackを使用していない場合は、アップグレードアシスタンスを使用して、次回のアップグレードを準備してください。", "xpack.upgradeAssistant.overview.cloudBackup.hasSnapshotMessage": "前回のスナップショットは{lastBackupTime}に作成されました。", "xpack.upgradeAssistant.overview.cloudBackup.loadingError": "最新のスナップショットステータスの取得中にエラーが発生しました", "xpack.upgradeAssistant.overview.cloudBackup.noSnapshotMessage": "データはバックアップされていません。", @@ -48895,7 +48894,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "再試行", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Discoverでログを分析", "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Logs Explorerで廃止予定ログを表示", - "xpack.upgradeAssistant.overview.whatsNewLink": "最新リリースのハイライトを確認", "xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "「{indexName}」に再インデックスするための権限が不十分です。", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "すべての廃止予定の警告が解決されました。", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "アップグレード前に次の問題を解決する必要があります:{upgradeIssues}。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 27eb8d93e9919..463906b3e6cff 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -48072,7 +48072,6 @@ "xpack.upgradeAssistant.overview.apiCompatibilityNoteTitle": "应用 API 兼容性标头(可选)", "xpack.upgradeAssistant.overview.backupStepDescription": "做出更改之前,请确保具有当前快照。", "xpack.upgradeAssistant.overview.backupStepTitle": "备份您的数据", - "xpack.upgradeAssistant.overview.checkUpcomingVersion": "如果您未使用最新版本的 Elastic Stack,请使用升级助手准备下次升级。", "xpack.upgradeAssistant.overview.cloudBackup.hasSnapshotMessage": "上次创建快照的时间为 {lastBackupTime}。", "xpack.upgradeAssistant.overview.cloudBackup.loadingError": "检索最新快照状态时出错", "xpack.upgradeAssistant.overview.cloudBackup.noSnapshotMessage": "您的数据未备份。", @@ -48147,7 +48146,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "重试", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "在 Discover 中分析日志", "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "在日志浏览器中查看弃用日志", - "xpack.upgradeAssistant.overview.whatsNewLink": "查看最新发布亮点", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "所有弃用警告均已解决。", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "在升级之前必须解决以下问题:{upgradeIssues}。", "xpack.upgradeAssistant.status.esTotalCriticalDepsMessage": "{esTotalCriticalDeps} 个 Elasticsearch 弃用{esTotalCriticalDeps, plural, other {问题}}", diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx index cc28b2e152e23..b9579005ffe3a 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx @@ -9,13 +9,13 @@ import React, { useEffect, useState } from 'react'; import { EuiSteps, - EuiText, EuiPageHeader, EuiButtonEmpty, EuiSpacer, EuiLink, EuiPageBody, EuiPageSection, + EuiText, } from '@elastic/eui'; import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; @@ -94,18 +94,24 @@ export const Overview = withRouter(({ history }: RouteComponentProps) => { > + + + ), + }} /> - - - - -