From 153cba37799193e2b1e881b8080698509681c1d6 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 21 Jul 2022 07:27:28 +0200 Subject: [PATCH] new diagram, new query design added to menu --- app/src/mainMenuDefinition.js | 2 ++ packages/web/src/commands/stdCommands.ts | 20 +++++++++++++++++++- packages/web/src/query/newQuery.ts | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/src/mainMenuDefinition.js b/app/src/mainMenuDefinition.js index 8efc4c7d..a86a569f 100644 --- a/app/src/mainMenuDefinition.js +++ b/app/src/mainMenuDefinition.js @@ -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 }, diff --git a/packages/web/src/commands/stdCommands.ts b/packages/web/src/commands/stdCommands.ts index df85f8eb..4d04aa59 100644 --- a/packages/web/src/commands/stdCommands.ts +++ b/packages/web/src/commands/stdCommands.ts @@ -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', diff --git a/packages/web/src/query/newQuery.ts b/packages/web/src/query/newQuery.ts index 256d7dbb..8c5c05aa 100644 --- a/packages/web/src/query/newQuery.ts +++ b/packages/web/src/query/newQuery.ts @@ -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 #' }); +}