use editor data hook

This commit is contained in:
Jan Prochazka
2020-12-03 15:16:22 +01:00
parent 9a42d1d6bd
commit fc5c0eb239
9 changed files with 182 additions and 142 deletions

View File

@@ -11,16 +11,20 @@ export default function useNewQuery() {
const tooltip = `${connection.displayName || connection.server}\n${database}`;
return ({ title = undefined, ...props } = {}) =>
openNewTab(setOpenedTabs, {
title: title || 'Query',
icon: 'img sql-file',
tooltip,
tabComponent: 'QueryTab',
props: {
...props,
conid: connection._id,
database,
return ({ title = undefined, initialData = undefined, ...props } = {}) =>
openNewTab(
setOpenedTabs,
{
title: title || 'Query',
icon: 'img sql-file',
tooltip,
tabComponent: 'QueryTab',
props: {
...props,
conid: connection._id,
database,
},
},
});
initialData
);
}