fix(meilisearch): hide generic new-query entry for meilisearch
This commit is contained in:
6 files changed
+56
-11
No files matched your search
@@ -50,6 +50,7 @@ const props = defineProps<{
|
||||
agentDriverUpdateCount: number;
|
||||
hasMcpUpdateAvailable: boolean;
|
||||
hasConnections: boolean;
|
||||
canNewQuery: boolean;
|
||||
hasSqlFileConnections: boolean;
|
||||
}>();
|
||||
|
||||
@@ -562,7 +563,7 @@ const toolbarStyle = computed(() => {
|
||||
</span>
|
||||
</Button>
|
||||
|
||||
<Button variant="ghost" size="sm" :class="toolbarTextButtonClass" @click="emit('new-query')" :disabled="!hasConnections">
|
||||
<Button v-if="canNewQuery" variant="ghost" size="sm" :class="toolbarTextButtonClass" @click="emit('new-query')">
|
||||
<FilePlus2 class="h-3.5 w-3.5" />
|
||||
<span :class="toolbarTextLabelClass">{{ t("toolbar.newQuery") }}</span>
|
||||
</Button>
|
||||
|
||||
@@ -20,7 +20,7 @@ defineProps<{
|
||||
recentConnections: ConnectionConfig[];
|
||||
savedSqlHistoryItems: WelcomeSavedSqlHistoryItem[];
|
||||
appVersion: string;
|
||||
hasConnections: boolean;
|
||||
canNewQuery: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -94,7 +94,7 @@ function welcomeConnectionSubtitle(connection: ConnectionConfig): string {
|
||||
<button class="flex min-w-0 items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('new-connection')">
|
||||
<Plus class="h-4 w-4 shrink-0" /> <span class="min-w-0 truncate">{{ t("toolbar.newConnection") }}</span>
|
||||
</button>
|
||||
<button class="flex min-w-0 items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" :disabled="!hasConnections" @click="emit('new-query')">
|
||||
<button v-if="canNewQuery" class="flex min-w-0 items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('new-query')">
|
||||
<FilePlus2 class="h-4 w-4 shrink-0" /> <span class="min-w-0 truncate">{{ t("toolbar.newQuery") }}</span>
|
||||
</button>
|
||||
<button class="flex min-w-0 items-center gap-2 overflow-hidden rounded-md px-3 py-2 text-left text-sm hover:bg-muted/50" @click="emit('show-history')">
|
||||
|
||||
@@ -6078,9 +6078,17 @@ function buildSpecialSidebarMenu(context: SidebarMenuFactoryContext): boolean {
|
||||
|
||||
if (node.type === "elasticsearch-index" || node.type === "vector-collection") {
|
||||
items.push({ label: t("contextMenu.copyName"), action: copyName, icon: Copy, shortcut: shortcutCopyName.value });
|
||||
items.push({ label: "", separator: true });
|
||||
items.push({ label: t("contextMenu.viewData"), action: toggle, icon: TableProperties });
|
||||
items.push({ label: t("contextMenu.newQuery"), action: newQuery, icon: TerminalSquare });
|
||||
// Meilisearch indexes open through their dedicated search workspace; the
|
||||
// generic data/query actions are not valid for this connection type.
|
||||
const isMeilisearchIndex = currentDatabaseType() === "meilisearch";
|
||||
const hasAdditionalIndexActions = canRenameMongoCollection.value || canManageElasticsearchIndex.value || canDropMilvusCollection.value;
|
||||
if (!isMeilisearchIndex || hasAdditionalIndexActions) {
|
||||
items.push({ label: "", separator: true });
|
||||
}
|
||||
if (!isMeilisearchIndex) {
|
||||
items.push({ label: t("contextMenu.viewData"), action: toggle, icon: TableProperties });
|
||||
items.push({ label: t("contextMenu.newQuery"), action: newQuery, icon: TerminalSquare });
|
||||
}
|
||||
if (canRenameMongoCollection.value) {
|
||||
items.push({ label: t("contextMenu.renameObject"), action: openRenameMongoCollectionDialog, icon: Pencil, shortcut: shortcutRename });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user