Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { DataView } from '@kbn/data-views-plugin/common';
import { PublishingSubject } from '../publishing_subject';

/**
* This API publishes a list of data views that it uses. Note that this should not contain any
* ad-hoc data views.
* This API publishes a list of data views that it uses.
*/
export interface PublishesDataViews {
dataViews$: PublishingSubject<DataView[] | undefined>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const getControlGroupEmbeddableFactory = () => {
isEditingEnabled: () => true,
openAddDataControlFlyout: (settings) => {
const parentDataViewId = apiPublishesDataViews(parentApi)
? parentApi.dataViews$.value?.[0]?.id
? parentApi.dataViews$.value?.find((dataView) => dataView.isPersisted())?.id
: undefined;
const newControlState = controlsManager.getNewControlState();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export function initializeDataViewsManager(
const dataViewsSubscription = combineLatest([controlGroupDataViewsPipe, childDataViewsPipe])
.pipe(
switchMap(async ([controlGroupDataViews, childDataViews]) => {
const allDataViews = [...(controlGroupDataViews ?? []), ...childDataViews].filter(
(dataView) => dataView.isPersisted()
);
const allDataViews = [...(controlGroupDataViews ?? []), ...childDataViews];

if (allDataViews.length === 0) {
try {
Expand Down