Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(sql-editor): minor updates (#7989)
Liu Ji28a5925d3003
diff --git a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vueindex e159daee9d..cdfc1c53df 100644--- a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue+++ b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue@@ -1,5 +1,6 @@<template><div+ ref="containerRef"class="w-full flex flex-wrap gap-y-2 justify-between sm:items-center p-2 border-b bg-white"><div@@ -18,20 +19,20 @@}}</span>- <span class="hidden sm:inline ml-1">+ <span v-show="showShortcutText" class="ml-1">({{ keyboardShortcutStr("cmd_or_ctrl+⏎") }})</span></NButton><NButton size="small" :disabled="!allowQuery" @click="handleExplainQuery"><mdi:play class="-ml-1.5" /><span>Explain</span>- <span class="hidden sm:inline ml-1">+ <span v-show="showShortcutText" class="ml-1">({{ keyboardShortcutStr("cmd_or_ctrl+E") }})</span></NButton><NButton size="small" :disabled="!allowQuery" @click="handleFormatSQL"><span>{{ $t("sql-editor.format") }}</span>- <span class="hidden sm:inline ml-1">+ <span v-show="showShortcutText" class="ml-1">({{ keyboardShortcutStr("shift+opt_or_alt+F") }})</span></NButton>@@ -42,7 +43,7 @@@click="handleClearScreen"><span>{{ $t("sql-editor.clear-screen") }}</span>- <span class="hidden sm:inline ml-1">+ <span v-show="showShortcutText" class="ml-1">({{ keyboardShortcutStr("shift+opt_or_alt+C") }})</span></NButton>@@ -63,7 +64,7 @@><carbon:save class="-ml-1" /><span class="ml-1">{{ $t("common.save") }}</span>- <span class="hidden sm:inline ml-1">+ <span v-show="showShortcutText" class="ml-1">({{ keyboardShortcutStr("cmd_or_ctrl+S") }})</span></NButton>@@ -106,7 +107,8 @@</template><script lang="ts" setup>-import { computed, defineEmits, reactive } from "vue";+import { useElementSize } from "@vueuse/core";+import { computed, defineEmits, reactive, ref } from "vue";import {useTabStore,useSQLEditorStore,@@ -141,6 +143,8 @@ const tabStore = useTabStore();const sqlEditorStore = useSQLEditorStore();const uiStateStore = useUIStateStore();const webTerminalStore = useWebTerminalStore();+const containerRef = ref<HTMLDivElement>();+const { width: containerWidth } = useElementSize(containerRef);const hasSharedSQLScriptFeature = featureToRef("bb.feature.shared-sql-script");const connection = computed(() => tabStore.currentTab.connection);@@ -242,4 +246,8 @@ const handleShareButtonClick = () => {state.requiredFeatureName = "bb.feature.shared-sql-script";}};++const showShortcutText = computed(() => {+ return containerWidth.value > 800;+});</script>diff --git a/frontend/src/views/sql-editor/SecondarySidebar/SecondarySidebar.vue b/frontend/src/views/sql-editor/SecondarySidebar/SecondarySidebar.vueindex 960b161dc2..af8c5e6bce 100644--- a/frontend/src/views/sql-editor/SecondarySidebar/SecondarySidebar.vue+++ b/frontend/src/views/sql-editor/SecondarySidebar/SecondarySidebar.vue@@ -81,4 +81,13 @@ watch(},{ immediate: true });++watch(+ () => tabStore.currentTab.id,+ () => {+ if (showInfoPane.value) {+ tab.value = "INFO";+ }+ }+);</script>