diff --git a/src/ui/utils/getActionPanelItems.tsx b/src/ui/utils/getActionPanelItems.tsx index 25e2e18b48..c9b62e9615 100644 --- a/src/ui/utils/getActionPanelItems.tsx +++ b/src/ui/utils/getActionPanelItems.tsx @@ -24,14 +24,7 @@ export const TYPES_TO_DIALOGS_MAP = { export const ITEM_PASTE_ITEM_ID = 'paste'; -export const getActionPanelItems = ({ - copiedData, - onPasteItem, - openDialog, - filterItem, - userSettings, - scope, -}: { +export type ActionPanelItemParams = { copiedData: CopiedConfigData | null; onPasteItem: (item: CopiedConfigData) => void; openDialog: ( @@ -41,11 +34,25 @@ export const getActionPanelItems = ({ filterItem?: (item: DashkitActionPanelItem) => boolean; userSettings?: DLUserSettings; scope?: string; -}) => { + enableHiddenItems?: boolean; +}; + +export const getActionPanelItems = ({ + copiedData, + onPasteItem, + openDialog, + filterItem, + userSettings, + scope, + enableHiddenItems = true, +}: ActionPanelItemParams) => { const {getBasicActionPanelItems} = registry.common.functions.getAll(); const items = getBasicActionPanelItems({userSettings, scope}); - if (copiedData) { + const enablePaste = + copiedData && (enableHiddenItems || copiedData.type !== DashTabItemType.Image); + + if (enablePaste) { items.push({ id: ITEM_PASTE_ITEM_ID, icon: ,