From cb7ffb4415ca1baa0bed26cd4905f9a10abcde2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 14 Dec 2018 14:19:39 +0100 Subject: [PATCH] select refactor fixes --- .../PermissionList/AddPermission.tsx | 1 + .../DisabledPermissionListItem.tsx | 3 ++- .../PermissionList/PermissionListItem.tsx | 3 ++- .../components/Select/DataSourcePicker.tsx | 2 +- public/app/core/components/Select/Select.tsx | 2 +- .../app/core/components/Select/TeamPicker.tsx | 20 +++---------------- 6 files changed, 10 insertions(+), 21 deletions(-) diff --git a/public/app/core/components/PermissionList/AddPermission.tsx b/public/app/core/components/PermissionList/AddPermission.tsx index 19828d7eef5..749bef680bf 100644 --- a/public/app/core/components/PermissionList/AddPermission.tsx +++ b/public/app/core/components/PermissionList/AddPermission.tsx @@ -122,6 +122,7 @@ class AddPermissions extends Component {
{} | void; placeholder?: string; width?: number; - value?: any; + value?: SelectOptionItem; className?: string; components: object; isDisabled?: boolean; diff --git a/public/app/core/components/Select/TeamPicker.tsx b/public/app/core/components/Select/TeamPicker.tsx index 31b78b19830..6449114cfff 100644 --- a/public/app/core/components/Select/TeamPicker.tsx +++ b/public/app/core/components/Select/TeamPicker.tsx @@ -1,11 +1,7 @@ import React, { Component } from 'react'; -import AsyncSelect from 'react-select/lib/Async'; -import PickerOption from './PickerOption'; +import { AsyncSelect } from './Select'; import { debounce } from 'lodash'; import { getBackendSrv } from 'app/core/services/backend_srv'; -import ResetStyles from './ResetStyles'; -import IndicatorsContainer from './IndicatorsContainer'; -import NoOptionsMessage from './NoOptionsMessage'; export interface Team { id: number; @@ -45,6 +41,7 @@ export class TeamPicker extends Component { const teams = result.teams.map(team => { return { id: team.id, + value: team.id, label: team.name, name: team.name, imgUrl: team.avatarUrl, @@ -62,24 +59,13 @@ export class TeamPicker extends Component { return (
'Loading...'} noOptionsMessage={() => 'No teams found'} - getOptionValue={i => i.id} - getOptionLabel={i => i.label} />
);