bind global menu item "Open SQL console" to the logic to create such a note

This commit is contained in:
zadam
2020-05-08 23:39:46 +02:00
parent c3438e0f3f
commit d20415c979
9 changed files with 67 additions and 24 deletions

View File

@@ -1,5 +1,7 @@
import Component from "../widgets/component.js";
import appContext from "./app_context.js";
import dateNoteService from "../services/date_notes.js";
import noteCreateService from "../services/note_create.js";
export default class DialogCommandExecutor extends Component {
jumpToNoteCommand() {
@@ -54,18 +56,22 @@ export default class DialogCommandExecutor extends Component {
}
showOptionsCommand() {
import("../dialogs/options.js").then(d => d.showDialog())
import("../dialogs/options.js").then(d => d.showDialog());
}
showHelpCommand() {
import("../dialogs/help.js").then(d => d.showDialog())
import("../dialogs/help.js").then(d => d.showDialog());
}
showSQLConsoleCommand() {
import("../dialogs/sql_console.js").then(d => d.showDialog())
async showSQLConsoleCommand() {
const sqlConsoleNote = await dateNoteService.createSqlConsole();
const tabContext = await appContext.tabManager.openTabWithNote(sqlConsoleNote.noteId, true);
appContext.triggerCommand('focusOnDetail', {tabId: tabContext.tabId});
}
showBackendLogCommand() {
import("../dialogs/backend_log.js").then(d => d.showDialog())
import("../dialogs/backend_log.js").then(d => d.showDialog());
}
}