diff --git a/packages/grafana-ui/src/components/Select/getSelectStyles.ts b/packages/grafana-ui/src/components/Select/getSelectStyles.ts index b74b412eefe..397128ea51f 100644 --- a/packages/grafana-ui/src/components/Select/getSelectStyles.ts +++ b/packages/grafana-ui/src/components/Select/getSelectStyles.ts @@ -43,6 +43,7 @@ export const getSelectStyles = stylesFactory((theme: GrafanaTheme) => { font-size: ${theme.typography.size.sm}; color: ${theme.colors.textWeak}; white-space: normal; + line-height: ${theme.typography.lineHeight.md}; `, optionBody: css` label: grafana-select-option-body; diff --git a/public/app/core/components/PermissionList/AddPermission.tsx b/public/app/core/components/PermissionList/AddPermission.tsx index b2ca39e6e67..780f6c78fa7 100644 --- a/public/app/core/components/PermissionList/AddPermission.tsx +++ b/public/app/core/components/PermissionList/AddPermission.tsx @@ -1,8 +1,10 @@ import React, { Component } from 'react'; +import { css } from 'emotion'; +import config from 'app/core/config'; import { UserPicker } from 'app/core/components/Select/UserPicker'; import { TeamPicker, Team } from 'app/core/components/Select/TeamPicker'; -import { LegacyForms, Icon } from '@grafana/ui'; -import { SelectableValue } from '@grafana/data'; +import { Button, Form, HorizontalGroup, Icon, Select, stylesFactory } from '@grafana/ui'; +import { GrafanaTheme, SelectableValue } from '@grafana/data'; import { User } from 'app/types'; import { dashboardPermissionLevels, @@ -12,7 +14,6 @@ import { NewDashboardAclItem, OrgRole, } from 'app/types/acl'; -const { Select } = LegacyForms; export interface Props { onAddPermission: (item: NewDashboardAclItem) => void; @@ -38,8 +39,8 @@ class AddPermissions extends Component { }; } - onTypeChanged = (evt: any) => { - const type = evt.target.value as AclTarget; + onTypeChanged = (item: any) => { + const type = item.value as AclTarget; switch (type) { case AclTarget.User: @@ -67,8 +68,7 @@ class AddPermissions extends Component { this.setState({ permission: permission.value! }); }; - onSubmit = async (evt: React.SyntheticEvent) => { - evt.preventDefault(); + onSubmit = async () => { await this.props.onAddPermission(this.state); this.setState(this.getCleanState()); }; @@ -88,59 +88,57 @@ class AddPermissions extends Component { const newItem = this.state; const pickerClassName = 'min-width-20'; const isValid = this.isValid(); + const styles = getStyles(config.theme); + return ( -
+
-
-
Add Permission For
-
-
-
- -
-
- - {newItem.type === AclTarget.User ? ( -
- -
- ) : null} - - {newItem.type === AclTarget.Team ? ( -
- -
- ) : null} - -
+
Add Permission For
+ + {() => ( + -
- -
- -
-
-
+ + + )} +
); } } +const getStyles = stylesFactory((theme: GrafanaTheme) => ({ + label: css` + color: ${theme.colors.textBlue}; + font-weight: bold; + `, +})); + export default AddPermissions; diff --git a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx index 8f28aee38e1..80e091c46d0 100644 --- a/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx +++ b/public/app/core/components/PermissionList/DisabledPermissionListItem.tsx @@ -1,7 +1,6 @@ import React, { Component } from 'react'; -import { LegacyForms, Icon } from '@grafana/ui'; +import { Select, Icon } from '@grafana/ui'; import { dashboardPermissionLevels } from 'app/types/acl'; -const { Select } = LegacyForms; export interface Props { item: any; @@ -28,8 +27,7 @@ export default class DisabledPermissionListItem extends Component { -
+