diff --git a/frontend/public/components/deployment.jsx b/frontend/public/components/deployment.jsx index ffd5afe6ea9..bbaffafda7c 100644 --- a/frontend/public/components/deployment.jsx +++ b/frontend/public/components/deployment.jsx @@ -161,7 +161,7 @@ const DeploymentTableRow = (o) => { }; }; -const DeploymentTableRows = componentProps => +const DeploymentTableRows = ({componentProps}) => _.map(componentProps.data, obj => obj && obj.metadata && DeploymentTableRow(obj)); const DeploymentTableHeader = props => { diff --git a/frontend/public/components/factory/table.tsx b/frontend/public/components/factory/table.tsx index 024fc37862f..10ead4a33e7 100644 --- a/frontend/public/components/factory/table.tsx +++ b/frontend/public/components/factory/table.tsx @@ -353,10 +353,10 @@ export const Table = connect(stateToProps, {sortList: UIActions.sortList})( } render() { - const {Rows, label, mock, onSelect, selectedResourcesForKind, 'aria-label': ariaLabel, virtualize} = this.props; + const {Rows, label, mock, onSelect, selectedResourcesForKind, 'aria-label': ariaLabel, virtualize, customData} = this.props; const {sortBy, columns} = this.state; const componentProps: any = _.pick(this.props, ['data', 'filters', 'selected', 'match', 'kindObj']); - const rows = Rows(componentProps, selectedResourcesForKind); + const rows = Rows({componentProps, selectedResourcesForKind, customData}); let children = null; if (rows){ @@ -436,6 +436,7 @@ export type TableInnerProps = { onSelect?: (event: React.MouseEvent, isSelected: boolean, rowIndex: number, rowData: IRowData, extraData: IExtraData) => void; staticFilters?: any[]; virtualize?: boolean; + customData?: any; }; export type TableInnerState = { diff --git a/frontend/public/components/utils/kebab.tsx b/frontend/public/components/utils/kebab.tsx index 394f03064ac..8d1981bc80b 100644 --- a/frontend/public/components/utils/kebab.tsx +++ b/frontend/public/components/utils/kebab.tsx @@ -126,9 +126,9 @@ export class Kebab extends React.Component { render() { const { isOpen } = this.state; - const { options, isDisabled, position, id } = this.props; + const { options, isDisabled, position, id, children } = this.props; - const items = []; + let items = []; if (options && options.length){ options.forEach((option) => { items.push( @@ -141,6 +141,9 @@ export class Kebab extends React.Component { ); }); + } else { + //default to children if no options are passed, allowing custom jsx for items + items = children; } return ( @@ -167,6 +170,7 @@ export type KebabProps = { isDisabled?: boolean; options: KebabOption[]; position?: OneOf; + children?: React.ReactNode[]; }; export type KebabState = {