fix(mongodb): preserve collection queries and preview selection
Closes #8306
This commit is contained in:
4 files changed
+55
-1
No files matched your search
@@ -5534,7 +5534,12 @@ function closeCellDetails() {
|
||||
function toggleMongoJsonPreview() {
|
||||
if (!canShowMongoJsonPreview.value) return;
|
||||
showMongoJsonPreview.value = !showMongoJsonPreview.value;
|
||||
if (showMongoJsonPreview.value) closeCellDetails();
|
||||
if (showMongoJsonPreview.value) {
|
||||
closeCellDetails();
|
||||
if (!currentSelectedCellPosition() && displayItems.value.length > 0 && visibleColumnIndexes.value.length > 0) {
|
||||
selectSingleCell(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closeMongoJsonPreview() {
|
||||
|
||||
+7
@@ -5,6 +5,13 @@ const dataGridSource = readFileSync(new URL("../DataGrid.vue", import.meta.url),
|
||||
const largeValueSource = readFileSync(new URL("../../../composables/useDataGridLargeValues.ts", import.meta.url), "utf8");
|
||||
|
||||
describe("DataGrid cell detail selection", () => {
|
||||
it("selects the first available cell when opening Mongo JSON preview without a selection", () => {
|
||||
const togglePreview = dataGridSource.match(/function toggleMongoJsonPreview[\s\S]*?\n\}/)?.[0];
|
||||
expect(togglePreview).toContain("if (showMongoJsonPreview.value)");
|
||||
expect(togglePreview).toContain("!currentSelectedCellPosition() && displayItems.value.length > 0 && visibleColumnIndexes.value.length > 0");
|
||||
expect(togglePreview).toContain("selectSingleCell(0, 0)");
|
||||
});
|
||||
|
||||
it("keeps Canvas hover state while the renderer swaps drawing surfaces", () => {
|
||||
expect(dataGridSource).toContain("function isCanvasGridInteractionTarget(target: Node): boolean");
|
||||
expect(dataGridSource).toContain("canvasOverlayRef.value?.contains(target) === true");
|
||||
|
||||
Reference in new issue
Block a user