Skip to content

Commit

Permalink
feat(#20): refactor and fix small things in tree table
Browse files Browse the repository at this point in the history
- disable back/forward button when there is no more data to show
- separate the filter button in a const
- fix end index that is show

closes #20
  • Loading branch information
mari1912 committed Jul 4, 2024
1 parent 7073106 commit 07408b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions dashboard/src/components/Table/TreeTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useMemo } from "react";

import { FormattedMessage } from "react-intl";

import { TableRow, TableCell } from "../ui/table";

import { TreeTableBody } from "../../types/tree/Tree";
Expand All @@ -19,13 +21,18 @@ const treeTableColumnsLabelId = [
];

const TreeTableRow = (row: TreeTableBody): JSX.Element => {
const backgroundClassName = "flex flex-row bg-lightGray w-fit h-fit p-1 rounded-lg";
return (
<TableRow>
<TableCell>{row.name}</TableCell>
<TableCell>{row.branch}</TableCell>
<TableCell>{row.commit}</TableCell>
<TableCell><div className="bg-lightGray w-fit h-fit p-1 rounded-lg">{row.buildStatus}</div></TableCell>
<TableCell><div className="bg-lightGray w-fit h-fit p-1 rounded-lg">{row.testStatus}</div></TableCell>
<TableCell><div className={backgroundClassName}>{row.buildStatus}</div></TableCell>
<TableCell>
<div className={backgroundClassName}>
<FormattedMessage id="treeTable.finished" />
<div className="pl-1">{row.testStatus}</div>
</div></TableCell>
</TableRow>
);
};
Expand Down
3 changes: 2 additions & 1 deletion dashboard/src/locales/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ export const messages = {
},
treeTable: {
branch: "Branch",
build: "Build Status",
build: "Build Status (valid / invalid)",
commit: "Commit/tag",
finished: "Finished",
test: "Test Status",
tree: "Tree",
},
Expand Down

0 comments on commit 07408b5

Please sign in to comment.