mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Select: Don't portal by default * Select: Portal all the Selects * Fix indendentation in this comment * Select: Remove @example docs until formatting is correct * Docs: Add some documentation for the Select changes * Update docs/sources/whatsnew/whats-new-in-v8-1.md Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update docs/sources/whatsnew/whats-new-in-v8-1.md Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update packages/grafana-ui/src/components/Select/types.ts Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Update public/app/core/components/TransformersUI/prepareTimeSeries/PrepareTimeSeriesEditor.tsx Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> * Docs: Variants instead of varients * Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com> Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
23 lines
562 B
TypeScript
23 lines
562 B
TypeScript
import React, { FC } from 'react';
|
|
import { OrgRole } from '@grafana/data';
|
|
import { Select } from '@grafana/ui';
|
|
|
|
interface Props {
|
|
value: OrgRole;
|
|
disabled?: boolean;
|
|
onChange: (role: OrgRole) => void;
|
|
}
|
|
|
|
const options = Object.keys(OrgRole).map((key) => ({ label: key, value: key }));
|
|
|
|
export const OrgRolePicker: FC<Props> = ({ value, onChange, ...restProps }) => (
|
|
<Select
|
|
menuShouldPortal
|
|
value={value}
|
|
options={options}
|
|
onChange={(val) => onChange(val.value as OrgRole)}
|
|
placeholder="Choose role..."
|
|
{...restProps}
|
|
/>
|
|
);
|