Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into bugfix/ilm_pr…
Browse files Browse the repository at this point in the history
…iority_field
  • Loading branch information
alisonelizabeth committed Jun 29, 2020
2 parents f068f51 + 821aa99 commit f22bfe5
Show file tree
Hide file tree
Showing 172 changed files with 5,613 additions and 3,606 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ Public information about a registered [application](./kibana-plugin-core-public.
```typescript
export declare type PublicAppInfo = Omit<App, 'mount' | 'updater$'> & {
legacy: false;
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
appRoute: string;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ Information about a registered [legacy application](./kibana-plugin-core-public.
```typescript
export declare type PublicLegacyAppInfo = Omit<LegacyApp, 'updater$'> & {
legacy: true;
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
};
```
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"resolutions": {
"**/@types/node": ">=10.17.17 <10.20.0",
"**/@types/react": "^16.9.36",
"**/@types/react-router": "^5.1.3",
"**/@types/hapi": "^17.0.18",
"**/@types/angular": "^1.6.56",
"**/@types/hoist-non-react-statics": "^3.3.1",
Expand Down Expand Up @@ -202,6 +201,7 @@
"inline-style": "^2.0.0",
"joi": "^13.5.2",
"jquery": "^3.5.0",
"js-levenshtein": "^1.1.6",
"js-yaml": "3.13.1",
"json-stable-stringify": "^1.0.1",
"json-stringify-pretty-compact": "1.2.0",
Expand Down Expand Up @@ -245,8 +245,8 @@
"react-monaco-editor": "~0.27.0",
"react-redux": "^7.2.0",
"react-resize-detector": "^4.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-sizeme": "^2.3.6",
"react-use": "^13.27.0",
"reactcss": "1.2.3",
Expand Down Expand Up @@ -377,8 +377,8 @@
"@types/react-grid-layout": "^0.16.7",
"@types/react-redux": "^7.1.9",
"@types/react-resize-detector": "^4.0.1",
"@types/react-router": "^5.1.3",
"@types/react-router-dom": "^5.1.3",
"@types/react-router": "^5.1.7",
"@types/react-router-dom": "^5.1.5",
"@types/react-virtualized": "^9.18.7",
"@types/recompose": "^0.30.6",
"@types/redux-actions": "^2.6.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-ui-shared-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-intl": "^2.8.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"regenerator-runtime": "^0.13.3",
"rxjs": "^6.5.5",
"symbol-observable": "^1.2.0",
Expand Down
7 changes: 7 additions & 0 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ export interface LegacyApp extends AppBase {
*/
export type PublicAppInfo = Omit<App, 'mount' | 'updater$'> & {
legacy: false;
// remove optional on fields populated with default values
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
appRoute: string;
};

/**
Expand All @@ -278,6 +282,9 @@ export type PublicAppInfo = Omit<App, 'mount' | 'updater$'> & {
*/
export type PublicLegacyAppInfo = Omit<LegacyApp, 'updater$'> & {
legacy: true;
// remove optional on fields populated with default values
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
};

/**
Expand Down
5 changes: 5 additions & 0 deletions src/core/public/application/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,17 @@ export function getAppInfo(app: App<unknown> | LegacyApp): PublicAppInfo | Publi
const { updater$, ...infos } = app;
return {
...infos,
status: app.status!,
navLinkStatus: app.navLinkStatus!,
legacy: true,
};
} else {
const { updater$, mount, ...infos } = app;
return {
...infos,
status: app.status!,
navLinkStatus: app.navLinkStatus!,
appRoute: app.appRoute!,
legacy: false,
};
}
Expand Down
5 changes: 5 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,11 +1143,16 @@ export type PluginOpaqueId = symbol;
// @public
export type PublicAppInfo = Omit<App, 'mount' | 'updater$'> & {
legacy: false;
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
appRoute: string;
};

// @public
export type PublicLegacyAppInfo = Omit<LegacyApp, 'updater$'> & {
legacy: true;
status: AppStatus;
navLinkStatus: AppNavLinkStatus;
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { createInputControlVisController } from './vis_controller';
import { getControlsTab } from './components/editor/controls_tab';
import { OptionsTab } from './components/editor/options_tab';
import { InputControlVisDependencies } from './plugin';
import { defaultFeedbackMessage } from '../../kibana_utils/public';

export function createInputControlVisTypeDefinition(deps: InputControlVisDependencies) {
const InputControlVisController = createInputControlVisController(deps);
Expand All @@ -39,7 +38,6 @@ export function createInputControlVisTypeDefinition(deps: InputControlVisDepende
defaultMessage: 'Create interactive controls for easy dashboard manipulation.',
}),
stage: 'experimental',
feedbackMessage: defaultFeedbackMessage,
visualization: InputControlVisController,
visConfig: {
defaults: {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/kibana_utils/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ export { distinctUntilChangedWithInitialValue } from './distinct_until_changed_w
export { url } from './url';
export { now } from './now';
export { calculateObjectHash } from './calculate_object_hash';
export { defaultFeedbackMessage } from './default_feedback_message';
1 change: 0 additions & 1 deletion src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export {
UiComponentInstance,
url,
createGetterSetter,
defaultFeedbackMessage,
} from '../common';
export * from './core';
export * from '../common/errors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { ButtonIconSide } from '@elastic/eui';

export type TopNavMenuAction = (anchorElement: EventTarget) => void;
export type TopNavMenuAction = (anchorElement: HTMLElement) => void;

export interface TopNavMenuData {
id?: string;
Expand All @@ -29,7 +29,7 @@ export interface TopNavMenuData {
testId?: string;
className?: string;
disableButton?: boolean | (() => boolean);
tooltip?: string | (() => string);
tooltip?: string | (() => string | undefined);
emphasize?: boolean;
iconType?: string;
iconSide?: ButtonIconSide;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ export class SavedObjectLoader {
}

/**
* Retrieve a saved object by id. Returns a promise that completes when the object finishes
* Retrieve a saved object by id or create new one.
* Returns a promise that completes when the object finishes
* initializing.
* @param id
* @param opts
* @returns {Promise<SavedObject>}
*/
async get(id?: string) {
async get(opts?: Record<string, unknown> | string) {
// can accept object as argument in accordance to SavedVis class
// see src/plugins/saved_objects/public/saved_object/saved_object_loader.ts
// @ts-ignore
const obj = new this.Class(id);
const obj = new this.Class(opts);
return obj.init();
}

Expand Down
1 change: 1 addition & 0 deletions src/plugins/saved_objects/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface SavedObjectSaveOpts {
confirmOverwrite?: boolean;
isTitleDuplicateConfirmed?: boolean;
onTitleDuplicate?: () => void;
returnToOrigin?: boolean;
}

export interface SavedObjectCreationOpts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ import { i18n } from '@kbn/i18n';
import { keyCodes, EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EventEmitter } from 'events';

import { Vis, PersistedState } from 'src/plugins/visualizations/public';
import { SavedSearch } from 'src/plugins/discover/public';
import {
Vis,
PersistedState,
VisualizeEmbeddableContract,
} from 'src/plugins/visualizations/public';
import { TimeRange } from 'src/plugins/data/public';
import { SavedObject } from 'src/plugins/saved_objects/public';
import { DefaultEditorNavBar, OptionTab } from './navbar';
import { DefaultEditorControls } from './controls';
import { setStateParamValue, useEditorReducer, useEditorFormState, discardChanges } from './state';
Expand All @@ -34,18 +38,20 @@ import { SidebarTitle } from './sidebar_title';
import { Schema } from '../../schemas';

interface DefaultEditorSideBarProps {
embeddableHandler: VisualizeEmbeddableContract;
isCollapsed: boolean;
onClickCollapse: () => void;
optionTabs: OptionTab[];
uiState: PersistedState;
vis: Vis;
isLinkedSearch: boolean;
eventEmitter: EventEmitter;
savedSearch?: SavedSearch;
savedSearch?: SavedObject;
timeRange: TimeRange;
}

function DefaultEditorSideBar({
embeddableHandler,
isCollapsed,
onClickCollapse,
optionTabs,
Expand Down Expand Up @@ -104,12 +110,12 @@ function DefaultEditorSideBar({
aggs: state.data.aggs ? (state.data.aggs.aggs.map((agg) => agg.toJSON()) as any) : [],
},
});
eventEmitter.emit('updateVis');
embeddableHandler.reload();
eventEmitter.emit('dirtyStateChange', {
isDirty: false,
});
setTouched(false);
}, [vis, state, formState.invalid, setTouched, isDirty, eventEmitter]);
}, [vis, state, formState.invalid, setTouched, isDirty, eventEmitter, embeddableHandler]);

const onSubmit: KeyboardEventHandler<HTMLFormElement> = useCallback(
(event) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import { Vis } from 'src/plugins/visualizations/public';
import { SavedSearch } from 'src/plugins/discover/public';
import { SavedObject } from 'src/plugins/saved_objects/public';
import { useKibana } from '../../../../kibana_react/public';

interface LinkedSearchProps {
savedSearch: SavedSearch;
savedSearch: SavedObject;
eventEmitter: EventEmitter;
}

interface SidebarTitleProps {
isLinkedSearch: boolean;
savedSearch?: SavedSearch;
savedSearch?: SavedObject;
vis: Vis;
eventEmitter: EventEmitter;
}
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/vis_default_editor/public/default_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function DefaultEditor({

embeddableHandler.render(visRef.current);
setTimeout(() => {
eventEmitter.emit('apply');
eventEmitter.emit('embeddableRendered');
});

return () => embeddableHandler.destroy();
Expand Down Expand Up @@ -102,6 +102,7 @@ function DefaultEditor({
initialWidth={editorInitialWidth}
>
<DefaultEditorSideBar
embeddableHandler={embeddableHandler}
isCollapsed={isCollapsed}
onClickCollapse={onClickCollapse}
optionTabs={optionTabs}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class VisEditor extends Component {

updateVisState = debounce(() => {
this.props.vis.params = this.state.model;
this.props.eventEmitter.emit('updateVis');
this.props.embeddableHandler.reload();
this.props.eventEmitter.emit('dirtyStateChange', {
isDirty: false,
});
Expand Down Expand Up @@ -187,6 +187,7 @@ export class VisEditor extends Component {
autoApply={this.state.autoApply}
model={model}
embeddableHandler={this.props.embeddableHandler}
eventEmitter={this.props.eventEmitter}
vis={this.props.vis}
timeRange={this.props.timeRange}
uiState={this.uiState}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class VisEditorVisualizationUI extends Component {

this._handler = embeddableHandler;
await this._handler.render(this._visEl.current);
this.props.eventEmitter.emit('embeddableRendered');

this._subscription = this._handler.handler.data$.subscribe((data) => {
this.setPanelInterval(data.value.visData);
Expand Down Expand Up @@ -279,6 +280,7 @@ VisEditorVisualizationUI.propTypes = {
uiState: PropTypes.object,
onToggleAutoApply: PropTypes.func,
embeddableHandler: PropTypes.object,
eventEmitter: PropTypes.object,
timeRange: PropTypes.object,
dirty: PropTypes.bool,
autoApply: PropTypes.bool,
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_type_timeseries/public/metrics_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { metricsRequestHandler } from './request_handler';
import { EditorController } from './application';
// @ts-ignore
import { PANEL_TYPES } from '../common/panel_types';
import { defaultFeedbackMessage } from '../../kibana_utils/public';
import { VisEditor } from './application/components/vis_editor_lazy';

export const metricsVisDefinition = {
Expand All @@ -34,7 +33,6 @@ export const metricsVisDefinition = {
defaultMessage: 'Build time-series using a visual pipeline interface',
}),
icon: 'visVisualBuilder',
feedbackMessage: defaultFeedbackMessage,
visConfig: {
defaults: {
id: '61ca57f0-469d-11e7-af02-69e470af7417',
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/vis_type_vega/public/vega_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { i18n } from '@kbn/i18n';
import { DefaultEditorSize } from '../../vis_default_editor/public';
import { VegaVisualizationDependencies } from './plugin';
import { VegaVisEditor } from './components';
import { defaultFeedbackMessage } from '../../kibana_utils/public';

import { createVegaRequestHandler } from './vega_request_handler';
// @ts-ignore
Expand Down Expand Up @@ -56,6 +55,5 @@ export const createVegaTypeDefinition = (dependencies: VegaVisualizationDependen
showFilterBar: true,
},
stage: 'experimental',
feedbackMessage: defaultFeedbackMessage,
};
};
1 change: 1 addition & 0 deletions src/plugins/visualizations/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export {
VisSavedObject,
VisResponseValue,
} from './types';
export { VisualizationListItem } from './vis_types/vis_type_alias_registry';
export { VISUALIZE_ENABLE_LABS_SETTING } from '../common/constants';
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const convertFromSerializedVis = (vis: SerializedVis): ISavedVis => {
title: vis.title,
description: vis.description,
visState: {
title: vis.title,
type: vis.type,
aggs: vis.data.aggs,
params: vis.params,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function createSavedVisLoader(services: SavedObjectKibanaServicesWithVisu
source.icon = source.type.icon;
source.image = source.type.image;
source.typeTitle = source.type.title;
source.editUrl = `#/edit/${id}`;
source.editUrl = `/edit/${id}`;

return source;
};
Expand Down
1 change: 1 addition & 0 deletions src/plugins/visualizations/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type VisualizationControllerConstructor = new (
) => VisualizationController;

export interface SavedVisState {
title: string;
type: string;
params: VisParams;
aggs: AggConfigOptions[];
Expand Down
Loading

0 comments on commit f22bfe5

Please sign in to comment.