|
17 | 17 | import React, { useContext, useEffect, useState } from 'react' |
18 | 18 | import { Column } from '../table/ArtemisTable'; |
19 | 19 | import { artemisService } from '../artemis-service'; |
20 | | -import { Toolbar, ToolbarContent, ToolbarItem, Text, SearchInput, Button, PaginationVariant, Pagination, DataList, DataListCell, DataListCheck, DataListItem, DataListItemCells, DataListItemRow, Modal, TextContent, Icon, ModalVariant } from '@patternfly/react-core'; |
| 20 | +import { Toolbar, ToolbarContent, ToolbarItem, Text, SearchInput, Button, PaginationVariant, Pagination, DataList, DataListCell, DataListCheck, DataListItem, DataListItemCells, DataListItemRow, Modal, TextContent, Icon, ModalVariant, PageSection } from '@patternfly/react-core'; |
21 | 21 | import { Thead, Tr, Th, Tbody, Td, ActionsColumn, IAction, Table } from '@patternfly/react-table'; |
22 | 22 | import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon'; |
23 | 23 | import { createQueueObjectName } from '../util/jmx'; |
@@ -341,55 +341,57 @@ export const MessagesTable: React.FunctionComponent<MessageProps> = props => { |
341 | 341 | </ToolbarItem> |
342 | 342 | </ToolbarContent> |
343 | 343 | </Toolbar> |
344 | | - <Table id='message-table' variant="compact" aria-label="Column Management Table"> |
345 | | - <Thead> |
346 | | - <Tr > |
347 | | - <Th |
348 | | - select={{ |
349 | | - onSelect: (_event, isSelecting) => selectAllMessages(isSelecting), |
350 | | - isSelected: areAllMessagesSelected |
351 | | - }} |
352 | | - /> |
353 | | - {columns.map((column, id) => { |
354 | | - if (column.visible) { |
355 | | - return <Th key={id}>{column.name}</Th> |
356 | | - } else return '' |
357 | | - } |
358 | | - )} |
359 | | - </Tr> |
360 | | - </Thead> |
361 | | - <Tbody> |
362 | | - {rows.map((row, rowIndex) => ( |
363 | | - <Tr key={rowIndex}> |
364 | | - <> |
365 | | - <Td |
366 | | - select={{ |
367 | | - rowIndex, |
368 | | - onSelect: (_event, isSelecting) => onSelectMessage(Number(artemisService.getKeyByValue(row, "messageID")), rowIndex, isSelecting), |
369 | | - isSelected: isMessageSelected(Number(artemisService.getKeyByValue(row, "messageID"))) |
370 | | - }} |
371 | | - /> |
372 | | - {columns.map((column, id) => { |
373 | | - if (column.visible) { |
374 | | - const text = artemisService.getKeyByValue(row, column.id); |
375 | | - if (column.link) { |
376 | | - return <Td key={id}><Link to="" onClick={() => { if (column.link) { column.link(row) } }}>{text}</Link></Td> |
377 | | - } else { |
378 | | - return <Td key={id}>{text}</Td> |
379 | | - } |
380 | | - } else return '' |
381 | | - } |
382 | | - )} |
383 | | - <td> |
384 | | - <ActionsColumn |
385 | | - items={getRowActions(row, rowIndex)} |
386 | | - /> |
387 | | - </td> |
388 | | - </> |
| 344 | + <PageSection hasOverflowScroll frameBorder='false' aria-label='artemis-data-table' style={{ paddingTop: '0', paddingBottom: '0', paddingLeft: '0', paddingRight: '0' }} > |
| 345 | + <Table id='message-table' variant="compact" aria-label="Column Management Table"> |
| 346 | + <Thead> |
| 347 | + <Tr > |
| 348 | + <Th |
| 349 | + select={{ |
| 350 | + onSelect: (_event, isSelecting) => selectAllMessages(isSelecting), |
| 351 | + isSelected: areAllMessagesSelected |
| 352 | + }} |
| 353 | + /> |
| 354 | + {columns.map((column, id) => { |
| 355 | + if (column.visible) { |
| 356 | + return <Th key={id}>{column.name}</Th> |
| 357 | + } else return '' |
| 358 | + } |
| 359 | + )} |
389 | 360 | </Tr> |
390 | | - ))} |
391 | | - </Tbody> |
392 | | - </Table> |
| 361 | + </Thead> |
| 362 | + <Tbody> |
| 363 | + {rows.map((row, rowIndex) => ( |
| 364 | + <Tr key={rowIndex}> |
| 365 | + <> |
| 366 | + <Td |
| 367 | + select={{ |
| 368 | + rowIndex, |
| 369 | + onSelect: (_event, isSelecting) => onSelectMessage(Number(artemisService.getKeyByValue(row, "messageID")), rowIndex, isSelecting), |
| 370 | + isSelected: isMessageSelected(Number(artemisService.getKeyByValue(row, "messageID"))) |
| 371 | + }} |
| 372 | + /> |
| 373 | + {columns.map((column, id) => { |
| 374 | + if (column.visible) { |
| 375 | + const text = artemisService.getKeyByValue(row, column.id); |
| 376 | + if (column.link) { |
| 377 | + return <Td key={id}><Link to="" onClick={() => { if (column.link) { column.link(row) } }}>{text}</Link></Td> |
| 378 | + } else { |
| 379 | + return <Td key={id}>{text}</Td> |
| 380 | + } |
| 381 | + } else return '' |
| 382 | + } |
| 383 | + )} |
| 384 | + <Td isActionCell> |
| 385 | + <ActionsColumn |
| 386 | + items={getRowActions(row, rowIndex)} |
| 387 | + /> |
| 388 | + </Td> |
| 389 | + </> |
| 390 | + </Tr> |
| 391 | + ))} |
| 392 | + </Tbody> |
| 393 | + </Table> |
| 394 | + </PageSection> |
393 | 395 | <Pagination |
394 | 396 | itemCount={resultsSize} |
395 | 397 | page={page} |
|
0 commit comments