Improve Table typing and remove annotations on callbacks

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-06-07 11:30:28 -04:00
1 parent 22c9d03edb
commit defb0ea0dd
55 files changed
+498 -490

No files matched your search

@@ -56,15 +56,15 @@ export class ReplicaSets extends React.Component<Props> {
tableId="workload_replicasets"
className="ReplicaSets" store={replicaSetStore}
sortingCallbacks={{
[columnId.name]: (replicaSet: ReplicaSet) => replicaSet.getName(),
[columnId.namespace]: (replicaSet: ReplicaSet) => replicaSet.getNs(),
[columnId.desired]: (replicaSet: ReplicaSet) => replicaSet.getDesired(),
[columnId.current]: (replicaSet: ReplicaSet) => replicaSet.getCurrent(),
[columnId.ready]: (replicaSet: ReplicaSet) => replicaSet.getReady(),
[columnId.age]: (replicaSet: ReplicaSet) => replicaSet.getTimeDiffFromNow(),
[columnId.name]: replicaSet => replicaSet.getName(),
[columnId.namespace]: replicaSet => replicaSet.getNs(),
[columnId.desired]: replicaSet => replicaSet.getDesired(),
[columnId.current]: replicaSet => replicaSet.getCurrent(),
[columnId.ready]: replicaSet => replicaSet.getReady(),
[columnId.age]: replicaSet => replicaSet.getTimeDiffFromNow(),
}}
searchFilters={[
(replicaSet: ReplicaSet) => replicaSet.getSearchFields(),
replicaSet => replicaSet.getSearchFields(),
]}
renderHeaderTitle="Replica Sets"
renderTableHeader={[
@@ -76,7 +76,7 @@ export class ReplicaSets extends React.Component<Props> {
{ title: "Ready", className: "ready", sortBy: columnId.ready, id: columnId.ready },
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
]}
renderTableContents={(replicaSet: ReplicaSet) => [
renderTableContents={replicaSet => [
replicaSet.getName(),
<KubeObjectStatusIcon key="icon" object={replicaSet}/>,
replicaSet.getNs(),