Skip to content

Commit

Permalink
Merge branch 'upgrade-typescript-v4-9-5' of github.com:mistic/kibana …
Browse files Browse the repository at this point in the history
…into upgrade-typescript-v4-9-5
  • Loading branch information
mistic committed Feb 24, 2024
2 parents c44e462 + 3411e28 commit 8b3f482
Show file tree
Hide file tree
Showing 89 changed files with 3,819 additions and 644 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.5.1",
"@elastic/eui": "93.1.1",
"@elastic/eui": "93.2.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,9 @@ export const getEuiContextMapping = (): EuiTokensObject => {
defaultMessage: 'Search for anything...',
}
),
'euiSideNav.mobileToggleAriaLabel': i18n.translate('core.euiSideNav.mobileToggleAriaLabel', {
defaultMessage: 'Toggle navigation',
}),
'euiStat.loadingText': i18n.translate('core.euiStat.loadingText', {
defaultMessage: 'Statistic is loading',
}),
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
customUrls: `${MACHINE_LEARNING_DOCS}ml-configuring-url.html`,
dataFrameAnalytics: `${MACHINE_LEARNING_DOCS}ml-dfanalytics.html`,
dFAPrepareData: `${MACHINE_LEARNING_DOCS}ml-dfa-overview.html#prepare-transform-data`,
dFAStartJob: `${ELASTICSEARCH_DOCS}start-dfanalytics.html`,
dFACreateJob: `${ELASTICSEARCH_DOCS}put-dfanalytics.html`,
featureImportance: `${MACHINE_LEARNING_DOCS}ml-feature-importance.html`,
outlierDetectionRoc: `${MACHINE_LEARNING_DOCS}ml-dfa-finding-outliers.html#ml-dfanalytics-roc`,
regressionEvaluation: `${MACHINE_LEARNING_DOCS}ml-dfa-regression.html#ml-dfanalytics-regression-evaluation`,
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.

7 changes: 4 additions & 3 deletions packages/shared-ux/page/solution_nav/src/solution_nav.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
$euiSideNavEmphasizedBackgroundColor: transparentize($euiColorLightShade, .7);
@import '@elastic/eui/src/components/side_nav/mixins';
@import 'variables';

// Put the page background color in the flyout version too
.kbnSolutionNav__flyout {
background-color: $euiPageBackgroundColor;

.kbnSolutionNav {
flex: auto; // Override default EuiPageSideBar flex CSS when in a flyout
}
}

