Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TableInfo always showing "Tree" as item names #285

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading