From e8ba35ab2d5d56f13a2eb6cdcb0bad14518cb7dd Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Wed, 26 Sep 2018 10:31:43 +0200 Subject: [PATCH] Move User type out of UserPicker and into app/types --- public/app/core/components/Picker/UserPicker.tsx | 8 +------- public/app/types/index.ts | 2 ++ public/app/types/user.ts | 6 ++++++ 3 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 public/app/types/user.ts diff --git a/public/app/core/components/Picker/UserPicker.tsx b/public/app/core/components/Picker/UserPicker.tsx index e50513c44e1..8f48ba8f66a 100644 --- a/public/app/core/components/Picker/UserPicker.tsx +++ b/public/app/core/components/Picker/UserPicker.tsx @@ -3,6 +3,7 @@ import Select from 'react-select'; import PickerOption from './PickerOption'; import { debounce } from 'lodash'; import { getBackendSrv } from 'app/core/services/backend_srv'; +import { User } from 'app/types'; export interface Props { onSelected: (user: User) => void; @@ -14,13 +15,6 @@ export interface State { isLoading: boolean; } -export interface User { - id: number; - label: string; - avatarUrl: string; - login: string; -} - export class UserPicker extends Component { debouncedSearch: any; diff --git a/public/app/types/index.ts b/public/app/types/index.ts index 8c50ea88782..bd219282f52 100644 --- a/public/app/types/index.ts +++ b/public/app/types/index.ts @@ -8,6 +8,7 @@ import { DashboardAcl, OrgRole, PermissionLevel } from './acl'; import { DataSource } from './datasources'; import { PluginMeta } from './plugins'; import { ApiKey, ApiKeysState } from './apiKeys'; +import { User } from './user'; export { Team, @@ -36,6 +37,7 @@ export { PluginMeta, ApiKey, ApiKeysState, + User, }; export interface StoreState { diff --git a/public/app/types/user.ts b/public/app/types/user.ts new file mode 100644 index 00000000000..9c13e6b027b --- /dev/null +++ b/public/app/types/user.ts @@ -0,0 +1,6 @@ +export interface User { + id: number; + label: string; + avatarUrl: string; + login: string; +}