mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve Table typing and remove annotations on callbacks
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
22c9d03edb
commit
defb0ea0dd
55 files changed
+498
-490
No files matched your search
@@ -28,7 +28,6 @@ import { limitRangeStore } from "./limit-ranges.store";
|
||||
import type { LimitRangeRouteParams } from "./limit-ranges.route";
|
||||
import React from "react";
|
||||
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
|
||||
import type { LimitRange } from "../../api/endpoints/limit-range.api";
|
||||
|
||||
enum columnId {
|
||||
name = "name",
|
||||
@@ -49,22 +48,22 @@ export class LimitRanges extends React.Component<Props> {
|
||||
className="LimitRanges"
|
||||
store={limitRangeStore}
|
||||
sortingCallbacks={{
|
||||
[columnId.name]: (item: LimitRange) => item.getName(),
|
||||
[columnId.namespace]: (item: LimitRange) => item.getNs(),
|
||||
[columnId.age]: (item: LimitRange) => item.getTimeDiffFromNow(),
|
||||
[columnId.name]: item => item.getName(),
|
||||
[columnId.namespace]: item => item.getNs(),
|
||||
[columnId.age]: item => item.getTimeDiffFromNow(),
|
||||
}}
|
||||
searchFilters={[
|
||||
(item: LimitRange) => item.getName(),
|
||||
(item: LimitRange) => item.getNs(),
|
||||
item => item.getName(),
|
||||
item => item.getNs(),
|
||||
]}
|
||||
renderHeaderTitle={"Limit Ranges"}
|
||||
renderHeaderTitle="Limit Ranges"
|
||||
renderTableHeader={[
|
||||
{ title: "Name", className: "name", sortBy: columnId.name, id: columnId.name },
|
||||
{ className: "warning", showWithColumn: columnId.name },
|
||||
{ title: "Namespace", className: "namespace", sortBy: columnId.namespace, id: columnId.namespace },
|
||||
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
|
||||
]}
|
||||
renderTableContents={(limitRange: LimitRange) => [
|
||||
renderTableContents={limitRange => [
|
||||
limitRange.getName(),
|
||||
<KubeObjectStatusIcon key="icon" object={limitRange}/>,
|
||||
limitRange.getNs(),
|
||||
|
||||
Reference in new issue
Block a user