mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Implements patch policies #31914 - https://github.com/fleetdm/fleet/pull/40816 - https://github.com/fleetdm/fleet/pull/41248 - https://github.com/fleetdm/fleet/pull/41276 - https://github.com/fleetdm/fleet/pull/40948 - https://github.com/fleetdm/fleet/pull/40837 - https://github.com/fleetdm/fleet/pull/40956 - https://github.com/fleetdm/fleet/pull/41168 - https://github.com/fleetdm/fleet/pull/41171 - https://github.com/fleetdm/fleet/pull/40691 - https://github.com/fleetdm/fleet/pull/41524 - https://github.com/fleetdm/fleet/pull/41674 --------- Co-authored-by: Jonathan Katz <44128041+jkatz01@users.noreply.github.com> Co-authored-by: jkatz01 <yehonatankatz@gmail.com> Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import React, { useCallback } from "react";
|
|
import classnames from "classnames";
|
|
|
|
import { ISoftwareInstallPolicyUI } from "interfaces/software";
|
|
|
|
import TableContainer from "components/TableContainer";
|
|
import TableCount from "components/TableContainer/TableCount";
|
|
import generateInstallerPoliciesTableConfig from "./InstallerPoliciesTableConfig";
|
|
|
|
export const baseClass = "installer-policies-table";
|
|
|
|
interface IInstallerPoliciesTable {
|
|
className?: string;
|
|
teamId?: number;
|
|
isLoading?: boolean;
|
|
policies?: ISoftwareInstallPolicyUI[] | null;
|
|
}
|
|
const InstallerPoliciesTable = ({
|
|
className,
|
|
teamId,
|
|
isLoading = false,
|
|
policies,
|
|
}: IInstallerPoliciesTable) => {
|
|
const classNames = classnames(baseClass, className);
|
|
|
|
const softwareStatusHeaders = generateInstallerPoliciesTableConfig({
|
|
teamId,
|
|
});
|
|
|
|
const renderInstallerPoliciesCount = useCallback(() => {
|
|
return <TableCount name="policies" count={policies?.length} />;
|
|
}, [policies?.length]);
|
|
|
|
return (
|
|
<TableContainer
|
|
className={classNames}
|
|
isLoading={isLoading}
|
|
columnConfigs={softwareStatusHeaders}
|
|
data={policies || []}
|
|
renderCount={renderInstallerPoliciesCount}
|
|
disablePagination
|
|
disableMultiRowSelect
|
|
emptyComponent={() => <></>}
|
|
showMarkAllPages={false}
|
|
isAllPagesSelected={false}
|
|
hideFooter
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default InstallerPoliciesTable;
|