Skip to content

Commit

Permalink
[embeddable] remove legacy embeddable types (elastic#204832)
Browse files Browse the repository at this point in the history
Part of embeddable cleanup. PR removes legacy embeddable type guards and
types.
  • Loading branch information
nreese authored Dec 19, 2024
1 parent cb24aa5 commit b321646
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { createExtract, createInject } from './dashboard_container_references';
import { createEmbeddablePersistableStateServiceMock } from '@kbn/embeddable-plugin/common/mocks';
import { ParsedDashboardAttributesWithType } from '../../types';
import { SavedObjectEmbeddableInput } from '@kbn/embeddable-plugin/public';
import { SavedObjectEmbeddableInput } from '@kbn/embeddable-plugin/common';

const persistableStateService = createEmbeddablePersistableStateServiceMock();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { Filter, TimeRange, onlyDisabledFiltersChanged } from '@kbn/es-query';
import { COMPARE_ALL_OPTIONS, Filter, TimeRange, onlyDisabledFiltersChanged } from '@kbn/es-query';
import { combineLatest, distinctUntilChanged, Observable, skip } from 'rxjs';
import { shouldRefreshFilterCompareOptions } from '@kbn/embeddable-plugin/public';
import { apiPublishesSettings } from '@kbn/presentation-containers/interfaces/publishes_settings';
import { apiPublishesReload, apiPublishesUnifiedSearch } from '@kbn/presentation-publishing';
import { areTimesEqual } from '../../../../dashboard_api/unified_search_manager';

const shouldRefreshFilterCompareOptions = {
...COMPARE_ALL_OPTIONS,
// do not compare $state to avoid refreshing when filter is pinned/unpinned (which does not impact results)
state: false,
};

export function newSession$(api: unknown) {
const observables: Array<Observable<unknown>> = [];

Expand Down
14 changes: 0 additions & 14 deletions src/plugins/embeddable/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,13 @@ export {
EmbeddableFactoryNotFoundError,
EmbeddableStateTransfer,
ErrorEmbeddable,
genericEmbeddableInputIsEqual,
isContextMenuTriggerContext,
isEmbeddable,
isErrorEmbeddable,
isExplicitInputWithAttributes,
isFilterableEmbeddable,
isMultiValueClickTriggerContext,
isRangeSelectTriggerContext,
isReferenceOrValueEmbeddable,
isRowClickTriggerContext,
isSavedObjectEmbeddableInput,
isValueClickTriggerContext,
MULTI_VALUE_CLICK_TRIGGER,
omitGenericEmbeddableInput,
panelBadgeTrigger,
panelHoverTrigger,
PanelNotFoundError,
Expand All @@ -46,11 +39,8 @@ export {
PANEL_NOTIFICATION_TRIGGER,
runEmbeddableFactoryMigrations,
SELECT_RANGE_TRIGGER,
shouldFetch$,
shouldRefreshFilterCompareOptions,
VALUE_CLICK_TRIGGER,
ViewMode,
withEmbeddableSubscription,
} from './lib';
export type {
CellValueContext,
Expand All @@ -63,15 +53,11 @@ export type {
EmbeddableInstanceConfiguration,
EmbeddableOutput,
EmbeddablePackageState,
FilterableEmbeddable,
IEmbeddable,
MultiValueClickContext,
OutputSpec,
PropertySpec,
RangeSelectContext,
ReferenceOrValueEmbeddable,
SavedObjectEmbeddableInput,
SelfStyledEmbeddable,
ValueClickContext,
} from './lib';
export type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import { ViewMode } from '..';
import { KibanaExecutionContext } from '@kbn/core/types';
import { EmbeddableInput, omitGenericEmbeddableInput, genericEmbeddableInputIsEqual } from '.';
import { EmbeddableInput } from '.';
import { omitGenericEmbeddableInput, genericEmbeddableInputIsEqual } from './diff_embeddable_input';

const getGenericEmbeddableState = (state?: Partial<EmbeddableInput>): EmbeddableInput => {
const defaultState: EmbeddableInput = {
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/embeddable/public/lib/embeddables/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@

export * from '../../../common/lib/saved_object_embeddable';
export * from './default_embeddable_factory_provider';
export { genericEmbeddableInputIsEqual, omitGenericEmbeddableInput } from './diff_embeddable_input';
export { Embeddable } from './embeddable';
export { EmbeddableErrorHandler } from './embeddable_error_handler';
export * from './embeddable_factory';
export * from './embeddable_factory_definition';
export { ErrorEmbeddable } from './error_embeddable';
export { isErrorEmbeddable } from './is_error_embeddable';
export { isEmbeddable } from './is_embeddable';
export type { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable';
export { withEmbeddableSubscription } from './with_subscription';
19 changes: 0 additions & 19 deletions src/plugins/embeddable/public/lib/embeddables/is_embeddable.ts

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions src/plugins/embeddable/public/lib/filterable_embeddable/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

51 changes: 0 additions & 51 deletions src/plugins/embeddable/public/lib/filterable_embeddable/types.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/plugins/embeddable/public/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ export * from './embeddables';
export * from './types';
export * from './triggers';
export * from './state_transfer';
export * from './reference_or_value_embeddable';
export * from './self_styled_embeddable';
export * from './filterable_embeddable';
export * from './factory_migrations/run_factory_migrations';
Loading

0 comments on commit b321646

Please sign in to comment.