Skip to content

Commit 4018b30

Browse files
committed
FE: Set width for columns, fix header background color
1 parent 1e41747 commit 4018b30

File tree

8 files changed

+38
-34
lines changed

8 files changed

+38
-34
lines changed

frontend/src/components/ConsumerGroups/List.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { useConsumerGroups } from 'lib/hooks/api/consumers';
1717
import Tooltip from 'components/common/Tooltip/Tooltip';
1818
import ResourcePageHeading from 'components/common/ResourcePageHeading/ResourcePageHeading';
1919

20-
const COLUMN_SIZE = 160;
2120
const List = () => {
2221
const { clusterName } = useAppParams<ClusterNameRoute>();
2322
const [searchParams] = useSearchParams();
@@ -53,13 +52,13 @@ const List = () => {
5352
id: ConsumerGroupOrdering.MEMBERS,
5453
header: 'Num Of Members',
5554
accessorKey: 'members',
56-
size: COLUMN_SIZE,
55+
size: 140,
5756
},
5857
{
5958
id: ConsumerGroupOrdering.TOPIC_NUM,
6059
header: 'Num Of Topics',
6160
accessorKey: 'topics',
62-
size: COLUMN_SIZE,
61+
size: 140,
6362
},
6463
{
6564
id: ConsumerGroupOrdering.MESSAGES_BEHIND,
@@ -68,13 +67,13 @@ const List = () => {
6867
cell: (args) => {
6968
return args.getValue() ?? 'N/A';
7069
},
71-
size: COLUMN_SIZE,
70+
size: 124,
7271
},
7372
{
7473
header: 'Coordinator',
7574
accessorKey: 'coordinator.id',
7675
enableSorting: false,
77-
size: COLUMN_SIZE,
76+
size: 104,
7877
},
7978
{
8079
id: ConsumerGroupOrdering.STATE,
@@ -91,7 +90,7 @@ const List = () => {
9190
/>
9291
);
9392
},
94-
size: COLUMN_SIZE,
93+
size: 124,
9594
},
9695
],
9796
[]

frontend/src/components/Dashboard/Dashboard.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import * as S from './Dashboard.styled';
1717
import ClusterName from './ClusterName';
1818
import ClusterTableActionsCell from './ClusterTableActionsCell';
1919

