mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashfolders: css class as parameter for Picker
For the permissions picker, pass in an extra class to decide if the description should be aligned left or right.
This commit is contained in:
@@ -25,6 +25,7 @@ export default class DisabledPermissionListItem extends Component<IProps, any> {
|
||||
handlePicked={() => {}}
|
||||
value={item.permission}
|
||||
disabled={true}
|
||||
className={'gf-form-input--form-dropdown-right'}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -32,6 +32,7 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
|
||||
handlePicked={handleChangePermission}
|
||||
value={item.permission}
|
||||
disabled={item.inherited}
|
||||
className={'gf-form-input--form-dropdown-right'}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface IProps {
|
||||
handlePicked: (permission) => void;
|
||||
value: number;
|
||||
disabled: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export interface OptionWithDescription {
|
||||
@@ -22,7 +23,7 @@ class DescriptionPicker extends Component<IProps, any> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { optionsWithDesc, handlePicked, value, disabled } = this.props;
|
||||
const { optionsWithDesc, handlePicked, value, disabled, className } = this.props;
|
||||
|
||||
return (
|
||||
<div className="permissions-picker">
|
||||
@@ -34,7 +35,7 @@ class DescriptionPicker extends Component<IProps, any> {
|
||||
labelKey="label"
|
||||
options={optionsWithDesc}
|
||||
onChange={handlePicked}
|
||||
className="width-7 gf-form-input gf-form-input--form-dropdown"
|
||||
className={`width-7 gf-form-input gf-form-input--form-dropdown ${className || ''}`}
|
||||
optionComponent={DescriptionOption}
|
||||
placeholder="Choose"
|
||||
disabled={disabled}
|
||||
|
||||
@@ -39,10 +39,6 @@ $select-option-selected-bg: $dropdownLinkBackgroundActive;
|
||||
color: $input-color-placeholder;
|
||||
}
|
||||
|
||||
.Select-menu-outer {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
> .Select-control {
|
||||
@include select-control();
|
||||
border-color: $dark-3;
|
||||
@@ -102,3 +98,9 @@ $select-option-selected-bg: $dropdownLinkBackgroundActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.gf-form-input--form-dropdown-right {
|
||||
.Select-menu-outer {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user