designer - moving tables

This commit is contained in:
Jan Prochazka
2020-12-26 09:45:15 +01:00
parent 7d5d2d131f
commit ca985330f6
9 changed files with 380 additions and 1 deletions

View File

@@ -27,3 +27,29 @@ export default function useNewQuery() {
{ editor: initialData }
);
}
export function useNewQueryDesign() {
const openNewTab = useOpenNewTab();
const currentDatabase = useCurrentDatabase();
const connection = _.get(currentDatabase, 'connection') || {};
const database = _.get(currentDatabase, 'name');
const tooltip = `${connection.displayName || connection.server}\n${database}`;
return ({ title = undefined, initialData = undefined, ...props } = {}) =>
openNewTab(
{
title: title || 'Query',
icon: 'img query-design',
tooltip,
tabComponent: 'QueryDesignTab',
props: {
...props,
conid: connection._id,
database,
},
},
{ editor: initialData }
);
}