fix the PR comments
This commit is contained in:
parent
4aef6c6e25
commit
ee3a50912a
@ -1062,29 +1062,24 @@ export default function ControlPanel({
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
function: () => {},
|
Readme: () => {
|
||||||
},
|
setModal(MODAL.CODE);
|
||||||
documentation: {
|
const result = jsonToDocumentation({
|
||||||
children: [
|
tables: tables,
|
||||||
{
|
relationships: relationships,
|
||||||
Markdown: () => {
|
notes: notes,
|
||||||
setModal(MODAL.CODE);
|
subjectAreas: areas,
|
||||||
const result = jsonToDocumentation({
|
database: database,
|
||||||
tables: tables,
|
title: title,
|
||||||
relationships: relationships,
|
});
|
||||||
notes: notes,
|
setExportData((prev) => ({
|
||||||
subjectAreas: areas,
|
...prev,
|
||||||
database: database,
|
data: result,
|
||||||
title: title,
|
extension: "md",
|
||||||
});
|
}));
|
||||||
setExportData((prev) => ({
|
|
||||||
...prev,
|
|
||||||
data: result,
|
|
||||||
extension: "md",
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
],
|
],
|
||||||
function: () => {},
|
function: () => {},
|
||||||
},
|
},
|
||||||
|
@ -236,7 +236,6 @@ const en = {
|
|||||||
empty_index_name: "Declared an index with no name in table '{{tableName}}'",
|
empty_index_name: "Declared an index with no name in table '{{tableName}}'",
|
||||||
didnt_find_diagram: "Oops! Didn't find the diagram.",
|
didnt_find_diagram: "Oops! Didn't find the diagram.",
|
||||||
unsigned: "Unsigned",
|
unsigned: "Unsigned",
|
||||||
documentation: "Documentation",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -212,7 +212,6 @@ const es = {
|
|||||||
edit_relationship: "{{extra}} Editar relación {{refName}}",
|
edit_relationship: "{{extra}} Editar relación {{refName}}",
|
||||||
delete_relationship: "Eliminar relación {{refName}}",
|
delete_relationship: "Eliminar relación {{refName}}",
|
||||||
not_found: "No encontrado",
|
not_found: "No encontrado",
|
||||||
documentation: "Documentación",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -217,7 +217,6 @@ const fr = {
|
|||||||
edit_relationship: "{{extra}} Modifier la relation {{refName}}",
|
edit_relationship: "{{extra}} Modifier la relation {{refName}}",
|
||||||
delete_relationship: "Supprimer la relation {{refName}}",
|
delete_relationship: "Supprimer la relation {{refName}}",
|
||||||
not_found: "Non trouvé",
|
not_found: "Non trouvé",
|
||||||
documentation: "Documentation",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { dbToTypes } from "../../data/datatypes";
|
import { dbToTypes } from "../../data/datatypes";
|
||||||
import { jsonToMermaid } from "./mermaid";
|
import { jsonToMermaid } from "./mermaid";
|
||||||
|
import { databases } from "../../data/databases";
|
||||||
|
|
||||||
export function jsonToDocumentation(obj) {
|
export function jsonToDocumentation(obj) {
|
||||||
|
|
||||||
@ -44,16 +45,13 @@ export function jsonToDocumentation(obj) {
|
|||||||
.map((r) => {
|
.map((r) => {
|
||||||
const startTable = obj.tables[r.startTableId].name;
|
const startTable = obj.tables[r.startTableId].name;
|
||||||
const endTable = obj.tables[r.endTableId].name;
|
const endTable = obj.tables[r.endTableId].name;
|
||||||
return `- **${startTable} to ${endTable}**: ${r.cardinality} ${r.comment ? "(" + r.comment + ")" : ""}\n`;
|
return `- **${startTable} to ${endTable}**: ${r.cardinality}\n`;
|
||||||
}).join("") : "";
|
}).join("") : "";
|
||||||
|
|
||||||
console.log(obj.tables);
|
|
||||||
console.log(obj.relationships);
|
|
||||||
|
|
||||||
return `# ${obj.title} documentation\n## Summary\n\n- [Introduction](#introduction)\n- [Database Type](#database-type)\n`+
|
return `# ${obj.title} documentation\n## Summary\n\n- [Introduction](#introduction)\n- [Database Type](#database-type)\n`+
|
||||||
`- [Table Structure](#table-structure)\n${documentationSummary}\n- [Relationships](#relationships)\n- [Database Diagram](#database-Diagram)\n\n`+
|
`- [Table Structure](#table-structure)\n${documentationSummary}\n- [Relationships](#relationships)\n- [Database Diagram](#database-Diagram)\n\n`+
|
||||||
`## Introduction\n\n## Database type\n\n- **Database system:** `+
|
`## Introduction\n\n## Database type\n\n- **Database system:** `+
|
||||||
`${obj.database.type}\n## Table structure\n\n${documentationEntities}`+
|
`${databases[obj.database].name}\n## Table structure\n\n${documentationEntities}`+
|
||||||
`\n\n## Relationships\n\n${documentationRelationships}\n\n`+
|
`\n\n## Relationships\n\n${documentationRelationships}\n\n`+
|
||||||
`## Database Diagram\n\n\`\`\`${jsonToMermaid(obj)}\`\`\``;
|
`## Database Diagram\n\n\`\`\`${jsonToMermaid(obj)}\`\`\``;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user