Skip to content

Commit

Permalink
fix: TableInfo always showing "Tree" as item names
Browse files Browse the repository at this point in the history
  • Loading branch information
lfjnascimento committed Sep 12, 2024
1 parent d73399a commit 7c321fc
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions dashboard/src/components/Table/BootsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const BootsTable = ({
const tableInfoElement = (
<div className="flex flex-col items-end">
<TableInfo
itemName="global.boots"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={data_len}
Expand Down
6 changes: 5 additions & 1 deletion dashboard/src/components/Table/TableInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import {
} from 'react-icons/md';
import { FormattedMessage } from 'react-intl';

import { MessagesKey } from '@/locales/messages';

import { Button } from '../ui/button';

interface ITableInformation {
itemName: MessagesKey;
startIndex: number;
endIndex: number;
totalTrees: number;
Expand All @@ -17,6 +20,7 @@ interface ITableInformation {
}

export const TableInfo = ({
itemName,
startIndex,
endIndex,
totalTrees,
Expand All @@ -35,7 +39,7 @@ export const TableInfo = ({
</span>
<FormattedMessage id="table.of" />
<span className="font-bold">{totalTrees}</span>
<FormattedMessage id="table.tree" />
<FormattedMessage id={itemName} />
</div>
<div className={groupsClassName}>
<FormattedMessage id="table.itemsPerPage" />
Expand Down
1 change: 1 addition & 0 deletions dashboard/src/components/Table/TestsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const TestsTable = ({ treeId }: ITestsTable): JSX.Element => {
const tableInfoElement = (
<div className="flex flex-col items-end">
<TableInfo
itemName="global.tests"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={data_len}
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/components/TreeListingPage/TreeListingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const TreeListingPage = ({ inputFilter }: ITreeListingPage): JSX.Element => {
</span>
<div className="flex items-end gap-4">
<TableInfo
itemName="global.tree"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={listItems.length}
Expand All @@ -123,6 +124,7 @@ const TreeListingPage = ({ inputFilter }: ITreeListingPage): JSX.Element => {
<TreeTable treeTableRows={listItems.slice(startIndex, endIndex)} />
<div className="flex flex-col items-end">
<TableInfo
itemName="global.tree"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={listItems.length}
Expand Down
3 changes: 3 additions & 0 deletions dashboard/src/locales/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export const messages = {
'filter.treeURL': 'Tree URL',
'global.all': 'All',
'global.architecture': 'Architecture',
'global.boots': 'Boots',
'global.branch': 'Branch',
'global.build': 'Builds',
'global.cancel': 'Cancel',
'global.cleanAll': 'Clean all',
'global.command': 'Command',
Expand Down Expand Up @@ -126,6 +128,7 @@ export const messages = {
'global.success': 'Success',
'global.successful': 'Successful',
'global.summary': 'Summary',
'global.tests': 'Tests',
'global.timing': 'Timing',
'global.total': 'Total',
'global.tree': 'Tree',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const BuildDetailsTestSection = ({
const tableInfoElement = (
<div className="flex flex-col items-end">
<TableInfo
itemName="global.tests"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={data_len}
Expand Down
2 changes: 2 additions & 0 deletions dashboard/src/pages/TreeDetails/Tabs/Build/BuildTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ const BuildTab = ({ treeDetailsData }: BuildTab): JSX.Element => {
]}
/>
<TableInfo
itemName="global.build"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={filteredContent?.length ?? 0}
Expand All @@ -311,6 +312,7 @@ const BuildTab = ({ treeDetailsData }: BuildTab): JSX.Element => {
/>
<div className="flex justify-end">
<TableInfo
itemName="global.build"
startIndex={startIndex + 1}
endIndex={endIndex}
totalTrees={filteredContent?.length ?? 0}
Expand Down

0 comments on commit 7c321fc

Please sign in to comment.