.kbnSolutionNav {
@include euiSideNavEmbellish;
@include euiYScroll;

display: flex;
Expand Down
5 changes: 3 additions & 2 deletions packages/shared-ux/page/solution_nav/src/solution_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
useIsWithinMinBreakpoint,
useEuiTheme,
useEuiThemeCSSVariables,
EuiPageSidebar,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -234,11 +235,11 @@ export const SolutionNav: FC<SolutionNavProps> = ({
className="kbnSolutionNav__flyout"
hideCloseButton={!canBeCollapsed}
>
<div className={sideNavClasses}>
<EuiPageSidebar className={sideNavClasses} hasEmbellish={true}>
{titleText}
<EuiSpacer size="l" />
{sideNavContent}
</div>
</EuiPageSidebar>
</EuiFlyout>
)}
{canBeCollapsed && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const withSolutionNav = <P extends TemplateProps>(WrappedComponent: Compo
...props.pageSideBarProps,
minWidth: isSidebarShrunk ? euiTheme.size.xxl : undefined,
className: sideBarClasses,
hasEmbellish: !isSidebarShrunk,
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/eui@93.1.1': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@93.2.0': ['SSPL-1.0 OR Elastic License 2.0'],
'[email protected]': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'[email protected]': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
'@bufbuild/[email protected]': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause)
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/controls/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"unifiedSearch",
"uiActions"
],
"extraPublicDirs": ["common"]
"extraPublicDirs": ["common"],
"requiredBundles": ["kibanaUtils"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,44 @@

import '../control_group.scss';

import {
arrayMove,
SortableContext,
rectSortingStrategy,
sortableKeyboardCoordinates,
} from '@dnd-kit/sortable';
import classNames from 'classnames';
import React, { useEffect, useMemo, useState } from 'react';
import { TypedUseSelectorHook, useSelector } from 'react-redux';

import {
closestCenter,
DndContext,
DragEndEvent,
DragOverlay,
KeyboardSensor,
LayoutMeasuringStrategy,
PointerSensor,
useSensor,
useSensors,
LayoutMeasuringStrategy,
} from '@dnd-kit/core';
import classNames from 'classnames';
import React, { useMemo, useState } from 'react';
import { TypedUseSelectorHook, useSelector } from 'react-redux';
import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui';

import {
arrayMove,
rectSortingStrategy,
SortableContext,
sortableKeyboardCoordinates,
} from '@dnd-kit/sortable';
import {
EuiButtonEmpty,
EuiButtonIcon,
EuiCheckbox,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiPanel,
EuiText,
EuiTourStep,
} from '@elastic/eui';
import { ViewMode } from '@kbn/embeddable-plugin/public';

import { ControlGroupReduxState } from '../types';
import { ControlGroupStrings } from '../control_group_strings';
import { ControlClone, SortableControl } from './control_group_sortable_item';
import { useControlGroupContainer } from '../embeddable/control_group_container';
import { ControlGroupReduxState } from '../types';
import { ControlClone, SortableControl } from './control_group_sortable_item';

const contextSelect = useSelector as TypedUseSelectorHook<ControlGroupReduxState>;

Expand All @@ -47,6 +57,12 @@ export const ControlGroup = () => {
const viewMode = contextSelect((state) => state.explicitInput.viewMode);
const controlStyle = contextSelect((state) => state.explicitInput.controlStyle);
const showAddButton = contextSelect((state) => state.componentState.showAddButton);
const controlWithInvalidSelectionsId = contextSelect(
(state) => state.componentState.controlWithInvalidSelectionsId
);
const [tourStepOpen, setTourStepOpen] = useState<boolean>(true);
const [suppressTourChecked, setSuppressTourChecked] = useState<boolean>(false);
const [renderTourStep, setRenderTourStep] = useState(false);

const isEditable = viewMode === ViewMode.EDIT;

Expand All @@ -61,6 +77,87 @@ export const ControlGroup = () => {
[panels]
);

useEffect(() => {
/**
* This forces the tour step to get unmounted so that it can attach to the new invalid
* control - otherwise, the anchor will remain attached to the old invalid control
*/
setRenderTourStep(false);
setTimeout(() => setRenderTourStep(true), 100);
}, [controlWithInvalidSelectionsId]);

const tourStep = useMemo(() => {
if (
!renderTourStep ||
!controlGroup.canShowInvalidSelectionsWarning() ||
!tourStepOpen ||
!controlWithInvalidSelectionsId
) {
return null;
}
const invalidControlType = panels[controlWithInvalidSelectionsId].type;

return (
<EuiTourStep
step={1}
stepsTotal={1}
minWidth={300}
maxWidth={300}
display="block"
isStepOpen={true}
repositionOnScroll
onFinish={() => {}}
panelPaddingSize="m"
anchorPosition="downCenter"
panelClassName="controlGroup--invalidSelectionsTour"
anchor={`#controlFrame--${controlWithInvalidSelectionsId}`}
title={
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem grow={false}>
<EuiIcon type="warning" color="warning" />
</EuiFlexItem>
<EuiFlexItem>{ControlGroupStrings.invalidControlWarning.getTourTitle()}</EuiFlexItem>
</EuiFlexGroup>
}
content={ControlGroupStrings.invalidControlWarning.getTourContent(invalidControlType)}
footerAction={[
<EuiCheckbox
compressed
checked={suppressTourChecked}
id={'controlGroup--suppressTourCheckbox'}
className="controlGroup--suppressTourCheckbox"
onChange={(e) => setSuppressTourChecked(e.target.checked)}
label={
<EuiText size="xs" className="controlGroup--suppressTourCheckboxLabel">
{ControlGroupStrings.invalidControlWarning.getSuppressTourLabel()}
</EuiText>
}
/>,
<EuiButtonEmpty
size="xs"
flush="right"
color="text"
onClick={() => {
setTourStepOpen(false);
if (suppressTourChecked) {
controlGroup.suppressInvalidSelectionsWarning();
}
}}
>
{ControlGroupStrings.invalidControlWarning.getDismissButton()}
</EuiButtonEmpty>,
]}
/>
);
}, [
panels,
controlGroup,
tourStepOpen,
renderTourStep,
suppressTourChecked,
controlWithInvalidSelectionsId,
]);

const [draggingId, setDraggingId] = useState<string | null>(null);
const draggingIndex = useMemo(
() => (draggingId ? idsInOrder.indexOf(draggingId) : -1),
Expand Down Expand Up @@ -117,6 +214,7 @@ export const ControlGroup = () => {
alignItems="center"
data-test-subj="controls-group"
>
{tourStep}
<EuiFlexItem>
<DndContext
onDragStart={({ active }) => setDraggingId(active.id)}
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/controls/public/control_group/control_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,12 @@ $controlMinWidth: $euiSize * 14;
top: (-$euiSizeXS) !important;
}
}

.controlGroup--invalidSelectionsTour {
.controlGroup--suppressTourCheckbox {
height: 22px;
&Label {
font-weight: $euiFontWeightMedium;
}
}
}
Loading

0 comments on commit 8b3f482

Please sign in to comment.