From 74511c67dd0fd4717c4d1a26262b22449505a5d8 Mon Sep 17 00:00:00 2001 From: Tao Bojlen Date: Wed, 29 Aug 2018 02:17:08 +0200 Subject: [PATCH] use better instance dropdown --- frontend/src/App.tsx | 18 +++--- frontend/src/components/InstanceSearch.tsx | 70 ++++++++++++---------- frontend/src/index.css | 10 +--- frontend/src/redux/reducers.ts | 3 +- frontend/src/redux/types.ts | 8 +-- 5 files changed, 52 insertions(+), 57 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index dc24aa1..373e447 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,7 +10,7 @@ import { fetchInstances } from './redux/actions'; import { IAppState, IInstance } from './redux/types'; interface IAppProps { - currentInstance: IInstance; + currentInstance: IInstance | null; instances?: IInstance[], isLoadingInstances: boolean, fetchInstances: () => void; @@ -56,13 +56,15 @@ class AppImpl extends React.Component { private renderGraph = () => { return ( - - ) +
+ +
+ ); } } diff --git a/frontend/src/components/InstanceSearch.tsx b/frontend/src/components/InstanceSearch.tsx index 7ca9dfc..ccf3ac9 100644 --- a/frontend/src/components/InstanceSearch.tsx +++ b/frontend/src/components/InstanceSearch.tsx @@ -1,62 +1,68 @@ import * as React from 'react'; import { connect } from 'react-redux'; +// import { List, ListRowProps } from 'react-virtualized'; import { Dispatch } from 'redux'; -import { MenuItem } from '@blueprintjs/core'; -import { IItemRendererProps, Suggest } from '@blueprintjs/select'; +import { Button, MenuItem } from '@blueprintjs/core'; +import { IconNames } from '@blueprintjs/icons'; +import { ItemPredicate, ItemRenderer, Select } from '@blueprintjs/select'; import { selectInstance } from '../redux/actions'; import { IAppState, IInstance } from '../redux/types'; interface IInstanceSearchProps { - currentInstance: IInstance; + currentInstance: IInstance | null; instances?: IInstance[]; selectInstance: (instanceName: string) => void; } +const InstanceSelect = Select.ofType(); + class InstanceSearchImpl extends React.Component { public render() { return ( - +