From 24825dc8994a81df9ab89659b41f9d2873a12676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 14 Dec 2018 12:59:45 +0100 Subject: [PATCH] renamed folder to select --- .../PermissionList/AddPermission.tsx | 17 +++--- .../DisabledPermissionListItem.tsx | 12 ++--- .../PermissionList/PermissionListItem.tsx | 12 ++--- .../components/Picker/DescriptionOption.tsx | 26 ---------- .../components/Picker/DescriptionPicker.tsx | 52 ------------------- .../core/components/Picker/SimplePicker.tsx | 52 ------------------- .../IndicatorsContainer.tsx | 0 .../{Picker => Select}/NoOptionsMessage.tsx | 0 .../{Picker => Select}/PickerOption.test.tsx | 0 .../{Picker => Select}/PickerOption.tsx | 0 .../{Picker => Select}/ResetStyles.tsx | 0 .../components/{Picker => Select}/Select.tsx | 20 +++++-- .../{Picker => Select}/TeamPicker.test.tsx | 0 .../{Picker => Select}/TeamPicker.tsx | 0 .../{Picker => Select}/Unit/UnitGroup.tsx | 0 .../{Picker => Select}/Unit/UnitOption.tsx | 0 .../{Picker => Select}/Unit/UnitPicker.tsx | 0 .../{Picker => Select}/UserPicker.test.tsx | 0 .../{Picker => Select}/UserPicker.tsx | 2 +- .../__snapshots__/PickerOption.test.tsx.snap | 0 .../__snapshots__/TeamPicker.test.tsx.snap | 0 .../__snapshots__/UserPicker.test.tsx.snap | 0 .../SharedPreferences/SharedPreferences.tsx | 4 +- .../core/components/TagFilter/TagFilter.tsx | 6 +-- .../dashboard/dashgrid/DataSourcePicker.tsx | 6 +-- public/app/features/explore/Explore.tsx | 8 +-- public/app/features/teams/TeamMembers.tsx | 2 +- public/app/plugins/panel/gauge/MappingRow.tsx | 9 ++-- .../app/plugins/panel/gauge/ValueOptions.tsx | 4 +- 29 files changed, 57 insertions(+), 175 deletions(-) delete mode 100644 public/app/core/components/Picker/DescriptionOption.tsx delete mode 100644 public/app/core/components/Picker/DescriptionPicker.tsx delete mode 100644 public/app/core/components/Picker/SimplePicker.tsx rename public/app/core/components/{Picker => Select}/IndicatorsContainer.tsx (100%) rename public/app/core/components/{Picker => Select}/NoOptionsMessage.tsx (100%) rename public/app/core/components/{Picker => Select}/PickerOption.test.tsx (100%) rename public/app/core/components/{Picker => Select}/PickerOption.tsx (100%) rename public/app/core/components/{Picker => Select}/ResetStyles.tsx (100%) rename public/app/core/components/{Picker => Select}/Select.tsx (90%) rename public/app/core/components/{Picker => Select}/TeamPicker.test.tsx (100%) rename public/app/core/components/{Picker => Select}/TeamPicker.tsx (100%) rename public/app/core/components/{Picker => Select}/Unit/UnitGroup.tsx (100%) rename public/app/core/components/{Picker => Select}/Unit/UnitOption.tsx (100%) rename public/app/core/components/{Picker => Select}/Unit/UnitPicker.tsx (100%) rename public/app/core/components/{Picker => Select}/UserPicker.test.tsx (100%) rename public/app/core/components/{Picker => Select}/UserPicker.tsx (96%) rename public/app/core/components/{Picker => Select}/__snapshots__/PickerOption.test.tsx.snap (100%) rename public/app/core/components/{Picker => Select}/__snapshots__/TeamPicker.test.tsx.snap (100%) rename public/app/core/components/{Picker => Select}/__snapshots__/UserPicker.test.tsx.snap (100%) diff --git a/public/app/core/components/PermissionList/AddPermission.tsx b/public/app/core/components/PermissionList/AddPermission.tsx index d6da7c68544..19828d7eef5 100644 --- a/public/app/core/components/PermissionList/AddPermission.tsx +++ b/public/app/core/components/PermissionList/AddPermission.tsx @@ -1,7 +1,7 @@ import React, { Component } from 'react'; -import { UserPicker } from 'app/core/components/Picker/UserPicker'; -import { TeamPicker, Team } from 'app/core/components/Picker/TeamPicker'; -import DescriptionPicker, { OptionWithDescription } from 'app/core/components/Picker/DescriptionPicker'; +import { UserPicker } from 'app/core/components/Select/UserPicker'; +import { TeamPicker, Team } from 'app/core/components/Select/TeamPicker'; +import { Select, SelectOptionItem } from 'app/core/components/Select/Select'; import { User } from 'app/types'; import { dashboardPermissionLevels, @@ -61,7 +61,7 @@ class AddPermissions extends Component { this.setState({ teamId: team && !Array.isArray(team) ? team.id : 0 }); }; - onPermissionChanged = (permission: OptionWithDescription) => { + onPermissionChanged = (permission: SelectOptionItem) => { this.setState({ permission: permission.value }); }; @@ -121,11 +121,10 @@ class AddPermissions extends Component { ) : null}
-
diff --git a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx index ff679f67ae2..ae25aecce15 100644 --- a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx +++ b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import DescriptionPicker from 'app/core/components/Picker/DescriptionPicker'; +import Select from 'app/core/components/Select/Select'; import { dashboardPermissionLevels } from 'app/types/acl'; export interface Props { @@ -23,11 +23,11 @@ export default class DisabledPermissionListItem extends Component { Can
- {}} - disabled={true} - className={'gf-form-select-box__control--menu-right'} + i.value} - getOptionLabel={i => i.label} - value={selectedOption} - /> -
- ); - } -} - -export default DescriptionPicker; diff --git a/public/app/core/components/Picker/SimplePicker.tsx b/public/app/core/components/Picker/SimplePicker.tsx deleted file mode 100644 index 18b8b4bfc02..00000000000 --- a/public/app/core/components/Picker/SimplePicker.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { SFC } from 'react'; -import Select from 'react-select'; -import DescriptionOption from './DescriptionOption'; -import IndicatorsContainer from './IndicatorsContainer'; -import ResetStyles from './ResetStyles'; - -interface Props { - className?: string; - defaultValue?: any; - getOptionLabel: (item: any) => string; - getOptionValue: (item: any) => string; - onSelected: (item: any) => {} | void; - options: any[]; - placeholder?: string; - width?: number; - value: any; -} - -const SimplePicker: SFC = ({ - className, - defaultValue, - getOptionLabel, - getOptionValue, - onSelected, - options, - placeholder, - width, - value, -}) => { - return ( - item.value === theme)} options={themes} onChange={theme => this.onThemeChanged(theme.value)} @@ -118,6 +119,7 @@ export class SharedPreferences extends PureComponent {