Fix review comments

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-06-08 19:28:00 -04:00
1 parent f988ea95b1
commit 738cf564a0
4 files changed
+13 -8

No files matched your search

@@ -198,9 +198,12 @@ export class ClusterRoleBindingDialog extends React.Component<Props> {
isDisabled={this.isEditing}
options={this.clusterRoleRefoptions}
value={this.selectedRoleRef}
onChange={({ value }) => {
onChange={({ value }: SelectOption<ClusterRole> ) => {
if (this.bindingName === this.selectedRoleRef.getName()) {
this.bindingName = value.getName();
}
this.selectedRoleRef = value;
this.bindingName = this.selectedRoleRef.getName();
}}
/>
@@ -254,7 +257,7 @@ export class ClusterRoleBindingDialog extends React.Component<Props> {
render() {
const { ...dialogProps } = this.props;
const [action, nextLabel] = this.isEditing ? ["Edit", "Update"] : ["Add", "Create"];
const disableNext = !this.selectedRoleRef || !this.selectedBindings.length;
const disableNext = !this.selectedRoleRef || !this.selectedBindings.length || !this.bindingName;
return (
<Dialog
@@ -217,13 +217,15 @@ export class RoleBindingDialog extends React.Component<Props> {
options={this.roleRefOptions}
value={this.selectedRoleRef}
onChange={({ value }) => {
if (this.bindingName === this.selectedRoleRef.getName()) {
this.bindingName = value.getName();
}
this.selectedRoleRef = value;
if (this.selectedRoleRef.kind === "Role") {
this.bindingNamespace = this.selectedRoleRef.getNs();
}
this.bindingName = this.selectedRoleRef.getName();
}}
/>
@@ -276,7 +278,7 @@ export class RoleBindingDialog extends React.Component<Props> {
render() {
const { ...dialogProps } = this.props;
const [action, nextLabel] = this.isEditing ? ["Edit", "Update"] : ["Add", "Create"];
const disableNext = !this.selectedRoleRef || !this.selectedBindings.length;
const disableNext = !this.selectedRoleRef || !this.selectedBindings.length || !this.bindingNamespace || !this.bindingName;
return (
<Dialog
@@ -75,7 +75,7 @@ export class RoleBindings extends React.Component<Props> {
renderTableContents={(binding: RoleBinding) => [
binding.getName(),
<KubeObjectStatusIcon key="icon" object={binding} />,
binding.getNs() || "-",
binding.getNs(),
binding.getSubjectNames(),
binding.getAge(),
]}
@@ -1,4 +1,4 @@
.ClusterRoleDetails {
.RoleDetails {
.rule {
display: grid;
grid-template-columns: min-content auto;