20-
const COLUMN_SIZE = 100;
2120
const Dashboard: React.FC = () => {
2221
const { data } = useGetUserInfo();
2322
const clusters = useClusters();
@@ -39,29 +38,29 @@ const Dashboard: React.FC = () => {
3938
const columns = React.useMemo<ColumnDef<Cluster>[]>(() => {
4039
const initialColumns: ColumnDef<Cluster>[] = [
4140
{ header: 'Cluster name', accessorKey: 'name', cell: ClusterName },
42-
{ header: 'Version', accessorKey: 'version', size: COLUMN_SIZE },
41+
{ header: 'Version', accessorKey: 'version', size: 100 },
4342
{
4443
header: 'Brokers count',
4544
accessorKey: 'brokerCount',
46-
size: COLUMN_SIZE,
45+
size: 120,
4746
},
4847
{
4948
header: 'Partitions',
5049
accessorKey: 'onlinePartitionCount',
51-
size: COLUMN_SIZE,
50+
size: 100,
5251
},
53-
{ header: 'Topics', accessorKey: 'topicCount', size: COLUMN_SIZE },
52+
{ header: 'Topics', accessorKey: 'topicCount', size: 80 },
5453
{
5554
header: 'Production',
5655
accessorKey: 'bytesInPerSec',
5756
cell: SizeCell,
58-
size: COLUMN_SIZE,
57+
size: 100,
5958
},
6059
{
6160
header: 'Consumption',
6261
accessorKey: 'bytesOutPerSec',
6362
cell: SizeCell,
64-
size: COLUMN_SIZE,
63+
size: 116,
6564
},
6665
];
6766

@@ -70,7 +69,7 @@ const Dashboard: React.FC = () => {
7069
header: '',
7170
id: 'actions',
7271
cell: ClusterTableActionsCell,
73-
size: COLUMN_SIZE + 40,
72+
size: 140,
7473
});
7574
}
7675

frontend/src/components/NavBar/NavBar.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Navbar = styled.nav(
1515
left: 0;
1616
right: 0;
1717
z-index: 30;
18-
background-color: ${theme.menu.primary.backgroundColor.normal};
18+
background-color: ${theme.menu.header.backgroundColor};
1919
min-height: 3.25rem;
2020
`
2121
);

frontend/src/components/Schemas/List/List.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import ResourcePageHeading from 'components/common/ResourcePageHeading/ResourceP
2121

2222
import GlobalSchemaSelector from './GlobalSchemaSelector/GlobalSchemaSelector';
2323

24-
const COLUMN_SIZE = 160;
2524
const List: React.FC = () => {
2625
const { isReadOnly } = React.useContext(ClusterContext);
2726
const { clusterName } = useAppParams<ClusterNameRoute>();
@@ -52,13 +51,13 @@ const List: React.FC = () => {
5251
/>
5352
),
5453
},
55-
{ header: 'Id', accessorKey: 'id', size: COLUMN_SIZE },
56-
{ header: 'Type', accessorKey: 'schemaType', size: COLUMN_SIZE },
57-
{ header: 'Version', accessorKey: 'version', size: COLUMN_SIZE },
54+
{ header: 'Id', accessorKey: 'id', size: 120 },
55+
{ header: 'Type', accessorKey: 'schemaType', size: 120 },
56+
{ header: 'Version', accessorKey: 'version', size: 120 },
5857
{
5958
header: 'Compatibility',
6059
accessorKey: 'compatibilityLevel',
61-
size: COLUMN_SIZE,
60+
size: 160,
6261
},
6362
],
6463
[]

frontend/src/components/Topics/List/TopicTable.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { TopicTitleCell } from './TopicTitleCell';
1313
import ActionsCell from './ActionsCell';
1414
import BatchActionsbar from './BatchActionsBar';
1515

16-
const COLUMN_SIZE = 100;
1716
const TopicTable: React.FC = () => {
1817
const { clusterName } = useAppParams<{ clusterName: ClusterName }>();
1918
const [searchParams] = useSearchParams();
@@ -45,13 +44,13 @@ const TopicTable: React.FC = () => {
4544
id: TopicColumnsToSort.TOTAL_PARTITIONS,
4645
header: 'Partitions',
4746
accessorKey: 'partitionCount',
48-
size: COLUMN_SIZE,
47+
size: 100,
4948
},
5049
{
5150
id: TopicColumnsToSort.OUT_OF_SYNC_REPLICAS,
5251
header: 'Out of sync replicas',
5352
accessorKey: 'partitions',
54-
size: COLUMN_SIZE,
53+
size: 154,
5554
cell: ({ getValue }) => {
5655
const partitions = getValue<Topic['partitions']>();
5756
if (partitions === undefined || partitions.length === 0) {
@@ -67,13 +66,13 @@ const TopicTable: React.FC = () => {
6766
header: 'Replication Factor',
6867
accessorKey: 'replicationFactor',
6968
enableSorting: false,
70-
size: COLUMN_SIZE,
69+
size: 148,
7170
},
7271
{
7372
header: 'Number of messages',
7473
accessorKey: 'partitions',
7574
enableSorting: false,
76-
size: COLUMN_SIZE,
75+
size: 146,
7776
cell: ({ getValue }) => {
7877
const partitions = getValue<Topic['partitions']>();
7978
if (partitions === undefined || partitions.length === 0) {
@@ -88,7 +87,7 @@ const TopicTable: React.FC = () => {
8887
id: TopicColumnsToSort.SIZE,
8988
header: 'Size',
9089
accessorKey: 'segmentSize',
91-
size: COLUMN_SIZE,
90+
size: 100,
9291
cell: SizeCell,
9392
},
9493
{
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import React from 'react';
22
import { CellContext } from '@tanstack/react-table';
33

4-
import * as S from './Table.styled';
5-
64
const BreakableTextCell = <T,>({ getValue }: CellContext<T, unknown>) => {
7-
return <S.BreakableText>{getValue<string>()}</S.BreakableText>;
5+
return (
6+
<div
7+
style={{
8+
wordBreak: 'break-word',
9+
whiteSpace: 'pre-wrap',
10+
}}
11+
>
12+
{getValue<string>()}
13+
</div>
14+
);
815
};
916

1017
export default BreakableTextCell;

frontend/src/components/common/NewTable/Table.styled.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,3 @@ export const TableWrapper = styled.div<{ $disabled: boolean }>(
235235
`}
236236
`
237237
);
238-
239-
export const BreakableText = styled.div`
240-
word-break: 'break-word';
241-
white-space: 'pre-wrap';
242-
`;

frontend/src/theme/theme.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ export const theme = {
566566
},
567567
},
568568
menu: {
569+
header: {
570+
backgroundColor: Colors.brand[0],
571+
},
569572
primary: {
570573
backgroundColor: {
571574
normal: 'transparent',
@@ -1098,6 +1101,9 @@ export const darkTheme: ThemeType = {
10981101
},
10991102
},
11001103
menu: {
1104+
header: {
1105+
backgroundColor: Colors.brand[90],
1106+
},
11011107
primary: {
11021108
backgroundColor: {
11031109
normal: 'transparent',

0 commit comments

Comments
 (0)