Dynamic dashboards: Add paste panel back, change paste icon (#103780)
* Add paste panel back, change paste icon * make i18n-extract
This commit is contained in:
@@ -45,7 +45,7 @@ export function RowLayoutManagerRenderer({ model }: SceneComponentProps<RowsLayo
|
||||
<Trans i18nKey="dashboard.canvas-actions.new-row">New row</Trans>
|
||||
</Button>
|
||||
{hasCopiedRow && (
|
||||
<Button icon="plus" variant="primary" fill="text" onClick={() => model.pasteRow()}>
|
||||
<Button icon="clipboard-alt" variant="primary" fill="text" onClick={() => model.pasteRow()}>
|
||||
<Trans i18nKey="dashboard.canvas-actions.paste-row">Paste row</Trans>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -57,7 +57,7 @@ export function TabsLayoutManagerRenderer({ model }: SceneComponentProps<TabsLay
|
||||
<Trans i18nKey="dashboard.canvas-actions.new-tab">New tab</Trans>
|
||||
</Button>
|
||||
{hasCopiedTab && (
|
||||
<Button icon="plus" variant="primary" fill="text" onClick={() => model.pasteTab()}>
|
||||
<Button icon="clipboard-alt" variant="primary" fill="text" onClick={() => model.pasteTab()}>
|
||||
<Trans i18nKey="dashboard.canvas-actions.paste-tab">Paste tab</Trans>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { TabsLayoutManager } from '../layout-tabs/TabsLayoutManager';
|
||||
import { DashboardLayoutManager } from '../types/DashboardLayoutManager';
|
||||
|
||||
import { addNewRowTo, addNewTabTo } from './addNew';
|
||||
import { useClipboardState } from './useClipboardState';
|
||||
import { ungroupLayout } from './utils';
|
||||
|
||||
export interface Props {
|
||||
@@ -20,6 +21,7 @@ export interface Props {
|
||||
|
||||
export function CanvasGridAddActions({ layoutManager }: Props) {
|
||||
const styles = useStyles2(getStyles);
|
||||
const { hasCopiedPanel } = useClipboardState();
|
||||
|
||||
return (
|
||||
<div className={cx(styles.addAction, 'dashboard-canvas-add-button')}>
|
||||
@@ -55,8 +57,19 @@ export function CanvasGridAddActions({ layoutManager }: Props) {
|
||||
<Trans i18nKey="dashboard.canvas-actions.group-panels">Group panels</Trans>
|
||||
</Button>
|
||||
</Dropdown>
|
||||
{}
|
||||
{renderUngroupAction(layoutManager)}
|
||||
{hasCopiedPanel && layoutManager.pastePanel && (
|
||||
<Button
|
||||
variant="primary"
|
||||
fill="text"
|
||||
icon="clipboard-alt"
|
||||
onClick={() => {
|
||||
layoutManager.pastePanel?.();
|
||||
}}
|
||||
>
|
||||
<Trans i18nKey="dashboard.canvas-actions.paste-panel">Paste panel</Trans>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2622,6 +2622,7 @@
|
||||
"group-panels": "Group panels",
|
||||
"new-row": "New row",
|
||||
"new-tab": "New tab",
|
||||
"paste-panel": "Paste panel",
|
||||
"paste-row": "Paste row",
|
||||
"paste-tab": "Paste tab",
|
||||
"un-group-panels": "Ungroup"
|
||||
|
||||
Reference in New Issue
Block a user