Merge pull request #521 from grafana/schedules-alpha-fix-typescript

Schedules alpha fix typescript
This commit is contained in:
maskin25 2022-09-12 15:33:30 +03:00 committed by GitHub
commit 12fb7b5966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 11 deletions

View file

@ -9,6 +9,7 @@ import { SortableContainer, SortableElement, SortableHandle } from 'react-sortab
import Text from 'components/Text/Text';
import WorkingHours from 'components/WorkingHours/WorkingHours';
import GSelect from 'containers/GSelect/GSelect';
import RemoteSelect from 'containers/RemoteSelect/RemoteSelect';
import UserTooltip from 'containers/UserTooltip/UserTooltip';
import { User } from 'models/user/user.types';
@ -121,18 +122,13 @@ const UserGroups = (props: UserGroupsProps) => {
isMultipleGroups={isMultipleGroups}
useDragHandle
/>
<GSelect
key={items.length} // to completely rerender when users length change
<RemoteSelect
key={items.length}
showSearch
allowClear
modelName="userStore"
displayField="username"
valueField="pk"
placeholder="Add user"
className={cx('select')}
href="/users/?filters=true&roles=0&roles=1"
value={null}
onChange={handleUserAdd}
getOptionLabel={({ label, value }: SelectableValue) => <UserTooltip id={value} />}
showError={showError}
/>
</VerticalGroup>

View file

@ -27,6 +27,7 @@ interface RemoteSelectProps {
isMulti?: boolean;
openMenuOnFocus?: boolean;
getOptionLabel?: (item: SelectableValue) => React.ReactNode;
showError?: boolean;
}
const RemoteSelect = inject('store')(
@ -46,6 +47,7 @@ const RemoteSelect = inject('store')(
allowClear,
getOptionLabel,
openMenuOnFocus = true,
showError,
} = props;
const [options, setOptions] = useState<SelectableValue[] | undefined>();
@ -111,6 +113,7 @@ const RemoteSelect = inject('store')(
defaultOptions={options}
loadOptions={loadOptionsCallback}
getOptionLabel={getOptionLabel}
invalid={showError}
/>
);
})

View file

@ -43,7 +43,7 @@
}
.slots__animate {
transition: transform 500ms ease;
/* transition: transform 500ms ease; */
}
.slots__transparent {

View file

@ -105,8 +105,8 @@
height: 4px;
background: #3d71d9;
border-radius: 2px;
left: calc((3 / 8) * 100%);
right: calc((2 / 8) * 100%);
left: calc((9 / 24) * 100%);
right: calc((7 / 24) * 100%);
}
.time-marks {