new diagram, new query design added to menu

This commit is contained in:
Jan Prochazka 2022-07-21 07:27:28 +02:00
parent 8f110355c4
commit 153cba3779
3 changed files with 25 additions and 1 deletions

View File

@ -6,6 +6,8 @@ module.exports = ({ editMenu }) => [
{ command: 'new.sqliteDatabase', hideDisabled: true },
{ divider: true },
{ command: 'new.query', hideDisabled: true },
{ command: 'new.queryDesign', hideDisabled: true },
{ command: 'new.diagram', hideDisabled: true },
{ command: 'new.freetable', hideDisabled: true },
{ command: 'new.shell', hideDisabled: true },
{ command: 'new.jsonl', hideDisabled: true },

View File

@ -6,7 +6,7 @@ import SettingsModal from '../settings/SettingsModal.svelte';
import ImportExportModal from '../modals/ImportExportModal.svelte';
import SqlGeneratorModal from '../modals/SqlGeneratorModal.svelte';
import { showModal } from '../modals/modalTools';
import newQuery from '../query/newQuery';
import newQuery, { newDiagram, newQueryDesign } from '../query/newQuery';
import saveTabFile from '../utility/saveTabFile';
import openNewTab from '../utility/openNewTab';
import getElectron from '../utility/getElectron';
@ -120,6 +120,24 @@ registerCommand({
},
});
registerCommand({
id: 'new.queryDesign',
category: 'New',
icon: 'img query-design',
name: 'Query design',
menuName: 'New query design',
onClick: () => newQueryDesign(),
});
registerCommand({
id: 'new.diagram',
category: 'New',
icon: 'img diagram',
name: 'ER Diagram',
menuName: 'New ER diagram',
onClick: () => newDiagram(),
});
registerCommand({
id: 'new.archiveFolder',
category: 'New',

View File

@ -36,3 +36,7 @@ export default function newQuery({
export function newQueryDesign() {
return newQuery({ tabComponent: 'QueryDesignTab', icon: 'img query-design' });
}
export function newDiagram() {
return newQuery({ tabComponent: 'DiagramTab', icon: 'img diagram', title: 'Diagram #' });
}