mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
7b77f18376
commit
dcf253e7d5
401 files changed
+2018
-40
No files matched your search
@@ -16,6 +16,7 @@ export class KubeObjectStatusIcon extends React.Component<Props> {
|
||||
@computed get objectStatuses() {
|
||||
const { object } = this.props;
|
||||
const registrations = kubeObjectStatusRegistry.getItemsForKind(object.kind, object.apiVersion);
|
||||
|
||||
return registrations.map((item: KubeObjectStatusRegistration) => { return item.resolve(object); }).filter((item: KubeObjectStatus) => !!item);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,7 @@ export class KubeObjectStatusIcon extends React.Component<Props> {
|
||||
getAge(timestamp: string) {
|
||||
if (!timestamp) return "";
|
||||
const diff = new Date().getTime() - new Date(timestamp).getTime();
|
||||
|
||||
return formatDuration(diff, true);
|
||||
}
|
||||
|
||||
@@ -72,19 +74,23 @@ export class KubeObjectStatusIcon extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
const { objectStatuses} = this;
|
||||
|
||||
if (!objectStatuses.length) return null;
|
||||
|
||||
const sortedStatuses = objectStatuses.sort((a: KubeObjectStatus, b: KubeObjectStatus) => {
|
||||
if (a.level < b.level ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (a.level > b.level ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
const level = this.statusClassName(sortedStatuses[0].level);
|
||||
|
||||
return (
|
||||
<Icon
|
||||
material={level}
|
||||
|
||||
Reference in new issue
Block a user