Skip to content

Commit

Permalink
Merge branch 'master' into d/2021-10-18-scss-in-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Oct 20, 2021
2 parents 84d8328 + a7a1e54 commit dabea01
Show file tree
Hide file tree
Showing 248 changed files with 3,030 additions and 1,840 deletions.
11 changes: 11 additions & 0 deletions .buildkite/pipelines/pull_request/uptime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- command: .buildkite/scripts/steps/functional/uptime.sh
label: 'Uptime @elastic/synthetics Tests'
agents:
queue: ci-group-6
depends_on: build
timeout_in_minutes: 120
retry:
automatic:
- exit_status: '*'
limit: 1
4 changes: 4 additions & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const uploadPipeline = (pipelineContent) => {
// pipeline.push(getPipeline('.buildkite/pipelines/pull_request/apm_cypress.yml'));
// }

if (await doAnyChangesMatch([/^x-pack\/plugins\/uptime/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/uptime.yml'));
}

pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml'));

uploadPipeline(pipeline.join('\n'));
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/scripts/steps/functional/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

# Note, changes here might also need to be made in other scripts, e.g. uptime.sh

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
Expand Down
17 changes: 17 additions & 0 deletions .buildkite/scripts/steps/functional/uptime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

export JOB=kibana-uptime-playwright

echo "--- Uptime @elastic/synthetics Tests"

cd "$XPACK_DIR"

checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \
node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
13 changes: 2 additions & 11 deletions examples/expressions_explorer/public/actions_and_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { NAVIGATE_TRIGGER_ID } from './actions/navigate_trigger';
Expand All @@ -42,10 +38,6 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};

const handleEvents = (event: any) => {
if (event.name !== 'NAVIGATE') return;
// enrich event context with some extra data
Expand Down Expand Up @@ -83,10 +75,9 @@ export function ActionsExpressionsExample({ expressions, actions }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
onEvent={handleEvents}
renderError={(message: any) => {
return <div>{message}</div>;
Expand Down
13 changes: 2 additions & 11 deletions examples/expressions_explorer/public/actions_and_expressions2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';

Expand All @@ -45,10 +41,6 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};

const handleEvents = (event: any) => {
updateVariables({ color: event.data.href === 'http://www.google.com' ? 'red' : 'blue' });
};
Expand Down Expand Up @@ -81,11 +73,10 @@ export function ActionsExpressionsExample2({ expressions, actions }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
data-test-subj="expressionsVariablesTestRenderer"
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
variables={variables}
onEvent={handleEvents}
renderError={(message: any) => {
Expand Down
16 changes: 6 additions & 10 deletions examples/expressions_explorer/public/render_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ import {
EuiTitle,
EuiButton,
} from '@elastic/eui';
import {
ExpressionsStart,
ReactExpressionRenderer,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { Start as InspectorStart } from '../../../src/plugins/inspector/public';

Expand All @@ -42,9 +38,7 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
updateExpression(value);
};

const inspectorAdapters = {
expression: new ExpressionsInspectorAdapter(),
};
const inspectorAdapters = {};

return (
<EuiPageBody>
Expand Down Expand Up @@ -83,10 +77,12 @@ export function RenderExpressionsExample({ expressions, inspector }: Props) {
</EuiFlexItem>
<EuiFlexItem>
<EuiPanel data-test-subj="expressionRender" paddingSize="none" role="figure">
<ReactExpressionRenderer
<expressions.ReactExpressionRenderer
expression={expression}
debug={true}
inspectorAdapters={inspectorAdapters}
onData$={(result, panels) => {
Object.assign(inspectorAdapters, panels);
}}
renderError={(message: any) => {
return <div>{message}</div>;
}}
Expand Down
28 changes: 12 additions & 16 deletions examples/expressions_explorer/public/run_expressions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { useState, useEffect, useMemo } from 'react';
import React, { useState, useEffect } from 'react';
import { pluck } from 'rxjs/operators';
import {
EuiCodeBlock,
Expand All @@ -22,12 +22,9 @@ import {
EuiTitle,
EuiButton,
} from '@elastic/eui';
import {
ExpressionsStart,
ExpressionsInspectorAdapter,
} from '../../../src/plugins/expressions/public';
import { ExpressionsStart } from '../../../src/plugins/expressions/public';
import { ExpressionEditor } from './editor/expression_editor';
import { Start as InspectorStart } from '../../../src/plugins/inspector/public';
import { Adapters, Start as InspectorStart } from '../../../src/plugins/inspector/public';

interface Props {
expressions: ExpressionsStart;
Expand All @@ -37,25 +34,24 @@ interface Props {
export function RunExpressionsExample({ expressions, inspector }: Props) {
const [expression, updateExpression] = useState('markdownVis "## expressions explorer"');
const [result, updateResult] = useState<unknown>({});
const [inspectorAdapters, updateInspectorAdapters] = useState<Adapters>({});

const expressionChanged = (value: string) => {
updateExpression(value);
};

const inspectorAdapters = useMemo(
() => ({
expression: new ExpressionsInspectorAdapter(),
}),
[]
);

useEffect(() => {
const execution = expressions.execute(expression, null, {
debug: true,
inspectorAdapters,
});
const subscription = execution.getData().pipe(pluck('result')).subscribe(updateResult);

const subscription = execution
.getData()
.pipe(pluck('result'))
.subscribe((data) => {
updateResult(data);
updateInspectorAdapters(execution.inspect());
});
execution.inspect();
return () => subscription.unsubscribe();
}, [expression, expressions, inspectorAdapters]);

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
"@types/reduce-reducers": "^1.0.0",
"@types/redux-actions": "^2.6.1",
"@types/seedrandom": ">=2.0.0 <4.0.0",
"@types/selenium-webdriver": "^4.0.9",
"@types/selenium-webdriver": "^4.0.15",
"@types/semver": "^7",
"@types/set-value": "^2.0.0",
"@types/sinon": "^7.0.13",
Expand Down Expand Up @@ -781,7 +781,7 @@
"rxjs-marbles": "^5.0.6",
"sass-loader": "^10.2.0",
"sass-resources-loader": "^2.0.1",
"selenium-webdriver": "^4.0.0-alpha.7",
"selenium-webdriver": "^4.0.0",
"serve-static": "1.14.1",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
* Side Public License, v 1.
*/

import { convertSavedDashboardPanelToPanelState } from '../../../common/embeddable/embeddable_saved_object_converters';
import {
convertSavedDashboardPanelToPanelState,
convertPanelStateToSavedDashboardPanel,
} from '../../../common/embeddable/embeddable_saved_object_converters';
import type { SavedDashboardPanel, DashboardPanelMap } from '../../types';

export const convertSavedPanelsToPanelMap = (panels?: SavedDashboardPanel[]): DashboardPanelMap => {
Expand All @@ -16,3 +19,9 @@ export const convertSavedPanelsToPanelMap = (panels?: SavedDashboardPanel[]): Da
});
return panelsMap;
};

export const convertPanelMapToSavedPanels = (panels: DashboardPanelMap, version: string) => {
return Object.values(panels).map((panel) =>
convertPanelStateToSavedDashboardPanel(panel, version)
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
DashboardContainerInput,
DashboardBuildContext,
} from '../../types';
import { convertSavedPanelsToPanelMap } from './convert_saved_panels_to_panel_map';
import { convertSavedPanelsToPanelMap } from './convert_dashboard_panels';

interface SavedObjectToDashboardStateProps {
version: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { ForwardedDashboardState } from '../../locator';
import { DashboardState } from '../../types';
import { convertSavedPanelsToPanelMap } from './convert_saved_panels_to_panel_map';
import { convertSavedPanelsToPanelMap } from './convert_dashboard_panels';

export const loadDashboardHistoryLocationState = (
state?: ForwardedDashboardState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
DashboardState,
RawDashboardState,
} from '../../types';
import { convertSavedPanelsToPanelMap } from './convert_saved_panels_to_panel_map';
import { convertSavedPanelsToPanelMap } from './convert_dashboard_panels';

type SyncDashboardUrlStateProps = DashboardBuildContext & { savedDashboard: DashboardSavedObject };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,24 @@ export function DashboardTopNav({
const timeRange = timefilter.getTime();
ShowShareModal({
share,
timeRange,
kibanaVersion,
anchorElement,
dashboardCapabilities,
dashboardSessionStorage,
currentDashboardState: currentState,
savedDashboard: dashboardAppState.savedDashboard,
isDirty: Boolean(dashboardAppState.hasUnsavedChanges),
timeRange,
});
},
[dashboardAppState, dashboardCapabilities, share, kibanaVersion, timefilter]
[
share,
timefilter,
kibanaVersion,
dashboardAppState,
dashboardCapabilities,
dashboardSessionStorage,
]
);

const dashboardTopNavActions = useMemo(() => {
Expand Down
Loading

0 comments on commit dabea01

Please sign in to comment.