mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-02 20:43:58 +00:00
perspective set root command
This commit is contained in:
@@ -3,6 +3,8 @@ import _ from 'lodash';
|
|||||||
import { showModal } from '../modals/modalTools';
|
import { showModal } from '../modals/modalTools';
|
||||||
import CustomJoinModal from './CustomJoinModal.svelte';
|
import CustomJoinModal from './CustomJoinModal.svelte';
|
||||||
import InputTextModal from '../modals/InputTextModal.svelte';
|
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||||
|
import runCommand from '../commands/runCommand';
|
||||||
|
import { tick } from 'svelte';
|
||||||
|
|
||||||
interface PerspectiveNodeMenuProps {
|
interface PerspectiveNodeMenuProps {
|
||||||
node: PerspectiveTreeNode;
|
node: PerspectiveTreeNode;
|
||||||
@@ -138,15 +140,6 @@ export function getPerspectiveNodeMenu(props: PerspectiveNodeMenuProps) {
|
|||||||
filterInfo && {
|
filterInfo && {
|
||||||
text: 'Add to filter',
|
text: 'Add to filter',
|
||||||
onClick: () => setConfig(cfg => addToPerspectiveFilter(cfg, parentDesignerId, columnName)),
|
onClick: () => setConfig(cfg => addToPerspectiveFilter(cfg, parentDesignerId, columnName)),
|
||||||
|
|
||||||
// setConfig(cfg => ({
|
|
||||||
// ...cfg,
|
|
||||||
|
|
||||||
// filters: {
|
|
||||||
// ...cfg.filters,
|
|
||||||
// [node.uniqueName]: '',
|
|
||||||
// },
|
|
||||||
// })),
|
|
||||||
},
|
},
|
||||||
customJoin && {
|
customJoin && {
|
||||||
text: 'Remove custom join',
|
text: 'Remove custom join',
|
||||||
@@ -203,5 +196,23 @@ export function getPerspectiveNodeMenu(props: PerspectiveNodeMenuProps) {
|
|||||||
onClick: () => setConfig(cfg => setPerspectiveTableAlias(cfg, node?.designerId, null)),
|
onClick: () => setConfig(cfg => setPerspectiveTableAlias(cfg, node?.designerId, null)),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
node?.nodeConfig &&
|
||||||
|
config.rootDesignerId != node?.designerId && [
|
||||||
|
{ divider: true },
|
||||||
|
{
|
||||||
|
text: 'Set root',
|
||||||
|
onClick: async () => {
|
||||||
|
setConfig(cfg => ({
|
||||||
|
...cfg,
|
||||||
|
rootDesignerId: node?.designerId,
|
||||||
|
}));
|
||||||
|
await tick();
|
||||||
|
if (config.isArranged) {
|
||||||
|
runCommand('designer.arrange');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user