mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-19 16:16:45 +00:00
feat(editor): add table structure peek and dblclick insert
This commit is contained in:
+3
-3
@@ -255,15 +255,15 @@ test("preserves table actions when context-menu metadata is unavailable", () =>
|
||||
database: "app",
|
||||
schema: "public",
|
||||
});
|
||||
assert.deepEqual(queryContextObjectActions(undefined), ["view-data", "edit-table-structure", "view-ddl"]);
|
||||
assert.deepEqual(queryContextObjectActions(undefined), ["view-data", "peek-table-structure", "edit-table-structure", "view-ddl"]);
|
||||
});
|
||||
|
||||
test("uses source actions for views and materialized views", () => {
|
||||
const expected = ["view-data", "edit-view", "view-source", "view-ddl"];
|
||||
const expected = ["view-data", "peek-table-structure", "edit-view", "view-source", "view-ddl"];
|
||||
|
||||
assert.deepEqual(queryContextObjectActions("view"), expected);
|
||||
assert.deepEqual(queryContextObjectActions("materialized_view"), expected);
|
||||
assert.deepEqual(queryContextObjectActions("table"), ["view-data", "edit-table-structure", "view-ddl"]);
|
||||
assert.deepEqual(queryContextObjectActions("table"), ["view-data", "peek-table-structure", "edit-table-structure", "view-ddl"]);
|
||||
});
|
||||
|
||||
test("falls back to the candidate database and schema when no table is loaded", () => {
|
||||
|
||||
@@ -9,6 +9,7 @@ const materializedViewTarget: SqlObjectNavigationTarget = { ...tableTarget, type
|
||||
|
||||
test("routes table context actions with the resolved target payload", () => {
|
||||
assert.deepEqual(queryContextObjectRoute("view-data", tableTarget), { event: "viewTableData", payload: [tableTarget] });
|
||||
assert.deepEqual(queryContextObjectRoute("peek-table-structure", tableTarget), { event: "peekTableStructure", payload: [tableTarget] });
|
||||
assert.deepEqual(queryContextObjectRoute("edit-table-structure", tableTarget), { event: "editTableStructure", payload: [tableTarget] });
|
||||
assert.deepEqual(queryContextObjectRoute("view-ddl", tableTarget), { event: "viewTableDdl", payload: [tableTarget] });
|
||||
});
|
||||
@@ -20,6 +21,7 @@ test("routes view source actions with editing intent and type fidelity", () => {
|
||||
|
||||
test("preserves materialized view type in every routed payload", () => {
|
||||
assert.deepEqual(queryContextObjectRoute("view-data", materializedViewTarget), { event: "viewTableData", payload: [materializedViewTarget] });
|
||||
assert.deepEqual(queryContextObjectRoute("peek-table-structure", materializedViewTarget), { event: "peekTableStructure", payload: [materializedViewTarget] });
|
||||
assert.deepEqual(queryContextObjectRoute("edit-view", materializedViewTarget), { event: "openObjectSource", payload: [materializedViewTarget, true] });
|
||||
assert.deepEqual(queryContextObjectRoute("view-source", materializedViewTarget), { event: "openObjectSource", payload: [materializedViewTarget, false] });
|
||||
assert.deepEqual(queryContextObjectRoute("view-ddl", materializedViewTarget), { event: "viewTableDdl", payload: [materializedViewTarget] });
|
||||
|
||||
Reference in New Issue
Block a user