Skip to content

Commit

Permalink
Fix [Consumer groups] Table is empty although BE response is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mariana-furyk committed Jan 3, 2024
1 parent a755cf1 commit fb9ebab
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 83 deletions.
21 changes: 20 additions & 1 deletion src/components/ConsumerGroup/ConsumerGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ import PageHeader from '../../elements/PageHeader/PageHeader'
import Search from '../../common/Search/Search'
import Table from '../Table/Table'
import { RoundedIcon } from 'igz-controls/components'
import ConsumerGroupShardLagTableRow from '../../elements/ConsumerGroupShardLagTableRow/ConsumerGroupShardLagTableRow'

import nuclioActions from '../../actions/nuclio'
import { generatePageData } from './consumerGroup.util.js'
import { getNoDataMessage } from '../../utils/getNoDataMessage'
import { showErrorNotification } from '../../utils/notifications.util'
import createConsumerGroupContent from '../../utils/createConsumerGroupContent'

import { ReactComponent as RefreshIcon } from 'igz-controls/images/refresh.svg'

Expand Down Expand Up @@ -105,6 +107,11 @@ const ConsumerGroup = ({

const pageData = useMemo(() => generatePageData(), [])

const tableContent = useMemo(
() => createConsumerGroupContent(filteredV3ioStreamShardLags),
[filteredV3ioStreamShardLags]
)

return (
<>
{!isEmpty(currentV3ioStream) && (
Expand All @@ -129,7 +136,19 @@ const ConsumerGroup = ({
<RefreshIcon />
</RoundedIcon>
</div>
<Table actionsMenu={[]} content={filteredV3ioStreamShardLags} pageData={pageData} />
<Table
actionsMenu={[]}
content={filteredV3ioStreamShardLags}
hideActionsMenu
pageData={pageData}
tableHeaders={pageData.tableHeaders}
>
{tableContent.map((rowItem, index) => {
return (
<ConsumerGroupShardLagTableRow key={index} content={tableContent} rowItem={rowItem} />
)
})}
</Table>
{!nuclioStore.v3ioStreams.loading &&
!nuclioStore.v3ioStreamShardLags.loading &&
nuclioStore.v3ioStreamShardLags.parsedData.length === 0 && (
Expand Down
19 changes: 18 additions & 1 deletion src/components/ConsumerGroups/ConsumerGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import NoData from '../../common/NoData/NoData'
import PageHeader from '../../elements/PageHeader/PageHeader'
import Search from '../../common/Search/Search'
import Table from '../Table/Table'
import ConsumerGroupTableRow from '../../elements/ConsumerGroupTableRow/ConsumerGroupTableRow'

import createConsumerGroupsContent from '../../utils/createConsumerGroupsContent'
import { GROUP_BY_NONE } from '../../constants'
import { generatePageData } from './consumerGroups.util.js'
import { setFilters } from '../../reducers/filtersReducer'
Expand All @@ -52,6 +54,11 @@ const ConsumerGroups = () => {

const pageData = useMemo(() => generatePageData(), [])

const tableContent = useMemo(
() => createConsumerGroupsContent(filteredV3ioStreams, params),
[filteredV3ioStreams, params]
)

return (
<>
<PageHeader
Expand All @@ -67,7 +74,17 @@ const ConsumerGroups = () => {
value={filterByName}
/>
</div>
<Table actionsMenu={[]} content={filteredV3ioStreams} pageData={pageData} />
<Table
actionsMenu={[]}
content={filteredV3ioStreams}
hideActionsMenu
pageData={pageData}
tableHeaders={pageData.tableHeaders}
>
{tableContent.map((rowItem, index) => {
return <ConsumerGroupTableRow key={index} content={tableContent} rowItem={rowItem} />
})}
</Table>
{!nuclioStore.v3ioStreams.loading && nuclioStore.v3ioStreams.parsedData.length === 0 && (
<NoData message="You haven’t created any consumer group yet" />
)}
Expand Down
81 changes: 0 additions & 81 deletions src/utils/generateTableContent.js

This file was deleted.

0 comments on commit fb9ebab

Please sign in to comment.