From 8cd76e711c9328254d498b4f9afa221311f5a487 Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Thu, 8 Jul 2021 17:43:33 +0200 Subject: [PATCH] feat(UI): new connection add panel --- src/renderer/App.vue | 23 +- src/renderer/components/SettingBarContext.vue | 8 +- src/renderer/components/TheSettingBar.vue | 4 +- src/renderer/components/TheTitleBar.vue | 1 + .../WorkspaceAddConnectionPanel.vue | 517 ++++++++++++++++++ .../WorkspaceEditConnectionPanel.vue | 6 +- .../{ => old}/ModalNewConnection.vue | 0 .../components/{ => old}/TheAppWelcome.vue | 0 .../store/modules/connections.store.js | 1 + .../store/modules/workspaces.store.js | 7 +- 10 files changed, 545 insertions(+), 22 deletions(-) create mode 100644 src/renderer/components/WorkspaceAddConnectionPanel.vue rename src/renderer/components/{ => old}/ModalNewConnection.vue (100%) rename src/renderer/components/{ => old}/TheAppWelcome.vue (100%) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index ee5bb60f..2c57f3da 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -4,22 +4,21 @@
- -
+
+
+ + + + + +
- - - - - - -
@@ -36,9 +35,8 @@ export default { TheSettingBar: () => import(/* webpackChunkName: "TheSettingBar" */'@/components/TheSettingBar'), TheFooter: () => import(/* webpackChunkName: "TheFooter" */'@/components/TheFooter'), TheNotificationsBoard: () => import(/* webpackChunkName: "TheNotificationsBoard" */'@/components/TheNotificationsBoard'), - TheAppWelcome: () => import(/* webpackChunkName: "TheAppWelcome" */'@/components/TheAppWelcome'), Workspace: () => import(/* webpackChunkName: "Workspace" */'@/components/Workspace'), - ModalNewConnection: () => import(/* webpackChunkName: "ModalNewConnection" */'@/components/ModalNewConnection'), + WorkspaceAddConnectionPanel: () => import(/* webpackChunkName: "WorkspaceAddConnectionPanel" */'@/components/WorkspaceAddConnectionPanel'), ModalSettings: () => import(/* webpackChunkName: "ModalSettings" */'@/components/ModalSettings'), TheScratchpad: () => import(/* webpackChunkName: "TheScratchpad" */'@/components/TheScratchpad'), ModalDiscardChanges: () => import(/* webpackChunkName: "ModalDiscardChanges" */'@/components/ModalDiscardChanges'), @@ -49,9 +47,8 @@ export default { }, computed: { ...mapGetters({ + selectedWorkspace: 'workspaces/getSelected', isLoading: 'application/isLoading', - isNewConnModal: 'application/isNewModal', - isEditModal: 'application/isEditModal', isSettingModal: 'application/isSettingModal', isScratchpad: 'application/isScratchpad', connections: 'connections/getConnections', diff --git a/src/renderer/components/SettingBarContext.vue b/src/renderer/components/SettingBarContext.vue index c709beaa..a729585f 100644 --- a/src/renderer/components/SettingBarContext.vue +++ b/src/renderer/components/SettingBarContext.vue @@ -49,7 +49,8 @@ export default { }, computed: { ...mapGetters({ - getConnectionName: 'connections/getConnectionName' + getConnectionName: 'connections/getConnectionName', + selectedWorkspace: 'workspaces/getSelected' }), connectionName () { return this.getConnectionName(this.contextConnection.uid); @@ -57,9 +58,12 @@ export default { }, methods: { ...mapActions({ - deleteConnection: 'connections/deleteConnection' + deleteConnection: 'connections/deleteConnection', + selectWorkspace: 'workspaces/selectWorkspace' }), confirmDeleteConnection () { + if (this.selectedWorkspace === this.contextConnection.uid) + this.selectWorkspace(); this.deleteConnection(this.contextConnection); this.closeContext(); }, diff --git a/src/renderer/components/TheSettingBar.vue b/src/renderer/components/TheSettingBar.vue index d10b39d6..1a765f0c 100644 --- a/src/renderer/components/TheSettingBar.vue +++ b/src/renderer/components/TheSettingBar.vue @@ -25,7 +25,8 @@