diff --git a/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts b/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts index 48e9068eeda7a..0dc205675bd30 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/application_usage/rollups.ts @@ -96,11 +96,22 @@ export async function rollDailyData(logger: Logger, savedObjectsClient?: ISavedO })), { overwrite: true } ); - await Promise.all( + const promiseStatuses = await Promise.allSettled( rawApplicationUsageTransactional.map( ({ id }) => savedObjectsClient.delete(SAVED_OBJECTS_TRANSACTIONAL_TYPE, id) // There is no bulkDelete :( ) ); + const rejectedPromises = promiseStatuses.filter( + (settledResult): settledResult is PromiseRejectedResult => + settledResult.status === 'rejected' + ); + if (rejectedPromises.length > 0) { + throw new Error( + `Failed to delete some items in ${SAVED_OBJECTS_TRANSACTIONAL_TYPE}: ${JSON.stringify( + rejectedPromises.map(({ reason }) => reason) + )}` + ); + } } } while (toCreate.size > 0); } catch (err) { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx index a8b1680ebde07..ef69f6a545656 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx @@ -32,6 +32,19 @@ interface Props { policyName: string; } +/** + * Ensure that the JSON we get from the from has phases in the correct order. + */ +const prettifyFormJson = (policy: SerializedPolicy): SerializedPolicy => ({ + ...policy, + phases: { + hot: policy.phases.hot, + warm: policy.phases.warm, + cold: policy.phases.cold, + delete: policy.phases.delete, + }, +}); + export const PolicyJsonFlyout: React.FunctionComponent = ({ policyName, close }) => { /** * policy === undefined: we are checking validity @@ -46,7 +59,7 @@ export const PolicyJsonFlyout: React.FunctionComponent = ({ policyName, c const updatePolicy = useCallback(async () => { setPolicy(undefined); if (await validateForm()) { - setPolicy(getFormData() as SerializedPolicy); + setPolicy(prettifyFormJson(getFormData())); } else { setPolicy(null); } diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestion.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestion.tsx index 1dc89d2795309..851da79314552 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestion.tsx +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestion.tsx @@ -5,14 +5,13 @@ */ import React, { useRef, useEffect, RefObject } from 'react'; -import styled from 'styled-components'; import { EuiSuggestItem } from '@elastic/eui'; -import theme from '@elastic/eui/dist/eui_theme_light.json'; import { QuerySuggestion } from '../../../../../../../../src/plugins/data/public'; +import { euiStyled } from '../../../../../../observability/public'; -const SuggestionItem = styled.div<{ selected: boolean }>` - background: ${(props) => (props.selected ? theme.euiColorLightestShade : 'initial')}; +const SuggestionItem = euiStyled.div<{ selected: boolean }>` + background: ${(props) => (props.selected ? props.theme.eui.euiColorLightestShade : 'initial')}; `; function getIconColor(type: string) { diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestions.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestions.tsx index 4e2b08d97cf4b..4f8fb712de679 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestions.tsx +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/suggestions.tsx @@ -5,12 +5,11 @@ */ import React, { useRef, useState, useEffect } from 'react'; -import styled from 'styled-components'; import { isEmpty } from 'lodash'; -import { tint } from 'polished'; -import theme from '@elastic/eui/dist/eui_theme_light.json'; +import { rgba } from 'polished'; import { Suggestion } from './suggestion'; import { QuerySuggestion } from '../../../../../../../../src/plugins/data/public'; +import { euiStyled } from '../../../../../../observability/public'; export const unit = 16; @@ -30,16 +29,30 @@ export function px(value: number): string { return `${value}px`; } -const List = styled.ul` +const List = euiStyled.ul` width: 100%; - border: 1px solid ${theme.euiColorLightShade}; + border: 1px solid ${(props) => props.theme.eui.euiColorLightShade}; border-radius: ${px(units.quarter)}; - box-shadow: 0px ${px(units.quarter)} ${px(units.double)} ${tint(0.1, theme.euiColorFullShade)}; - background: #fff; + background-color: ${(props) => props.theme.eui.euiColorEmptyShade}; z-index: 10; max-height: ${px(unit * 20)}; - overflow: scroll; + overflow: auto; position: absolute; + + &::-webkit-scrollbar { + height: ${({ theme }) => theme.eui.euiScrollBar}; + width: ${({ theme }) => theme.eui.euiScrollBar}; + } + + &::-webkit-scrollbar-thumb { + background-clip: content-box; + background-color: ${({ theme }) => rgba(theme.eui.euiColorDarkShade, 0.5)}; + border: ${({ theme }) => theme.eui.euiScrollBarCorner} solid transparent; + } + &::-webkit-scrollbar-corner, + &::-webkit-scrollbar-track { + background-color: transparent; + } `; interface SuggestionsProps { diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/typehead.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/typehead.tsx index 5582818b6f09b..2dbbca84e6e63 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/typehead.tsx +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/typeahead/typehead.tsx @@ -236,8 +236,6 @@ export const Typeahead: React.FC = ({ }; const onMouseEnterSuggestion = (index: number) => { - setState({ ...state, index }); - setState((prevState) => ({ ...prevState, index,