mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Fixes issues with user and team picker
This commit is contained in:
parent
3efaf52049
commit
e38a04ba9a
@ -1,4 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import _ from 'lodash';
|
||||
import { AsyncSelect } from './Select';
|
||||
import { debounce } from 'lodash';
|
||||
import { getBackendSrv } from 'app/core/services/backend_srv';
|
||||
@ -37,6 +38,10 @@ export class TeamPicker extends Component<Props, State> {
|
||||
const backendSrv = getBackendSrv();
|
||||
this.setState({ isLoading: true });
|
||||
|
||||
if (_.isNil(query)) {
|
||||
query = '';
|
||||
}
|
||||
|
||||
return backendSrv.get(`/api/teams/search?perpage=10&page=1&query=${query}`).then(result => {
|
||||
const teams = result.teams.map(team => {
|
||||
return {
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Libraries
|
||||
import React, { Component } from 'react';
|
||||
import _ from 'lodash';
|
||||
|
||||
// Components
|
||||
import { AsyncSelect } from './Select';
|
||||
@ -38,6 +39,10 @@ export class UserPicker extends Component<Props, State> {
|
||||
const backendSrv = getBackendSrv();
|
||||
this.setState({ isLoading: true });
|
||||
|
||||
if (_.isNil(query)) {
|
||||
query = '';
|
||||
}
|
||||
|
||||
return backendSrv
|
||||
.get(`/api/org/users?query=${query}&limit=10`)
|
||||
.then(result => {
|
||||
|
Loading…
Reference in New Issue
Block a user