1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 00:09:40 +02:00

feat(helm): update helm view [r8s-256] (#582)

Co-authored-by: Cara Ryan <cara.ryan@portainer.io>
Co-authored-by: James Player <james.player@portainer.io>
Co-authored-by: stevensbkang <skan070@gmail.com>
This commit is contained in:
Ali 2025-04-10 16:08:24 +12:00 committed by GitHub
parent 46eddbe7b9
commit 0ca9321db1
57 changed files with 2635 additions and 222 deletions

View file

@ -70,6 +70,7 @@ export interface Props<D extends DefaultType> extends AutomationTestingProps {
getRowCanExpand?(row: Row<D>): boolean;
noWidget?: boolean;
extendTableOptions?: (options: TableOptions<D>) => TableOptions<D>;
includeSearch?: boolean;
}
export function Datatable<D extends DefaultType>({
@ -98,6 +99,7 @@ export function Datatable<D extends DefaultType>({
totalCount = dataset.length,
isServerSidePagination = false,
extendTableOptions = (value) => value,
includeSearch,
}: Props<D> & PaginationProps) {
const pageCount = useMemo(
() => Math.ceil(totalCount / settings.pageSize),
@ -192,6 +194,7 @@ export function Datatable<D extends DefaultType>({
renderTableActions={() => renderTableActions(selectedItems)}
renderTableSettings={() => renderTableSettings(tableInstance)}
data-cy={`${dataCy}-header`}
includeSearch={includeSearch}
/>
<DatatableContent<D>

View file

@ -16,6 +16,7 @@ type Props = {
renderTableActions?(): ReactNode;
description?: ReactNode;
titleId?: string;
includeSearch?: boolean;
} & AutomationTestingProps;
export function DatatableHeader({
@ -28,8 +29,9 @@ export function DatatableHeader({
description,
titleId,
'data-cy': dataCy,
includeSearch = !!title,
}: Props) {
if (!title) {
if (!title && !includeSearch) {
return null;
}
@ -50,12 +52,12 @@ export function DatatableHeader({
return (
<Table.Title
id={titleId}
label={title}
label={title ?? ''}
icon={titleIcon}
description={description}
data-cy={dataCy}
>
{searchBar}
{includeSearch && searchBar}
{tableActions}
{tableTitleSettings}
</Table.Title>