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:
Daniel Lee
2018-01-29 14:30:01 +01:00
parent 5ee2d1de05
commit 146af8595d
4 changed files with 11 additions and 6 deletions
@@ -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}
+6 -4
View File
@@ -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;
}
}