mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enable object-shorthand rule (#1500)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
2a8cfe5e67
commit
ff93760dc4
42 files changed
+69
-66
No files matched your search
@@ -152,7 +152,7 @@ export class AddCluster extends React.Component {
|
||||
: ClusterStore.embedCustomKubeConfig(clusterId, kubeConfig); // save in app-files folder
|
||||
return {
|
||||
id: clusterId,
|
||||
kubeConfigPath: kubeConfigPath,
|
||||
kubeConfigPath,
|
||||
workspace: workspaceStore.currentWorkspaceId,
|
||||
contextName: kubeConfig.currentContext,
|
||||
preferences: {
|
||||
|
||||
@@ -36,7 +36,7 @@ export class HelmChartStore extends ItemStore<HelmChart> {
|
||||
const loadVersions = (repo: string) => {
|
||||
return helmChartsApi.get(repo, chartName).then(({ versions }) => {
|
||||
return versions.map(chart => ({
|
||||
repo: repo,
|
||||
repo,
|
||||
version: chart.getVersion()
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ export const ClusterMetrics = observer(() => {
|
||||
id: metricType + metricNodeRole,
|
||||
label: metricType.toUpperCase() + " usage",
|
||||
borderColor: colors[metricType],
|
||||
data: data
|
||||
data
|
||||
}];
|
||||
const cpuOptions: ChartOptions = {
|
||||
scales: {
|
||||
|
||||
@@ -92,11 +92,11 @@ export class AddSecretDialog extends React.Component<Props> {
|
||||
const { name, namespace, type } = this;
|
||||
const { data = [], labels = [], annotations = [] } = this.secret[type];
|
||||
const secret: Partial<Secret> = {
|
||||
type: type,
|
||||
type,
|
||||
data: this.getDataFromFields(data, val => val ? base64.encode(val) : ""),
|
||||
metadata: {
|
||||
name: name,
|
||||
namespace: namespace,
|
||||
name,
|
||||
namespace,
|
||||
annotations: this.getDataFromFields(annotations),
|
||||
labels: this.getDataFromFields(labels),
|
||||
} as IKubeObjectMetadata
|
||||
|
||||
@@ -60,7 +60,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace> {
|
||||
kind: "Namespace",
|
||||
apiVersion: "v1",
|
||||
metadata: {
|
||||
name: name,
|
||||
name,
|
||||
uid: "",
|
||||
resourceVersion: "",
|
||||
selfLink: `/api/v1/namespaces/${name}`
|
||||
|
||||
@@ -137,7 +137,7 @@ export class AddRoleBindingDialog extends React.Component<Props> {
|
||||
else {
|
||||
const name = useRoleForBindingName ? selectedRole.getName() : bindingName;
|
||||
roleBinding = await roleBindingsStore.create({ name, namespace }, {
|
||||
subjects: subjects,
|
||||
subjects,
|
||||
roleRef: {
|
||||
name: selectedRole.getName(),
|
||||
kind: selectedRole.kind,
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ export class ServiceAccountsDetails extends React.Component<Props> {
|
||||
apiVersion: "v1",
|
||||
kind: "Secret",
|
||||
metadata: {
|
||||
name: name,
|
||||
name,
|
||||
uid: null,
|
||||
selfLink: null,
|
||||
resourceVersion: null
|
||||
|
||||
@@ -59,7 +59,7 @@ export class App extends React.Component {
|
||||
name: "cluster",
|
||||
action: "open",
|
||||
params: {
|
||||
clusterId: clusterId
|
||||
clusterId
|
||||
}
|
||||
});
|
||||
window.addEventListener("online", () => {
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Checkbox extends React.PureComponent<CheckboxProps> {
|
||||
render() {
|
||||
const { label, inline, className, value, theme, children, ...inputProps } = this.props;
|
||||
const componentClass = cssNames('Checkbox flex', className, {
|
||||
inline: inline,
|
||||
inline,
|
||||
checked: value,
|
||||
disabled: this.props.disabled,
|
||||
["theme-" + theme]: theme,
|
||||
|
||||
@@ -55,7 +55,7 @@ export class EditResource extends React.Component<Props> {
|
||||
}
|
||||
editResourceStore.setData(this.tabId, {
|
||||
...this.tabData,
|
||||
draft: draft,
|
||||
draft,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export class FileInput extends React.Component<Props> {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => {
|
||||
resolve({
|
||||
file: file,
|
||||
file,
|
||||
data: reader.result,
|
||||
error: reader.error ? String(reader.error) : null,
|
||||
});
|
||||
|
||||
@@ -149,7 +149,7 @@ export class Input extends React.Component<InputProps, State> {
|
||||
this.setState({
|
||||
validating: false,
|
||||
valid: !errors.length,
|
||||
errors: errors,
|
||||
errors,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -273,11 +273,11 @@ export class Input extends React.Component<InputProps, State> {
|
||||
|
||||
const className = cssNames("Input", this.props.className, {
|
||||
[`theme ${theme}`]: theme,
|
||||
focused: focused,
|
||||
disabled: disabled,
|
||||
focused,
|
||||
disabled,
|
||||
invalid: !valid,
|
||||
dirty: dirty,
|
||||
validating: validating,
|
||||
dirty,
|
||||
validating,
|
||||
validatingLine: validating && showValidationLine,
|
||||
});
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ export class MenuActions extends React.Component<MenuActionsProps> {
|
||||
...menuProps
|
||||
} = this.props;
|
||||
const menuClassName = cssNames("MenuActions flex", className, {
|
||||
toolbar: toolbar,
|
||||
toolbar,
|
||||
gaps: toolbar, // add spacing for .flex
|
||||
});
|
||||
const autoClose = !toolbar;
|
||||
|
||||
@@ -15,7 +15,7 @@ export class Notifications extends React.Component {
|
||||
|
||||
static ok(message: NotificationMessage) {
|
||||
notificationsStore.add({
|
||||
message: message,
|
||||
message,
|
||||
timeout: 2500,
|
||||
status: NotificationStatus.OK
|
||||
});
|
||||
@@ -23,7 +23,7 @@ export class Notifications extends React.Component {
|
||||
|
||||
static error(message: NotificationMessage) {
|
||||
notificationsStore.add({
|
||||
message: message,
|
||||
message,
|
||||
timeout: 10000,
|
||||
status: NotificationStatus.ERROR
|
||||
});
|
||||
@@ -33,7 +33,7 @@ export class Notifications extends React.Component {
|
||||
return notificationsStore.add({
|
||||
status: NotificationStatus.INFO,
|
||||
timeout: 0,
|
||||
message: message,
|
||||
message,
|
||||
...customOpts,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ export class RadioGroup extends React.Component<RadioGroupProps, {}> {
|
||||
<div className={className}>
|
||||
{radios.map(radio => {
|
||||
return React.cloneElement(radio, {
|
||||
name: name,
|
||||
name,
|
||||
disabled: disabled !== undefined ? disabled : radio.props.disabled,
|
||||
checked: radio.props.value === value,
|
||||
onChange: onChange
|
||||
onChange
|
||||
} as any);
|
||||
})}
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@ export class Radio extends React.Component<RadioProps> {
|
||||
render() {
|
||||
const { className, label, checked, children, ...inputProps } = this.props;
|
||||
const componentClass = cssNames('Radio flex align-center', className, {
|
||||
checked: checked,
|
||||
checked,
|
||||
disabled: this.props.disabled,
|
||||
});
|
||||
return (
|
||||
|
||||
@@ -60,7 +60,7 @@ export class TableCell extends React.Component<TableCellProps> {
|
||||
render() {
|
||||
const { className, checkbox, isChecked, sortBy, _sort, _sorting, _nowrap, children, title, renderBoolean: displayBoolean, ...cellProps } = this.props;
|
||||
const classNames = cssNames("TableCell", className, {
|
||||
checkbox: checkbox,
|
||||
checkbox,
|
||||
nowrap: _nowrap,
|
||||
sorting: this.isSortable,
|
||||
});
|
||||
|
||||
@@ -82,7 +82,7 @@ export class Table extends React.Component<TableProps> {
|
||||
typeof elem.props.children === "string" ? elem.props.children : undefined
|
||||
);
|
||||
return React.cloneElement(elem, {
|
||||
title: title,
|
||||
title,
|
||||
_sort: this.sort,
|
||||
_sorting: this.sortParams,
|
||||
_nowrap: headElem.props.nowrap,
|
||||
|
||||
@@ -32,10 +32,10 @@ export class Tabs extends React.PureComponent<TabsProps> {
|
||||
render() {
|
||||
const { center, wrap, onChange, value, autoFocus, scrollable = true, withBorder, ...elemProps } = this.props;
|
||||
const className = cssNames("Tabs", this.props.className, {
|
||||
center: center,
|
||||
wrap: wrap,
|
||||
scrollable: scrollable,
|
||||
withBorder: withBorder,
|
||||
center,
|
||||
wrap,
|
||||
scrollable,
|
||||
withBorder,
|
||||
});
|
||||
return (
|
||||
<TabsContext.Provider value={{ autoFocus, value, onChange }}>
|
||||
@@ -120,7 +120,7 @@ export class Tab extends React.PureComponent<TabProps> {
|
||||
let { className } = this.props;
|
||||
className = cssNames("Tab flex gaps align-center", className, {
|
||||
"active": this.isActive,
|
||||
"disabled": disabled,
|
||||
disabled,
|
||||
});
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -180,8 +180,8 @@ export class Tooltip extends React.Component<TooltipProps> {
|
||||
break;
|
||||
}
|
||||
return {
|
||||
left: left,
|
||||
top: top,
|
||||
left,
|
||||
top,
|
||||
right: left + tooltipBounds.width,
|
||||
bottom: top + tooltipBounds.height,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user