#274 allow to create folder

This commit is contained in:
Jan Prochazka
2022-11-10 10:10:53 +01:00
parent 66ade5823f
commit 607ae7c872
5 changed files with 62 additions and 8 deletions

View File

@@ -1,4 +1,12 @@
import { currentDatabase, currentTheme, extensions, getExtensions, getVisibleToolbar, visibleToolbar } from '../stores';
import {
currentDatabase,
currentTheme,
emptyConnectionGroupNames,
extensions,
getExtensions,
getVisibleToolbar,
visibleToolbar,
} from '../stores';
import registerCommand from './registerCommand';
import { get } from 'svelte/store';
import AboutModal from '../modals/AboutModal.svelte';
@@ -93,6 +101,31 @@ registerCommand({
},
});
registerCommand({
id: 'new.connection.folder',
toolbar: true,
icon: 'icon add-folder',
toolbarName: 'Add connection folder',
category: 'New',
toolbarOrder: 1,
name: 'Connection',
testEnabled: () => !getCurrentConfig()?.runAsPortal,
onClick: () => {
showModal(InputTextModal, {
value: '',
label: 'New connection folder name',
header: 'Create connection folder',
onConfirm: async folder => {
emptyConnectionGroupNames.update(names => {
if (!folder) return names;
if (names.includes(folder)) return names;
return [...names, folder];
});
},
});
},
});
registerCommand({
id: 'new.query',
category: 'New',