Skip to content

Commit ee3a509

Browse files
committed
fix the PR comments
1 parent 4aef6c6 commit ee3a509

File tree

5 files changed

+20
-30
lines changed

5 files changed

+20
-30
lines changed

src/components/EditorHeader/ControlPanel.jsx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,29 +1062,24 @@ export default function ControlPanel({
10621062
}));
10631063
},
10641064
},
1065-
],
1066-
function: () => {},
1067-
},
1068-
documentation: {
1069-
children: [
1070-
{
1071-
Markdown: () => {
1072-
setModal(MODAL.CODE);
1073-
const result = jsonToDocumentation({
1074-
tables: tables,
1075-
relationships: relationships,
1076-
notes: notes,
1077-
subjectAreas: areas,
1078-
database: database,
1079-
title: title,
1080-
});
1081-
setExportData((prev) => ({
1082-
...prev,
1083-
data: result,
1084-
extension: "md",
1085-
}));
1086-
}
1065+
{
1066+
Readme: () => {
1067+
setModal(MODAL.CODE);
1068+
const result = jsonToDocumentation({
1069+
tables: tables,
1070+
relationships: relationships,
1071+
notes: notes,
1072+
subjectAreas: areas,
1073+
database: database,
1074+
title: title,
1075+
});
1076+
setExportData((prev) => ({
1077+
...prev,
1078+
data: result,
1079+
extension: "md",
1080+
}));
10871081
}
1082+
},
10881083
],
10891084
function: () => {},
10901085
},

src/i18n/locales/en.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ const en = {
236236
empty_index_name: "Declared an index with no name in table '{{tableName}}'",
237237
didnt_find_diagram: "Oops! Didn't find the diagram.",
238238
unsigned: "Unsigned",
239-
documentation: "Documentation",
240239
},
241240
};
242241

src/i18n/locales/es.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ const es = {
212212
edit_relationship: "{{extra}} Editar relación {{refName}}",
213213
delete_relationship: "Eliminar relación {{refName}}",
214214
not_found: "No encontrado",
215-
documentation: "Documentación",
216215
},
217216
};
218217

src/i18n/locales/fr.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ const fr = {
217217
edit_relationship: "{{extra}} Modifier la relation {{refName}}",
218218
delete_relationship: "Supprimer la relation {{refName}}",
219219
not_found: "Non trouvé",
220-
documentation: "Documentation",
221220
},
222221
};
223222

src/utils/exportAs/documentation.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { dbToTypes } from "../../data/datatypes";
22
import { jsonToMermaid } from "./mermaid";
3+
import { databases } from "../../data/databases";
34

45
export function jsonToDocumentation(obj) {
56

@@ -44,16 +45,13 @@ export function jsonToDocumentation(obj) {
4445
.map((r) => {
4546
const startTable = obj.tables[r.startTableId].name;
4647
const endTable = obj.tables[r.endTableId].name;
47-
return `- **${startTable} to ${endTable}**: ${r.cardinality} ${r.comment ? "(" + r.comment + ")" : ""}\n`;
48+
return `- **${startTable} to ${endTable}**: ${r.cardinality}\n`;
4849
}).join("") : "";
4950

50-
console.log(obj.tables);
51-
console.log(obj.relationships);
52-
5351
return `# ${obj.title} documentation\n## Summary\n\n- [Introduction](#introduction)\n- [Database Type](#database-type)\n`+
5452
`- [Table Structure](#table-structure)\n${documentationSummary}\n- [Relationships](#relationships)\n- [Database Diagram](#database-Diagram)\n\n`+
5553
`## Introduction\n\n## Database type\n\n- **Database system:** `+
56-
`${obj.database.type}\n## Table structure\n\n${documentationEntities}`+
54+
`${databases[obj.database].name}\n## Table structure\n\n${documentationEntities}`+
5755
`\n\n## Relationships\n\n${documentationRelationships}\n\n`+
5856
`## Database Diagram\n\n\`\`\`${jsonToMermaid(obj)}\`\`\``;
5957
}

0 commit comments

Comments
 (0)