1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fixing role binding details view without subjects (#688)

Signed-off-by: alexfront <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-08-14 14:39:28 +03:00 committed by GitHub
parent e249769562
commit 30c14eb6da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ export class RoleBindingDetails extends React.Component<Props> {
}
const name = roleBinding.getName();
const { roleRef } = roleBinding;
const subjects = roleBinding.getSubjects();
return (
<div className="RoleBindingDetails">
<KubeObjectMeta object={roleBinding}/>
@ -83,6 +84,7 @@ export class RoleBindingDetails extends React.Component<Props> {
</Table>
<DrawerTitle title={<Trans>Bindings</Trans>}/>
{subjects.length > 0 && (
<Table selectable className="bindings box grow">
<TableHead>
<TableCell checkbox/>
@ -91,7 +93,7 @@ export class RoleBindingDetails extends React.Component<Props> {
<TableCell className="type"><Trans>Namespace</Trans></TableCell>
</TableHead>
{
roleBinding.getSubjects().map((subject, i) => {
subjects.map((subject, i) => {
const { kind, name, namespace } = subject;
const isSelected = selectedSubjects.includes(subject);
return (
@ -108,6 +110,7 @@ export class RoleBindingDetails extends React.Component<Props> {
})
}
</Table>
)}
<KubeEventDetails object={roleBinding}/>