Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/EditorCanvas/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export default function Table({
<div className="hidden group-hover:block">
<div className="flex justify-end items-center mx-2 space-x-1.5">
<Button
aria-label={tableData.locked ? t("unlock") : t("lock")}
icon={tableData.locked ? <IconLock /> : <IconUnlock />}
size="small"
theme="solid"
Expand All @@ -184,6 +185,7 @@ export default function Table({
onClick={lockUnlockTable}
/>
<Button
aria-label={t("edit")}
icon={<IconEdit />}
size="small"
theme="solid"
Expand Down Expand Up @@ -260,6 +262,7 @@ export default function Table({
style={{ width: "200px", wordBreak: "break-word" }}
>
<Button
aria-label={t("more")}
icon={<IconMore />}
type="tertiary"
size="small"
Expand Down Expand Up @@ -461,6 +464,7 @@ export default function Table({
<div className="text-zinc-400">
{hoveredField === index ? (
<Button
aria-label={t("delete")}
theme="solid"
size="small"
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default function RelationshipInfo({ data }) {
position="rightTop"
showArrow
>
<Button icon={<IconMore />} type="tertiary" />
<Button aria-label={t("more")} icon={<IconMore />} type="tertiary" />
</Popover>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/EditorSidePanel/TablesTab/IndexDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default function IndexDetails({ data, fields, iid, tid }) {
showArrow
>
<Button
aria-label={t("more")}
icon={<IconMore />}
type="tertiary"
style={{ marginLeft: "12px" }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorSidePanel/TablesTab/TableField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default function TableField({ data, tid, index, inherited }) {
position="right"
showArrow
>
<Button type="tertiary" icon={<IconMore />} />
<Button aria-label={t("more")} type="tertiary" icon={<IconMore />} />
</Popover>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorSidePanel/TypesTab/TypeField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default function TypeField({ data, tid, fid }) {
trigger="click"
position="right"
>
<Button icon={<IconMore />} type="tertiary" />
<Button aria-label={t("more")} icon={<IconMore />} type="tertiary" />
</Popover>
</Col>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorSidePanel/TypesTab/TypesTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function TypesTab() {
showArrow
position="rightTop"
>
<Button theme="borderless" icon={<IconInfoCircle />} />
<Button aria-label={t("info")} theme="borderless" icon={<IconInfoCircle />} />
</Popover>
)}
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ const en = {
type_name_required: "Type name is required",
database: "Database",
saved: "Saved",
lock: "Lock",
unlock: "Unlock",
info: "Info",
more: "More",
},
};

Expand Down
15 changes: 15 additions & 0 deletions src/utils/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function getTypeIndex(types, idOrIndex) {
if (typeof idOrIndex === "number") return idOrIndex;
if (typeof idOrIndex === "string") {
return types.findIndex((t) => t.id === idOrIndex);
}
return -1;
}

export function getTypeById(types, idOrIndex) {
const index = getTypeIndex(types, idOrIndex);
return {
type: index >= 0 ? types[index] : null,
index,
};
}
26 changes: 25 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,28 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("node_modules")) {
if (id.includes("@douyinfe/semi-ui") || id.includes("@douyinfe/semi-icons")) {
return "semi-ui";
}
if (id.includes("@lexical") || id.includes("lexical")) {
return "lexical";
}
if (id.includes("node-sql-parser") || id.includes("oracle-sql-parser")) {
return "sql-parser";
}
if (id.includes("lodash") || id.includes("luxon") || id.includes("axios")) {
return "utils";
}
return "vendor";
}
},
},
},
chunkSizeWarningLimit: 1000,
},
});
Loading