From 2f4c7ed216b383e80de0d91b067e8c114891da7b Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 22 Oct 2018 11:40:14 -0700 Subject: [PATCH] Update implementation of IndexList in tasks page --- .../ui/src/tasks/components/TasksList.tsx | 114 ++++++------------ 1 file changed, 39 insertions(+), 75 deletions(-) diff --git a/chronograf/ui/src/tasks/components/TasksList.tsx b/chronograf/ui/src/tasks/components/TasksList.tsx index e43c6bc0ba..2381756369 100644 --- a/chronograf/ui/src/tasks/components/TasksList.tsx +++ b/chronograf/ui/src/tasks/components/TasksList.tsx @@ -13,10 +13,6 @@ import { // Types import {Task} from 'src/types/v2/tasks' -import { - IndexListColumn, - IndexListRow, -} from 'src/shared/components/index_views/IndexListTypes' import EmptyTasksList from 'src/tasks/components/EmptyTasksList' interface Props { @@ -29,83 +25,51 @@ interface Props { export default class TasksList extends PureComponent { public render() { const {searchTerm, onCreate} = this.props + return ( - - } - /> + + + + + + + + + } + columnCount={4} + > + {this.rows} + + ) } - private get columns(): IndexListColumn[] { - return [ - { - key: 'task--name', - title: 'Name', - size: 500, - showOnHover: false, - align: Alignment.Left, - }, - { - key: 'task--organization', - title: 'Organization', - size: 100, - showOnHover: false, - align: Alignment.Left, - }, - { - key: 'task--status', - title: 'Status', - size: 90, - showOnHover: false, - align: Alignment.Left, - }, - { - key: 'task--actions', - title: '', - size: 200, - showOnHover: true, - align: Alignment.Right, - }, - ] - } - - private get rows(): IndexListRow[] { + private get rows(): JSX.Element[] { const {tasks} = this.props - return tasks.map(t => ({ - disabled: false, - columns: [ - { - key: 'task--name', - contents: {t.name}, - }, - { - key: 'task--organization', - contents: t.organization.name, - }, - { - key: 'task--status', - contents: 'Enabled', - }, - { - key: 'task--actions', - contents: ( - -