mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Revert 2844 (#2980)
* Revert "review comments" This reverts commit97f2ecd88d. * Revert "Switch to I, remove type parameter default" This reverts commita3073cc99b. * Revert "Improve Table typing and remove annotations on callbacks" This reverts commitdefb0ea0dd.
This commit is contained in:
1 parent
97f2ecd88d
commit
60a19143b4
55 files changed
+471
-479
No files matched your search
@@ -106,7 +106,7 @@ export class NamespaceStore extends KubeObjectStore<Namespace> {
|
||||
return super.getSubscribeApis();
|
||||
}
|
||||
|
||||
protected async loadItems(params: KubeObjectStoreLoadingParams<Namespace>) {
|
||||
protected async loadItems(params: KubeObjectStoreLoadingParams) {
|
||||
const { allowedNamespaces } = this;
|
||||
|
||||
let namespaces = (await super.loadItems(params)) || [];
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
import "./namespaces.scss";
|
||||
|
||||
import React from "react";
|
||||
import { NamespaceStatus } from "../../api/endpoints";
|
||||
import { Namespace, NamespaceStatus } from "../../api/endpoints";
|
||||
import { AddNamespaceDialog } from "./add-namespace-dialog";
|
||||
import { TabLayout } from "../layout/tab-layout";
|
||||
import { Badge } from "../badge";
|
||||
@@ -51,14 +51,14 @@ export class Namespaces extends React.Component<Props> {
|
||||
tableId="namespaces"
|
||||
className="Namespaces" store={namespaceStore}
|
||||
sortingCallbacks={{
|
||||
[columnId.name]: ns => ns.getName(),
|
||||
[columnId.labels]: ns => ns.getLabels(),
|
||||
[columnId.age]: ns => ns.getTimeDiffFromNow(),
|
||||
[columnId.status]: ns => ns.getStatus(),
|
||||
[columnId.name]: (ns: Namespace) => ns.getName(),
|
||||
[columnId.labels]: (ns: Namespace) => ns.getLabels(),
|
||||
[columnId.age]: (ns: Namespace) => ns.getTimeDiffFromNow(),
|
||||
[columnId.status]: (ns: Namespace) => ns.getStatus(),
|
||||
}}
|
||||
searchFilters={[
|
||||
item => item.getSearchFields(),
|
||||
item => item.getStatus()
|
||||
(item: Namespace) => item.getSearchFields(),
|
||||
(item: Namespace) => item.getStatus()
|
||||
]}
|
||||
renderHeaderTitle="Namespaces"
|
||||
renderTableHeader={[
|
||||
@@ -68,7 +68,7 @@ export class Namespaces extends React.Component<Props> {
|
||||
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
|
||||
{ title: "Status", className: "status", sortBy: columnId.status, id: columnId.status },
|
||||
]}
|
||||
renderTableContents={item => [
|
||||
renderTableContents={(item: Namespace) => [
|
||||
item.getName(),
|
||||
<KubeObjectStatusIcon key="icon" object={item} />,
|
||||
item.getLabels().map(label => <Badge key={label} label={label}/>),
|
||||
@@ -79,7 +79,7 @@ export class Namespaces extends React.Component<Props> {
|
||||
addTooltip: "Add Namespace",
|
||||
onAdd: () => AddNamespaceDialog.open(),
|
||||
}}
|
||||
customizeTableRowProps={item => ({
|
||||
customizeTableRowProps={(item: Namespace) => ({
|
||||
disabled: item.getStatus() === NamespaceStatus.TERMINATING,
|
||||
})}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user