Revert 2844 (#2980)

* Revert "review comments"

This reverts commit 97f2ecd88d.

* Revert "Switch to I, remove type parameter default"

This reverts commit a3073cc99b.

* Revert "Improve Table typing and remove annotations on callbacks"

This reverts commit defb0ea0dd.
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-06-07 12:02:15 -04:00
1 parent 97f2ecd88d
commit 60a19143b4
55 files changed
+471 -479

No files matched your search

@@ -25,6 +25,7 @@ import React from "react";
import { observer } from "mobx-react";
import type { RouteComponentProps } from "react-router-dom";
import type { EndpointRouteParams } from "./endpoints.route";
import type { Endpoint } from "../../api/endpoints/endpoint.api";
import { endpointStore } from "./endpoints.store";
import { KubeObjectListLayout } from "../kube-object";
import { KubeObjectStatusIcon } from "../kube-object-status-icon";
@@ -48,12 +49,12 @@ export class Endpoints extends React.Component<Props> {
tableId="network_endpoints"
className="Endpoints" store={endpointStore}
sortingCallbacks={{
[columnId.name]: endpoint => endpoint.getName(),
[columnId.namespace]: endpoint => endpoint.getNs(),
[columnId.age]: endpoint => endpoint.getTimeDiffFromNow(),
[columnId.name]: (endpoint: Endpoint) => endpoint.getName(),
[columnId.namespace]: (endpoint: Endpoint) => endpoint.getNs(),
[columnId.age]: (endpoint: Endpoint) => endpoint.getTimeDiffFromNow(),
}}
searchFilters={[
endpoint => endpoint.getSearchFields()
(endpoint: Endpoint) => endpoint.getSearchFields()
]}
renderHeaderTitle="Endpoints"
renderTableHeader={[
@@ -63,7 +64,7 @@ export class Endpoints extends React.Component<Props> {
{ title: "Endpoints", className: "endpoints", id: columnId.endpoints },
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
]}
renderTableContents={endpoint => [
renderTableContents={(endpoint: Endpoint) => [
endpoint.getName(),
<KubeObjectStatusIcon key="icon" object={endpoint} />,
endpoint.getNs(),
@@ -71,7 +72,7 @@ export class Endpoints extends React.Component<Props> {
endpoint.getAge(),
]}
tableProps={{
customRowHeights: (item, lineHeight, paddings) => {
customRowHeights: (item: Endpoint, lineHeight, paddings) => {
const lines = item.getEndpointSubsets().length || 1;
return lines * lineHeight + paddings;