1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Apply suggestions from code review

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-04-14 10:03:37 -04:00 committed by GitHub
parent 79659e569a
commit 5b2d593b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ interface IWarning extends ItemObject {
message: string; message: string;
selfLink: string; selfLink: string;
age: string | number; age: string | number;
getTimeDiffFromNow(): number; timeDiffFromNow: number;
} }
enum sortBy { enum sortBy {
@ -38,7 +38,7 @@ export class ClusterIssues extends React.Component<Props> {
private sortCallbacks = { private sortCallbacks = {
[sortBy.type]: (warning: IWarning) => warning.kind, [sortBy.type]: (warning: IWarning) => warning.kind,
[sortBy.object]: (warning: IWarning) => warning.getName(), [sortBy.object]: (warning: IWarning) => warning.getName(),
[sortBy.age]: (warning: IWarning) => warning.getTimeDiffFromNow(), [sortBy.age]: (warning: IWarning) => warning.timeDiffFromNow,
}; };
@computed get warnings() { @computed get warnings() {
@ -53,7 +53,7 @@ export class ClusterIssues extends React.Component<Props> {
age: getAge(), age: getAge(),
getId, getId,
getName, getName,
getTimeDiffFromNow, timeDiffFromNow: getTimeDiffFromNow(),
kind, kind,
message, message,
selfLink, selfLink,
@ -71,7 +71,7 @@ export class ClusterIssues extends React.Component<Props> {
warnings.push({ warnings.push({
getId: () => uid, getId: () => uid,
getName: () => name, getName: () => name,
getTimeDiffFromNow, timeDiffFromNow: getTimeDiffFromNow(),
age: getAge(), age: getAge(),
message, message,
kind, kind,