Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(mongodb): remove duplicate refresh button in document browser (#2696)

LSD095cb867a59a
diff --git a/apps/desktop/src/components/document/DocumentBrowser.vue b/apps/desktop/src/components/document/DocumentBrowser.vue
index 91d7fc460b..c52e77a612 100644
--- a/apps/desktop/src/components/document/DocumentBrowser.vue
+++ b/apps/desktop/src/components/document/DocumentBrowser.vue
@@ -2,7 +2,7 @@
import { computed, ref, onMounted, onBeforeUnmount } from "vue";
import { uuid } from "@/lib/common/utils";
import { useI18n } from "vue-i18n";
-import { RefreshCw, RefreshCcw, Loader2, Trash2, Plus, Save, ChevronLeft, ChevronRight, Table2, Braces, X, Columns3, Check, Search, Wrench, Filter } from "@lucide/vue";
+import { RefreshCw, Trash2, Plus, Save, ChevronLeft, ChevronRight, Table2, Braces, X, Columns3, Check, Search, Wrench, Filter } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Input } from "@/components/ui/input";
@@ -1124,13 +1124,6 @@ function resetTableSearchSplitWidth() {
</button>
</div>
</div>
- <div class="flex shrink-0 items-center gap-1 border-l px-1">
- <Button variant="ghost" size="sm" class="h-5 shrink-0 gap-1 px-1.5 text-xs" :disabled="loading" @click="load">
- <Loader2 v-if="loading" class="h-3 w-3 animate-spin" />
- <RefreshCcw v-else class="h-3 w-3" />
- {{ t("grid.refresh") }}
- </Button>
- </div>
</template>
</DataGrid>
diff --git a/packages/app-tests/documentBrowser.test.ts b/packages/app-tests/documentBrowser.test.ts
new file mode 100644
index 0000000000..16e491460d
--- /dev/null
+++ b/packages/app-tests/documentBrowser.test.ts
@@ -0,0 +1,19 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import path from "node:path";
+import { test } from "vitest";
+
+function searchBarSlotSource(): string {
+ const source = readFileSync(path.resolve("apps/desktop/src/components/document/DocumentBrowser.vue"), "utf8");
+ const start = source.indexOf('<template #search-bar');
+ const end = source.indexOf("\n </DataGrid>", start);
+ assert.notEqual(start, -1, "expected DocumentBrowser search-bar slot");
+ assert.notEqual(end, -1, "expected DocumentBrowser DataGrid closing tag");
+ return source.slice(start, end);
+}
+
+test("mongo document result search bar does not render a duplicate refresh button", () => {
+ const slot = searchBarSlotSource();
+ assert.equal(slot.includes('{{ t("grid.refresh") }}'), false);
+ assert.equal(slot.includes("RefreshCcw"), false);
+});