Skip to content

Commit

Permalink
Update entity counts page
Browse files Browse the repository at this point in the history
  • Loading branch information
markquintontulloch committed Nov 14, 2024
1 parent 5a019cc commit 81d693b
Show file tree
Hide file tree
Showing 3 changed files with 314 additions and 80 deletions.
29 changes: 23 additions & 6 deletions src/main/cliapp/src/components/EntityCountsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const EntityCountsComponent = () => {
_tableData[type].push({
name: CLASSES[key].name,
link: CLASSES[key].link,
type: CLASSES[key].type,
isIndexed: CLASSES[key].isIndexed,
dbCount: res.entity[key]['dbCount'],
esCount: res.entity[key]['esCount'],
});
Expand All @@ -45,10 +47,9 @@ export const EntityCountsComponent = () => {
return <a href={rowData.link}>{rowData.name}</a>;
};

const ROW_HIGHLIGHT_IGNORE = ['Disease Annotations', 'Literature References', 'Bulk Loads / Failed Loads'];

const getRowClass = (rowData) => {
if (ROW_HIGHLIGHT_IGNORE.includes(rowData.name)) return;
console.log(rowData);
if (!rowData.isIndexed) return;

if (rowData?.dbCount !== rowData.esCount) {
return 'bg-gray-500 text-white';
Expand All @@ -58,7 +59,7 @@ export const EntityCountsComponent = () => {
return (
<>
<div className="grid nested dashboard">
<div className="col-4">
<div className="col-3">
<DataTable
header="Entities"
value={tableData.entity}
Expand All @@ -79,7 +80,7 @@ export const EntityCountsComponent = () => {
/>
</DataTable>
</div>
<div className="col-4">
<div className="col-3">
<DataTable
header="Ontologies"
value={tableData.ontology}
Expand All @@ -100,7 +101,23 @@ export const EntityCountsComponent = () => {
/>
</DataTable>
</div>
<div className="col-4">
<div className="col-3">
<DataTable
header="Associations"
value={tableData.association}
sortField="name"
sortOrder={1}
rowClassName={(rowData) => getRowClass(rowData)}
>
<Column field="name" header="Association Type" body={nameHyperlinkTemplate} />
<Column
field="dbCount"
header="Database Term Count"
body={(rowData) => <NumberTemplate number={rowData.dbCount} />}
/>
</DataTable>
</div>
<div className="col-3">
<DataTable
header="System"
value={tableData.system}
Expand Down
Loading

0 comments on commit 81d693b

Please sign in to comment.