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
@@ -60,7 +60,7 @@ export class CRDDetails extends React.Component<Props> {
|
||||
<DrawerItem name={<Trans>Conditions</Trans>} className="conditions" labelsOnly>
|
||||
{
|
||||
crd.getConditions().map(condition => {
|
||||
const { type, message, lastTransitionTime, status } = condition
|
||||
const { type, message, lastTransitionTime, status } = condition;
|
||||
return (
|
||||
<Badge
|
||||
key={type}
|
||||
@@ -112,7 +112,7 @@ export class CRDDetails extends React.Component<Props> {
|
||||
<Badge label={jsonPath}/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)
|
||||
);
|
||||
})
|
||||
}
|
||||
</Table>
|
||||
@@ -130,7 +130,7 @@ export class CRDDetails extends React.Component<Props> {
|
||||
</>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,4 +140,4 @@ kubeObjectDetailRegistry.add({
|
||||
components: {
|
||||
Details: (props) => <CRDDetails {...props} />
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
import "./crd-list.scss"
|
||||
import "./crd-list.scss";
|
||||
|
||||
import React from "react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
@@ -24,7 +24,7 @@ enum sortBy {
|
||||
@observer
|
||||
export class CrdList extends React.Component {
|
||||
@computed get groups() {
|
||||
return navigation.searchParams.getAsArray("groups")
|
||||
return navigation.searchParams.getAsArray("groups");
|
||||
}
|
||||
|
||||
onGroupChange(group: string) {
|
||||
@@ -32,7 +32,7 @@ export class CrdList extends React.Component {
|
||||
const index = groups.findIndex(item => item == group);
|
||||
if (index !== -1) groups.splice(index, 1);
|
||||
else groups.push(group);
|
||||
setQueryParams({ groups })
|
||||
setQueryParams({ groups });
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -52,14 +52,14 @@ export class CrdList extends React.Component {
|
||||
searchFilters={Object.values(sortingCallbacks)}
|
||||
filterItems={[
|
||||
(items: CustomResourceDefinition[]) => {
|
||||
return selectedGroups.length ? items.filter(item => selectedGroups.includes(item.getGroup())) : items
|
||||
return selectedGroups.length ? items.filter(item => selectedGroups.includes(item.getGroup())) : items;
|
||||
}
|
||||
]}
|
||||
renderHeaderTitle={<Trans>Custom Resources</Trans>}
|
||||
customizeHeader={() => {
|
||||
let placeholder = <Trans>All groups</Trans>;
|
||||
if (selectedGroups.length == 1) placeholder = <><Trans>Group</Trans>: {selectedGroups[0]}</>
|
||||
if (selectedGroups.length >= 2) placeholder = <><Trans>Groups</Trans>: {selectedGroups.join(", ")}</>
|
||||
if (selectedGroups.length == 1) placeholder = <><Trans>Group</Trans>: {selectedGroups[0]}</>;
|
||||
if (selectedGroups.length >= 2) placeholder = <><Trans>Groups</Trans>: {selectedGroups.join(", ")}</>;
|
||||
return {
|
||||
// todo: move to global filters
|
||||
filters: (
|
||||
@@ -77,11 +77,11 @@ export class CrdList extends React.Component {
|
||||
<span>{group}</span>
|
||||
{isSelected && <Icon small material="check" className="box right"/>}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
};
|
||||
}}
|
||||
renderTableHeader={[
|
||||
{ title: <Trans>Resource</Trans>, className: "kind", sortBy: sortBy.kind },
|
||||
@@ -99,10 +99,10 @@ export class CrdList extends React.Component {
|
||||
crd.getVersion(),
|
||||
crd.getScope(),
|
||||
crd.getAge(),
|
||||
]
|
||||
];
|
||||
}}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ interface Props extends KubeObjectDetailsProps<CustomResourceDefinition> {
|
||||
|
||||
function convertSpecValue(value: any): any {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(convertSpecValue)
|
||||
return value.map(convertSpecValue);
|
||||
}
|
||||
|
||||
if (typeof value === "object") {
|
||||
@@ -31,10 +31,10 @@ function convertSpecValue(value: any): any {
|
||||
className="box grow"
|
||||
value={JSON.stringify(value, null, 2)}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return value
|
||||
return value;
|
||||
}
|
||||
|
||||
@observer
|
||||
@@ -48,13 +48,13 @@ export class CrdResourceDetails extends React.Component<Props> {
|
||||
<DrawerItem key={name} name={name} renderBoolean>
|
||||
{convertSpecValue(jsonPath.value(crd, jp.slice(1)))}
|
||||
</DrawerItem>
|
||||
))
|
||||
));
|
||||
}
|
||||
|
||||
renderStatus(crd: CustomResourceDefinition, columns: AdditionalPrinterColumnsV1[]) {
|
||||
const showStatus = !columns.find(column => column.name == "Status") && crd.status?.conditions;
|
||||
if (!showStatus) {
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
const conditions = crd.status.conditions
|
||||
@@ -66,13 +66,13 @@ export class CrdResourceDetails extends React.Component<Props> {
|
||||
className={cssNames({ disabled: status === "False" }, kind.toLowerCase())}
|
||||
tooltip={message}
|
||||
/>
|
||||
))
|
||||
));
|
||||
|
||||
return (
|
||||
<DrawerItem name={<Trans>Status</Trans>} className="status" labelsOnly>
|
||||
{conditions}
|
||||
</DrawerItem>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -90,6 +90,6 @@ export class CrdResourceDetails extends React.Component<Props> {
|
||||
{this.renderAdditionalColumns(object, extraColumns)}
|
||||
{this.renderStatus(object, extraColumns)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export class CrdResources extends React.Component<Props> {
|
||||
store.loadAll();
|
||||
}
|
||||
})
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
@computed get crd() {
|
||||
@@ -41,7 +41,7 @@ export class CrdResources extends React.Component<Props> {
|
||||
}
|
||||
|
||||
@computed get store() {
|
||||
if (!this.crd) return null
|
||||
if (!this.crd) return null;
|
||||
return apiManager.getStore(this.crd.getResourceApiBase());
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ export class CrdResources extends React.Component<Props> {
|
||||
[sortBy.name]: (item: KubeObject) => item.getName(),
|
||||
[sortBy.namespace]: (item: KubeObject) => item.getNs(),
|
||||
[sortBy.age]: (item: KubeObject) => item.metadata.creationTimestamp,
|
||||
}
|
||||
};
|
||||
extraColumns.forEach(column => {
|
||||
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, column.jsonPath.slice(1))
|
||||
})
|
||||
sortingCallbacks[column.name] = (item: KubeObject) => jsonPath.value(item, column.jsonPath.slice(1));
|
||||
});
|
||||
|
||||
return (
|
||||
<KubeObjectListLayout
|
||||
@@ -78,7 +78,7 @@ export class CrdResources extends React.Component<Props> {
|
||||
title: name,
|
||||
className: name.toLowerCase(),
|
||||
sortBy: name
|
||||
}
|
||||
};
|
||||
}),
|
||||
{ title: <Trans>Age</Trans>, className: "age", sortBy: sortBy.age },
|
||||
]}
|
||||
@@ -92,6 +92,6 @@ export class CrdResources extends React.Component<Props> {
|
||||
crdInstance.getAge(),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,15 @@ import { buildURL } from "../../../common/utils/buildUrl";
|
||||
|
||||
export const crdRoute: RouteProps = {
|
||||
path: "/crd"
|
||||
}
|
||||
};
|
||||
|
||||
export const crdDefinitionsRoute: RouteProps = {
|
||||
path: crdRoute.path + "/definitions"
|
||||
}
|
||||
};
|
||||
|
||||
export const crdResourcesRoute: RouteProps = {
|
||||
path: crdRoute.path + "/:group/:name"
|
||||
}
|
||||
};
|
||||
|
||||
export interface ICRDListQuery {
|
||||
groups?: string;
|
||||
|
||||
@@ -26,14 +26,14 @@ export class CRDStore extends KubeObjectStore<CustomResourceDefinition> {
|
||||
super();
|
||||
|
||||
// auto-init stores for crd-s
|
||||
reaction(() => this.items.toJS(), items => items.forEach(initStore))
|
||||
reaction(() => this.items.toJS(), items => items.forEach(initStore));
|
||||
}
|
||||
|
||||
protected sortItems(items: CustomResourceDefinition[]) {
|
||||
return super.sortItems(items, [
|
||||
crd => crd.getGroup(),
|
||||
crd => crd.getName(),
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
||||
@computed get groups() {
|
||||
@@ -43,7 +43,7 @@ export class CRDStore extends KubeObjectStore<CustomResourceDefinition> {
|
||||
if (!groups[group]) groups[group] = [];
|
||||
groups[group].push(crd);
|
||||
return groups;
|
||||
}, groups)
|
||||
}, groups);
|
||||
}
|
||||
|
||||
getByGroup(group: string, pluralName: string) {
|
||||
@@ -53,12 +53,12 @@ export class CRDStore extends KubeObjectStore<CustomResourceDefinition> {
|
||||
}
|
||||
|
||||
getByObject(obj: KubeObject) {
|
||||
if (!obj) return null
|
||||
if (!obj) return null;
|
||||
const { kind, apiVersion } = obj;
|
||||
|
||||
return this.items.find(crd => (
|
||||
kind === crd.getResourceKind() && apiVersion === `${crd.getGroup()}/${crd.getVersion()}`
|
||||
))
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export class CustomResources extends React.Component {
|
||||
url: crdURL(),
|
||||
routePath: crdRoute.path.toString(),
|
||||
}
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in new issue
Block a user