mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enforce semicolons in eslint
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
0f3f5611ba
commit
1477bb8274
531 files changed
+3979
-3975
No files matched your search
+10
-10
@@ -1,4 +1,4 @@
|
||||
import "./add-role-binding-dialog.scss"
|
||||
import "./add-role-binding-dialog.scss";
|
||||
|
||||
import React from "react";
|
||||
import { computed, observable } from "mobx";
|
||||
@@ -67,7 +67,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
@computed get selectedBindings() {
|
||||
return [
|
||||
...this.selectedAccounts,
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
close = () => {
|
||||
@@ -121,7 +121,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
name: item.getName(),
|
||||
kind: item.kind,
|
||||
namespace: item.getNs(),
|
||||
}
|
||||
};
|
||||
}
|
||||
return item;
|
||||
});
|
||||
@@ -152,7 +152,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
};
|
||||
|
||||
@computed get roleOptions(): BindingSelectOption[] {
|
||||
let roles = rolesStore.items as Role[]
|
||||
let roles = rolesStore.items as Role[];
|
||||
if (this.bindContext) {
|
||||
// show only cluster-roles or roles for selected context namespace
|
||||
roles = roles.filter(role => !role.getNs() || role.getNs() === this.bindContext);
|
||||
@@ -163,8 +163,8 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
return {
|
||||
value: role.getId(),
|
||||
label: name + (namespace ? ` (${namespace})` : "")
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@computed get serviceAccountOptions(): BindingSelectOption[] {
|
||||
@@ -175,8 +175,8 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
item: account,
|
||||
value: name,
|
||||
label: <><Icon small material="account_box"/> {name} ({namespace})</>
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
renderContents() {
|
||||
@@ -240,7 +240,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
maxMenuHeight={200}
|
||||
/>
|
||||
</>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -275,6 +275,6 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
</WizardStep>
|
||||
</Wizard>
|
||||
</Dialog>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from "./role-bindings"
|
||||
export * from "./role-binding-details"
|
||||
export * from "./add-role-binding-dialog"
|
||||
export * from "./role-bindings";
|
||||
export * from "./role-binding-details";
|
||||
export * from "./add-role-binding-dialog";
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./role-binding-details.scss"
|
||||
import "./role-binding-details.scss";
|
||||
|
||||
import React from "react";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
@@ -30,7 +30,7 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
reaction(() => this.props.object, (obj) => {
|
||||
this.selectedSubjects.clear();
|
||||
})
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
selectSubject(subject: IRoleBindingSubject) {
|
||||
@@ -40,7 +40,7 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
isSelected
|
||||
? selectedSubjects.filter(sub => sub !== subject) // unselect
|
||||
: selectedSubjects.concat(subject) // select
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@autobind()
|
||||
@@ -53,7 +53,7 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
message: (
|
||||
<p><Trans>Remove selected bindings for <b>{roleBinding.getName()}</b>?</Trans></p>
|
||||
)
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -106,7 +106,7 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
<TableCell className="type">{kind}</TableCell>
|
||||
<TableCell className="ns">{namespace || "-"}</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
);
|
||||
})
|
||||
}
|
||||
</Table>
|
||||
@@ -119,7 +119,7 @@ export class RoleBindingDetails extends React.Component<Props> {
|
||||
removeTooltip={<Trans>Remove selected bindings from ${name}</Trans>}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ kubeObjectDetailRegistry.add({
|
||||
components: {
|
||||
Details: (props) => <RoleBindingDetails {...props} />
|
||||
}
|
||||
})
|
||||
});
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "RoleBinding",
|
||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||
@@ -137,7 +137,7 @@ kubeObjectDetailRegistry.add({
|
||||
components: {
|
||||
Details: (props) => <KubeEventDetails {...props} />
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
kubeObjectDetailRegistry.add({
|
||||
@@ -146,7 +146,7 @@ kubeObjectDetailRegistry.add({
|
||||
components: {
|
||||
Details: (props) => <RoleBindingDetails {...props} />
|
||||
}
|
||||
})
|
||||
});
|
||||
kubeObjectDetailRegistry.add({
|
||||
kind: "ClusterRoleBinding",
|
||||
apiVersions: ["rbac.authorization.k8s.io/v1"],
|
||||
@@ -154,4 +154,4 @@ kubeObjectDetailRegistry.add({
|
||||
components: {
|
||||
Details: (props) => <KubeEventDetails {...props} />
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import difference from "lodash/difference"
|
||||
import uniqBy from "lodash/uniqBy"
|
||||
import difference from "lodash/difference";
|
||||
import uniqBy from "lodash/uniqBy";
|
||||
import { clusterRoleBindingApi, IRoleBindingSubject, RoleBinding, roleBindingApi } from "../../api/endpoints";
|
||||
import { KubeObjectStore } from "../../kube-object.store";
|
||||
import { autobind } from "../../utils";
|
||||
@@ -10,37 +10,37 @@ export class RoleBindingsStore extends KubeObjectStore<RoleBinding> {
|
||||
api = clusterRoleBindingApi
|
||||
|
||||
subscribe() {
|
||||
return super.subscribe([clusterRoleBindingApi, roleBindingApi])
|
||||
return super.subscribe([clusterRoleBindingApi, roleBindingApi]);
|
||||
}
|
||||
|
||||
protected sortItems(items: RoleBinding[]) {
|
||||
return super.sortItems(items, [
|
||||
roleBinding => roleBinding.kind,
|
||||
roleBinding => roleBinding.getName()
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
protected loadItem(params: { name: string; namespace?: string }) {
|
||||
if (params.namespace) return roleBindingApi.get(params)
|
||||
return clusterRoleBindingApi.get(params)
|
||||
if (params.namespace) return roleBindingApi.get(params);
|
||||
return clusterRoleBindingApi.get(params);
|
||||
}
|
||||
|
||||
protected loadItems(namespaces?: string[]) {
|
||||
if (namespaces) {
|
||||
return Promise.all(
|
||||
namespaces.map(namespace => roleBindingApi.list({ namespace }))
|
||||
).then(items => items.flat())
|
||||
).then(items => items.flat());
|
||||
} else {
|
||||
return Promise.all([clusterRoleBindingApi.list(), roleBindingApi.list()])
|
||||
.then(items => items.flat())
|
||||
.then(items => items.flat());
|
||||
}
|
||||
}
|
||||
|
||||
protected async createItem(params: { name: string; namespace?: string }, data?: Partial<RoleBinding>) {
|
||||
if (params.namespace) {
|
||||
return roleBindingApi.create(params, data)
|
||||
return roleBindingApi.create(params, data);
|
||||
} else {
|
||||
return clusterRoleBindingApi.create(params, data)
|
||||
return clusterRoleBindingApi.create(params, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export class RoleBindingsStore extends KubeObjectStore<RoleBinding> {
|
||||
if (addSubjects) {
|
||||
newSubjects = uniqBy(currentSubjects.concat(addSubjects), ({ kind, name, namespace }) => {
|
||||
return [kind, name, namespace].join("-");
|
||||
})
|
||||
});
|
||||
} else if (removeSubjects) {
|
||||
newSubjects = difference(currentSubjects, removeSubjects);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./role-bindings.scss"
|
||||
import "./role-bindings.scss";
|
||||
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
@@ -58,6 +58,6 @@ export class RoleBindings extends React.Component<Props> {
|
||||
addTooltip: <Trans>Create new RoleBinding</Trans>,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user