diff --git a/src/renderer/components/ModalNewRoutine.vue b/src/renderer/components/ModalNewRoutine.vue deleted file mode 100644 index 4929c15d..00000000 --- a/src/renderer/components/ModalNewRoutine.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - {{ $t('message.createNewRoutine') }} - - - - - - - {{ $t('word.name') }} - - - - - - - - {{ $t('word.language') }} - - - - - {{ language }} - - - - - - - {{ $t('word.definer') }} - - - - - {{ $t('message.currentUser') }} - - - {{ user.name }}@{{ user.host }} - - - - - {{ $t('message.currentUser') }} - - - - - - - {{ $t('word.comment') }} - - - - - - - - {{ $t('message.sqlSecurity') }} - - - - DEFINER - INVOKER - - - - - - {{ $t('message.dataAccess') }} - - - - CONTAINS SQL - NO SQL - READS SQL DATA - MODIFIES SQL DATA - - - - - - - - {{ $t('word.deterministic') }} - - - - - - - - - diff --git a/src/renderer/components/ModalNewTrigger.vue b/src/renderer/components/ModalNewTrigger.vue deleted file mode 100644 index cb1b523d..00000000 --- a/src/renderer/components/ModalNewTrigger.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - - - {{ $t('message.createNewTrigger') }} - - - - - - - {{ $t('word.name') }} - - - - - - - - {{ $t('word.definer') }} - - - - - {{ $t('message.currentUser') }} - - - {{ user.name }}@{{ user.host }} - - - - - {{ $t('message.currentUser') }} - - - - - - - {{ $t('word.table') }} - - - - - {{ table.name }} - - - - - - - {{ $t('word.event') }} - - - - - BEFORE - AFTER - - - - {{ event }} - - - - - {{ event }} - - - - - - - - {{ $t('message.triggerStatement') }} - - - - - - - diff --git a/src/renderer/components/Workspace.vue b/src/renderer/components/Workspace.vue index 29de833f..8bfe0cf7 100644 --- a/src/renderer/components/Workspace.vue +++ b/src/renderer/components/Workspace.vue @@ -102,6 +102,23 @@ + + + + {{ tab.elementName | cutText }} + + + + - - - {{ tab.elementName | cutText }} + + + {{ $t('message.newRoutine') }} + - import { mapGetters, mapActions } from 'vuex'; +// import Tables from '@/ipc-api/Tables'; import Triggers from '@/ipc-api/Triggers'; import Routines from '@/ipc-api/Routines'; import Functions from '@/ipc-api/Functions'; @@ -146,7 +141,6 @@ import MiscContext from '@/components/WorkspaceExploreBarMiscContext'; import MiscFolderContext from '@/components/WorkspaceExploreBarMiscFolderContext'; import ModalNewSchema from '@/components/ModalNewSchema'; -import ModalNewRoutine from '@/components/ModalNewRoutine'; import ModalNewFunction from '@/components/ModalNewFunction'; import ModalNewTriggerFunction from '@/components/ModalNewTriggerFunction'; import ModalNewScheduler from '@/components/ModalNewScheduler'; @@ -161,7 +155,6 @@ export default { MiscFolderContext, ModalNewSchema, - ModalNewRoutine, ModalNewFunction, ModalNewTriggerFunction, ModalNewScheduler @@ -284,6 +277,7 @@ export default { }, openCreateElementTab (element) { this.closeDatabaseContext(); + this.closeMiscFolderContext(); this.newTab({ uid: this.workspace.uid, diff --git a/src/renderer/components/WorkspaceExploreBarMiscFolderContext.vue b/src/renderer/components/WorkspaceExploreBarMiscFolderContext.vue index c5810958..47b2b13f 100644 --- a/src/renderer/components/WorkspaceExploreBarMiscFolderContext.vue +++ b/src/renderer/components/WorkspaceExploreBarMiscFolderContext.vue @@ -6,14 +6,14 @@ {{ $t('message.createNewTrigger') }} {{ $t('message.createNewRoutine') }} diff --git a/src/renderer/components/WorkspaceExploreBarSchemaContext.vue b/src/renderer/components/WorkspaceExploreBarSchemaContext.vue index 72389f15..135c3370 100644 --- a/src/renderer/components/WorkspaceExploreBarSchemaContext.vue +++ b/src/renderer/components/WorkspaceExploreBarSchemaContext.vue @@ -31,7 +31,7 @@ {{ $tc('word.storedRoutine', 1) }} @@ -141,8 +141,8 @@ export default { openCreateTriggerTab () { this.$emit('open-create-trigger-tab'); }, - showCreateRoutineModal () { - this.$emit('show-create-routine-modal'); + openCreateRoutineTab () { + this.$emit('open-create-routine-tab'); }, showCreateFunctionModal () { this.$emit('show-create-function-modal'); diff --git a/src/renderer/components/WorkspaceTabNewRoutine.vue b/src/renderer/components/WorkspaceTabNewRoutine.vue new file mode 100644 index 00000000..7e8bc155 --- /dev/null +++ b/src/renderer/components/WorkspaceTabNewRoutine.vue @@ -0,0 +1,351 @@ + + + + + + + + + + + {{ $t('word.name') }} + + + + + + + + {{ $t('word.language') }} + + + + {{ language }} + + + + + + + + {{ $t('word.definer') }} + + + + {{ $t('message.currentUser') }} + + + {{ user.name }}@{{ user.host }} + + + + + {{ $t('message.currentUser') }} + + + + + + + + {{ $t('word.comment') }} + + + + + + + + {{ $t('message.sqlSecurity') }} + + + DEFINER + INVOKER + + + + + + + {{ $t('message.dataAccess') }} + + + CONTAINS SQL + NO SQL + READS SQL DATA + MODIFIES SQL DATA + + + + + + . + + {{ $t('word.deterministic') }} + + + + + + + + {{ $t('message.routineBody') }} + + + + + + + diff --git a/src/renderer/components/WorkspaceTabNewTrigger.vue b/src/renderer/components/WorkspaceTabNewTrigger.vue index 536dbc3f..70ed780e 100644 --- a/src/renderer/components/WorkspaceTabNewTrigger.vue +++ b/src/renderer/components/WorkspaceTabNewTrigger.vue @@ -202,7 +202,7 @@ export default { this.originalTrigger = { sql: this.customizations.triggerSql, definer: '', - table: 'elements', + table: this.schemaTables.length ? this.schemaTables[0].name : null, activation: 'BEFORE', event: this.customizations.triggerMultipleEvents ? ['INSERT'] : 'INSERT', name: '' @@ -274,6 +274,7 @@ export default { }); this.removeTab({ uid: this.connection.uid, tab: this.tab.uid }); + this.changeBreadcrumbs({ schema: this.schema, trigger: this.localTrigger.name }); } else this.addNotification({ status: 'error', message: response }); diff --git a/src/renderer/i18n/en-US.js b/src/renderer/i18n/en-US.js index e16b597e..4022aedc 100644 --- a/src/renderer/i18n/en-US.js +++ b/src/renderer/i18n/en-US.js @@ -234,7 +234,8 @@ module.exports = { thereAreNoTableFields: 'There are no table fields', newTable: 'New table', newView: 'New view', - newTrigger: 'New trigger' + newTrigger: 'New trigger', + newRoutine: 'New routine' }, faker: { address: 'Address',