mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Input: Width prop (#23615)
* Add width property * Remove unused import * Spelling mistake * Add width to interface * Make width optional * Remove size * Update snapshot * Remove size from places * Add size prop for button * Update width * Update snapshots
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
import React, { FC } from 'react';
|
||||
import { OrgRole } from '@grafana/data';
|
||||
import { Select, FormInputSize } from '@grafana/ui';
|
||||
import { Select } from '@grafana/ui';
|
||||
|
||||
interface Props {
|
||||
value: OrgRole;
|
||||
size?: FormInputSize;
|
||||
onChange: (role: OrgRole) => void;
|
||||
}
|
||||
|
||||
const options = Object.keys(OrgRole).map(key => ({ label: key, value: key }));
|
||||
|
||||
export const OrgRolePicker: FC<Props> = ({ value, onChange, size }) => (
|
||||
export const OrgRolePicker: FC<Props> = ({ value, onChange, ...restProps }) => (
|
||||
<Select
|
||||
size={size}
|
||||
value={value}
|
||||
options={options}
|
||||
onChange={val => onChange(val.value as OrgRole)}
|
||||
placeholder="Choose role..."
|
||||
{...restProps}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -37,15 +37,15 @@ const UserCreatePage: React.FC<UserCreatePageProps> = ({ navModel, updateLocatio
|
||||
return (
|
||||
<>
|
||||
<Field label="Name" required invalid={!!errors.name} error={!!errors.name && 'Name is required'}>
|
||||
<Input name="name" size="md" ref={register({ required: true })} />
|
||||
<Input name="name" ref={register({ required: true })} />
|
||||
</Field>
|
||||
|
||||
<Field label="E-mail">
|
||||
<Input name="email" size="md" ref={register} />
|
||||
<Input name="email" ref={register} />
|
||||
</Field>
|
||||
|
||||
<Field label="Username">
|
||||
<Input name="login" size="md" ref={register} />
|
||||
<Input name="login" ref={register} />
|
||||
</Field>
|
||||
<Field
|
||||
label="Password"
|
||||
@@ -54,7 +54,6 @@ const UserCreatePage: React.FC<UserCreatePageProps> = ({ navModel, updateLocatio
|
||||
error={!!errors.password && 'Password is required and must contain at least 4 characters'}
|
||||
>
|
||||
<Input
|
||||
size="md"
|
||||
type="password"
|
||||
name="password"
|
||||
ref={register({
|
||||
|
||||
@@ -43,7 +43,7 @@ const UserListAdminPageUnConnected: React.FC<Props> = props => {
|
||||
<div>
|
||||
<HorizontalGroup justify="space-between">
|
||||
<Input
|
||||
size="md"
|
||||
width={40}
|
||||
type="text"
|
||||
placeholder="Search user by login,email or name"
|
||||
tabIndex={1}
|
||||
|
||||
@@ -267,7 +267,6 @@ export class UserProfileRow extends PureComponent<UserProfileRowProps, UserProfi
|
||||
<td className="width-25" colSpan={2}>
|
||||
{this.state.editing ? (
|
||||
<Input
|
||||
size="md"
|
||||
type={inputType}
|
||||
defaultValue={value}
|
||||
onBlur={this.onInputBlur}
|
||||
|
||||
Reference in New Issue
Block a user