Skip to content

Commit

Permalink
Copy to dashboard from a maximized panel (#179422)
Browse files Browse the repository at this point in the history
Disallow copy to Dashboard when the Dashboard has a maximized panel.
  • Loading branch information
hlvhe authored Mar 27, 2024
1 parent 0e622d9 commit 0b1f2f6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from '@kbn/presentation-publishing';
import { toMountPoint } from '@kbn/react-kibana-mount';
import { Action, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import { apiCanExpandPanels } from '@kbn/presentation-containers/interfaces/panel_management';

import { DASHBOARD_CONTAINER_TYPE } from '../dashboard_container';
import { DashboardPluginInternalFunctions } from '../dashboard_container/external_api/dashboard_api';
Expand All @@ -48,7 +49,8 @@ const apiIsCompatible = (api: unknown): api is CopyToDashboardAPI => {
apiHasUniqueId(api) &&
apiHasParentApi(api) &&
apiIsOfType(api.parentApi, DASHBOARD_CONTAINER_TYPE) &&
apiPublishesSavedObjectId(api.parentApi)
apiPublishesSavedObjectId(api.parentApi) &&
!(apiCanExpandPanels(api.parentApi) && api.parentApi.expandedPanelId.getValue())
);
};

Expand Down

0 comments on commit 0b1f2f6

Please sign in to comment.