diff --git a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx index 77671396505..ff679f67ae2 100644 --- a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx +++ b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx @@ -28,6 +28,7 @@ export default class DisabledPermissionListItem extends Component { onSelected={() => {}} disabled={true} className={'gf-form-select-box__control--menu-right'} + value={item.permission} /> diff --git a/public/app/core/components/PermissionList/PermissionListItem.tsx b/public/app/core/components/PermissionList/PermissionListItem.tsx index 47ab62416ae..56b6114d236 100644 --- a/public/app/core/components/PermissionList/PermissionListItem.tsx +++ b/public/app/core/components/PermissionList/PermissionListItem.tsx @@ -79,6 +79,7 @@ export default class PermissionsListItem extends PureComponent { onSelected={this.onPermissionChanged} disabled={item.inherited} className={'gf-form-select-box__control--menu-right'} + value={item.permission} /> diff --git a/public/app/core/components/Picker/DescriptionPicker.tsx b/public/app/core/components/Picker/DescriptionPicker.tsx index 2c3611cca81..4c39dcd8a79 100644 --- a/public/app/core/components/Picker/DescriptionPicker.tsx +++ b/public/app/core/components/Picker/DescriptionPicker.tsx @@ -16,15 +16,19 @@ export interface Props { onSelected: (permission) => void; disabled: boolean; className?: string; + value?: any; } +const getSelectedOption = (optionsWithDesc, value) => optionsWithDesc.find(option => option.value === value); + class DescriptionPicker extends Component { constructor(props) { super(props); } render() { - const { optionsWithDesc, onSelected, disabled, className } = this.props; + const { optionsWithDesc, onSelected, disabled, className, value } = this.props; + const selectedOption = getSelectedOption(optionsWithDesc, value); return (