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 (#2981)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
c6a4d55d86
commit
64ac04186b
59 files changed
+487
-482
No files matched your search
@@ -24,7 +24,6 @@ import "./view.scss";
|
||||
import { observer } from "mobx-react";
|
||||
import React from "react";
|
||||
import type { RouteComponentProps } from "react-router";
|
||||
import type { Role } from "../../../api/endpoints";
|
||||
import { KubeObjectListLayout } from "../../kube-object";
|
||||
import { KubeObjectStatusIcon } from "../../kube-object-status-icon";
|
||||
import { AddRoleDialog } from "./add-dialog";
|
||||
@@ -51,12 +50,12 @@ export class Roles extends React.Component<Props> {
|
||||
className="Roles"
|
||||
store={rolesStore}
|
||||
sortingCallbacks={{
|
||||
[columnId.name]: (role: Role) => role.getName(),
|
||||
[columnId.namespace]: (role: Role) => role.getNs(),
|
||||
[columnId.age]: (role: Role) => role.getTimeDiffFromNow(),
|
||||
[columnId.name]: role => role.getName(),
|
||||
[columnId.namespace]: role => role.getNs(),
|
||||
[columnId.age]: role => role.getTimeDiffFromNow(),
|
||||
}}
|
||||
searchFilters={[
|
||||
(role: Role) => role.getSearchFields(),
|
||||
role => role.getSearchFields(),
|
||||
]}
|
||||
renderHeaderTitle="Roles"
|
||||
renderTableHeader={[
|
||||
@@ -65,7 +64,7 @@ export class Roles extends React.Component<Props> {
|
||||
{ title: "Namespace", className: "namespace", sortBy: columnId.namespace, id: columnId.namespace },
|
||||
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
|
||||
]}
|
||||
renderTableContents={(role: Role) => [
|
||||
renderTableContents={role => [
|
||||
role.getName(),
|
||||
<KubeObjectStatusIcon key="icon" object={role} />,
|
||||
role.getNs(),
|
||||
|
||||
Reference in new issue
Block a user