mirror of
https://github.com/fleetdm/fleet
synced 2026-05-04 22:08:41 +00:00
# 3 unreleased bug fixes: ## Resolves #34123 Footer when paginated: <img width="1519" height="1123" alt="Screenshot 2025-10-14 at 1 23 00 PM" src="https://github.com/user-attachments/assets/d69d27b4-44e4-4458-92be-e0dfaeab527f" /> No footer when only one page: <img width="1523" height="1007" alt="Screenshot 2025-10-14 at 1 20 45 PM" src="https://github.com/user-attachments/assets/2d8266bb-c872-4888-98b1-3af7147fd27f" /> ## Resolves #34169 Name + description are now truncated: <img width="1732" height="710" alt="Screenshot 2025-10-14 at 11 11 32 AM" src="https://github.com/user-attachments/assets/02a60892-e678-413e-a7d4-5c6d39980cd2" /> ## Resolves #34170 Labels page no longer re-renders unnecessarily - [x] QA'd all new/changed functionality manually - [x] Confirmed that the fix is not expected to adversely impact load test results
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import React, { memo } from "react";
|
|
|
|
import { ILabel } from "interfaces/label";
|
|
|
|
import { IUser } from "interfaces/user";
|
|
|
|
import TableContainer from "components/TableContainer";
|
|
import TableCount from "components/TableContainer/TableCount";
|
|
import EmptyTable from "components/EmptyTable";
|
|
|
|
import { generateDataSet, generateTableHeaders } from "./LabelsTableConfig";
|
|
|
|
const baseClass = "labels-table";
|
|
|
|
interface ILabelsTable {
|
|
labels: ILabel[];
|
|
onClickAction: (action: string, label: ILabel) => void;
|
|
currentUser: IUser;
|
|
}
|
|
|
|
const LabelsTable = ({ labels, onClickAction, currentUser }: ILabelsTable) => {
|
|
const tableHeaders = generateTableHeaders(currentUser, onClickAction);
|
|
|
|
const tableData = generateDataSet(labels);
|
|
|
|
return (
|
|
<TableContainer
|
|
className={baseClass}
|
|
isLoading={false}
|
|
columnConfigs={tableHeaders}
|
|
data={tableData}
|
|
defaultSortHeader="name"
|
|
defaultSortDirection="asc"
|
|
resultsTitle="labels"
|
|
showMarkAllPages={false}
|
|
isAllPagesSelected={false}
|
|
isClientSidePagination
|
|
renderCount={() =>
|
|
tableData.length ? (
|
|
<TableCount name="labels" count={tableData.length} />
|
|
) : null
|
|
}
|
|
emptyComponent={() =>
|
|
EmptyTable({
|
|
header: "No labels",
|
|
info: "Labels you create will appear here.",
|
|
})
|
|
}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default memo(LabelsTable);
|