Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Show info icon only for generic diagrams

1ilit85ccb19d8fcf
diff --git a/src/components/EditorSidePanel/TypesTab/TypesTab.jsx b/src/components/EditorSidePanel/TypesTab/TypesTab.jsx
index aec07011..769c6af1 100644
--- a/src/components/EditorSidePanel/TypesTab/TypesTab.jsx
+++ b/src/components/EditorSidePanel/TypesTab/TypesTab.jsx
@@ -1,7 +1,7 @@
import { Collapse, Button, Popover } from "@douyinfe/semi-ui";
import { IconPlus, IconInfoCircle } from "@douyinfe/semi-icons";
-import { useSelect, useTypes } from "../../../hooks";
-import { ObjectType } from "../../../data/constants";
+import { useSelect, useTables, useTypes } from "../../../hooks";
+import { DB, ObjectType } from "../../../data/constants";
import Searchbar from "./SearchBar";
import Empty from "../Empty";
import TypeInfo from "./TypeInfo";
@@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next";
export default function TypesTab() {
const { types, addType } = useTypes();
const { selectedElement, setSelectedElement } = useSelect();
+ const { database } = useTables();
const { t } = useTranslation();
return (
@@ -21,21 +22,23 @@ export default function TypesTab() {
{t("add_type")}
</Button>
</div>
- <Popover
- content={
- <div className="w-[240px] text-sm space-y-2 popover-theme">
- {t("types_info")
- .split("\n")
- .map((line, index) => (
- <div key={index}>{line}</div>
- ))}
- </div>
- }
- showArrow
- position="rightTop"
- >
- <Button theme="borderless" icon={<IconInfoCircle />} />
- </Popover>
+ {database === DB.GENERIC && (
+ <Popover
+ content={
+ <div className="w-[240px] text-sm space-y-2 popover-theme">
+ {t("types_info")
+ .split("\n")
+ .map((line, index) => (
+ <div key={index}>{line}</div>
+ ))}
+ </div>
+ }
+ showArrow
+ position="rightTop"
+ >
+ <Button theme="borderless" icon={<IconInfoCircle />} />
+ </Popover>
+ )}
</div>
{types.length <= 0 ? (
<Empty title={t("no_types")} text={t("no_types_text")} />
diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js
index 379807f8..c739cabd 100644
--- a/src/i18n/locales/en.js
+++ b/src/i18n/locales/en.js
@@ -112,7 +112,7 @@ const en = {
this_will_appear_as_is: "*This will appear in the generated script as is.",
comment: "Comment",
add_field: "Add field",
- values: "values",
+ values: "Values",
size: "Size",
precision: "Precision",
set_precision: "Set precision: (size, digits)",
@@ -216,6 +216,10 @@ const en = {
generic: "Generic",
generic_description:
"Generic diagrams can be exported to any SQL flavor but support few data types.",
+ enums: "Enums",
+ add_enum: "Add enum",
+ edit_enum: "Edit enum",
+ delete_enum: "Delete enum",
},
};