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.
pull/10719/head
Daniel Lee 7 years ago
parent 5ee2d1de05
commit 146af8595d
  1. 1
      public/app/core/components/Permissions/DisabledPermissionsListItem.tsx
  2. 1
      public/app/core/components/Permissions/PermissionsListItem.tsx
  3. 5
      public/app/core/components/Picker/DescriptionPicker.tsx
  4. 10
      public/sass/components/_form_select_box.scss

@ -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;
}
}

Loading…
Cancel
Save