diff --git a/plugins/rbac/src/components/CreateRole/AddedMembersTableColumn.tsx b/plugins/rbac/src/components/CreateRole/AddedMembersTableColumn.tsx index 9744f23e81..58809b5a99 100644 --- a/plugins/rbac/src/components/CreateRole/AddedMembersTableColumn.tsx +++ b/plugins/rbac/src/components/CreateRole/AddedMembersTableColumn.tsx @@ -9,29 +9,27 @@ import { FormikErrors } from 'formik'; import { getKindNamespaceName } from '../../utils/rbac-utils'; import { RoleFormValues, SelectedMember } from './types'; -export const basicSelectedMembersColumns = - (): TableColumn[] => [ - { - title: 'Type', - field: 'type', - type: 'string', - }, - { - title: 'Members', - field: 'members', - type: 'numeric', - align: 'left', - emptyValue: '-', - }, - ]; - export const reviewStepMemebersTableColumns = () => [ { title: 'Name', field: 'label', type: 'string', }, - ...basicSelectedMembersColumns(), + { + title: 'Type', + field: 'type', + type: 'string', + }, + { + title: 'Members', + field: 'members', + type: 'numeric', + align: 'left', + render: (mem: number) => { + if (mem || mem === 0) return mem; + return '-'; + }, + }, ]; export const selectedMembersColumns = ( @@ -63,7 +61,18 @@ export const selectedMembersColumns = ( ); }, }, - ...basicSelectedMembersColumns(), + { + title: 'Type', + field: 'type', + type: 'string', + }, + { + title: 'Members', + field: 'members', + type: 'numeric', + align: 'left', + emptyValue: '-', + }, { title: 'Actions', sorting: false, diff --git a/plugins/rbac/src/utils/create-role-utils.ts b/plugins/rbac/src/utils/create-role-utils.ts index d6a7a1ff74..15d95a68ad 100644 --- a/plugins/rbac/src/utils/create-role-utils.ts +++ b/plugins/rbac/src/utils/create-role-utils.ts @@ -51,7 +51,7 @@ export const getMembersCount = (member: MemberEntity) => { temp++; } return temp; - }, 0) || 1 + }, 0) : undefined; };