revert(grid): remove direct table structure navigation
Reverts d2df8d1633.
Refs: #9937
This commit is contained in:
2 files changed
-33
No files matched your search
@@ -12507,22 +12507,6 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
|
|||||||
>
|
>
|
||||||
<template #leading>
|
<template #leading>
|
||||||
<slot v-if="hasResultToolbarActionsSlot" name="result-toolbar-actions" :compact="compactDataGridToolbar" />
|
<slot v-if="hasResultToolbarActionsSlot" name="result-toolbar-actions" :compact="compactDataGridToolbar" />
|
||||||
<Tooltip v-if="props.context === 'table-data' && canOpenTableStructureEditor">
|
|
||||||
<TooltipTrigger as-child>
|
|
||||||
<Button
|
|
||||||
data-grid-edit-table-structure-action
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
:class="['data-grid-topbar-action-button h-5 shrink-0 px-1.5 text-xs', compactDataGridToolbar ? 'data-grid-topbar-action-button--compact' : '']"
|
|
||||||
:aria-label="t('contextMenu.editStructure')"
|
|
||||||
@click="openTableStructureEditor"
|
|
||||||
>
|
|
||||||
<PencilRuler class="data-grid-topbar-action-icon h-3 w-3" />
|
|
||||||
<span class="data-grid-topbar-action-label" :class="{ 'data-grid-topbar-action-label--compact': compactDataGridToolbar }">{{ t("contextMenu.editStructure") }}</span>
|
|
||||||
</Button>
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent side="bottom">{{ t("contextMenu.editStructure") }}</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip v-if="showQueryEditReadOnlyBadge">
|
<Tooltip v-if="showQueryEditReadOnlyBadge">
|
||||||
<TooltipTrigger as-child>
|
<TooltipTrigger as-child>
|
||||||
<div class="flex h-5 items-center gap-1 rounded border border-muted-foreground/30 bg-muted/60 px-1.5 text-xs font-medium text-muted-foreground">
|
<div class="flex h-5 items-center gap-1 rounded border border-muted-foreground/30 bg-muted/60 px-1.5 text-xs font-medium text-muted-foreground">
|
||||||
|
|||||||
-17
@@ -152,21 +152,6 @@ afterEach(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("DataGrid edit-table-structure shortcut", () => {
|
describe("DataGrid edit-table-structure shortcut", () => {
|
||||||
it("opens the structure editor from the table-data toolbar", async () => {
|
|
||||||
const { host, openTableStructure } = mountGrid();
|
|
||||||
await settle();
|
|
||||||
const action = host.querySelector<HTMLButtonElement>("[data-grid-edit-table-structure-action]");
|
|
||||||
|
|
||||||
expect(action).not.toBeNull();
|
|
||||||
expect(action?.getAttribute("aria-label")).toBe("Edit Structure");
|
|
||||||
expect(action?.textContent).toContain("Edit Structure");
|
|
||||||
action?.click();
|
|
||||||
await settle();
|
|
||||||
|
|
||||||
expect(openTableStructure).toHaveBeenCalledOnce();
|
|
||||||
expect(openTableStructure).toHaveBeenCalledWith("connection-1", "app", "public", "users", "ddl", undefined, "warehouse", "table");
|
|
||||||
});
|
|
||||||
|
|
||||||
it("opens the existing structure editor route for an eligible table-data grid", async () => {
|
it("opens the existing structure editor route for an eligible table-data grid", async () => {
|
||||||
const { host, openTableStructure } = mountGrid();
|
const { host, openTableStructure } = mountGrid();
|
||||||
await settle();
|
await settle();
|
||||||
@@ -221,7 +206,6 @@ describe("DataGrid edit-table-structure shortcut", () => {
|
|||||||
expect(event.defaultPrevented).toBe(false);
|
expect(event.defaultPrevented).toBe(false);
|
||||||
expect(bubbled).toHaveBeenCalledOnce();
|
expect(bubbled).toHaveBeenCalledOnce();
|
||||||
expect(openTableStructure).not.toHaveBeenCalled();
|
expect(openTableStructure).not.toHaveBeenCalled();
|
||||||
expect(host.querySelector("[data-grid-edit-table-structure-action]")).toBeNull();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("leaves editable text targets untouched", async () => {
|
it("leaves editable text targets untouched", async () => {
|
||||||
@@ -275,7 +259,6 @@ describe("DataGrid edit-table-structure shortcut", () => {
|
|||||||
expect(keydown).toMatch(
|
expect(keydown).toMatch(
|
||||||
/if \(!targetAllowsNativeClipboard && props\.context === "table-data" && canOpenTableStructureEditor\.value && isEditTableStructureShortcut\(event, settingsStore\.editorSettings\.shortcuts\)\) \{[\s\S]*?event\.preventDefault\(\);[\s\S]*?event\.stopPropagation\(\);[\s\S]*?openTableStructureEditor\(\);[\s\S]*?return;/,
|
/if \(!targetAllowsNativeClipboard && props\.context === "table-data" && canOpenTableStructureEditor\.value && isEditTableStructureShortcut\(event, settingsStore\.editorSettings\.shortcuts\)\) \{[\s\S]*?event\.preventDefault\(\);[\s\S]*?event\.stopPropagation\(\);[\s\S]*?openTableStructureEditor\(\);[\s\S]*?return;/,
|
||||||
);
|
);
|
||||||
expect(dataGridSource).toMatch(/data-grid-edit-table-structure-action[\s\S]*?@click="openTableStructureEditor"/);
|
|
||||||
expect(dataGridSource).toMatch(/<Button v-if="canOpenTableStructureEditor"[^>]*@click="openTableStructureEditor">/);
|
expect(dataGridSource).toMatch(/<Button v-if="canOpenTableStructureEditor"[^>]*@click="openTableStructureEditor">/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user