fix(mongodb): remove duplicate refresh button in document browser (#2696)
This commit is contained in:
2 files changed
+20
-8
No files matched your search
@@ -2,7 +2,7 @@
|
|||||||
import { computed, ref, onMounted, onBeforeUnmount } from "vue";
|
import { computed, ref, onMounted, onBeforeUnmount } from "vue";
|
||||||
import { uuid } from "@/lib/common/utils";
|
import { uuid } from "@/lib/common/utils";
|
||||||
import { useI18n } from "vue-i18n";
|
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 { Button } from "@/components/ui/button";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
@@ -1124,13 +1124,6 @@ function resetTableSearchSplitWidth() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</template>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
});
|
||||||
Reference in new issue
Block a user