Skip to content

Commit 6876409

Browse files
authored
fix: Users table header displaying when no results (RocketChat#36883)
1 parent bf14a53 commit 6876409

3 files changed

Lines changed: 6 additions & 239 deletions

File tree

.changeset/two-planes-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': patch
3+
---
4+
5+
Fixes an issue where users table headers are being displayed when there's no results

apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ const UsersTable = ({
159159
return (
160160
<>
161161
<UsersTableFilters roleData={roleData} setUsersFilters={setUserFilters} />
162-
163162
{isLoading && (
164163
<GenericTable>
165164
<GenericTableHeader>{headers}</GenericTableHeader>
@@ -168,7 +167,6 @@ const UsersTable = ({
168167
</GenericTableBody>
169168
</GenericTable>
170169
)}
171-
172170
{isError && (
173171
<GenericNoResults icon='warning' title={t('Something_went_wrong')} buttonTitle={t('Reload_page')} buttonAction={onReload} />
174172
)}
@@ -184,7 +182,7 @@ const UsersTable = ({
184182
/>
185183
)}
186184

187-
{isSuccess && !!users && (
185+
{isSuccess && users.length > 0 && (
188186
<>
189187
<GenericTable>
190188
<GenericTableHeader>{headers}</GenericTableHeader>

apps/meteor/client/views/admin/users/UsersTable/__snapshots__/UsersTable.spec.tsx.snap

Lines changed: 0 additions & 236 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,242 +1528,6 @@ exports[`renders NoResults without crashing 1`] = `
15281528
</div>
15291529
</div>
15301530
</div>
1531-
<div
1532-
class="rcx-box rcx-box--full rcx-css-qcmk2x"
1533-
>
1534-
<div
1535-
class="rcx-box rcx-box--full rcx-css-pln26h rcx-css-1cb6i7s"
1536-
data-overlayscrollbars="host"
1537-
>
1538-
<div
1539-
class="os-size-observer"
1540-
>
1541-
<div
1542-
class="os-size-observer-listener"
1543-
/>
1544-
</div>
1545-
<div
1546-
class=""
1547-
data-overlayscrollbars-viewport="scrollbarHidden overflowXHidden overflowYHidden"
1548-
style="margin-right: 0px; margin-bottom: 0px; margin-left: 0px; top: 0px; left: 0px; width: calc(100% + 0px); padding: 0px 0px 0px 0px;"
1549-
tabindex="-1"
1550-
>
1551-
<div
1552-
class="rcx-box rcx-box--full rcx-table__wrapper"
1553-
>
1554-
<table
1555-
class="rcx-box rcx-box--full rcx-table--sticky rcx-table--fixed rcx-table"
1556-
>
1557-
<thead
1558-
class="rcx-box rcx-box--full rcx-table__head"
1559-
>
1560-
<tr
1561-
class="rcx-box rcx-box--full rcx-table__row"
1562-
>
1563-
<th
1564-
class="rcx-box rcx-box--full rcx-table__cell--clickable rcx-table__cell--header rcx-table__cell"
1565-
>
1566-
<div
1567-
class="rcx-box rcx-box--full rcx-css-127j9mz"
1568-
wrap="no-wrap"
1569-
>
1570-
Name
1571-
<svg
1572-
class="rcx-box rcx-box--full rcx-css-13s9wy"
1573-
fill="none"
1574-
viewBox="0 0 16 16"
1575-
xmlns="http://www.w3.org/2000/svg"
1576-
>
1577-
<path
1578-
d="M5.33337 5.99999L8.00004 3.33333L10.6667 5.99999"
1579-
stroke="#E4E7EA"
1580-
stroke-linecap="round"
1581-
stroke-linejoin="round"
1582-
stroke-width="1.33333"
1583-
/>
1584-
<path
1585-
d="M5.33337 10L8.00004 12.6667L10.6667 10"
1586-
stroke="#E4E7EA"
1587-
stroke-linecap="round"
1588-
stroke-linejoin="round"
1589-
stroke-width="1.33333"
1590-
/>
1591-
</svg>
1592-
</div>
1593-
</th>
1594-
<th
1595-
class="rcx-box rcx-box--full rcx-table__cell--clickable rcx-table__cell--header rcx-table__cell"
1596-
>
1597-
<div
1598-
class="rcx-box rcx-box--full rcx-css-127j9mz"
1599-
wrap="no-wrap"
1600-
>
1601-
Username
1602-
<svg
1603-
class="rcx-box rcx-box--full rcx-css-13s9wy"
1604-
fill="none"
1605-
viewBox="0 0 16 16"
1606-
xmlns="http://www.w3.org/2000/svg"
1607-
>
1608-
<path
1609-
d="M5.33337 5.99999L8.00004 3.33333L10.6667 5.99999"
1610-
stroke="#E4E7EA"
1611-
stroke-linecap="round"
1612-
stroke-linejoin="round"
1613-
stroke-width="1.33333"
1614-
/>
1615-
<path
1616-
d="M5.33337 10L8.00004 12.6667L10.6667 10"
1617-
stroke="#E4E7EA"
1618-
stroke-linecap="round"
1619-
stroke-linejoin="round"
1620-
stroke-width="1.33333"
1621-
/>
1622-
</svg>
1623-
</div>
1624-
</th>
1625-
<th
1626-
class="rcx-box rcx-box--full rcx-table__cell--header rcx-table__cell rcx-css-1nngkbl"
1627-
>
1628-
<div
1629-
class="rcx-box rcx-box--full rcx-css-127j9mz"
1630-
wrap="no-wrap"
1631-
>
1632-
Actions
1633-
</div>
1634-
</th>
1635-
</tr>
1636-
</thead>
1637-
<tbody
1638-
class="rcx-box rcx-box--full rcx-table__body"
1639-
/>
1640-
</table>
1641-
</div>
1642-
</div>
1643-
<div
1644-
class="os-scrollbar os-scrollbar-horizontal os-theme-dark os-scrollbar-auto-hide os-scrollbar-auto-hide-hidden os-scrollbar-handle-interactive os-scrollbar-cornerless os-scrollbar-unusable"
1645-
style="--os-scroll-percent: 0; --os-viewport-percent: 0; --os-scroll-direction: 0;"
1646-
>
1647-
<div
1648-
class="os-scrollbar-track"
1649-
>
1650-
<div
1651-
class="os-scrollbar-handle"
1652-
/>
1653-
</div>
1654-
</div>
1655-
<div
1656-
class="os-scrollbar os-scrollbar-vertical os-theme-dark os-scrollbar-auto-hide os-scrollbar-auto-hide-hidden os-scrollbar-handle-interactive os-scrollbar-cornerless os-scrollbar-unusable"
1657-
style="--os-scroll-percent: 0; --os-viewport-percent: 0; --os-scroll-direction: 0;"
1658-
>
1659-
<div
1660-
class="os-scrollbar-track"
1661-
>
1662-
<div
1663-
class="os-scrollbar-handle"
1664-
/>
1665-
</div>
1666-
</div>
1667-
</div>
1668-
</div>
1669-
<nav
1670-
class="rcx-box rcx-box--full rcx-pagination--divider rcx-pagination"
1671-
>
1672-
<div
1673-
class="rcx-box rcx-box--full rcx-pagination__left"
1674-
>
1675-
<span
1676-
class="rcx-box rcx-box--full rcx-pagination__label"
1677-
>
1678-
Items per page:
1679-
</span>
1680-
<ol
1681-
class="rcx-box rcx-box--full rcx-pagination__list"
1682-
>
1683-
<li
1684-
class="rcx-box rcx-box--full rcx-pagination__list-item"
1685-
>
1686-
<button
1687-
class="rcx-box rcx-box--full rcx-pagination__link"
1688-
disabled=""
1689-
tabindex="-1"
1690-
>
1691-
25
1692-
</button>
1693-
</li>
1694-
<li
1695-
class="rcx-box rcx-box--full rcx-pagination__list-item"
1696-
>
1697-
<button
1698-
class="rcx-box rcx-box--full rcx-pagination__link"
1699-
tabindex="0"
1700-
>
1701-
50
1702-
</button>
1703-
</li>
1704-
<li
1705-
class="rcx-box rcx-box--full rcx-pagination__list-item"
1706-
>
1707-
<button
1708-
class="rcx-box rcx-box--full rcx-pagination__link"
1709-
tabindex="0"
1710-
>
1711-
100
1712-
</button>
1713-
</li>
1714-
</ol>
1715-
</div>
1716-
<div
1717-
class="rcx-box rcx-box--full rcx-pagination__right"
1718-
>
1719-
<span
1720-
class="rcx-box rcx-box--full rcx-pagination__label"
1721-
>
1722-
Showing results 1 - 0 of 0
1723-
</span>
1724-
<ol
1725-
class="rcx-box rcx-box--full rcx-pagination__list"
1726-
>
1727-
<li
1728-
class="rcx-box rcx-box--full rcx-pagination__list-item"
1729-
>
1730-
<button
1731-
class="rcx-box rcx-box--full rcx-pagination__back"
1732-
disabled=""
1733-
>
1734-
<span
1735-
class="rcx-box rcx-box--full rcx-chevron--left rcx-chevron"
1736-
>
1737-
<i
1738-
aria-hidden="true"
1739-
class="rcx-box rcx-box--full rcx-icon--name-chevron-down rcx-icon rcx-css-1g87xs3"
1740-
>
1741-
1742-
</i>
1743-
</span>
1744-
</button>
1745-
</li>
1746-
<li
1747-
class="rcx-box rcx-box--full rcx-pagination__list-item"
1748-
>
1749-
<button
1750-
class="rcx-box rcx-box--full rcx-pagination__forward"
1751-
>
1752-
<span
1753-
class="rcx-box rcx-box--full rcx-chevron--right rcx-chevron"
1754-
>
1755-
<i
1756-
aria-hidden="true"
1757-
class="rcx-box rcx-box--full rcx-icon--name-chevron-down rcx-icon rcx-css-1g87xs3"
1758-
>
1759-
1760-
</i>
1761-
</span>
1762-
</button>
1763-
</li>
1764-
</ol>
1765-
</div>
1766-
</nav>
17671531
</div>
17681532
</body>
17691533
`;

0 commit comments

Comments
 (0)