Skip to content

Commit

Permalink
Merge branch 'schema-database' of github.com:sokphaladam/studio into …
Browse files Browse the repository at this point in the history
…schema-database
  • Loading branch information
sokphaladam committed Jan 17, 2025
2 parents 29d717f + 967484a commit 0ed9556
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 318 deletions.
56 changes: 55 additions & 1 deletion src/components/gui/schema-sidebar-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,61 @@ export default function SchemaList({ search }: Readonly<SchemaListProps>) {
const selectedName = item?.name;
const isTable = item?.type === "table";
const isTrigger = item?.type === "trigger";
const isView = item?.type === "view";

const createMenuSection = {

Check failure on line 146 in src/components/gui/schema-sidebar-list.tsx

View workflow job for this annotation

GitHub Actions / quality-check

Cannot redeclare block-scoped variable 'createMenuSection'.
title: "Create",
sub: [
databaseDriver.getFlags().supportCreateUpdateTable && {
title: "Create Table",
onClick: () => {
scc.tabs.openBuiltinSchema({
schemaName: item?.schemaName ?? currentSchemaName,
});
},
},
databaseDriver.getFlags().supportCreateUpdateTrigger
? {
title: "Create Trigger",
onClick: () => {
scc.tabs.openBuiltinTrigger({
schemaName: item?.schemaName ?? currentSchemaName,
tableName: item?.tableSchema?.tableName,
});
},
}
: undefined,
...extensions.getResourceCreateMenu(),
],
};

const modificationSection = item

Check failure on line 172 in src/components/gui/schema-sidebar-list.tsx

View workflow job for this annotation

GitHub Actions / quality-check

Cannot redeclare block-scoped variable 'modificationSection'.
? [
isTable && databaseDriver.getFlags().supportCreateUpdateTable
? {
title: "Edit Table",
onClick: () => {
scc.tabs.openBuiltinSchema({
schemaName: item?.schemaName ?? currentSchemaName,
tableName: item?.name,
});
},
}
: undefined,
databaseDriver.getFlags().supportCreateUpdateTrigger && isTrigger
? {
title: "Edit Trigger",
onClick: () => {
scc.tabs.openBuiltinTrigger({
schemaName: item?.schemaName ?? currentSchemaName,
name: item.name,
tableName: item?.tableSchema?.tableName,
});
},
}
: undefined,
...extensions.getResourceContextMenu(item, "modification"),
]
: [];

const createMenuSection = {

Check failure on line 201 in src/components/gui/schema-sidebar-list.tsx

View workflow job for this annotation

GitHub Actions / quality-check

Cannot redeclare block-scoped variable 'createMenuSection'.
title: "Create",
Expand Down
146 changes: 0 additions & 146 deletions src/components/gui/tabs/view-tab.tsx

This file was deleted.

72 changes: 0 additions & 72 deletions src/components/gui/view-editor/index.tsx

This file was deleted.

62 changes: 0 additions & 62 deletions src/components/gui/view-editor/view-controller.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions src/core/builtin-tab/open-view-tab.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/core/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { builtinOpenQueryTab } from "../builtin-tab/open-query-tab";
import { builtinOpenSchemaTab } from "../builtin-tab/open-schema-tab";
import { builtinOpenTableTab } from "../builtin-tab/open-table-tab";
import { builtinOpenTriggerTab } from "../builtin-tab/open-trigger-tab";
import { buildinOpenViewTab } from "../builtin-tab/open-view-tab";

export const scc = {
tabs: {
Expand All @@ -19,7 +18,6 @@ export const scc = {
openBuiltinTrigger: builtinOpenTriggerTab.open,
openBuiltinERD: builtinOpenERDTab.open,
openBuiltinMassDropTable: builtinMassDropTableTab.open,
openBuildinView: buildinOpenViewTab.open,

close: (keys: string[]) => {
if (window.outerbaseCloseTab) {
Expand Down
Loading

0 comments on commit 0ed9556

Please sign in to comment.