Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

update page titles (#247)

Guy Ben-Aharon2efa7fe696ea
diff --git a/src/context/chartdb-context/chartdb-provider.tsx b/src/context/chartdb-context/chartdb-provider.tsx
index 48641d48..ddec0faf 100644
--- a/src/context/chartdb-context/chartdb-provider.tsx
+++ b/src/context/chartdb-context/chartdb-provider.tsx
@@ -51,7 +51,7 @@ export const ChartDBProvider: React.FC<React.PropsWithChildren> = ({
if (diagramName) {
document.title = `ChartDB - ${diagramName}`;
} else {
- document.title = 'ChartDB';
+ document.title = 'ChartDB - Create Diagram';
}
}, [diagramName]);
diff --git a/src/lib/domain/db-table.ts b/src/lib/domain/db-table.ts
index 571360de..97e9f363 100644
--- a/src/lib/domain/db-table.ts
+++ b/src/lib/domain/db-table.ts
@@ -116,7 +116,10 @@ export const createTablesFromMetadata = ({
(col: ColumnInfo): DBField => ({
id: generateId(),
name: col.name,
- type: { id: col.type.split(' ').join('_'), name: col.type },
+ type: {
+ id: col.type.split(' ').join('_').toLowerCase(),
+ name: col.type.toLowerCase(),
+ },
primaryKey: tablePrimaryKeys.includes(col.name),
unique: Object.values(aggregatedIndexes).some(
(idx) =>
diff --git a/src/pages/examples-page/examples-page.tsx b/src/pages/examples-page/examples-page.tsx
index 06ba8fa0..d4a4cd6a 100644
--- a/src/pages/examples-page/examples-page.tsx
+++ b/src/pages/examples-page/examples-page.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useEffect } from 'react';
import ChartDBLogo from '@/assets/logo.png';
import ChartDBDarkLogo from '@/assets/logo-dark.png';
import { examples } from './examples-data/examples-data';
@@ -7,6 +7,10 @@ import { useTheme } from '@/hooks/use-theme';
export const ExamplesPage: React.FC = () => {
const { effectiveTheme } = useTheme();
+ useEffect(() => {
+ document.title = 'ChartDB - Examples';
+ }, []);
+
return (
<section className="flex w-screen flex-col bg-background">
<nav className="flex h-12 flex-row items-center justify-between border-b px-4">