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

Leave Table headers don't render when too many rows from API #29

Open
lylehenderson opened this issue Oct 16, 2023 · 5 comments
Open

Leave Table headers don't render when too many rows from API #29

lylehenderson opened this issue Oct 16, 2023 · 5 comments

Comments

@lylehenderson
Copy link
Contributor

lylehenderson commented Oct 16, 2023

They are defined:
Leave Balances

<TableHead>
                                        <TableRow className={classes.leaveTableRow}>
                                            <TableCell align="left" padding={'none'}><Typography variant={'body3'} component={'div'}>{intl.formatMessage({id: 'LeaveBalance.type'})}</Typography></TableCell>
                                            <TableCell align="left" padding={'none'}>{intl.formatMessage({id: 'LeaveBalance.taken'})}</TableCell>
                                            <TableCell align="left" padding={'none'}>{intl.formatMessage({id: 'LeaveBalance.accrued'})}</TableCell>
                                            <TableCell align="right" padding={'none'} style={{"textAlign": "right"}}>{intl.formatMessage({id: 'LeaveBalance.balance'})}</TableCell>
                                        </TableRow>
                                    </TableHead>

but never render.

Account Balances Header isn't even defined.

@ellucianBret
Copy link
Member

@lylehenderson I am not following. The TableHead does render the text for the column headers.

Screenshot 2023-10-16 at 2 57 04 PM

Account Balances doesn't use a table header.

Bret

@ellucianBret
Copy link
Member

Maybe because you don't have data? Line 176 only renders the table is there is data.

I bet this is the case. It looks like it renders nothing if the data is returned with no transactions. It needs an empty view.

Bret

@lylehenderson
Copy link
Contributor Author

lylehenderson commented Oct 16, 2023 via email

@lylehenderson
Copy link
Contributor Author

lylehenderson commented Oct 16, 2023 via email

@lylehenderson lylehenderson changed the title Account Details and Leave Table headers don't render Leave Table headers don't render when too many rows from API Oct 16, 2023
@lylehenderson
Copy link
Contributor Author

Hmm none of my screenshots make it to these comments.
I did update the issue title to match the defect found.

I resolved this by:
if (data && Array.isArray(data)) { const leaves = data.filter(leaves => { return leaves.totalBalance !== '0' });
Removed any zero balance records from the Card preview. Not sure that is the best course of action, but it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants