mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* feat: 🎸 move advanced_ui_actions plugin to NP * fix: 🐛 fix NP plugin configs * fix: 🐛 remove import from legacy platform
This commit is contained in:
parent
0edb03fba4
commit
569f8004d2
21 changed files with 45 additions and 83 deletions
|
@ -48,8 +48,13 @@ function renderBadges(badges: IAction[], embeddable: IEmbeddable) {
|
|||
));
|
||||
}
|
||||
|
||||
function isVisualizeEmbeddable(embeddable: IEmbeddable | any): embeddable is any {
|
||||
return embeddable.type === 'VISUALIZE_EMBEDDABLE_TYPE';
|
||||
const VISUALIZE_EMBEDDABLE_TYPE = 'visualization';
|
||||
type VisualizeEmbeddable = any;
|
||||
|
||||
function isVisualizeEmbeddable(
|
||||
embeddable: IEmbeddable | VisualizeEmbeddable
|
||||
): embeddable is VisualizeEmbeddable {
|
||||
return embeddable.type === VISUALIZE_EMBEDDABLE_TYPE;
|
||||
}
|
||||
|
||||
export function PanelHeader({
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"prefix": "xpack",
|
||||
"paths": {
|
||||
"xpack.actions": "legacy/plugins/actions",
|
||||
"xpack.advancedUiActions": "legacy/plugins/advanced_ui_actions",
|
||||
"xpack.advancedUiActions": "plugins/advanced_ui_actions",
|
||||
"xpack.alerting": "legacy/plugins/alerting",
|
||||
"xpack.apm": "legacy/plugins/apm",
|
||||
"xpack.beatsManagement": "legacy/plugins/beats_management",
|
||||
|
|
|
@ -43,7 +43,6 @@ import { encryptedSavedObjects } from './legacy/plugins/encrypted_saved_objects'
|
|||
import { snapshotRestore } from './legacy/plugins/snapshot_restore';
|
||||
import { actions } from './legacy/plugins/actions';
|
||||
import { alerting } from './legacy/plugins/alerting';
|
||||
import { advancedUiActions } from './legacy/plugins/advanced_ui_actions';
|
||||
import { lens } from './legacy/plugins/lens';
|
||||
|
||||
module.exports = function (kibana) {
|
||||
|
@ -88,6 +87,5 @@ module.exports = function (kibana) {
|
|||
snapshotRestore(kibana),
|
||||
actions(kibana),
|
||||
alerting(kibana),
|
||||
advancedUiActions(kibana),
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
|
||||
export const advancedUiActions = (kibana: any) =>
|
||||
new kibana.Plugin({
|
||||
id: 'advanced_ui_actions',
|
||||
publicDir: resolve(__dirname, 'public'),
|
||||
uiExports: {
|
||||
hacks: 'plugins/advanced_ui_actions/np_ready/public/legacy',
|
||||
},
|
||||
});
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @kbn/eslint/no-restricted-paths */
|
||||
import { npSetup, npStart } from 'ui/new_platform';
|
||||
/* eslint-enable @kbn/eslint/no-restricted-paths */
|
||||
|
||||
import { plugin } from '.';
|
||||
|
||||
const pluginInstance = plugin({} as any);
|
||||
export const setup = pluginInstance.setup(npSetup.core, {
|
||||
embeddable: npSetup.plugins.embeddable,
|
||||
uiActions: npSetup.plugins.uiActions,
|
||||
});
|
||||
export const start = pluginInstance.start(npStart.core, {
|
||||
embeddable: npStart.plugins.embeddable,
|
||||
uiActions: npStart.plugins.uiActions,
|
||||
});
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"id": "advanced_ui_actions",
|
||||
"id": "advancedUiActions",
|
||||
"version": "kibana",
|
||||
"requiredPlugins": [
|
||||
"embeddable",
|
||||
"ui_actions"
|
||||
"uiActions"
|
||||
],
|
||||
"server": false,
|
||||
"ui": true
|
|
@ -8,7 +8,7 @@ import { canInheritTimeRange } from './can_inherit_time_range';
|
|||
import {
|
||||
HelloWorldEmbeddable,
|
||||
HelloWorldContainer,
|
||||
} from '../../../../../../../src/plugins/embeddable/public/lib/test_samples';
|
||||
} from '../../../../src/plugins/embeddable/public/lib/test_samples';
|
||||
/** eslint-enable */
|
||||
import { TimeRangeEmbeddable, TimeRangeContainer } from './test_helpers';
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../../../src/plugins/data/public';
|
||||
import { Embeddable, IContainer, ContainerInput } from '../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../src/plugins/data/public';
|
||||
import { TimeRangeInput } from './custom_time_range_action';
|
||||
|
||||
interface ContainerTimeRangeInput extends ContainerInput<TimeRangeInput> {
|
|
@ -10,18 +10,18 @@ import { skip } from 'rxjs/operators';
|
|||
import * as Rx from 'rxjs';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import { EmbeddableFactory } from '../../../../../../../src/plugins/embeddable/public';
|
||||
import { EmbeddableFactory } from '../../../../src/plugins/embeddable/public';
|
||||
import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers';
|
||||
import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory';
|
||||
import { CustomTimeRangeAction } from './custom_time_range_action';
|
||||
import { coreMock } from '../../../../../../../src/core/public/mocks';
|
||||
import { coreMock } from '../../../../src/core/public/mocks';
|
||||
/* eslint-disable */
|
||||
import {
|
||||
HelloWorldEmbeddableFactory,
|
||||
HELLO_WORLD_EMBEDDABLE_TYPE,
|
||||
HelloWorldEmbeddable,
|
||||
HelloWorldContainer,
|
||||
} from '../../../../../../../src/plugins/embeddable/public/lib/test_samples';
|
||||
} from '../../../../src/plugins/embeddable/public/lib/test_samples';
|
||||
/* eslint-enable */
|
||||
|
||||
import { nextTick } from 'test_utils/enzyme_helpers';
|
|
@ -7,19 +7,13 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import React from 'react';
|
||||
import { IEmbeddable, Embeddable, EmbeddableInput } from 'src/plugins/embeddable/public';
|
||||
import {
|
||||
IAction,
|
||||
IncompatibleActionError,
|
||||
} from '../../../../../../../src/plugins/ui_actions/public';
|
||||
import { TimeRange } from '../../../../../../../src/plugins/data/public';
|
||||
import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../../src/legacy/core_plugins/kibana/public/discover/embeddable/search_embeddable';
|
||||
import { VisualizeEmbeddable } from '../../../../../../../src/legacy/core_plugins/kibana/public/visualize/embeddable/visualize_embeddable';
|
||||
import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../../src/legacy/core_plugins/kibana/public/visualize/embeddable/constants';
|
||||
|
||||
import { IAction, IncompatibleActionError } from '../../../../src/plugins/ui_actions/public';
|
||||
import { TimeRange } from '../../../../src/plugins/data/public';
|
||||
import { CustomizeTimeRangeModal } from './customize_time_range_modal';
|
||||
import { OpenModal, CommonlyUsedRange } from './types';
|
||||
|
||||
const CUSTOM_TIME_RANGE = 'CUSTOM_TIME_RANGE';
|
||||
const SEARCH_EMBEDDABLE_TYPE = 'search';
|
||||
|
||||
export interface TimeRangeInput extends EmbeddableInput {
|
||||
timeRange: TimeRange;
|
||||
|
@ -31,6 +25,9 @@ function hasTimeRange(
|
|||
return (embeddable as Embeddable<TimeRangeInput>).getInput().timeRange !== undefined;
|
||||
}
|
||||
|
||||
const VISUALIZE_EMBEDDABLE_TYPE = 'visualization';
|
||||
type VisualizeEmbeddable = any;
|
||||
|
||||
function isVisualizeEmbeddable(
|
||||
embeddable: IEmbeddable | VisualizeEmbeddable
|
||||
): embeddable is VisualizeEmbeddable {
|
|
@ -9,12 +9,11 @@ import { findTestSubject } from '@elastic/eui/lib/test';
|
|||
import { skip } from 'rxjs/operators';
|
||||
import * as Rx from 'rxjs';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import { EmbeddableFactory } from '../../../../../../../src/plugins/embeddable/public';
|
||||
import { EmbeddableFactory } from '../../../../src/plugins/embeddable/public';
|
||||
import { TimeRangeEmbeddable, TimeRangeContainer, TIME_RANGE_EMBEDDABLE } from './test_helpers';
|
||||
import { TimeRangeEmbeddableFactory } from './test_helpers/time_range_embeddable_factory';
|
||||
import { CustomTimeRangeBadge } from './custom_time_range_badge';
|
||||
import { coreMock } from '../../../../../../../src/core/public/mocks';
|
||||
import { coreMock } from '../../../../src/core/public/mocks';
|
||||
import { ReactElement } from 'react';
|
||||
import { nextTick } from 'test_utils/enzyme_helpers';
|
||||
|
|
@ -6,14 +6,9 @@
|
|||
|
||||
import React from 'react';
|
||||
import { prettyDuration, commonDurationRanges } from '@elastic/eui';
|
||||
|
||||
import { IEmbeddable, Embeddable, EmbeddableInput } from 'src/plugins/embeddable/public';
|
||||
import {
|
||||
IAction,
|
||||
IncompatibleActionError,
|
||||
} from '../../../../../../../src/plugins/ui_actions/public';
|
||||
import { TimeRange } from '../../../../../../../src/plugins/data/public';
|
||||
|
||||
import { IAction, IncompatibleActionError } from '../../../../src/plugins/ui_actions/public';
|
||||
import { TimeRange } from '../../../../src/plugins/data/public';
|
||||
import { CustomizeTimeRangeModal } from './customize_time_range_modal';
|
||||
import { doesInheritTimeRange } from './does_inherit_time_range';
|
||||
import { OpenModal, CommonlyUsedRange } from './types';
|
|
@ -19,8 +19,8 @@ import {
|
|||
EuiFlexItem,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../../../src/plugins/data/public';
|
||||
import { Embeddable, IContainer, ContainerInput } from '../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../src/plugins/data/public';
|
||||
import { TimeRangeInput } from './custom_time_range_action';
|
||||
import { doesInheritTimeRange } from './does_inherit_time_range';
|
||||
import { CommonlyUsedRange } from './types';
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { Embeddable, IContainer, ContainerInput } from 'src/plugins/embeddable/public';
|
||||
import { Embeddable, IContainer, ContainerInput } from '../../../../src/plugins/embeddable/public';
|
||||
import { TimeRangeInput } from './custom_time_range_action';
|
||||
|
||||
export function doesInheritTimeRange(embeddable: Embeddable<TimeRangeInput>) {
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { PluginInitializerContext } from 'src/core/public';
|
||||
import { PluginInitializerContext } from '../../../../src/core/public';
|
||||
import { AdvancedUiActionsPublicPlugin } from './plugin';
|
||||
|
||||
export function plugin(initializerContext: PluginInitializerContext) {
|
|
@ -4,14 +4,19 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public';
|
||||
import { IUiActionsStart, IUiActionsSetup } from 'src/plugins/ui_actions/public';
|
||||
import {
|
||||
PluginInitializerContext,
|
||||
CoreSetup,
|
||||
CoreStart,
|
||||
Plugin,
|
||||
} from '../../../../src/core/public';
|
||||
import { IUiActionsStart, IUiActionsSetup } from '../../../../src/plugins/ui_actions/public';
|
||||
import {
|
||||
CONTEXT_MENU_TRIGGER,
|
||||
PANEL_BADGE_TRIGGER,
|
||||
Setup as EmbeddableSetup,
|
||||
Start as EmbeddableStart,
|
||||
} from '../../../../../../../src/plugins/embeddable/public';
|
||||
} from '../../../../src/plugins/embeddable/public';
|
||||
import { CustomTimeRangeAction } from './custom_time_range_action';
|
||||
|
||||
import { CustomTimeRangeBadge } from './custom_time_range_badge';
|
|
@ -9,8 +9,8 @@ import {
|
|||
Container,
|
||||
ContainerOutput,
|
||||
GetEmbeddableFactory,
|
||||
} from '../../../../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../../../../src/plugins/data/public';
|
||||
} from '../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../src/plugins/data/public';
|
||||
|
||||
/**
|
||||
* interfaces are not allowed to specify a sub-set of the required types until
|
|
@ -9,8 +9,8 @@ import {
|
|||
Embeddable,
|
||||
EmbeddableInput,
|
||||
IContainer,
|
||||
} from '../../../../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../../../../src/plugins/data/public';
|
||||
} from '../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../src/plugins/data/public';
|
||||
|
||||
interface EmbeddableTimeRangeInput extends EmbeddableInput {
|
||||
timeRange: TimeRange;
|
|
@ -8,8 +8,8 @@ import {
|
|||
EmbeddableInput,
|
||||
IContainer,
|
||||
EmbeddableFactory,
|
||||
} from '../../../../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../../../../src/plugins/data/public';
|
||||
} from '../../../../../src/plugins/embeddable/public';
|
||||
import { TimeRange } from '../../../../../src/plugins/data/public';
|
||||
import { TIME_RANGE_EMBEDDABLE, TimeRangeEmbeddable } from './time_range_embeddable';
|
||||
|
||||
interface EmbeddableTimeRangeInput extends EmbeddableInput {
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { OverlayRef } from 'src/core/public';
|
||||
import { OverlayRef } from '../../../../src/core/public';
|
||||
|
||||
export interface CommonlyUsedRange {
|
||||
from: string;
|
Loading…
Add table
Add a link
Reference in a new issue