Skip to content
Closed
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
2 changes: 1 addition & 1 deletion src/components/CodeEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function CodeEditor({
.writeText(props.value)
.then(() => Toast.success(t("copied_to_clipboard")))
.catch((e) => {
console.log(e);
console.error(e);
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorHeader/ControlPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ export default function ControlPanel({
}
})
.catch((error) => {
console.log(error);
console.error(error);
Toast.error(t("didnt_find_diagram"));
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditorHeader/Modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default function Modal({
}
})
.catch((error) => {
console.log(error);
console.error(error);
Toast.error(t("didnt_find_diagram"));
});
};
Expand Down
9 changes: 4 additions & 5 deletions src/components/EditorSidePanel/TypesTab/TypeInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ import TypeField from "./TypeField";
import { useTranslation } from "react-i18next";
import { nanoid } from "nanoid";

export default function TypeInfo({ index, data }) {
export default function TypeInfo({ data }) {
const { layout } = useLayout();
const { deleteType, updateType } = useTypes();
const { tables, updateField } = useDiagram();
const { setUndoStack, setRedoStack } = useUndoRedo();
const [editField, setEditField] = useState({});
const { t } = useTranslation();

// TODO: remove indexes, not a valid case after adding id to types
const typeId = data.id ?? index;
const typeId = data.id;

return (
<div id={`scroll_type_${typeId}`}>
Expand All @@ -34,7 +33,7 @@ export default function TypeInfo({ index, data }) {
{data.name}
</div>
}
itemKey={`${index}`}
itemKey={`${data.id}`}
>
<div className="flex items-center mb-2.5">
<div className="text-md font-semibold break-keep">{t("name")}: </div>
Expand Down Expand Up @@ -90,7 +89,7 @@ export default function TypeInfo({ index, data }) {
/>
</div>
{data.fields.map((f, j) => (
<TypeField key={j} data={f} fid={j} tid={index} />
<TypeField key={j} data={f} fid={j} tid={data.id} />
))}
<Card
bodyStyle={{ padding: "4px" }}
Expand Down
8 changes: 4 additions & 4 deletions src/components/Workspace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default function WorkSpace() {
}
})
.catch((error) => {
console.log(error);
console.error(error);
});
};

Expand Down Expand Up @@ -288,7 +288,7 @@ export default function WorkSpace() {
}
})
.catch((error) => {
console.log(error);
console.error(error);
});
};

Expand Down Expand Up @@ -346,7 +346,7 @@ export default function WorkSpace() {
}
})
.catch((error) => {
console.log(error);
console.error(error);
if (selectedDb === "") setShowSelectDbModal(true);
});
};
Expand Down Expand Up @@ -393,7 +393,7 @@ export default function WorkSpace() {
);
}
} catch (e) {
console.log(e);
console.error(e);
setSaveState(State.FAILED_TO_LOAD);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/data/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ db.version(6).stores({
});

db.on("populate", (transaction) => {
transaction.templates.bulkAdd(templateSeeds).catch((e) => console.log(e));
transaction.templates.bulkAdd(templateSeeds).catch((e) => console.error(e));
});
1 change: 0 additions & 1 deletion src/utils/exportAs/dbml.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ function columnComment(field) {
}

function processType(type) {
// TODO: remove after a while
if (type.toUpperCase() === "TIMESTAMP WITH TIME ZONE") {
return "timestamptz";
}
Expand Down