Skip to content

Commit

Permalink
Display added tables
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Mar 30, 2024
1 parent f7517a7 commit aadf869
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ui/src/components/PhysDbView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ import {
sortTablesToHoist,
} from "../highlight";

function addedTables(tables, nextEngine) {
if (nextEngine == null) return [];
const added = [];
const currTableSet = new Set();
for (const currTable of tables) {
currTableSet.add(currTable.name);
}
for (const table of nextEngine.tables) {
if (currTableSet.has(table.name)) continue;
added.push(table);
}
return added;
}

function PhysDbView({
name,
provisioning,
Expand All @@ -18,6 +32,7 @@ function PhysDbView({
}) {
const physDbName = name;
const sortedTables = sortTablesToHoist(highlight, physDbName, false, tables);
const addedTablesList = addedTables(tables, nextEngine);

return (
<div
Expand Down Expand Up @@ -50,6 +65,17 @@ function PhysDbView({
onTableHoverExit={onTableHoverExit}
/>
))}
{addedTablesList.map(({ name, is_writer }) => (
<TableView
key={name}
name={name}
isWriter={is_writer}
color="blue"
highlightClass="dim"
onTableHoverEnter={() => {}}
onTableHoverExit={() => {}}
/>
))}
</div>
</div>
);
Expand Down

0 comments on commit aadf869

Please sign in to comment.